Data Monitor
  • 26 Jun 2020
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Data Monitor

  • Dark
    Light
  • PDF

API's Exposed For Data Monitor

Using the API’s exposed for Data monitor you can Create / Delete / Update Data monitor and you can perform some operations like Enabling / Disabling Data monitor.

Create / Delete / Update A Data Monitor Using API

1. Create a Data Monitor

API Suffix and Method

Suffix : /DataMonitors
Method : POST

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

Request Body Format

{
  "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "name": "string",
  "description": "string",
  "isEnabled": true,
  "compositeApplicationId": "b5a90529-a042-4e19-b9fa-bf446c242eba",
  "notificationChannelNames": [
    "string"
  ],
  "timeZone": "string",
  "recipients": "string",
  "isAlertOnCompliance": true,
  "isAlertOnCorrection": true,
  "daysOfWeek": [
    "string"
  ],
  "startTime": "2020-05-29T09:14:18.054Z",
  "endTime": "2020-05-29T09:14:18.054Z",
  "frequency": "string",
  "sendAlertBetweenStarTimeAndEndTime": true
}
Mandatory Fields

"name": "string"
"compositeApplicationId": "b5a90529-a042-4e19-b9fa-bf446c242eba"
"frequency": 0

Response Body
The Response Body contains the unique DataMonitorId for the newly created Data Monitor. Later this Id can be used to update / delete or Enable / Disable this Data Monitor.

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

2. Update A Data Monitor

API Suffix and Method

Suffix : /DataMonitors
Method : PUT

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

Request Body Format

{
  "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "name": "string",
  "description": "string",
  "isEnabled": true,
  "compositeApplicationId": "b5a90529-a042-4e19-b9fa-bf446c242eba",
  "notificationChannelNames": [
    "string"
  ],
  "timeZone": "string",
  "recipients": "string",
  "isAlertOnCompliance": true,
  "isAlertOnCorrection": true,
  "daysOfWeek": [
    "string"
  ],
  "startTime": "2020-05-29T09:14:18.067Z",
  "endTime": "2020-05-29T09:14:18.067Z",
  "frequency": "string",
  "sendAlertBetweenStarTimeAndEndTime": true
}
Mandatory fields

"id": "b5a90529-a042-4e19-b9fa-bf446c242eba" (Data Monitor Id)
"name": "string" (Data Monitor Name)
"compositeApplicationId": "b5a90529-a042-4e19-b9fa-bf446c242eba"
"frequency": 0

Response Body
Response Body contains the Id of the updated Data Monitor.

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

3. Delete A Data Monitor

API Suffix and Method

Suffix : /DataMonitors/{dataMonitorId}
Method : DELETE

This API can be used to delete an existing Data Monitor in Serverless360 composite application.
Request Body Format

dataMonitorId should be passsed in the Suffix URL 

Response Body

"Data monitor [DataMonitorName] deleted successfully"

Get Data Monitors

1. Get Data Monitors in a Composite Application

API Suffix and Method

Suffix : /DataMonitors/{compositeApplicationId}
Method : GET

This API can be used to get all the Data Monitor in a particular composite application.

Request Body Format

compositeApplicationId should be passsed in the Suffix URL 

Response Body
Response Body contains all the Data monitor details in the given Composite application Id.

[
  {
    "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
    "name": "Data Monitor",
    "description": "Data monitor can monitor Azure resources for performance/ reliability/ consumption based on metric value",
    "isEnabled": false,
    "compositeApplicationId": "0151fbf7-b6e0-44c9-98e6-def2aa0gh90",
    "notificationChannelNames": [],
    "timeZone": "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
    "recipients": "RecipientsMailId",
    "isAlertOnCompliance": false,
    "isAlertOnCorrection": false,
    "daysOfWeek": [],
    "startTime": "2020-05-07T00:00:00Z",
    "endTime": "0001-01-01T00:00:00Z",
    "frequency": "15 Minutes",
    "sendAlertBetweenStarTimeAndEndTime": false
  },
  {
    "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
    "name": "DataFactory_Data monitor",
    "description": "",
    "isEnabled": false,
    "compositeApplicationId": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
    "notificationChannelNames": [],
    "timeZone": "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
    "recipients": "RecipientsMailId",
    "isAlertOnCompliance": false,
    "isAlertOnCorrection": false,
    "daysOfWeek": [],
    "startTime": "2020-05-07T08:59:11Z",
    "endTime": "0001-01-01T00:00:00Z",
    "frequency": "15 Minutes",
    "sendAlertBetweenStarTimeAndEndTime": false
  }
]

2. Get Data Monitor By Id

API Suffix and Method

Suffix : /DataMonitors/GetDataMonitorById/{monitorId}
Method : GET

This API can be used to get individual Data monitor using the unique DataMonitorId.

Request Body Format

dataMonitorId should be passsed in the Suffix URL 

Response Body
Response Body contains properties of the given Data Monitor Id.

{
  "id": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "name": "DataFactory_Data monitor",
  "description": "",
  "isEnabled": false,
  "compositeApplicationId": "0151fbf7-b6e0-44c9-98e6-def2aaf0a70c",
  "notificationChannelNames": [],
  "timeZone": "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
  "recipients": "RecipientsMailId",
  "isAlertOnCompliance": false,
  "isAlertOnCorrection": false,
  "daysOfWeek": [],
  "startTime": "2020-05-07T08:59:11Z",
  "endTime": "0001-01-01T00:00:00Z",
  "frequency": "15 Minutes",
  "sendAlertBetweenStarTimeAndEndTime": false
}

Enable / Disable Data Monitors

1. Enable Data Monitor

API Suffix and Method

Suffix : /DataMonitors/{dataMonitorId}/Enable
Method : PUT

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

Request Body Format

dataMonitorId should be passsed in the Suffix URL 

Response Body
Response Body contains the Data monitor Id which was Enabled.

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

2. Disable Data Monitor

API Suffix and Method

Suffix : /DataMonitors/{dataMonitorId}/Disable
Method : PUT

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

Request Body Format

dataMonitorId should be passsed in the Suffix URL 

Response Body
Response Body contains the Data monitor Id which was disabled.

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

Get Configurable Metrics for specified Resource Id

API Suffix and Method

Suffix : /DataMonitors/GetConfigurableMetrics/{resourceId}
Method : GET

This API can be used to get the configurable metrics for specific resource by providing the unique Resource Id generated for each resource in Serverless360 whenever a resource is associated to any composite application .

Request Body Format

resourceId should be passsed in the Suffix URL 

Response Body
In the Response Body you will get all the Configurable Metrics for the specified resource.

[
 {
    "localizedValue": "Runs Started",
    "value": "RunsStarted",
    "unit": "Count",
    "primaryAggregationType": "Total"
  },
  {
    "localizedValue": "Runs Completed",
    "value": "RunsCompleted",
    "unit": "Count",
    "primaryAggregationType": "Total"
  },
  {
    "localizedValue": "Runs Succeeded",
    "value": "RunsSucceeded",
    "unit": "Count",
    "primaryAggregationType": "Total"
  }
]

Mapping a Resource To Data Monitor

Serverless360 provides two APIs to map a resource to a data monitor. One uses the Azure Resource Id, another uses the Resource Id generated in Serverless360.

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

API Suffix and Method

Suffix : /DataMonitors/Resource/MapResource
Method : POST

This API can be used to map a resource in Serverless360 Data Monitor using the unique Resource Id generated for each resource in Serverless360.

Request Body Format

{
  "resourceId": "b5a90529-a042-4e19-b9fa-bf446c242eba0",
  "monitorId": "0b5a90529-a042-4e19-b9fa-bf446c242eba",
  "metricConfigurations": [
    {
      "metricName": "string",
      "condition": "string",
      "warningThreshold": "string or integer",
      "errorThreshold": "string or integer"
    }
  ],
  "isAlertOnWarningOrErrorState": true
}
Mandatory Fields

"monitorId": "0b5a90529-a042-4e19-b9fa-bf446c242eba"
"resourceId": "b5a90529-a042-4e19-b9fa-bf446c242eba0"
"metricConfigurations": [
{
"metricName": "string",
"condition": "string",
"warningThreshold": "string or integer",
"errorThreshold": "string or integer"
}

  • You can use a metric or a number as warning and error threshold value.

Response Body

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

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

API Suffix and Method

Suffix : /DataMonitors/Resource/MapResourceUsingAzureResourceId
Method : POST

This API can be used to map a resource in Serverless360 Data Monitor using the Azure Resource Id.

Request Body Format

{
  "azureResourceId": "string",
  "monitorId": "b5a90529-a042-4e19-b9fa-bf446c242eba0",
  "metricConfigurations": [
    {
      "metricName": "string",
      "condition": "string",
      "warningThreshold": "string or integer",
      "errorThreshold": "string or integer"
    }
  ],
  "isAlertOnWarningOrErrorState": true
}
Mandatory Fields

"monitorId": "b5a90529-a042-4e19-b9fa-bf446c242eba0"
"azureResourceId": "string"
"metricConfigurations": [
{
"metricName": "string",
"condition": "string",
"warningThreshold": "string or integer",
"errorThreshold": "string or integer"
}

  • You can use a metric or a number as warning and error threshold value.

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 Data Monitor

Serverless360 again provides two APIs for unmapping a resource from a data monitor. One uses the Azure Resource Id, another uses the Resource Id generated in Serverless360.

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

API Suffix and Method

Suffix : /DataMonitors/{dataMonitorId}/Resource/{resourceId}/UnmapResource
Method : POST

This API can be used to unmap a resource in Serverless360 Data Monitor using the unique Resource Id generated for each resource in Serverless360.

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 Data Monitor using Azure Resource Id

API Suffix and Method

Suffix : /DataMonitors/{dataMonitorId}/Resource/UnMapResource
Method : POST

This API can be used to unmap a resource in Serverless360 Data Monitor using the Azure Resource Id.

Request Body Format

monitorId should be passsed in the Suffix URL and azureResourceId should be given in 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?