Request path and method

Request path Request method Description
/api/suggest POST Queries metrics, fields, tag keys, and tag values.

Request parameters

Parameter Type Required Description Default value Example
type String Yes The type of the objects that you need to query, such as metrics, field, tag key, and tag value. None metrics
metric String No The metric that you want to query. The field values, tag keys, and tag values that correspond to the specified metric are returned. If you set type to metrics, this parameter is ignored. None -
q String No The prefix of the object to query. None my_
max Integer No The maximum number of the returned entries. 25 4

Sample requests in the JSON format

      "type": "metrics",
      "q": "my_",
      "max": 4

Objective: Query four field names prefixed by the letter d based on the wind metric.

Request line: POST /api/suggest

Request body:

      "type": "field",
      "metric": "wind",
      "q": "d",
      "max": 4


A string array is returned.

    The following result is returned for the first sample request:
    [ "my_metric1", "my_metric2", "my_metric3", "my_metric4" ]
    The following result is returned for the second sample request. Only the two entries that meet the requirements are returned.
    [ "description", "direction" ]