All Products
Search
Document Center

ModifyDataSource

Last Updated: Mar 29, 2021

Modifies the information of a single data source in a table of a specified instance.

Description

Modifies the information of a single data source in a table of a specified instance. Request parameters are specified in camel case. For more information about the request parameters, see DataSource.

Method

PUT

URI

/openapi/instances/{instanceId}/dataSources/{tableName}

Request parameters

Parameter

Type

Required

Description

tableName

String

Yes

The name of the table that corresponds to an AIRec instance.

meta

The parameters of the data source.

type

String

Yes

The type of the data source. Only MaxCompute (formerly called ODPS) is supported.

projectName

String

Yes

The name of the MaxCompute project.

tableName

String

Yes

The name of the MaxCompute table.

partition

String

Yes

The partition in the MaxCompute table. Example: ds=20180102.

accessKeyId

String

Yes

The AccessKey ID that is used to access MaxCompute.

accessKeySecret

String

Yes

The AccessKey secret that is used to access MaxCompute.

timestamp

Integer

Yes

The timestamp. The value must be accurate to the millisecond. Example: 1544112000000.

incEnable

Boolean

Yes

Specifies whether a real-time data source is used.

fullEnable

Boolean

Yes

Specifies whether the data source is a start data source.

Response parameters

Parameter

Type

Description

requestId

String

The ID of the request.

result

List< DataSource >

Details about the data source.

Examples

Sample requests

PUT /openapi/instances/airec-cn-xxxxxx/dataSources/user
[
    {
        "tableName":"behavior",
        "meta":{
            "type":"ODPS",
            "timestamp":1544112000000,
            "accessKeyId":"ak",
            "projectName":"project",
            "tableName":"table",
            "partition":"ds=20181122",
            "accessKeySecret":"secret",
            "incEnabled":false,
            "fullEnabled":true
        }
    },
    {
        "tableName":"behavior",
        "meta":{
            "type":"UMENG",
            "appMetas":[
                "5e5dfc94cedf3c39390a7efc"
            ],
            "bizIdList":[
                "101"
            ],
            "incEnabled":true,
            "fullEnabled":false
        }
    }
]
// Use only a server SDK to upload data.
[ ]

Sample success responses

JSON format

{
    "Result":[
        {
            "GmtCreate":"2018-12-07T02:24:26.000Z",
            "GmtModified":"2018-12-07T02:24:26.000Z",
            "TableName":"behavior",
            "Meta":{
                "Type":"ODPS",
                "Timestamp":1544112000000,
                "AccessKeyId":"ak",
                "ProjectName":"project",
                "TableName":"table",
                "Partition":"dt=20181122",
                "IncEnabled":false,
                "FullEnabled":true
            }
        },
        {
            "GmtCreate":"2018-12-07T02:24:26.000Z",
            "GmtModified":"2018-12-07T02:24:26.000Z",
            "TableName":"behavior",
            "Meta":{
                "Type":"UMENG",
                "AppMetas":[
                    "5e5dfc94cedf3c39390a7efc"
                ],
                "BizIdList":[
                    "101"
                ]
            },
            "IncEnabled":false,
            "FullEnabled":true
        }
    ],
    "RequestId":"7F176EE8-51DA-4B4D-8FFE-04448CD7A171"
}

Sample error responses

JSON format

{
   "RequestId":"DF79FBBF-FFD9-42CD-A91E-220C97D13189",
   "Code":"InstanceNotExist",
   "Message":"The specified instance does not exist."
}