Skip to content

Commit 79a0e15

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add escalation policy routing action with support hours and acknowledgment timeout to On-Call routing rules (#4076)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent bf7dc7f commit 79a0e15

13 files changed

Lines changed: 272 additions & 66 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65461,6 +65461,7 @@ components:
6546165461
- $ref: "#/components/schemas/SendSlackMessageAction"
6546265462
- $ref: "#/components/schemas/SendTeamsMessageAction"
6546365463
- $ref: "#/components/schemas/TriggerWorkflowAutomationAction"
65464+
- $ref: "#/components/schemas/RoutingRuleEscalationPolicyAction"
6546465465
RoutingRuleAttributes:
6546565466
description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
6546665467
properties:
@@ -65478,6 +65479,52 @@ components:
6547865479
urgency:
6547965480
$ref: "#/components/schemas/Urgency"
6548065481
type: object
65482+
RoutingRuleEscalationPolicyAction:
65483+
description: "Triggers an escalation policy."
65484+
properties:
65485+
ack_timeout_minutes:
65486+
description: "The number of minutes before an acknowledged page is re-triggered."
65487+
example: 30
65488+
format: int64
65489+
type: integer
65490+
policy_id:
65491+
description: "The ID of the escalation policy to route to."
65492+
example: "00000000-0000-0000-0000-000000000000"
65493+
type: string
65494+
support_hours:
65495+
$ref: "#/components/schemas/RoutingRuleEscalationPolicyActionSupportHours"
65496+
type:
65497+
$ref: "#/components/schemas/RoutingRuleEscalationPolicyActionType"
65498+
urgency:
65499+
$ref: "#/components/schemas/Urgency"
65500+
required:
65501+
- type
65502+
- policy_id
65503+
type: object
65504+
RoutingRuleEscalationPolicyActionSupportHours:
65505+
description: "Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule."
65506+
properties:
65507+
restrictions:
65508+
description: "The list of support hours time windows."
65509+
items:
65510+
$ref: "#/components/schemas/TimeRestriction"
65511+
type: array
65512+
time_zone:
65513+
description: "The time zone in which the support hours are expressed."
65514+
example: ""
65515+
type: string
65516+
required:
65517+
- time_zone
65518+
type: object
65519+
RoutingRuleEscalationPolicyActionType:
65520+
default: escalation_policy
65521+
description: "Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule."
65522+
enum:
65523+
- escalation_policy
65524+
example: escalation_policy
65525+
type: string
65526+
x-enum-varnames:
65527+
- ESCALATION_POLICY
6548165528
RoutingRuleRelationships:
6548265529
description: Specifies relationships for a routing rule, linking to associated policy resources.
6548365530
properties:
@@ -85180,7 +85227,7 @@ components:
8518085227
type: string
8518185228
type: object
8518285229
TimeRestrictions:
85183-
description: Holds time zone information and a list of time restrictions for a routing rule.
85230+
description: Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field.
8518485231
properties:
8518585232
restrictions:
8518685233
description: Defines the list of time-based restrictions.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2025-11-27T14:11:49.966Z"
1+
"2026-05-15T14:39:18.459Z"

cassettes/v2/On-Call_446749911/Set-On-Call-team-routing-rules-returns-OK-response_1745526811/recording.har

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

features/v2/on-call.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Feature: On-Call
401401
And there is a valid "schedule" in the system
402402
And there is a valid "escalation_policy" in the system
403403
And request contains "team_id" parameter from "dd_team.data.id"
404-
And body with value {"data": {"attributes": {"rules": [{"actions": [{"channel": "channel", "type": "send_slack_message", "workspace": "workspace"}], "query": "tags.service:test", "time_restriction": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "monday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}, {"end_day": "tuesday", "end_time": "17:00:00", "start_day": "tuesday", "start_time": "09:00:00"}]}}, {"policy_id": "{{ escalation_policy.data.id }}", "query": "", "urgency": "low"}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}}
404+
And body with value {"data": {"attributes": {"rules": [{"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low"}], "query": "tags.service:time_restrictions", "time_restriction": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "monday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}, {"end_day": "tuesday", "end_time": "17:00:00", "start_day": "tuesday", "start_time": "09:00:00"}]}}, {"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low", "ack_timeout_minutes": 30, "support_hours": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "wednesday", "end_time": "17:00:00", "start_day": "wednesday", "start_time": "09:00:00"}, {"end_day": "thursday", "end_time": "17:00:00", "start_day": "thursday", "start_time": "09:00:00"}]}}], "query": "tags.service:support_hours_and_acknowledgment_timeout"}, {"policy_id": "{{ escalation_policy.data.id }}", "query": "tags.service:legacy_policy_definition", "urgency": "low"}, {"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low"}], "query": ""}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}}
405405
And request contains "include" parameter with value "rules"
406406
When the request is sent
407407
Then the response status is 200 OK

services/on_call/src/v2/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ export { RolesType } from "./models/RolesType";
129129
export { RoutingRule } from "./models/RoutingRule";
130130
export { RoutingRuleAction } from "./models/RoutingRuleAction";
131131
export { RoutingRuleAttributes } from "./models/RoutingRuleAttributes";
132+
export { RoutingRuleEscalationPolicyAction } from "./models/RoutingRuleEscalationPolicyAction";
133+
export { RoutingRuleEscalationPolicyActionSupportHours } from "./models/RoutingRuleEscalationPolicyActionSupportHours";
134+
export { RoutingRuleEscalationPolicyActionType } from "./models/RoutingRuleEscalationPolicyActionType";
132135
export { RoutingRuleRelationships } from "./models/RoutingRuleRelationships";
133136
export { RoutingRuleRelationshipsPolicy } from "./models/RoutingRuleRelationshipsPolicy";
134137
export { RoutingRuleRelationshipsPolicyData } from "./models/RoutingRuleRelationshipsPolicyData";

services/on_call/src/v2/models/RoutingRuleAction.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { UnparsedObject } from "@datadog/datadog-api-client";
22

3+
import { RoutingRuleEscalationPolicyAction } from "./RoutingRuleEscalationPolicyAction";
34
import { SendSlackMessageAction } from "./SendSlackMessageAction";
45
import { SendTeamsMessageAction } from "./SendTeamsMessageAction";
56
import { TriggerWorkflowAutomationAction } from "./TriggerWorkflowAutomationAction";
@@ -11,4 +12,5 @@ export type RoutingRuleAction =
1112
| SendSlackMessageAction
1213
| SendTeamsMessageAction
1314
| TriggerWorkflowAutomationAction
15+
| RoutingRuleEscalationPolicyAction
1416
| UnparsedObject;

services/on_call/src/v2/models/RoutingRuleAttributes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class RoutingRuleAttributes {
1717
*/
1818
"query"?: string;
1919
/**
20-
* Holds time zone information and a list of time restrictions for a routing rule.
20+
* Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field.
2121
*/
2222
"timeRestriction"?: TimeRestrictions;
2323
/**
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { RoutingRuleEscalationPolicyActionSupportHours } from "./RoutingRuleEscalationPolicyActionSupportHours";
4+
import { RoutingRuleEscalationPolicyActionType } from "./RoutingRuleEscalationPolicyActionType";
5+
import { Urgency } from "./Urgency";
6+
7+
/**
8+
* Triggers an escalation policy.
9+
*/
10+
export class RoutingRuleEscalationPolicyAction {
11+
/**
12+
* The number of minutes before an acknowledged page is re-triggered.
13+
*/
14+
"ackTimeoutMinutes"?: number;
15+
/**
16+
* The ID of the escalation policy to route to.
17+
*/
18+
"policyId": string;
19+
/**
20+
* Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule.
21+
*/
22+
"supportHours"?: RoutingRuleEscalationPolicyActionSupportHours;
23+
/**
24+
* Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule.
25+
*/
26+
"type": RoutingRuleEscalationPolicyActionType;
27+
/**
28+
* Specifies the level of urgency for a routing rule (low, high, or dynamic).
29+
*/
30+
"urgency"?: Urgency;
31+
/**
32+
* A container for additional, undeclared properties.
33+
* This is a holder for any undeclared properties as specified with
34+
* the 'additionalProperties' keyword in the OAS document.
35+
*/
36+
"additionalProperties"?: { [key: string]: any };
37+
/**
38+
* @ignore
39+
*/
40+
"_unparsed"?: boolean;
41+
42+
/**
43+
* @ignore
44+
*/
45+
static readonly attributeTypeMap: AttributeTypeMap = {
46+
ackTimeoutMinutes: {
47+
baseName: "ack_timeout_minutes",
48+
type: "number",
49+
format: "int64",
50+
},
51+
policyId: {
52+
baseName: "policy_id",
53+
type: "string",
54+
required: true,
55+
},
56+
supportHours: {
57+
baseName: "support_hours",
58+
type: "RoutingRuleEscalationPolicyActionSupportHours",
59+
},
60+
type: {
61+
baseName: "type",
62+
type: "RoutingRuleEscalationPolicyActionType",
63+
required: true,
64+
},
65+
urgency: {
66+
baseName: "urgency",
67+
type: "Urgency",
68+
},
69+
additionalProperties: {
70+
baseName: "additionalProperties",
71+
type: "{ [key: string]: any; }",
72+
},
73+
};
74+
75+
/**
76+
* @ignore
77+
*/
78+
static getAttributeTypeMap(): AttributeTypeMap {
79+
return RoutingRuleEscalationPolicyAction.attributeTypeMap;
80+
}
81+
82+
public constructor() {}
83+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { TimeRestriction } from "./TimeRestriction";
4+
5+
/**
6+
* Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule.
7+
*/
8+
export class RoutingRuleEscalationPolicyActionSupportHours {
9+
/**
10+
* The list of support hours time windows.
11+
*/
12+
"restrictions"?: Array<TimeRestriction>;
13+
/**
14+
* The time zone in which the support hours are expressed.
15+
*/
16+
"timeZone": string;
17+
/**
18+
* A container for additional, undeclared properties.
19+
* This is a holder for any undeclared properties as specified with
20+
* the 'additionalProperties' keyword in the OAS document.
21+
*/
22+
"additionalProperties"?: { [key: string]: any };
23+
/**
24+
* @ignore
25+
*/
26+
"_unparsed"?: boolean;
27+
28+
/**
29+
* @ignore
30+
*/
31+
static readonly attributeTypeMap: AttributeTypeMap = {
32+
restrictions: {
33+
baseName: "restrictions",
34+
type: "Array<TimeRestriction>",
35+
},
36+
timeZone: {
37+
baseName: "time_zone",
38+
type: "string",
39+
required: true,
40+
},
41+
additionalProperties: {
42+
baseName: "additionalProperties",
43+
type: "{ [key: string]: any; }",
44+
},
45+
};
46+
47+
/**
48+
* @ignore
49+
*/
50+
static getAttributeTypeMap(): AttributeTypeMap {
51+
return RoutingRuleEscalationPolicyActionSupportHours.attributeTypeMap;
52+
}
53+
54+
public constructor() {}
55+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { UnparsedObject } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule.
5+
*/
6+
export type RoutingRuleEscalationPolicyActionType =
7+
| typeof ESCALATION_POLICY
8+
| UnparsedObject;
9+
export const ESCALATION_POLICY = "escalation_policy";

0 commit comments

Comments
 (0)