Updates a data source.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | UpdateDataSource |
The operation that you want to perform. |
DataSourceId | Long | Yes | 1 |
The ID of the data source that you want to update. You can call the ListDataSources operation to obtain the ID. |
Content | String | Yes | { "accessId": "xssssss", "accessKey": "xsaxsaxsa", "authType": 2, "endpoint": "http://service.odps.aliyun.com/api", "project": "xsaxsax", "tag": "public" } |
The details about the data source that you want to update. You are not allowed to change the type of the data source. For example, you are not allowed to change the data source type from MaxCompute to mysql. Examples of details of some common data sources:
|
EnvType | Integer | Yes | 1 |
The environment in which the data source runs. Valid values:
|
RegionId | String | Yes | cn-shanghai |
The region ID of the data source. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint used to call the operation. |
Description | String | No | xxx |
The description of the data source. |
Status | String | No | ENABLED |
The status of the data source. The parameter is deprecated. Do not use this parameter. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Data | Boolean | true |
Indicates whether the data source is updated. |
HttpStatusCode | String | 200 |
The HTTP status code returned. |
RequestId | String | 0bc14115159376359**** |
The ID of the request. |
Success | Boolean | true |
Indicates whether the request is successful. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=UpdateDataSource
&Content={"accessId":"xssssss","accessKey":"xsaxsaxsa","authType":2,"endpoint":"http://service.odps.aliyun.com/api","project":"xsaxsax","tag":"public"}
&DataSourceId=1
&EnvType=1
&RegionId=cn-shanghai
&<Common request parameters>
Sample success responses
XML
format
<RequestId>0bc14115159376359****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>true</Data>
<Success>true</Success>
JSON
format
{
"RequestId": "0bc14115159376359****",
"HttpStatusCode": 200,
"Data": true,
"Success": true
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | Invalid.Tenant.ConnectionNotExists | The connection does not exist. | The error message returned because the specified data source does not exist. |
400 | Invalid.Tenant.ProjectNotExists | The project does not exist. | The error message returned because the specified workspace does not exist. |
403 | Invalid.Tenant.UserIsNotProjectOwnerOrAdmin | The user is not a project administrator or owner. | The error message returned because the member is not the workspace owner or the workspace administrator. |
400 | Invalid.Tenant.UserNotInProject | The user is not in the project. | The error message returned because the member is not added to the workspace. |
403 | Invalid.Tenant.UserNotInTenant | The user is not in tenant. | The error message returned because the member does not belong to the tenant. |
400 | MissingParam.ConnectionStr.Property | You must specify property %s required by the data source connection string. | The error message returned because the required properties of the connection string of the data source are not specified. |
400 | DataSource.CheckRamRoleFailure | Failed to check the RAM role. AccountId %s. roleArn %s. | The error message returned because the permissions on the data source have failed to be verified. |
400 | DataSource.ConnectionStrProperty.PatternNotMatch | The pattern value %s is invalid. The correct pattern is %s. | The error message returned because the connection string property of the data source does not match the specified rules. |
400 | DataSource.NotFound | The specified data source ID %s does not exist. | The error message returned because the specified data source does not exist. |
400 | Invalid.Connection.Empty | You must specify the connection parameter. | The error message returned because the parameters of the specified data source are not specified. |
400 | Invalid.DataSource.DataSourceTypeNotExist | The data source type %s does not exist. | The error message returned because the specified data source type does not exist. |
400 | Invalid.DataSource.DataSourceTypeNotSupport | The dataSourceType %s and subType %s are not supported. | The error message returned because the data source type is not supported. |
400 | Invalid.Operation | You cannot delete the bindingCalcEngine that is bound to the data source. | The error message returned because the compute engine that is associated with the data source cannot be deleted. |
400 | Invalid.Param.Odps.EngineIdOrConnectStrEmpty | Either the compute engine ID or the connection string must be specified when data source type is ODPS. | The error message returned because the compute engine ID and connection string of the MaxCompute data source cannot be left empty at the same time. |
400 | Required.Parameter.Empty | You must specify the parameter %s. | The error message returned because a required parameter is not specified. |
For a list of error codes, visit the API Error Center.