Skip to content

List Data Sources

API Overview

Use this API to query the data source list.

API URL

POST Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/datasource/list

For how to obtain anymetrics_host:anymetrics_port, see Calling APIs.

Common Parameters (Headers)

Parameter Type Required Description
tenant-id String Yes Tenant ID. Identifies the tenant for metric query content.
auth-type String Yes Authentication method. Supported values: UID, TOKEN, ACCOUNT, and APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

Request Parameters

Parameter Type Required Maximum Length Description Example
pageNum Integer Yes Page number, starting from 1. 1
pageSize Integer Yes Number of records per page. 20

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
id String Yes Data source ID. ds_123149
name String Yes Data source name. jmsr

Request Example

curl --location --request GET 'https://127.0.0.1:8083/anymetrics/api/v1/datasource/list?pageNum=1&pageSize=10' \
--header 'tenant-id: tn_19487697' \
--header 'auth-value: 463663891121963008' \
--header 'auth-type: UID' \

Response Example

{
    "data": {
        "totalPageSize": 1,
        "pageNumber": 1,
        "pageSize": 10,
        "datasourceInfoList": [
            {
                "id": "ds_19489669",
                "name": "jmsr"
            }
        ]
    },
    "success": true,
    "code": "200",
    "errorMsg": null,
    "detailErrorMsg": null,
    "traceId": "c397f866392e4a9e885c8a6c4f39fdb5.189.17466839819881013"
}