百度智能云

All Product Document

          Log Service

          ResolveIndex

          Description

          Query index list

          API restriction

          • Only path parameters are supported for input; other parameters (e.g., expand_wildcards, ignore_unavailable, allow_no_indices, mode) are not supported
          • All BLS are of the DataStream type. Therefore, only the data_streams field in the response body may have values, while the indices and aliases fields will return empty lists

          Request

          • Request syntax
          GET /_resolve/index/<name> HTTP/1.1
          Host: <Endpoint>
          Authorization: <Authorization String>
          • Request headers

          No additional headers are required beyond the standard request headers.

          • Request parameters
          Parameter name Types Required or not Parameter location Description
          name String Yes Path Index names support fuzzy matching

          Successful response

          • Response headers

          No additional headers are required beyond the standard response headers.

          • Response parameters
          Field Types Description
          data_streams Object Index list

          The element structure of data_streams object in the above table is as follows:

          Field Types Description
          name String Project and logstore name: For the default project, only the name is displayed; for non-default projects, the format is ProjectName$LogStoreName
          backing_indices List<String> Currently, it is the same as name and contains only a single element
          timestamp_field String Time field: Value is @timestamp

          Anomaly response

          • Response headers

          No additional headers are required beyond the standard response headers.

          • Response parameters
          Field Types Description
          error Error Error reason
          status Int HTTP status code: e.g., 500

          The element structure of Error object in the above table is as follows:

          Field Types Description
          root_cause List<Error> Root cause
          type String Error type
          reason String Error reason

          Example

          • Request example
          GET /_resolve/index/* HTTP/1.1
          Host: bls-log.bj.baidubce.com
          Authorization:bce-auth-v1/18717522d39411e9b721df098b0b908c/2019-09-10T07:00:20Z/1800/content-type;host;x-bce-date;x-bce-request-id/6a7cb6c9ac7ec156c805e55e7d0bcfc443b47feee97cf099c1c0d93a0b4c8304
          Content-Type: application/json; charset=utf-8
          • Response example
          HTTP/1.1 204
          Content-Type: application/json; charset=utf-8
          X-Bce-Request-Id: 2eeba101-4cc7-4cfe-b5ac-a3be8d060e33
          Date: Fri, 10 Apr 2020 04:42:37 GMT
          // Success example
          {
            "indices": [],
            "aliases": [],
            "data_streams": [
              {
                // Project and logstore name: For the default project, only the name is displayed; for non-default projects, the format is ProjectName$LogStoreName
                "name": "project$logStoreName",  // Format for default project: logStoreName
                // For BLS, it is the same as name
                "backing_indices": ["project$logStoreName"],
                // Time field
                "timestamp_field": "@timestamp"
              }
            ]
          }
          // Exception example
          {
            "error": {
              "root_cause": [
                {
                  "type": "invalid_index_name_exception",
                  "reason": "invalid_index_name_exception",
                }
              ],
              "type": "invalid_index_name_exception",
              "reason": "invalid_index_name_exception"
            },
            "status": 500
          }
          Previous
          FieldCaps
          Next
          TermsEnum