diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ac098a3c305d..27ad049e17c7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -65461,6 +65461,7 @@ components: - $ref: "#/components/schemas/SendSlackMessageAction" - $ref: "#/components/schemas/SendTeamsMessageAction" - $ref: "#/components/schemas/TriggerWorkflowAutomationAction" + - $ref: "#/components/schemas/RoutingRuleEscalationPolicyAction" RoutingRuleAttributes: description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency. properties: @@ -65478,6 +65479,52 @@ components: urgency: $ref: "#/components/schemas/Urgency" type: object + RoutingRuleEscalationPolicyAction: + description: "Triggers an escalation policy." + properties: + ack_timeout_minutes: + description: "The number of minutes before an acknowledged page is re-triggered." + example: 30 + format: int64 + type: integer + policy_id: + description: "The ID of the escalation policy to route to." + example: "00000000-0000-0000-0000-000000000000" + type: string + support_hours: + $ref: "#/components/schemas/RoutingRuleEscalationPolicyActionSupportHours" + type: + $ref: "#/components/schemas/RoutingRuleEscalationPolicyActionType" + urgency: + $ref: "#/components/schemas/Urgency" + required: + - type + - policy_id + type: object + RoutingRuleEscalationPolicyActionSupportHours: + 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." + properties: + restrictions: + description: "The list of support hours time windows." + items: + $ref: "#/components/schemas/TimeRestriction" + type: array + time_zone: + description: "The time zone in which the support hours are expressed." + example: "" + type: string + required: + - time_zone + type: object + RoutingRuleEscalationPolicyActionType: + default: escalation_policy + 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." + enum: + - escalation_policy + example: escalation_policy + type: string + x-enum-varnames: + - ESCALATION_POLICY RoutingRuleRelationships: description: Specifies relationships for a routing rule, linking to associated policy resources. properties: @@ -85180,7 +85227,7 @@ components: type: string type: object TimeRestrictions: - description: Holds time zone information and a list of time restrictions for a routing rule. + 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. properties: restrictions: description: Defines the list of time-based restrictions. diff --git a/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.frozen b/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.frozen index 7a29240030ea..9eedde19e4d1 100644 --- a/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.frozen +++ b/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.frozen @@ -1 +1 @@ -2025-11-27T14:11:49.966Z \ No newline at end of file +2026-05-15T14:39:18.459Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.yml b/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.yml index 1b0da60b4aae..10a368beb074 100644 --- a/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.yml +++ b/cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709@datadoghq.com","title":"user + string: '{"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958@datadoghq.com","title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443","attributes":{"name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1764252709@datadoghq.com","created_at":"2025-11-27T14:11:50.355271+00:00","modified_at":"2025-11-27T14:11:50.355271+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1764252709@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ad92f892fdf302962d879c0d02664d8e?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"af4cfd73-8162-49c3-899a-101d0617d500","attributes":{"uuid":"af4cfd73-8162-49c3-899a-101d0617d500","name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1778855958@datadoghq.com","created_at":"2026-05-15T14:39:20.154059+00:00","modified_at":"2026-05-15T14:39:20.154059+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1778855958@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c530c1e2f9d5cddf9d34bed00a5e760b?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,11 +25,11 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"handle":"test-handle-a7692378c203a880","name":"test-name-a7692378c203a880"},"type":"team"}}' + string: '{"data":{"attributes":{"handle":"test-handle-fc62c73422bed141","name":"test-name-fc62c73422bed141"},"type":"team"}}' headers: Accept: - application/json @@ -40,19 +40,19 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team","attributes":{"avatar":null,"banner":14,"created_at":"2025-11-27T14:11:50.842947+00:00","description":null,"handle":"test-handle-a7692378c203a880","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:50.842947+00:00","name":"test-name-a7692378c203a880","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8/permission-settings"}}}}}' + string: '{"data":{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2026-05-15T14:39:20.573129+00:00","description":null,"handle":"test-handle-fc62c73422bed141","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-05-15T14:39:20.573129+00:00","name":"test-name-fc62c73422bed141","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/5f48616e-52b1-4126-a255-0bd9f4820dc1/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/5f48616e-52b1-4126-a255-0bd9f4820dc1/permission-settings"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:49.966Z","end_date":"2025-12-07T14:11:49.966Z","interval":{"days":1},"members":[{"user":{"id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:49.966Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + string: '{"data":{"attributes":{"layers":[{"effective_date":"2026-05-05T14:39:18.459Z","end_date":"2026-05-25T14:39:18.459Z","interval":{"days":1},"members":[{"user":{"id":"af4cfd73-8162-49c3-899a-101d0617d500"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2026-05-10T14:39:18.459Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: Accept: - application/json @@ -63,18 +63,18 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"0eecb6fe-83c6-48c9-9e0e-82379498f733","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"6417bbaa-a75e-474d-a45a-9af8e1a3907a","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"d2139431-973b-42cc-a932-941aeff81783","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"},{"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules"},{"id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}},"type":"policies"}}' + string: '{"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"},{"id":"6417bbaa-a75e-474d-a45a-9af8e1a3907a","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"6417bbaa-a75e-474d-a45a-9af8e1a3907a","type":"schedules"},{"id":"af4cfd73-8162-49c3-899a-101d0617d500","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"}]}},"type":"policies"}}' headers: Accept: - application/json @@ -85,65 +85,65 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"533f661e-6a1f-4327-8d3f-035add94cff8","type":"steps"},{"id":"b8948730-6aec-4a51-8662-cce4026b94dc","type":"steps"}]},"teams":{"data":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}}}}' + string: '{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","resolve_page_on_policy_end":true,"retries":2,"tags":[]},"relationships":{"steps":{"data":[{"id":"cd41c9ed-3d97-469c-aa8a-9a36c0f45a82","type":"steps"},{"id":"102b0afe-da23-48ca-be15-699891fcbff7","type":"steps"}]},"teams":{"data":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"rules":[{"actions":[{"channel":"channel","type":"send_slack_message","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"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"}],"time_zone":"Europe/Paris"}},{"policy_id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","query":"","urgency":"low"}]},"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules"}}' + string: '{"data":{"attributes":{"rules":[{"actions":[{"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"escalation_policy","urgency":"low"}],"query":"tags.service:time_restrictions","time_restriction":{"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"}],"time_zone":"Europe/Paris"}},{"actions":[{"ack_timeout_minutes":30,"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","support_hours":{"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"}],"time_zone":"Europe/Paris"},"type":"escalation_policy","urgency":"low"}],"query":"tags.service:support_hours_and_acknowledgment_timeout"},{"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","query":"tags.service:legacy_policy_definition","urgency":"low"},{"actions":[{"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"escalation_policy","urgency":"low"}],"query":""}]},"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules"}}' headers: Accept: - application/json Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/teams/ba4fe917-0da4-4b40-96da-f9d7306d97d8/routing-rules?include=rules + uri: https://api.datadoghq.com/api/v2/on-call/teams/5f48616e-52b1-4126-a255-0bd9f4820dc1/routing-rules?include=rules response: body: encoding: UTF-8 - string: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-0","type":"team_routing_rules"},{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-1","type":"team_routing_rules"}]}}},"included":[{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-0","type":"team_routing_rules","attributes":{"actions":[{"type":"send_slack_message","channel":"channel","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"monday","end_time":"17:00:00","end_day":"monday"},{"start_time":"09:00:00","start_day":"tuesday","end_time":"17:00:00","end_day":"tuesday"}]}},"relationships":{"policy":{"data":null}}},{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-1","type":"team_routing_rules","attributes":{"actions":[],"query":"","urgency":"low"},"relationships":{"policy":{"data":{"id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","type":"policies"}}}}]}' + string: '{"data":{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"d4a7d064-0b02-4510-9412-24c95fdbef89","type":"team_routing_rules"},{"id":"a1a5fdd6-dd2b-4571-a86c-909a89a21490","type":"team_routing_rules"},{"id":"fdbe9494-e88c-4927-bb7e-407c0df33258","type":"team_routing_rules"},{"id":"8e059ecb-b492-4db6-accd-6eb69b4099b1","type":"team_routing_rules"}]}}},"included":[{"id":"d4a7d064-0b02-4510-9412-24c95fdbef89","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","urgency":"low"}],"query":"tags.service:time_restrictions","time_restriction":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"monday","end_time":"17:00:00","end_day":"monday"},{"start_time":"09:00:00","start_day":"tuesday","end_time":"17:00:00","end_day":"tuesday"}]},"urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}},{"id":"a1a5fdd6-dd2b-4571-a86c-909a89a21490","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","support_hours":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"wednesday","end_time":"17:00:00","end_day":"wednesday"},{"start_time":"09:00:00","start_day":"thursday","end_time":"17:00:00","end_day":"thursday"}]},"ack_timeout_minutes":30,"urgency":"low"}],"query":"tags.service:support_hours_and_acknowledgment_timeout","urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}},{"id":"fdbe9494-e88c-4927-bb7e-407c0df33258","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","urgency":"low"}],"query":"tags.service:legacy_policy_definition","urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}},{"id":"8e059ecb-b492-4db6-accd-6eb69b4099b1","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","urgency":"low"}],"query":"","urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}}]}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"rules":[]},"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules"}}' + string: '{"data":{"attributes":{"rules":[]},"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules"}}' headers: Accept: - application/json Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/teams/ba4fe917-0da4-4b40-96da-f9d7306d97d8/routing-rules + uri: https://api.datadoghq.com/api/v2/on-call/teams/5f48616e-52b1-4126-a255-0bd9f4820dc1/routing-rules response: body: encoding: UTF-8 - string: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' + string: '{"data":{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/66f0e922-2834-4d68-aa0b-98cc81fc2a9d + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/3321cfa1-8420-4655-ac38-f51ea522834e response: body: encoding: UTF-8 @@ -152,14 +152,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/1f9b0595-17a3-4d95-9b2e-edcea3b6e737 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/6417bbaa-a75e-474d-a45a-9af8e1a3907a response: body: encoding: UTF-8 @@ -168,14 +168,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8 + uri: https://api.datadoghq.com/api/v2/team/5f48616e-52b1-4126-a255-0bd9f4820dc1 response: body: encoding: UTF-8 @@ -184,14 +184,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 27 Nov 2025 14:11:49 GMT +- recorded_at: Fri, 15 May 2026 14:39:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/0473ca92-cb9b-11f0-85f9-9a82ffe01443 + uri: https://api.datadoghq.com/api/v2/users/af4cfd73-8162-49c3-899a-101d0617d500 response: body: encoding: UTF-8 diff --git a/examples/v2/on-call/SetOnCallTeamRoutingRules.rb b/examples/v2/on-call/SetOnCallTeamRoutingRules.rb index f293be78238d..cbad2925d04b 100644 --- a/examples/v2/on-call/SetOnCallTeamRoutingRules.rb +++ b/examples/v2/on-call/SetOnCallTeamRoutingRules.rb @@ -15,13 +15,13 @@ rules: [ DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({ actions: [ - DatadogAPIClient::V2::SendSlackMessageAction.new({ - channel: "channel", - type: DatadogAPIClient::V2::SendSlackMessageActionType::SEND_SLACK_MESSAGE, - workspace: "workspace", + DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({ + type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY, + policy_id: ESCALATION_POLICY_DATA_ID, + urgency: DatadogAPIClient::V2::Urgency::LOW, }), ], - query: "tags.service:test", + query: "tags.service:time_restrictions", time_restriction: DatadogAPIClient::V2::TimeRestrictions.new({ time_zone: "Europe/Paris", restrictions: [ @@ -40,11 +40,49 @@ ], }), }), + DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({ + actions: [ + DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({ + type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY, + policy_id: ESCALATION_POLICY_DATA_ID, + urgency: DatadogAPIClient::V2::Urgency::LOW, + ack_timeout_minutes: 30, + support_hours: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionSupportHours.new({ + time_zone: "Europe/Paris", + restrictions: [ + DatadogAPIClient::V2::TimeRestriction.new({ + end_day: DatadogAPIClient::V2::Weekday::WEDNESDAY, + end_time: "17:00:00", + start_day: DatadogAPIClient::V2::Weekday::WEDNESDAY, + start_time: "09:00:00", + }), + DatadogAPIClient::V2::TimeRestriction.new({ + end_day: DatadogAPIClient::V2::Weekday::THURSDAY, + end_time: "17:00:00", + start_day: DatadogAPIClient::V2::Weekday::THURSDAY, + start_time: "09:00:00", + }), + ], + }), + }), + ], + query: "tags.service:support_hours_and_acknowledgment_timeout", + }), DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({ policy_id: ESCALATION_POLICY_DATA_ID, - query: "", + query: "tags.service:legacy_policy_definition", urgency: DatadogAPIClient::V2::Urgency::LOW, }), + DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({ + actions: [ + DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({ + type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY, + policy_id: ESCALATION_POLICY_DATA_ID, + urgency: DatadogAPIClient::V2::Urgency::LOW, + }), + ], + query: "", + }), ], }), id: DD_TEAM_DATA_ID, diff --git a/features/v2/on-call.feature b/features/v2/on-call.feature index 0f4b2a0e3402..a4ea9a7c4f08 100644 --- a/features/v2/on-call.feature +++ b/features/v2/on-call.feature @@ -401,7 +401,7 @@ Feature: On-Call And there is a valid "schedule" in the system And there is a valid "escalation_policy" in the system And request contains "team_id" parameter from "dd_team.data.id" - 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"}} + 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"}} And request contains "include" parameter with value "rules" When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a9b20652de22..9e8451285fa8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5157,6 +5157,9 @@ def overrides "v2.routing_rule" => "RoutingRule", "v2.routing_rule_action" => "RoutingRuleAction", "v2.routing_rule_attributes" => "RoutingRuleAttributes", + "v2.routing_rule_escalation_policy_action" => "RoutingRuleEscalationPolicyAction", + "v2.routing_rule_escalation_policy_action_support_hours" => "RoutingRuleEscalationPolicyActionSupportHours", + "v2.routing_rule_escalation_policy_action_type" => "RoutingRuleEscalationPolicyActionType", "v2.routing_rule_relationships" => "RoutingRuleRelationships", "v2.routing_rule_relationships_policy" => "RoutingRuleRelationshipsPolicy", "v2.routing_rule_relationships_policy_data" => "RoutingRuleRelationshipsPolicyData", diff --git a/lib/datadog_api_client/v2/models/routing_rule_action.rb b/lib/datadog_api_client/v2/models/routing_rule_action.rb index cd4d3b04d05d..3ae2b1f7a81f 100644 --- a/lib/datadog_api_client/v2/models/routing_rule_action.rb +++ b/lib/datadog_api_client/v2/models/routing_rule_action.rb @@ -28,7 +28,8 @@ def openapi_one_of [ :'SendSlackMessageAction', :'SendTeamsMessageAction', - :'TriggerWorkflowAutomationAction' + :'TriggerWorkflowAutomationAction', + :'RoutingRuleEscalationPolicyAction' ] end # Builds the object diff --git a/lib/datadog_api_client/v2/models/routing_rule_attributes.rb b/lib/datadog_api_client/v2/models/routing_rule_attributes.rb index b5f95d50bd6f..fa8694906ba9 100644 --- a/lib/datadog_api_client/v2/models/routing_rule_attributes.rb +++ b/lib/datadog_api_client/v2/models/routing_rule_attributes.rb @@ -27,7 +27,7 @@ class RoutingRuleAttributes # Defines the query or condition that triggers this routing rule. attr_accessor :query - # Holds time zone information and a list of time restrictions for a routing rule. + # 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. attr_accessor :time_restriction # Specifies the level of urgency for a routing rule (low, high, or dynamic). diff --git a/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb new file mode 100644 index 000000000000..91dbf14722ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb @@ -0,0 +1,174 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Triggers an escalation policy. + class RoutingRuleEscalationPolicyAction + include BaseGenericModel + + # The number of minutes before an acknowledged page is re-triggered. + attr_accessor :ack_timeout_minutes + + # The ID of the escalation policy to route to. + attr_reader :policy_id + + # 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. + attr_accessor :support_hours + + # 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. + attr_reader :type + + # Specifies the level of urgency for a routing rule (low, high, or dynamic). + attr_accessor :urgency + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ack_timeout_minutes' => :'ack_timeout_minutes', + :'policy_id' => :'policy_id', + :'support_hours' => :'support_hours', + :'type' => :'type', + :'urgency' => :'urgency' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ack_timeout_minutes' => :'Integer', + :'policy_id' => :'String', + :'support_hours' => :'RoutingRuleEscalationPolicyActionSupportHours', + :'type' => :'RoutingRuleEscalationPolicyActionType', + :'urgency' => :'Urgency' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'ack_timeout_minutes') + self.ack_timeout_minutes = attributes[:'ack_timeout_minutes'] + end + + if attributes.key?(:'policy_id') + self.policy_id = attributes[:'policy_id'] + end + + if attributes.key?(:'support_hours') + self.support_hours = attributes[:'support_hours'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'urgency') + self.urgency = attributes[:'urgency'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @policy_id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param policy_id [Object] Object to be assigned + # @!visibility private + def policy_id=(policy_id) + if policy_id.nil? + fail ArgumentError, 'invalid value for "policy_id", policy_id cannot be nil.' + end + @policy_id = policy_id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ack_timeout_minutes == o.ack_timeout_minutes && + policy_id == o.policy_id && + support_hours == o.support_hours && + type == o.type && + urgency == o.urgency && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ack_timeout_minutes, policy_id, support_hours, type, urgency, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_support_hours.rb b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_support_hours.rb new file mode 100644 index 000000000000..04c5f8fca2ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_support_hours.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class RoutingRuleEscalationPolicyActionSupportHours + include BaseGenericModel + + # The list of support hours time windows. + attr_accessor :restrictions + + # The time zone in which the support hours are expressed. + attr_reader :time_zone + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'restrictions' => :'restrictions', + :'time_zone' => :'time_zone' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'restrictions' => :'Array', + :'time_zone' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionSupportHours` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'restrictions') + if (value = attributes[:'restrictions']).is_a?(Array) + self.restrictions = value + end + end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @time_zone.nil? + true + end + + # Custom attribute writer method with validation + # @param time_zone [Object] Object to be assigned + # @!visibility private + def time_zone=(time_zone) + if time_zone.nil? + fail ArgumentError, 'invalid value for "time_zone", time_zone cannot be nil.' + end + @time_zone = time_zone + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + restrictions == o.restrictions && + time_zone == o.time_zone && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [restrictions, time_zone, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_type.rb b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_type.rb new file mode 100644 index 000000000000..da60c3b47d0f --- /dev/null +++ b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class RoutingRuleEscalationPolicyActionType + include BaseEnumModel + + ESCALATION_POLICY = "escalation_policy".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/team_routing_rules_request_rule.rb b/lib/datadog_api_client/v2/models/team_routing_rules_request_rule.rb index 94f570034186..96634dd2f255 100644 --- a/lib/datadog_api_client/v2/models/team_routing_rules_request_rule.rb +++ b/lib/datadog_api_client/v2/models/team_routing_rules_request_rule.rb @@ -30,7 +30,7 @@ class TeamRoutingRulesRequestRule # Defines the query or condition that triggers this routing rule. attr_accessor :query - # Holds time zone information and a list of time restrictions for a routing rule. + # 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. attr_accessor :time_restriction # Specifies the level of urgency for a routing rule (low, high, or dynamic). diff --git a/lib/datadog_api_client/v2/models/time_restrictions.rb b/lib/datadog_api_client/v2/models/time_restrictions.rb index 6c4e7de5ddc1..6ed174eabb6f 100644 --- a/lib/datadog_api_client/v2/models/time_restrictions.rb +++ b/lib/datadog_api_client/v2/models/time_restrictions.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # Holds time zone information and a list of time restrictions for a routing rule. + # 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. class TimeRestrictions include BaseGenericModel