Create or Update Routing Rules
POST {{baseUrl}}/services/:serviceID/routing-rules
This endpoint creates or updates the routing rules for the given service.
If default rules not found it creates otherwise it updates the new rules.
Requires access_token
as a Bearer {{token}}
in the Authorization
header with write
scope.
Request Body
{"rules"=>[{"expression"=>"<string>", "route_to"=>{"entity_type"=>"<string>", "entity_id"=>"<string>"}}, {"expression"=>"<string>", "route_to"=>{"entity_type"=>"<string>", "entity_id"=>"<string>"}}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | null | ||
Content-Type | string |
RESPONSES
status: Created
{"data":{"id":"5d8b23427c870edd41453c25","created_at":"2019-09-25T08:20:18.884Z","updated_at":"2019-09-25T08:20:18.884Z","deleted_at":null,"service_id":"5d81d9687000fb6b9def7e35","organization_id":"5d81d9187000fb6b9def7e32","rules":[{"expression":"re(current.labels.alertname, \"^CPUThrottlingHigh.*\") \u0026\u0026 re(past.labels.alertname, \"^CPUThrottlingHigh.*\")","route_to":{"entity_type":"escalationpolicy","entity_id":"5d81d9407000fb6b9def7e33"}},{"expression":"re(current.labels.alertname, \"^CPUThrottlingHigh.*\") \u0026\u0026 re(past.labels.alertname, \"^CPUThrottlingHigh.*\")","route_to":{"entity_type":"squad","entity_id":"5d8b5976578cc3b845cb3608"}},{"expression":"re(current.labels.alertname, \"^CPUThrottlingHigh.*\") \u0026\u0026 re(past.labels.alertname, \"^CPUThrottlingHigh.*\")","route_to":{"entity_type":"user","entity_id":"5d81d9187000fb6b9def7e31"}}]}}