Update Data Source Owner
Use this API to update the Owner of a data source or its databases.
Request URL: /openapi/v1/datasource/owner/update
Request Method: POST
note
Each request can update only one Owner scope. Pass owner and type to update the data source Owner, or pass databaseOwners to update database Owners. Do not update both scopes in one request.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| datasourceId | String | Yes | Data source ID. Obtain it from List Data Sources. | ds-example123 |
| owner | String | No | Data source Owner. Pass this field when updating the data source Owner. | <Owner> |
| type | String | No | Data source Owner type. Values: account and role. | account |
| databaseOwners | Array | No | Database Owner list. This field uses replacement semantics. Pass an empty array to remove all database Owner bindings from the data source. | [] |
| └name | String | No | Database name. | app_db |
| └type | String | No | Database Owner type. Values: account and role. | account |
| └owner | Array | No | Database Owner identifier array. | [...] |
Request Examples
Update the data source Owner:
{
"datasourceId": "ds-example123",
"owner": "<Owner>",
"type": "account"
}
Remove all database Owner bindings:
{
"datasourceId": "ds-example123",
"databaseOwners": []
}
Response Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Bool | Whether the API call succeeded. | true |
| requestId | String | Request ID. | request-example |
| errorCode | String | Error code. Returned when the call fails. | INVALID_PARAMETER |
| message | String | Error message. Returned when the call fails. | Invalid parameter |
Successful Response
{
"success": true,
"requestId": "request-example"
}
After the update, call Query Data Source Owner to verify the latest configuration.