Nav

Working with Alerts

logo cloud active logo hybrid disabled logo server disabled logo pcf disabled

This document deals with calling the CloudHub API. For instructions on how to perform these same tasks more easily via the Runtime Manager UI, see CloudHub and its child pages.

The alerts API allows you to create alerts. All resources or methods that return or accept a type (except where noted) use the application JSON type. As an example, here’s a Curl command that would create an alert.

curl -vvvv -XPOST 'https://<Username>:<Password>@anypoint.mulesoft.com/cloudhub/api/alerts?_=<ApplicationID>' -H "content-type: application/json" -d '{"name":"sean","condition":{"application":"sean","event":{"type":"deployment_failure"}},"enabled":true,"email":{"others":["me@mulesoft.com"],"subject":"Deployment Failure","body":"The deployment of your application ${app} has failed. The error was: ${message}\nPlease see your https://anypoint.mulesoft.com/cloudhub/#/console/applications/${app}/logs for more details.\n\nMuleSoft CloudHub | https://anypoint.mulesoft.com/cloudhub/","replyTo":"","accountOwner":false}}' -H "content-type: application/json"

To create an alert on an application, you must first obtain that application’s ID. You can get that through the following command:

curl https://<Username>:<Password>@anypoint.mulesoft.com/cloudhub/api/applications/<ApplicationName>

Check out the API Portal of the CloudHub API to see an interactive reference of all the supported resources, methods, required properties and expected responses.

In the link above, search among other Mule APIs for the "CloudHub" API and click on its latest version.

In this topic: