Skip to content

Get Log Index List



GET /api/v1/metric_info/log/indexes

Overview

Lists logging and standard log indexes that are visible in the current workspace and are not bound to custom storage.

Before Calling and Usage Steps

This API lists only log index names that are within the current Key's visibility scope, are not bound to external storage, and have a queryType of logging or standard. It is not a complete list of all log index configurations in the workspace. For complete configuration, use Log Index List.

  1. Use the API Key of the target workspace, start from offset=0, and enter a positive integer limit as needed.
  2. Obtain the index name from content.data[].name and pass it to the log field or Tag value API.
  3. For subsequent requests, increase offset by limit. This API does not return a total count; end when fewer than limit records are returned.

Use the returned index names to call the log field or Tag value API. The list 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 in the target workspace.

Query Request Parameters

Parameter Name Type Required Description
limit integer Default: 100. Pass a positive integer.
Allows null: True
Default value: 100
Example: 100
How to obtain or enter: Enter the number of records the client wants to read each time.
offset integer The record number from which to start reading, counted from 0. Default: 0.
Allows null: True
Default value: 0
Example: 0
How 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 in the workspace that the current API Key belongs to.

Request Example

curl --get -H "DF-API-KEY: <DF-API-KEY>" \
  "https://openapi.guance.com/api/v1/metric_info/log/indexes" \
  --data-urlencode "limit=100" \
  --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 Log index name, for example, default.
content.declaration object or null 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": {
    "data": [
      {
        "name": "default"
      }
    ],
    "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 Handling Method
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.
500 ft.InternalServerError A string that cannot be converted to an integer was passed for limit or offset Internal error. Check the pagination fields used against the parameter table, pass a decimal integer string, and try again.

Feedback

Is this page helpful?