Updating Alert Rules

You can get alert rules using the following API.

Request URL

POST https://http-collector-observability.sixthsense.rakuten.com/api-externalization/api/v1/rules/{ruleId}

Header

Header key - Authorization

Header value - Bearer {{access_token}} (Navigate to Settings > Access token > Show access token in the SixthSence portal.)

Request

{
"aggregationType": "APDEX",
"aggregationValue": 0,
"channels": [
"string"
],
"instances": [
{
"key": "string",
"value": "string"
}
],
"operation": "EQ",
"period": 0,
"recoveryPeriod": 0,
"ruleName": "string",
"silencePeriod": 0,
"thresholdDisplayUnit": "string",
"thresholdDisplayValue": "string"
}
ParametersDescription
ruleIdRule id of the alert rule.

Example:

{
"ruleName": "Error count for code 401 greater than 1 for more than or equal to a count of 1 in a period of 5 mins",
"aggregationType": "SUM",
"aggregationValue": 0,
"period": 5,
"thresholdDisplayValue": "1",
"thresholdDisplayUnit": "na",
"operation": "GT",
"silencePeriod": 5,
"recoveryPeriod": 0,
"channels": [
"4KuExIUBVVmCg9TvYqE3"
]
}

Response

{
"data": {},
"message": "string",
"success": true
}

Example:

{
"message": "Alert updated successfully.",
"success": true,
"data": {
"ruleId": "YTMwNDI2YWItMWU3MC00ODQyLTgwOTItZWY4YzI2YTg3YjMzXzE2NzQwMzkyODg3Njc=",
"ruleName": "Error count for code 401 greater than 1 for more than or equal to a count of 1 in a period of 5 mins",
"metricDisplayName": "Error code",
"aggregationType": "SUM",
"aggregationValue": 0,
"period": 5,
"thresholdDisplayValue": "1",
"thresholdDisplayUnit": "na",
"operation": "GT",
"silencePeriod": 5,
"recoveryPeriod": 0,
"serviceId": "eyduYW1lJzonbm9kZS1hcHAtMicsJ3RlYW1JRCc6JzU5ZWRkZDE1LTIwMjQtNDA1OS05OGFlLTc5YTJjZTViYTEzNCcsJ3R5cGUnOidBJ30=.1",
"channels": [
"4KuExIUBVVmCg9TvYqE3"
],
"filters": [
{
"key": "service_error_code",
"value": "401"
}
],
"instances": [
{
"key": "endpoint",
"value": "http://www.google.com"
}
]
}
}