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
| Parameter | Type | Required | Description |
|---|---|---|---|
| dataSourceId | Integer | Yes | DataSource ID. |
| instanceDesc | String | No | Display name, up to 512 characters. |
| envId | Integer | No | Environment ID. See listEnvironments. |
| clusterId | Integer | No | Execution cluster ID. See listClusters. |
| host | String | No | Hostname or IP address. Omit port if the address already includes it. |
| port | Integer | No | Port, from 1 to 65535. |
| securityType | String | No | NONE (no authentication), ONLY_USER (username only), USER_PASSWD (username and password). |
| userName | String | No | Applies to ONLY_USER and USER_PASSWD. |
| password | String | No | Applies to USER_PASSWD. Required when switching to this method and there is no saved password. |
Response fields
| Fields in data | Type | Description |
|---|---|---|
| dataSourceId | Integer | DataSource 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
}
}