UpdateDataSource - 修改数据源配置
修改数据源配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
POST HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| UpdateModel |
string |
是 |
传参参考示例值的 JSON 样式,其中参数解析如下:
|
{ "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'" } } |
示例代码: @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***修改");
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()));
}
resouce 映射关系(仅列举部分,若您的数据源支持 vpc,但以下未列举,可通过开发者工具抓取编辑数据源->点击连接测试时触发的 detect 接口的入参信息中的 config.resource 获取您数据源的参数信息)
阿里云 -- rds
AnalyticDB MySQL 版 -- adb
AnalyticDB PostgreSQL 版 -- gpdb
Hologres -- hologres
ClickHouse -- clickhouse
E-MapReduce Serverless StarRocks 版 -- starrocks
PolarDB MySQL 版 -- polardb
PolarDB 分布式版 -- drds
PolarDB PostgreSQL 版 -- polardb
PolarDB PostgreSQL 版(兼容 Oracle)-- polardb
SelectDB -- selectdb
OceanBase -- oceanbase
Lindorm -- lindorm
Alibaba HybridDB for MySQL -- petaData
Hbase -- hbase
自建数据源,华为云数据源 -- ecs
AWS,微软云,腾讯云,谷歌云 -- rds
TDSQL-H LibraDB -- tdsql
Dataphin --- api_gateway
region 对照关系:
华北 1(青岛)-- cn-qingdao
华北 2(北京)-- cn-beijing
华北 3(张家口)-- cn-zhangjiakou
华北 5(呼和浩特)-- cn-huhehaote
华北 6(乌兰察布)-- cn-wulanchabu
华东 1(杭州)-- cn-hangzhou
华东 2(上海)-- cn-shanghai
华东 5(南京-本地地域 )-- cn-nanjing
华南 1(深圳)-- cn-shenzhen
华南 2(河源)-- cn-heyuan
华南 3(广州)-- cn-guangzhou
华东 6(福州-本地地域)-- cn-fuzhou
华中 1(武汉-本地地域)-- cn-wuhan-lr
西南 1(成都)-- cn-chengdu
中国香港 -- cn-hongkong
日本(东京) -- ap-northeast-1
韩国(首尔)-- ap-northeast-2
新加坡 -- ap-southeast-1
马来西亚(吉隆坡)-- ap-southeast-3
菲律宾(马尼拉) -- ap-southeast-6
印度尼西亚(雅加达)-- ap-southeast-5
泰国(曼谷)-- ap-southeast-7
美国(弗吉尼亚)-- us-east-1
美国(硅谷)-- us-west-1
墨西哥 -- na-south-1
英国(伦敦)-- eu-west-1
阿联酋(迪拜)-- me-east-1
德国(法兰克福)-- eu-central-1
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
D787E1A***********5DF8D885 |
| Result |
boolean |
接口执行结果。取值范围:
|
true |
| Success |
boolean |
是否请求成功。取值范围:
|
true |
示例
正常返回示例
JSON格式
{
"RequestId": "D787E1A***********5DF8D885",
"Result": true,
"Success": true
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Internal.System.Error | An internal system error occurred. | 系统内部异常。 |
| 400 | Invalid.Parameter.Error | The parameter is invalid:%s. | 无效参数%s。 |
| 400 | User.NotIn.Workspace | The user is not a member of the group workspace. | 该用户不在群空间中。 |
| 400 | NoPermissionTo.Operate.Object | You are not authorized to operate the objects. | 您无权操作这些对象。 |
| 400 | DatasourceId.IsNull.Error | You must select a data source before selecting the table. | 必须选择数据源之后再选择表。 |
| 400 | Datasource.NotFound.Error | The specified data source does not exist: %s. | 数据源不存在:%s。 |
| 400 | Name.RegularExpression.Error | Name format validation failed. | 名称格式验证失败。 |
| 400 | NameExceeded.MaxLength.Error | The name cannot exceed %s characters in length. | 名称长度不能超过%s个字符。 |
| 400 | Database.PortInvalid.Error | The database port is invalid. | 数据库端口无效。 |
| 400 | VpcInstance.Info.Error | Get vpc instance info error.please check vpc config %s. | 获取VPC实例信息错误。请检查VPC配置 %s。 |
| 400 | VpcInstance.Info.EmptyError | Not found instance. please check vpc config and authorization %s. | 未找到实例。请检查VPC配置和权限 %s。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。