修改資料來源配置。
調試
您可以在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,微軟雲,騰訊雲,Google雲 -- 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。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。