Updates a data source.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | UpdateDataSource | The operation that you want to perform. Set the value to UpdateDataSource. |
Description | String | No | xxx | The description of the data source. |
EnvType | Integer | Yes | 1 | The environment in which the data source resides. Valid values:
|
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:
|
Status | String | No | ENABLED | The status of the data source. This parameter is deprecated. Do not use this parameter. |
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. |
Response parameters
Parameter | Type | Example | Description |
HttpStatusCode | String | 200 | The HTTP status code returned. |
Data | Boolean | true | Indicates whether the data source is updated. |
RequestId | String | 0bc14115159376359**** | The request ID. |
Success | Boolean | true | Indicates whether the request was successful. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=UpdateDataSource
&Description=xxx
&EnvType=1
&Content={"accessId":"xssssss","accessKey":"xsaxsaxsa","authType":2,"endpoint":"http://service.odps.aliyun.com/api","project":"xsaxsax","tag":"public"}
&Status=ENABLED
&DataSourceId=1
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<UpdateDataSourceResponse>
<HttpStatusCode>200</HttpStatusCode>
<Data>true</Data>
<RequestId>0bc14115159376359****</RequestId>
<Success>true</Success>
</UpdateDataSourceResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"HttpStatusCode" : 200,
"Data" : true,
"RequestId" : "0bc14115159376359****",
"Success" : true
}
Error codes
HTTP status code | Error code | Error message | Description |
400 | Invalid.Tenant.ConnectionNotExists | The connection does not exist. | The specified data source does not exist. |
400 | Invalid.Tenant.ProjectNotExists | The project does not exist. | The specified workspace does not exist. |
400 | Invalid.Tenant.UserNotInProject | The user is not in the project. | The user is not added to the workspace. |
400 | MissingParam.ConnectionStr.Property | You must specify property %s required by the data source connection string. | 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 permissions on the data source failed to be verified. |
400 | DataSource.ConnectionStrProperty.PatternNotMatch | The pattern value %s is invalid. The correct pattern is %s. | The connection string properties of the data source do not match the specified rules. |
400 | DataSource.NotFound | The specified data source ID %s does not exist. | The specified data source does not exist. |
400 | Invalid.Connection.Empty | You must specify the connection parameter. | The parameters of the specified data source are not specified. |
400 | Invalid.DataSource.DataSourceTypeNotExist | The data source type %s does not exist. | The specified data source type does not exist. |
400 | Invalid.DataSource.DataSourceTypeNotSupport | The dataSourceType %s and subType %s are not supported. | The data source type is not supported. |
400 | Invalid.Operation | You cannot delete the bindingCalcEngine that is bound to the data source. | The compute engine that is associated with the data source cannot be deleted. |
400 | Required.Parameter.Empty | You must specify the parameter %s. | A required parameter is not specified. |
403 | Invalid.Tenant.UserIsNotProjectOwnerOrAdmin | The user is not a project administrator or owner. | The user is not the workspace owner or administrator. |
403 | Invalid.Tenant.UserNotInTenant | The user is not in tenant. | The user does not belong to the tenant. |
For a list of error codes, see Service error codes.