Create Alert Policy
POST /vdc/alertpolicy
Creates an Alert Policy to watch a metric and to raise an alert according to the given conditions in the policy
Required Roles
This call has no restrictions.
Request Payload
Table
XML
JSON
<alert_policy>
<policyName></policyName>
<metricType></metricType>
<metricName></metricName>
<createdBy></createdBy>
<isEnabled></isEnabled>
<isPerInstanceMetric></isPerInstanceMetric>
<period></period>
<periodUnits></periodUnits>
<datapointsToConsider></datapointsToConsider>
<datapointsToAlert></datapointsToAlert>
<statistic></statistic>
<operator></operator>
<condition>
<thresholdUnits></thresholdUnits>
<thresholdValue></thresholdValue>
<severityType></severityType>
</condition>
</alert_policy>
{
"policyName": "",
"metricType": "",
"metricName": "",
"createdBy": "",
"isEnabled": "",
"isPerInstanceMetric": "",
"period": "",
"periodUnits": "",
"datapointsToConsider": "",
"datapointsToAlert": "",
"statistic": "",
"operator": "",
"condition": [
{
"thresholdUnits": "",
"thresholdValue": "",
"severityType": ""
}
]
}
All parameters are required unless otherwise stated.
Field
Description
Type
Notes
alert_policy
policyName
String
metricType
String
metricName
String
createdBy
String
isEnabled
String
isPerInstanceMetric
Defaults to false (i.e. metric value is inspected at VDC level).
Set to true if the metric needs to be inspected at each node within the VDC.
String
period
Indicates the length of time to evaluate the metric to create each individual data point for a metric.
If you choose one hour as the period, there is one data point every hour
Integer
periodUnits
String
datapointsToConsider
Indicates the number of the most recent data points to consider to trigger alert
Integer
datapointsToAlert
Indicates the number of data points that must be breaching to trigger an alert
Integer
statistic
String
Valid Values:
MIN, MAX, AVG, SUM, COUNT
operator
String
Valid Values:
GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, EQUAL_TO
condition
0-* Elements
thresholdUnits
String
thresholdValue
String
severityType
Valid Values:
Response Body
Examples
XML Example
JSON Example
curl Example
Request
POST https://192.168.0.0:4443/vdc/alertpolicy/my%20RPO%20Policy
HTTP/1.1
Content-Type: application/xml
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
<alert_policy>
<policyName>my RPO Policy</policyName>
<metricType>Geo Replication Statistics</metricType>
<metricName>RPO</metricName>
<createdBy>USER</createdBy>
<isEnabled>true</isEnabled>
<isPerInstanceMetric>false</isPerInstanceMetric>
<period>600000</period>
<periodUnits>MILLISECONDS</periodUnits>
<datapointsToConsider>1</datapointsToConsider>
<datapointsToAlert>1</datapointsToAlert>
<statistic>MAX</statistic>
<operator>GREATER_THAN</operator>
<condition>
<thresholdUnits>HOURS</thresholdUnits>
<thresholdValue>1</thresholdValue>
<severityType>WARNING</severityType>
</condition>
</alert_policy>
Response
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alert_policy>
<policyName>my RPO Policy</policyName>
<metricType>Geo Replication Statistics</metricType>
<metricName>RPO</metricName>
<createdBy>USER</createdBy>
<isEnabled>true</isEnabled>
<isPerInstanceMetric>false</isPerInstanceMetric>
<period>600000</period>
<periodUnits>MILLISECONDS</periodUnits>
<datapointsToConsider>1</datapointsToConsider>
<datapointsToAlert>1</datapointsToAlert>
<statistic>MAX</statistic>
<operator>GREATER_THAN</operator>
<condition>
<thresholdUnits>HOURS</thresholdUnits>
<thresholdValue>1</thresholdValue>
<severityType>WARNING</severityType>
</condition>
</alert_policy>
Request
POST https://192.168.0.0:4443/vdc/alertpolicy/my%20RPO%20Policy
HTTP/1.1
Content-Type: application/json
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
{
"alert_policy": {
"policyName": "my RPO Policy",
"metricType": "Geo Replication Statistics",
"metricName": "RPO",
"createdBy": "USER",
"isEnabled": "true",
"isPerInstanceMetric": "false",
"period": "600000",
"periodUnits": "MILLISECONDS",
"datapointsToConsider": "1",
"datapointsToAlert": "1",
"statistic": "MAX",
"operator": "GREATER_THAN",
"condition": {
"thresholdUnits": "HOURS",
"thresholdValue": "1",
"severityType": "WARNING"
}
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"alert_policy": {
"policyName": "my RPO Policy",
"metricType": "Geo Replication Statistics",
"metricName": "RPO",
"createdBy": "USER",
"isEnabled": "true",
"isPerInstanceMetric": "false",
"period": "600000",
"periodUnits": "MILLISECONDS",
"datapointsToConsider": "1",
"datapointsToAlert": "1",
"statistic": "MAX",
"operator": "GREATER_THAN",
"condition": {
"thresholdUnits": "HOURS",
"thresholdValue": "1",
"severityType": "WARNING"
}
}
}
Request
cat body.txt
<alert_policy>
<policyName>my RPO Policy</policyName>
<metricType>Geo Replication Statistics</metricType>
<metricName>RPO</metricName>
<createdBy>USER</createdBy>
<isEnabled>true</isEnabled>
<isPerInstanceMetric>false</isPerInstanceMetric>
<period>600000</period>
<periodUnits>MILLISECONDS</periodUnits>
<datapointsToConsider>1</datapointsToConsider>
<datapointsToAlert>1</datapointsToAlert>
<statistic>MAX</statistic>
<operator>GREATER_THAN</operator>
<condition>
<thresholdUnits>HOURS</thresholdUnits>
<thresholdValue>1</thresholdValue>
<severityType>WARNING</severityType>
</condition>
</alert_policy>
curl -H $token -H "Content-Type: application/xml" -X POST --data @body.txt https://$nodeIp:4443/vdc/alertpolicy/my%20RPO%20Policy
Response
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alert_policy>
<policyName>my RPO Policy</policyName>
<metricType>Geo Replication Statistics</metricType>
<metricName>RPO</metricName>
<createdBy>USER</createdBy>
<isEnabled>true</isEnabled>
<isPerInstanceMetric>false</isPerInstanceMetric>
<period>600000</period>
<periodUnits>MILLISECONDS</periodUnits>
<datapointsToConsider>1</datapointsToConsider>
<datapointsToAlert>1</datapointsToAlert>
<statistic>MAX</statistic>
<operator>GREATER_THAN</operator>
<condition>
<thresholdUnits>HOURS</thresholdUnits>
<thresholdValue>1</thresholdValue>
<severityType>WARNING</severityType>
</condition>
</alert_policy>