Status Monitor
  • 26 Jun 2020
  • 5 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Status Monitor

  • Dark
    Light
  • PDF

API’s Exposed For Status Monitor

Using the API’s exposed for Status monitor you can Create / Delete / Update Status monitor and you can perform operations like Enabling / Disabling Status monitor, Map Unmap resources from a Status monitor.

Create / Delete / Update A Status Monitor Using API

1. Create a Status Monitor

API Suffix and Method

Suffix : /StatusMonitors
Method : POST

This API can be used to create a Status Monitor in Serverless360.

Request Body Format

{
  "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "name": "string",
  "description": "string",
  "isEnabled": true,
  "compositeApplicationId": "0000bf7-b6e0-44c9-98e6-def2aaf0a70c",
  "notificationChannelNames": [
    "string"
  ],
  "timeZone": "string",
  "recipients": "string",
  "isAlertOnFailure": true,
  "daysOfWeek": [
    "string"
  ],
  "timesOfDay": [
    "string"
  ]
}
Mandatory Fields

"name": "string"
"compositeApplicationId": "b5a90529-a042-4e19-b9fa-bf446c242eba"
"daysOfWeek": [ "string" ]
"timesOfDay": ["string"]

Response Body
The Response Body will have the unique Id generated by Serverless360 for this newly created Status Monitor.

0151fbf7-b6e0-44c9-98e6-def2aaf0a70c

2. Update a Exsisting Status Monitor

API Suffix and Method

Suffix : /StatusMonitors
Method : PUT

This API can be used to update an existing Status Monitor.

Request Body Format

{
  "id": "00151fbf7-b6e0-44c9-98e6-def2aaf0a70c0",
  "name": "string",
  "description": "string",
  "isEnabled": true,
  "compositeApplicationId": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "notificationChannelNames": [
    "string"
  ],
  "timeZone": "string",
  "recipients": "string",
  "isAlertOnFailure": true,
  "daysOfWeek": [
    "string"
  ],
  "timesOfDay": [
    "string"
  ]
}
Mandatory fields

"id": "0b5a9529-a042-4e19-b9fa-bf446c24eba0" (Threshold Monitor Id)
"name": "string" (Threshold Monitor Id)
"compositeApplicationId": "b5a90529-a042-4e19-b9fa-bf446c242eba"
"daysOfWeek": ["string"]
"timesOfDay": ["string"]

Response Body
Response Body contains the Id of the updated Status Monitor

0151fbf7-b6e0-44c9-98e6-def2aaf0a70c

3. Delete A Status Monitor

API Suffix and Method

Suffix : /StatusMonitors/{statusMonitorId}
Method : DELETE

This API can be used to delete an Existing Status Monitor in Serverless360 composite application.

Request Body Format

statusMonitorId should be passsed in the Suffix URL 

StatusMonitorId can be obtained using the API : GET StatusMonitorId

Response Body

"Status monitor { Status monitor name} deleted successfully"

Enable / Disable Status Monitors

1. Enable Status Monitor

API Suffix and Method

Suffix : /StatusMonitors/{statusMonitorId}/Enable
Method : PUT

This API can be used to enable a Status Monitor which is already created in Serverless360.

Request Body Format

statusMonitorId should be passsed in the Suffix URL 

Response Body
Response Body contains the Status monitor Id which was enabled.

"0151fbf7-b6e0-44c9-98e6-def2aaf0a70c"

2. Disable Threshold Monitor

API Suffix and Method

Suffix : /StatusMonitors/{statusMonitorId}/Disable
Method : PUT

This API can be used to disable a Status Monitor which is already created in Serverless360.

Request Body Format

statusMonitorId should be passsed in the suffix URL 

Response Body
Response Body contains the Status monitor Id which was Disabled.

"0151fbf7-b6e0-44c9-98e6-def2aaf0a70c"

Get Status Monitors

1. Get Configurable Properties for specified Resource Type

API Suffix and Method

Suffix : /StatusMonitors/GetConfigurableProperties/{resourceType}
Method : GET

This API can be used to get all Configurable Properties for specific resource type.

Request Body Format

resourceType should be passsed in the suffix URL 

Response Body
Response Body contains the Configurable Properties for the given resource type.

[
  {
    "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
    "resourceTypeId": 30,
    "propertyName": "Total Resource Count",
    "condition": ">",
    "warningLevel": 5,
    "errorLevel": 10,
    "expectedState": 0,
    "metricKey": "totalResourceCount",
    "propertyType": 1,
    "isComposite": false
  },
  {
    "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
    "resourceTypeId": 30,
    "propertyName": "Max Allowed Factory Size(Gb)",
    "condition": ">",
    "warningLevel": 5,
    "errorLevel": 10,
    "expectedState": 0,
    "metricKey": "maxAllowedFactorySizeInGbUnits",
    "propertyType": 1,
    "isComposite": false
  },
  {
    "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a700",
    "resourceTypeId": 30,
    "propertyName": "State",
    "condition": ">",
    "warningLevel": 5,
    "errorLevel": 10,
    "expectedState": 0,
    "metricKey": "runtimeState",
    "propertyType": 2,
    "isComposite": true
  },
  {
    "id": "0151fbf7-b6e0-78c9-98e6-def2aaf0a70c",
    "resourceTypeId": 30,
    "propertyName": "Max Allowed Resource Count",
    "condition": ">",
    "warningLevel": 5,
    "errorLevel": 10,
    "expectedState": 0,
    "metricKey": "maxAllowedResourceCount",
    "propertyType": 1,
    "isComposite": false
  },
  {
    "id": "0151fbf7-b5l0-44c9-98e6-def2aaf0a70c",
    "resourceTypeId": 30,
    "propertyName": "Factory Size(Gb)",
    "condition": ">",
    "warningLevel": 5,
    "errorLevel": 10,
    "expectedState": 0,
    "metricKey": "factorySizeInGbUnits",
    "propertyType": 1,
    "isComposite": false
  }
]

Mapping a Resource To Status Monitor

Serverless360 provides two APIs for Mapping a resource to a status monitor. One uses the Azure Resource Id, another uses the Resource Id generated in Serverless360.

1. Map a Resource to a Status Monitor using Resource Id

API Suffix and Method

Suffix : /StatusMonitors/Resource/MapResoure
Method : POST

This API can be used to map a resource in Serverless360's Status Monitor using the unique Resource Id generated for each resource in Serverless360 whenever a resource is mapped to any composite application.

Request Body Format

{
  "monitorId": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "resourceId": "b5a90529-a042-4e19-b9fa-bf446c242eba",
  "monitorStateconfiguration": {
    "expectedState": "string"
  },
  "propertyConfigurations": [
    {
      "property": "string",
      "warningThreshold": 0,
      "condition": "string",
      "errorThreshold": 0
    }
  ],
  "subResourceProperties": [
    {
      "resourceName": "string",
      "monitorStateconfiguration": {
        "expectedState": "string"
      },
      "propertyConfigurations": [
        {
          "property": "string",
          "warningThreshold": 0,
          "condition": "string",
          "errorThreshold": 0
        }
      ]
    }
  ]
}
Mandatory Fields

"monitorId": "0b5a90529-a042-4e19-b9fa-bf446c242eba"
"resourceId": "b5a90529-a042-4e19-b9fa-bf446c242eba0"
"resourceName": "string"
"propertyConfigurations": [
{
"property": "string",
"warningThreshold": 0,
"condition": "string",
"errorThreshold": 0
}
]
"monitorStateconfiguration": {
"expectedState": "string"
}

  • If propertyConfiguration parameter is used all its sub-parameters becomes mandatory

  • If monitorStateconfiguration parameter is used, expected state becomes mandatory

Response Body

{ResourceType} {resourceName} has been mapped to the {monitortype} monitor {MonitorName} successfully.

2. Map a Resource to a Status Monitor using Azure Resource Id

API Suffix and Method

Suffix : /StatusMonitors/Resource/MapResoureByAzureResourceId
Method : POST

This API can be used to map a resource in Serverless360's Status Monitor using the Azure Resource Id generated for each resource whenever a resource is created in the Azure Portal.

Request Body Format

{
  "monitorId": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "azureResourceId": "string",
  "monitorStateconfiguration": {
    "expectedState": "string"
  },
  "propertyConfigurations": [
    {
      "property": "string",
      "warningThreshold": 0,
      "condition": "string",
      "errorThreshold": 0
    }
  ],
  "subResourceProperties": [
    {
      "resourceName": "string",
      "monitorStateconfiguration": {
        "expectedState": "string"
      },
      "propertyConfigurations": [
        {
          "property": "string",
          "warningThreshold": 0,
          "condition": "string",
          "errorThreshold": 0
        }
      ]
    }
  ]
}
Mandatory Fields

"monitorId": "0b5a90529-a042-4e19-b9fa-bf446c242eba"
"azureResourceId": "string",
"resourceName": "string"
"propertyConfigurations": [
{
"property": "string",
"warningThreshold": 0,
"condition": "string",
"errorThreshold": 0
}
]
"monitorStateconfiguration": {
"expectedState": "string"
}

  • If propertyConfiguration parameter is used all its sub-parameters becomes mandatory

  • If monitorStateconfiguration parameter is used, expected state becomes mandatory

Reference link for How to get Azure Resource Id? can be used to retrieve the Azure Resource Id

Response Body

{ResourceType} {resourceName} has been mapped to the {monitortype} monitor {MonitorName} successfully.

Unmapping a Resource from a Status Monitor

Again Serverless360 provides two APIs for Unmapping a resource from a status monitor. One uses the Azure Resource Id, another uses the Resource Id generated in Serverless360.

1. Unmap a Resource From a Status Monitor using Resource Id

API Suffix and Method

Suffix : /StatusMonitors/{monitorId}/Resource/{resourceId}/UnMapResource
Method : POST

This API can be used to unmap a resource in Serverless360's Status Monitor using the unique Resource Id generated for each resource in Serverless360 whenever a resource is mapped to any composite application.

Request Body Format

monitorId and resourceId should be passsed in the Suffix URL 

Response Body

The {res type} ‘{res name}’ was unmapped from the {monitor type} monitor ‘{monitor name}’ successfully

2. Unmap a Resource From a Status Monitor using Azure Resource Id

API Suffix and Method

Suffix : /StatusMonitors/{monitorId}/Resource/UnMapResource
Method : POST

This API can be used to unmap a resource in Serverless360's Status Monitor using the Azure Resource Id generated for each resource whenever a resource is created in the Azure Portal.

Request Body Format

monitorId should be passsed in the Suffix URL and azureResourceId should be passed in the Request Body

Response Body

The {res type} ‘{res name}’ was unmapped from the {monitor type} monitor ‘{monitor name}’ successfully
We'd love to hear your thoughts
Please visit our feedback system to suggest new Features or Enhancements. You can also take a look at our Roadmap

Was this article helpful?

What's Next