Collectors API

You can use this API to do the following:

  • Create, retrieve, update and delete collectors.

  • Retrieve metric data from a collector.

  • Post metric data from a collector.

  • Retrieve the set of available metrics from a collector.

Collector terms

This API uses the following terms.

Term

Description

filter

To create and validate a metric filter, use the Search field in the Metrics page. You can then copy and paste the filter into your request.

fully_qualified_moob

The full name of the managed object associated with a metric. The full name is in the format namespace:managed-object:archive.

You can view the fully_qualified_moob at the top of a metric chart.

metric-chart-labels.png

key

An optional metric field that provides additional information. For example, the metric name might be "disk_used" and the key might be "eth0."

You can view the key at the top of a metric chart.

metric-chart-labels.png

mar

The managed object archive associated with a metric. This is the last element in the fully_qualified_moob: namespace:managed_object:archive.

namespace

The namespace associated with a metric. This is the first element in the fully_qualified_moob: namespace:managed_object:archive.

query

A database query to filter by collector(s)

start

The index of the first item to return from a set of query results. Thus a value of 50 will return the 50th object in the output onward.

uuid

The universally-unique ID of a collector. The UUID is in the format namespace:managed-object:archive.

You can view the UUID in the UI page for the collector.

collector-uuid.png

version

The SDK version of the mar. To determine the version, navigate to the following folder on the collector host: collector-home/collector/sheds/collector-instance-name/mars/namespace/mar-name/sdk-version-number

API Authentication

Moogsoft supports basic and bearer token authentication for programmatic access to our public APIs.

Basic authentication

Embed the API key in the URL using the format api_key@domain_name. For example:

curl -k "https://mynamespace_!bmf0u446-7345-297j-3769-g57rs8qqztm@api.moogsoft.ai/v1/integrations/metrics"\
    -H "Content-Type: application/json"
    -d '{ "metric": "your-metric", "data": 10, "source": "www.your-source.com", "key": "dev", "tags": { "key": "value" }, "utc_offset": "GMT-07:00"}'

Bearer token authentication

Include the API key as a header in the body of the HTTP request. For example:

curl -k "https://api.moogsoft.ai/v1/integrations/metrics"\
    -H "Content-Type: application/json"
    -H 'apiKey: mynamespace_!bmf0u446-7345-297j-3769-g57rs8qqztm'
    -d '{ "metric": "your-metric", "data": 10, "source": "www.your-source.com", "key": "dev", "tags": { "key": "value" }, "utc_offset": "GMT-07:00"}'

API specification