Modifies a data source configuration.
Try it now
Test
RAM authorization
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| UpdateModel |
string |
Yes |
A JSON-formatted string defining the data source configuration to update. See the example for the specific format. The JSON string includes the following parameters:
|
{ "schema": "schema", "userId":"S*****46345", "password": "Ta****34", "showName": "test", "address": "11*****.55", "instance": "quickbi_test", "dsId": "34d6d******3ca8ac267", "port": "3306", "dsType": "mysql", "username": "root", "config": { "initialSql": "Set timezone = '-10'" } } |
Example code @Test
public void UpdateDataSource () throws SDKException, ClientException {
UpdateDataSourceRequest request = new UpdateDataSourceRequest();
HashMap<String,Object> updateModel = new HashMap<>();
updateModel.put("dsId", "342e*******455");
updateModel.put("userId","74f5*****20ebf278c8");
updateModel.put("dsType", "impala");
updateModel.put("address", "12***22");
updateModel.put("instance", "default");
updateModel.put("showName", "wk***_update");
request.setUpdateModel(JSONObject.toJSONString(updateModel));
System.out.println(JSONObject.toJSONString(updateModel));
request.setSysConnectTimeout(60000);request.setSysReadTimeout(60000);
UpdateDataSourceResponse acsResponse = getPopAPIClient("test").getAcsResponse(request);
System.out.println(JSONObject.toJSONString(acsResponse.getResult()));
}
Additional information
Resource mappings
The following table lists the resource values for common data source types. If your data source supports VPC connections but is not listed, you can find its resource value by using the developer tools in your browser. Inspect the network request made to the detect API endpoint when you click Test Connection in the data source editor. The value is in the config.resource field of the request payload.
Alibaba Cloud services (such as ApsaraDB RDS):
rdsAnalyticDB for MySQL:
adbAnalyticDB for PostgreSQL:
gpdbHologres:
hologresClickHouse:
clickhouseE-MapReduce Serverless StarRocks:
starrocksPolarDB for MySQL:
polardbPolarDB-X:
drdsPolarDB for PostgreSQL:
polardbPolarDB for PostgreSQL (Oracle Compatible):
polardbSelectDB:
selectdbOceanBase:
oceanbaseLindorm:
lindormAlibaba HybridDB for MySQL:
petaDataHBase:
hbaseSelf-managed data sources and Huawei Cloud data sources:
ecsAWS, Microsoft Azure, Tencent Cloud, and Google Cloud:
rdsTDSQL-H LibraDB:
tdsqlDataphin:
api_gateway
Region mappings
China (Qingdao):
cn-qingdaoChina (Beijing):
cn-beijingChina (Zhangjiakou):
cn-zhangjiakouChina (Hohhot):
cn-huhehaoteChina (Ulanqab):
cn-wulanchabuChina (Hangzhou):
cn-hangzhouChina (Shanghai):
cn-shanghaiChina (Nanjing-Local Region):
cn-nanjingChina (Shenzhen):
cn-shenzhenChina (Heyuan):
cn-heyuanChina (Guangzhou):
cn-guangzhouChina (Fuzhou-Local Region):
cn-fuzhouChina (Wuhan-Local Region):
cn-wuhan-lrChina (Chengdu):
cn-chengduChina (Hong Kong):
cn-hongkongJapan (Tokyo):
ap-northeast-1Korea (Seoul):
ap-northeast-2Singapore:
ap-southeast-1Malaysia (Kuala Lumpur):
ap-southeast-3Philippines (Manila):
ap-southeast-6Indonesia (Jakarta):
ap-southeast-5Thailand (Bangkok):
ap-southeast-7US (Virginia):
us-east-1US (Silicon Valley):
us-west-1Mexico (Queretaro):
na-south-1UK (London):
eu-west-1UAE (Dubai):
me-east-1Germany (Frankfurt):
eu-central-1
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The container for the returned data. |
||
| RequestId |
string |
The ID of the request. |
D787E1A***********5DF8D885 |
| Result |
boolean |
The result of the operation. Valid values:
|
true |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"RequestId": "D787E1A***********5DF8D885",
"Result": true,
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Internal.System.Error | An internal system error occurred. | An internal system error occurred. |
| 400 | Invalid.Parameter.Error | The parameter is invalid:%s. | invalid parameter: ${0}. |
| 400 | User.NotIn.Workspace | The user is not a member of the group workspace. | The user is not a member of the group workspace. |
| 400 | NoPermissionTo.Operate.Object | You are not authorized to operate the objects. | You are not authorized to do this. |
| 400 | DatasourceId.IsNull.Error | You must select a data source before selecting the table. | You must select a data source before selecting the table. |
| 400 | Datasource.NotFound.Error | The specified data source does not exist: %s. | The specified data source does not exist: %s. |
| 400 | Name.RegularExpression.Error | Name format validation failed. | |
| 400 | NameExceeded.MaxLength.Error | The name cannot exceed %s characters in length. | The name cannot be longer than% s characters. |
| 400 | Database.PortInvalid.Error | The database port is invalid. | The database port is invalid. |
| 400 | VpcInstance.Info.Error | Get vpc instance info error.please check vpc config %s. | Get VPC instance info error.please check VPC config %s. |
| 400 | VpcInstance.Info.EmptyError | Not found instance. please check vpc config and authorization %s. | Not found instance. please check VPC config and authorization %s. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.