Skip to main content

Demo video: Use APIs to send sample data into Moogsoft Cloud

Use APIs to send sample data into Moogsoft Cloud

In this video, you will learn how to use best practices in managing API keys, navigate the Moogsoft API docs to locate relevant information, and build Event and Metrics API commands.

Suppose you have a monitoring tool collecting metric and event data, and you want to route that data to Moogsoft using our Event and Metric APIs.

3_eventmetric.png

You can build the integration right in our API documentation. Let me show you how.

But first, a little bit about API key management.

4_APIKeyManagement.png

You need an API key to push data to Moogsoft. The best practice here is not to use the primary API key as you see in the events API ingestion service page.

Rather, we recommend you create an API key that is revocable. This way you can grant and remove access to Moogsoft for different users and applications.

6_APIKeys.png

Here, you can create and revoke the keys as needed.

7_CreateAPIKey.png

Let’s create one! Provide a meaningful name and description so other administrators would know what this key is about.

8_APIKey.png

And the API key is generated for you to copy and use.  For security reasons, you will not be able to reference it once you move away from this screen.

9_CopyAPIKey.png

When and if you need to revoke it, you can do so here.

10_HowtoRevoke.png

Next, we are going to use our Moogsoft API documentation. Here’s a Metrics API sample code that includes the required fields and optional fields for this endpoint.

11_MetricDatum.png

Here’s the endpoint for the Metrics API.

12_Post.png

This is sample code on how to implement this API in a variety of languages.

13_Languages.png

To make this code speak to your instance of Moogsoft, add the API key you generated and copied earlier. Now the sample code is updated to include your key.

14_AddAPIKey.png

Same with the parameters. As you edit them the sample code automatically gets updated. When ready, click on Try It to actually ping your instance with this sample code.

15_AddData.png

Here’s the response. Looks like we are successfully communicating with our instance of Moogsoft!

17_Response.png

This is how you can build your integration with some level of assurance that it works.

18_Copyto.png

Once you fully develop your integration, copy and paste the resulting code into a CLI.

19_Copyto.png

We could also build shell scripts to add additional logic and conditionals that we simulated in the api docs site. Event API works the same way if you want to ingest both events and metrics.

20_EventsAPI.png

Now you know how to use our API documentation to send sample data into Moogsoft, then use it to create your own code.  Thanks for watching!