/api/search

    Note

    If the plugin is not configured or enabled, endpoints other than /api/search/lookup will return an exception.

    Verbs

    • GET

    • POST

    Requests

    Parameters used by the search endpoint include:

    Query String:

    POST:

    1. {
    2. "query": "name:*",
    3. "limit": 4,
    4. "startIndex": 5
    5. }

    Depending on the endpoint called, the output will change slightly. However common fields include:

    Name

    Data Type

    Description

    Example

    type

    String

    The type of query submitted, i.e. the endpoint called. Will be one of the endpoints listed above.

    TSMETA

    query

    String

    name:sys.cpu.*

    limit

    Integer

    The maximum number of items returned in the result set. Note that the actual number returned may be less than the limit.

    25

    startIndex

    Integer

    The starting index for the current result set as provided in the query

    0

    metric

    String

    The metric used for the lookup

    tags

    Array

    The list of tag pairs used for lookup queries. May be an empty list.

    [ ]

    time

    Integer

    The amount of time it took, in milliseconds, to complete the query

    120

    totalResults

    Integer

    The total number of results matched by the query

    1024

    results

    Array

    The result set. The format depends on the endpoint requested.

    See Below

    This endpoint will almost always return a 200 with content body. If the query doesn’t match any results, the results field will be an empty array and totalResults will be 0. If an error occurs, such as the plugin being disabled or not configured, an exception will be returned.

    TSMETA Response

    The TSMeta endpoint returns a list of matching TSMeta objects.

    TSMETA_SUMMARY Response

    The TSMeta Summary endpoint returns just the basic information associated with a timeseries including the TSUID, the metric name and tags. The search is run against the same index as the TSMeta query but returns a subset of the data.

    1. {
    2. "type": "TSMETA_SUMMARY",
    3. "query": "name:*",
    4. "metric": "*",
    5. "tags": [],
    6. "limit": 3,
    7. "time": 565,
    8. "results": [
    9. "tags": {
    10. "fqdn": "web01.mysite.com"
    11. },
    12. "metric": "app.apache.connections",
    13. "tsuid": "0000150000070010D0"
    14. },
    15. {
    16. "tags": {
    17. },
    18. "metric": "app.apache.connections",
    19. "tsuid": "0000150000070010D5"
    20. },
    21. {
    22. "tags": {
    23. "fqdn": "web03.mysite.com"
    24. },
    25. "metric": "app.apache.connections",
    26. "tsuid": "0000150000070010D6"
    27. }
    28. ],
    29. "startIndex": 0,
    30. "totalResults": 9688066
    31. }

    The TSUIDs endpoint returns a list of TSUIDS that match the query. The search is run against the same index as the TSMeta query but returns a subset of the data.

    UIDMETA Response

    1. {
    2. "type": "UIDMETA",
    3. "query": "name:*",
    4. "metric": "*",
    5. "tags": [],
    6. "limit": 3,
    7. "time": 517,
    8. "results": [
    9. "uid": "000007",
    10. "type": "TAGK",
    11. "name": "fqdn",
    12. "notes": "",
    13. "created": 1362655264,
    14. "custom": null,
    15. "displayName": ""
    16. },
    17. {
    18. "uid": "0010D0",
    19. "type": "TAGV",
    20. "name": "web01.mysite.com",
    21. "description": "",
    22. "notes": "",
    23. "created": 1362720007,
    24. "custom": null,
    25. "displayName": ""
    26. },
    27. {
    28. "uid": "0010D5",
    29. "type": "TAGV",
    30. "name": "web02.mysite.com",
    31. "description": "",
    32. "notes": "",
    33. "created": 1362720007,
    34. "custom": null,
    35. "displayName": ""
    36. }
    37. ],
    38. "startIndex": 0,

    Annotation Response

    The Annotation endpoint returns a list of Annotation objects that match the query.