Get Time Series Chart¶
GET /api/v1/chart_image/get
Overview¶
Get a time series chart based on the specified DQL / PromQL query statement.
Query Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| clientToken | string | Y | Workspace clientToken Example: wctn_xxx Allow empty: False |
| qtype | string | Query statement type, default is dql Allow empty: False Optional values: ['dql', 'promql'] |
|
| q | string | Y | Query statement Example: Allow empty: False |
| startTime | integer | Y | Start time point, timestamp in seconds Example: Allow empty: False |
| endTime | integer | Y | End time point, timestamp in seconds Example: Allow empty: False |
| interval | integer | Data point interval in seconds Example: Allow empty: False |
|
| tz | string | Timezone name, default value Asia/ShanghaiExample: Asia/Shanghai Allow empty: False |
Parameter Additional Notes¶
Query Notes
Note, this interface uses clientToken for authentication. It only takes effect when the clientToken is valid. This interface does not require adding the request header DF-API-KEY.
Request Example¶
curl 'https://openapi.truewatch.com/api/v1/chart_image/get?clientToken=xxxxx&qtype=dql&q=M%3A%3A%60cpu%60%3A(avg(%60usage_idle%60))%20BY%20%60host%60&interval=60&startTime=1743391592&endTime=1743392492&tz=Asia%2FShanghai' \
--data ''