Moogsoft APIs
Moogsoft supports "API-first" workflows. You can perform your setup, configuration, and analysis tasks programmatically using the Moogsoft APIs.
Request requirements
Each API request must include the following:
The URL path and endpoint — for example:
https://api.moogsoft.com/v1/integrations/metrics
https://api.moogsoft.com/v1/integrations/events
https://api.moogsoft.com/v1/alerts
https://api.moogsoft.com/v1/collectors/datums
A content-type header such as:
"Content-type": application/json
Note
Most endpoints expect
application/json
as the content type, but there are exceptions. Verify the required content type in the documentation before you send a command.The API key. Moogsoft supports basic and bearer token authentication.
"apiKey:" : your-name_eaeGvIxikEMsXt8WB51Wo2cSJOMTyn1MPO6
To find the correct URL path and API key, go to the Moogsoft UI > Integrations > Events page. The example cURL requests include the correct path and API key for your instance. A valid request will look like the following. Note the URL path, endpoint, and two headers.
curl \ -k "https://api.moogsoft.com/express/v1/integrations/events" \ -H "Content-Type: application/json" -H 'apiKey: your-name_eaeGvIxikEMsXt8WB51Wo2cSJOMTyn1MPO6' -d '{ "metric": "response-time-ms", "data": 563, "source": "dev.your.org", "key": "dev", "tags": { "team": "DevOps" } }'
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"}'
Responses
This API generates standard HTTP response codes. For descriptions of these codes, see www.w3.org or a similar reference.
Filters
Some endpoints include a "filter" parameter that enables you to filter the set of incidents, alerts, or metrics.
Publication date
Documentation published 2021-01-08T23:43:40+01:00