Get Log Schema Information¶
GET /api/v1/metric_info/log/schema
Overview¶
Get the field names and data types discovered on the current day for a Log Index.
Prerequisites and Usage Steps¶
The query scope is the current day in the Workspace time zone. When no data matches the conditions, the corresponding result fields are empty arrays. First, use the Log Index list to find the index name, then call this API. When you need to filter by values, pass the returned field names to Get Log Tag Values.
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 |
|---|---|---|---|
| index | string | The Log Index to query. If omitted or blank, default is used.Allows null: True Example: defaultHow to obtain or enter: Select from content.data[].name in the response of Get Log Index List. |
Additional Parameter Notes¶
Use GET to read data in the Workspace associated with the current API Key.
Request Example¶
curl --get -H "DF-API-KEY: <DF-API-KEY>" \
"https://openapi.guance.com/api/v1/metric_info/log/schema" \
--data-urlencode "index=default"
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content.index | string | The Log Index that was actually queried. |
| content.fields | array<object> |
Result list. Empty array when no results match. |
| content.fields[].name | string | Field name. Can be used in subsequent queries. |
| content.fields[].value_type | string | Field value type returned by the data source. Can be an empty string. |
| content.fields[].type | string | Field category. Fixed to text. |
| content.fields[].description | string | Field description. Currently an empty string. |
| content.declaration | object or null | The Workspace common declaration attached to non-empty content. When not configured, it can be null or an empty object; it is not added for an empty content object. |
{
"code": 200,
"content": {
"index": "default",
"fields": [
{
"name": "service",
"value_type": "string",
"type": "text",
"description": ""
}
],
"declaration": null
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 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 credentials are not authorized to query the data requested | Insufficient query permissions. | Check the API Key query permissions and the authorization scope for the target data. |
| 503 | ft.QueryServiceUnavailable | The dependent query service is temporarily unavailable | The query service is temporarily unavailable. Try again later. | Check content.retryable. For transient errors, retry after a delay. |