ARM REST Services

(8 reviews)

Alerts Examples

Get Alerts

List All Alerts
You can get a full list of configured alerts through the following call:

GET https://anypoint.mulesoft.com/hybrid/api/v1/alerts

The following is a sample response to this call:

"data":[{
  "id":2312,
  "timeCreated":"342423432142342",
  "timeUpdated":"342423432154342",
  "severity": "CRITICAL",
  "description": "Notify when one server of cluster 45 went down",
  "enabled":true,
  "action":{
"notification":{
  "recipients": ["alex.tiavo", "greg.kio"]
}
  },
  "condition":{
"resourceType": "CLUSTER",
"resources": [45],
"event": "DISCONNECTED"
  }
}]

Details on Alert
You can get the the details of a particular alert through the following call:

GET https://anypoint.mulesoft.com/hybrid/api/v1/alerts/2312

The following is a sample response to that call:

{
  "id":2312,
  "timeCreated":"342423432142342",
  "timeUpdated":"342423432154342",
  "severity": "CRITICAL",
  "description": "Notify when one server of cluster 45 went down",
  "enabled":true,
  "action":{
"notification":{
  "recipients": ["alex.tiavo", "greg.kio"]
}
  },
  "condition":{
"resourceType": "CLUSTER",
"resources": [45],
"event": "DISCONNECTED"
  }
}

Server Down/Up/Configured

This call creates an alert that notifies users "jeff.x" and "wai.y" when server 123 is disconnected:

POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts

{
"description":"Notify jeff and way in case Server 123 goes down",
"severity":"CRITICAL",
 "condition":{
 "resourceType":"SERVER",
 "resource":[123],
 "event":"DISCONNECTED"
 }
 "action":{
  "notification":{
        "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when one of the servers of server group 123 goes up:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case a member of Server Group 123 goes up",
    "severity":"WARNING",
     "condition":{
         "resourceType":"SERVER_GROUP",
         "resource":[123],
         "event":"CONNECTED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when one of the servers of cluster 123 gets Configured:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case member of cluster 123 gets Configured",
    "severity":"WARNING",
     "condition":{
         "resourceType":"CLUSTER",
         "resource":[123],
         "event":"CONFIGURED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when any server in the environment goes down:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case any server goes down",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER",
         "resource":[],
         "event":"DISCONNECTED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

By setting the resource field to an empty array, it refers to all resources.

Server Created/Deleted/Rejected

This call creates an alert that notifies users "jeff.x" and "wai.y" when server 123 is deleted:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case Server 123 is deleted",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER",
         "resource":[123],
         "event":"DELETED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when server group 123 is created:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case Server group 123 is deleted",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER_GROUP",
         "resource":[123],
         "event":"DELETED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when cluster 123 is deleted:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case Server group 123 is deleted",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"CLUSTER",
         "resource":[123],
         "event":"DELETED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when server group 123 is rejected:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case Server group 123 is rejected",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER_GROUP",
         "resource":[123],
         "event":"CONNECTION_REJECTED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

Agent/Runtime Version change

This call creates an alert that notifies users "jeff.x" and "wai.y" when server 123 changes the agent version:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case Server 123 changes the agent version,",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER",
         "resource":[123],
         "event":"AGENT_VERSION_UPDATED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when one of the servers of server group 123 changes the Runtime version:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case a member of Server Group 123 changes the Runtime version",
    "severity":"WARNING",
     "condition":{
         "resourceType":"SERVER_GROUP",
         "resource":[123],
         "event":"RUNTIME_VERSION_UPDATED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when one of the servers of cluster 123 changes the agent version:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case member of cluster 123 changes the agent version",
    "severity":"WARNING",
     "condition":{
         "resourceType":"CLUSTER",
         "resource":[123],
         "event":"AGENT_VERSION_UPDATED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when any server in the environment changes the agent version then the user needs to execute:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case any server changes the agent version",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER",
         "resource":[],
         "event":"AGENT_VERSION_UPDATED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

The empty resource means any resource.

Server group/cluster size

This call creates an alert that notifies users "jeff.x" and "wai.y" when cluster 123 is reduced in size:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case cluster 123 is reduced in size",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"CLUSTER",
         "resource":[123],
         "event":"SIZE_REDUCED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when server group 123 is increased in size:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and way in case server group 123 is increased in size",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"SERVER_GROUP",
         "resource":[123],
         "event":"SIZE_INCREASED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

Deployment Failure

This call creates an alert that notifies users "jeff.x" and "wai.y" when application 123 fails to deploy:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and wai on deployment failure of app 123",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"APPLICATION",
         "resource":[123],
         "event":"DEPLOYMENT_FAILED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when any application:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and wai on deployment failure any app in the environment",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"APPLICATION",
         "resource":[],
         "event":"DEPLOYMENT_FAILED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

Application Status changed

This call creates an alert that notifies users "jeff.x" and "wai.y" when application 123 was stopped:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and wai on app 123 stopped",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"APPLICATION",
         "resource":[123],
         "event":"STOPPED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

This call creates an alert that notifies users "jeff.x" and "wai.y" when application 123 was undeployed:

    POST https://anypoint.mulesoft.com/hybrid/api/v1/alerts
{
    "description":"Notify jeff and wai on app 123 stopped",
    "severity":"CRITICAL",
     "condition":{
         "resourceType":"APPLICATION",
         "resource":[123],
         "event":"UNDEPLOYED"
     }
     "action":{
          "notification":{
                "recipients":[ "jeff.x", "wai.y"]
          }
      }
}

The event field for an application status change can hold the values STARTED,DEPLOYED, STOPPED or UNDEPLOYED

Modify an alert

This call deletes a registered alert:

DELETE https://anypoint.mulesoft.com/hybrid/api/v1/alerts/123

This call disables a registered alert:

    PATCH https://anypoint.mulesoft.com/hybrid/api/v1/alerts/123
{
   "disable":false
}

Reviews