Update a Data Source
API Overview
Use this API to update information for a data source that has been added successfully.
API URL
POST Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/datasource/update
For how to obtain anymetrics_host:anymetrics_port, see Calling APIs.
| Parameter |
Type |
Required |
Description |
| tenant-id |
String |
Yes |
Tenant ID. Identifies the tenant that owns the resource. |
| user-id |
String |
Yes |
User ID. Identifies the user performing this operation. |
Request Parameters
| Parameter |
Type |
Required |
Maximum Length |
Description |
Example |
| datasourceId |
String |
Yes |
128 |
Data source ID. |
ds_123149 |
| displayName |
String |
No |
32 |
Data source display name. |
Sample data source |
| desc |
String |
No |
512 |
Data source description. |
This is the first data source created. |
| datasourceType |
String |
Yes |
32 |
Data source type, such as doris or starrocks. |
doris |
| configuration |
Array |
Yes |
|
Data source connection information. |
|
configuration
| Parameter |
Type |
Required |
Description |
Example |
| host |
String |
Yes |
Connection IP address. |
10.5.23.25 |
| port |
Integer |
Yes |
Port number. |
31010 |
| user |
String |
Yes |
Username. |
root |
| password |
String |
Yes |
Password. |
root |
| engineType |
String |
Yes |
Engine type. |
For example, AIR |
| properties |
JSON |
Yes |
Connection properties. |
{ "AIR_ENGINE_TENANT_ID":"tardis_0530", "AIR_ENGINE_CLOUD_ACCOUNT":"2f44uk6iv0u8@aloudata.com"} |
Response Parameters
| Parameter |
Type |
Required |
Description |
Example |
| success |
Boolean |
Yes |
Whether the response succeeded. |
true |
| code |
String |
Yes |
API response code. |
200 |
| errorMsg |
String |
Yes |
Error message. |
Request successful |
| detailErrorMsg |
String |
Yes |
Detailed error message. |
|
| traceId |
String |
Yes |
Trace ID for troubleshooting. |
fdde6861bd554805998343f9ff2dcd70.292.16857691758642861 |
| data |
Array |
Yes |
Returned result data. For details, see 4.1 data. |
|
data
| Parameter |
Type |
Required |
Description |
Example |
| datasourceId |
String |
Yes |
Data source ID. |
ds_123149 |
| catalog |
String |
Yes |
Catalog name. |
tn_123100_eb5899b802db890f69cea427bca13ae2 |
Request Example
curl --location --request GET 'https://127.0.0.1:8083/anymetrics/api/v1/datasource/update' \
--header 'tenant-id: tn_19487697' \
--header 'user-id: 463663891121963008' \
--header 'Accept-Language: zh-CN' \
--data-raw '{
"datasourceId": "ds_24903626",
"name": "fl_doris1",
"configuration": {
"host": "127.0.0.1",
"port": "9030",
"user": "root",
"password": "xxxxxx",
"engineType": "DORIS",
"properties": {
"port": "9030",
"host": "127.0.0.1"
}
}
}'
Response Example
{
"data": {
"datasourceId": "ds_24903626",
"catalog": "fl_doris1"
},
"success": true,
"code": "200",
"errorMsg": null,
"detailErrorMsg": null,
"traceId": "6387c419bf5d48d9a00613bd98057244.148.17289018554670115"
}