Get Measurement List with Search Support¶
GET /api/v1/metric_info/measurement/list
Overview¶
Lists the measurements discovered in the workspace on the current day. You can use a regular expression to filter names.
Before You Call and Usage Steps¶
The query scope is the current day in the workspace time zone. If no data matches the conditions, the result field is an empty array. Results are sorted by name in a case-insensitive manner. The response does not include a total count; pagination can end when fewer records than the current limit are received.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | AK identifier used for authentication. Example: <DF-API-KEY>How to obtain or enter: Create or obtain a Key with permissions for this API in API Key Management of the target workspace. |
Query Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| search | string | Performs regular expression matching on measurement names; for example, ^cpu matches names starting with cpu. If omitted or left empty, returns all measurements within the scope. Null allowed: True Example: ^cpuHow to obtain or enter: Use the measurement name or regular expression to match. |
|
| limit | integer | Default: 100. Pass a positive integer. Null allowed: True Default: 100 Example: 100How to obtain or enter: Enter the number of records the client wants to read each time. |
|
| offset | integer | Specifies the record from which to start reading, counted from 0; default: 0. Null allowed: True Default: 0 Example: 0How to obtain or enter: Pass 0 for the first page. For subsequent pages, add limit to the previous offset. |
Additional Parameter Notes¶
Use GET to read data from the workspace to which the current API Key belongs.
Request Example¶
curl --get -H "DF-API-KEY: <DF-API-KEY>" \
"https://openapi.guance.com/api/v1/metric_info/measurement/list" \
--data-urlencode "search=^cpu" \
--data-urlencode "limit=10" \
--data-urlencode "offset=0"
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content.data | array<object> |
Result list. Empty array when there are no matching results. |
| content.data[].name | string | Exact name of the measurement. |
| content.data[].type | string | Fixed to metric. |
| content.data[].description | string | Currently an empty string. |
| content.declaration | object or null | Workspace public declaration attached to non-empty content; if not configured, it can be null or an empty object; not added when the content object is empty. |
{
"code": 200,
"content": {
"data": [
{
"name": "cpu",
"type": "metric",
"description": ""
}
],
"declaration": null
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | An undeclared Query parameter was passed | Request field validation failed; the message indicates the field or rule. | Use only the parameters listed in the parameter table. |
| 403 | ft.ForbiddenQuery | The current credential is not authorized to query the data corresponding to the request | Insufficient query permission. | Check the API Key query permissions and the authorization scope of the target data. |
| 503 | ft.QueryServiceUnavailable | The dependent query service is temporarily unavailable | Query service temporarily unavailable; try again later. | Check content.retryable; for transient errors, retry after a delay. |
| 406 | ft.DqlParseError | The downstream cannot parse the query constructed from the request parameters | DQL query parsing error; the detailed text depends on the actual expression. | Verify the regular expression syntax, fields, and index names; preferably obtain values from the list or field API. |
| 500 | ft.InternalServerError | limit or offset is a string that cannot be converted to an integer | Internal error. | Check the pagination fields used in the parameter table, pass a decimal integer string, and try again. |