All Products
Search
Document Center

Quick BI:UpdateDataSource

Last Updated:Apr 23, 2026

Modifies a data source configuration.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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:

  • dsId: Required. The ID of the data source.

  • userId: Optional. The Quick BI user ID of the user who modifies the data source. If you specify this parameter, the update runs as this user.

  • dsType: Required. The type of the data source. This value cannot be changed and must match the existing data source type.

  • showName: Optional. The display name of the data source.

  • address: Optional. The database connection endpoint, which can be a domain name or an IP address.

  • port: Optional. The connection port for the database.

  • schema: Optional. The database schema. This parameter is required only for database types that support schemas. For example, the default schema for SQL Server is dbo, while MySQL does not use schemas.

  • instance: Optional. The database instance.

  • username: Optional. The username for the database account or the AccessKey ID.

  • password: Optional. The password for the database account.

  • resource: Specifies the VPC type. This parameter is required if you are using a VPC connection. If the data source was created with VPC settings, you must include this parameter in your update request. Omitting this parameter from the request disables the VPC connection. For a list of resource values, see the Additional information section below.

  • accessId: Optional. The AccessKey ID for the VPC instance. This parameter is required if the resource parameter is specified.

  • accessKey: Optional. The AccessKey secret for the VPC instance. This parameter is required if the resource parameter is specified.

  • instanceId: Optional. The ID of the VPC instance. This parameter is required if the resource parameter is specified.

  • region: Optional. The region where the VPC instance is located. This parameter is required if the resource parameter is specified. For a list of region IDs, see the Additional information section below.

  • config: Optional. A JSON object that contains additional configuration parameters for the database. You only need to include the fields that you want to update. Any field that you include is updated to the new value, even if it is an empty string. Fields that are not included in the request remain unchanged.

{ "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): rds

  • AnalyticDB for MySQL: adb

  • AnalyticDB for PostgreSQL: gpdb

  • Hologres: hologres

  • ClickHouse: clickhouse

  • E-MapReduce Serverless StarRocks: starrocks

  • PolarDB for MySQL: polardb

  • PolarDB-X: drds

  • PolarDB for PostgreSQL: polardb

  • PolarDB for PostgreSQL (Oracle Compatible): polardb

  • SelectDB: selectdb

  • OceanBase: oceanbase

  • Lindorm: lindorm

  • Alibaba HybridDB for MySQL: petaData

  • HBase: hbase

  • Self-managed data sources and Huawei Cloud data sources: ecs

  • AWS, Microsoft Azure, Tencent Cloud, and Google Cloud: rds

  • TDSQL-H LibraDB: tdsql

  • Dataphin: api_gateway

Region mappings

  • China (Qingdao): cn-qingdao

  • China (Beijing): cn-beijing

  • China (Zhangjiakou): cn-zhangjiakou

  • China (Hohhot): cn-huhehaote

  • China (Ulanqab): cn-wulanchabu

  • China (Hangzhou): cn-hangzhou

  • China (Shanghai): cn-shanghai

  • China (Nanjing-Local Region): cn-nanjing

  • China (Shenzhen): cn-shenzhen

  • China (Heyuan): cn-heyuan

  • China (Guangzhou): cn-guangzhou

  • China (Fuzhou-Local Region): cn-fuzhou

  • China (Wuhan-Local Region): cn-wuhan-lr

  • China (Chengdu): cn-chengdu

  • China (Hong Kong): cn-hongkong

  • Japan (Tokyo): ap-northeast-1

  • Korea (Seoul): ap-northeast-2

  • Singapore: ap-southeast-1

  • Malaysia (Kuala Lumpur): ap-southeast-3

  • Philippines (Manila): ap-southeast-6

  • Indonesia (Jakarta): ap-southeast-5

  • Thailand (Bangkok): ap-southeast-7

  • US (Virginia): us-east-1

  • US (Silicon Valley): us-west-1

  • Mexico (Queretaro): na-south-1

  • UK (London): eu-west-1

  • UAE (Dubai): me-east-1

  • Germany (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: The operation was successful.

  • false: The operation failed.

true

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

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.