Skip to main content

Update a DataSource

Update the specified DataSource. Send at least one field to update. Connection fields can be updated for MySQL and PostgreSQL.

POST /api/open/v1/datasource/updateDataSource

Requires “DataSource Manage” and management permission on the target DataSource.

Send the Idempotency-Key header with 1 to 128 visible ASCII characters.

Request parameters​

ParameterTypeRequiredDescription
dataSourceIdIntegerYesDataSource ID.
instanceDescStringNoDisplay name, up to 512 characters.
envIdIntegerNoEnvironment ID. See listEnvironments.
clusterIdIntegerNoExecution cluster ID. See listClusters.
hostStringNoHostname or IP address. Omit port if the address already includes it.
portIntegerNoPort, from 1 to 65535.
securityTypeStringNoNONE (no authentication), ONLY_USER (username only), USER_PASSWD (username and password).
userNameStringNoApplies to ONLY_USER and USER_PASSWD.
passwordStringNoApplies to USER_PASSWD. Required when switching to this method and there is no saved password.

Response fields​

Fields in dataTypeDescription
dataSourceIdIntegerDataSource ID.

Request example​

{
"dataSourceId": 42,
"instanceDesc": "Sales database (development)"
}

Response example​

{
"requestId": "7d3a4b8c-483e-5ed7-a46b-03ae15d47788",
"code": "OK",
"msg": "Request succeeded.",
"data": {
"dataSourceId": 42
}
}