diff --git a/.apigentools-info b/.apigentools-info index 672a18cf18..626a334d2c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-23 16:55:09.290879", - "spec_repo_commit": "6a0ddfd8" + "regenerated": "2025-05-23 19:26:15.843675", + "spec_repo_commit": "471c4a2a" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-23 16:55:09.383837", - "spec_repo_commit": "6a0ddfd8" + "regenerated": "2025-05-23 19:26:15.860373", + "spec_repo_commit": "471c4a2a" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4814503b49..86cc1adcb8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9584,12 +9584,11 @@ components: description: Information about the target to notify (such as a team or user). properties: identifier: - description: A unique ID for the target (for example, team handle or user - UUID). + description: Identifier for the target (for example, team handle or user + ID). type: string type: - description: The kind of target, `team_uuid` | `team_handle` | `user_uuid`. - type: string + $ref: '#/components/schemas/OnCallPageTargetType' type: object CreatePageRequestDataType: default: pages @@ -13631,7 +13630,6 @@ components: example: data: attributes: - description: Escalation Policy 1 description name: Escalation Policy 1 resolve_page_on_policy_end: true retries: 2 @@ -13690,7 +13688,6 @@ components: example: data: attributes: - description: Escalation Policy 1 description name: Escalation Policy 1 resolve_page_on_policy_end: true retries: 2 @@ -13741,13 +13738,9 @@ components: description: Defines the attributes for creating an escalation policy, including its description, name, resolution behavior, retries, and steps. properties: - description: - description: Provides a detailed text description of the new escalation - policy. - type: string name: description: Specifies the name for the new escalation policy. - example: On-call Escalation Policy + example: On-Call Escalation Policy type: string resolve_page_on_policy_end: description: Indicates whether the page is automatically resolved when the @@ -13825,14 +13818,11 @@ components: type: object EscalationPolicyDataAttributes: description: Defines the main attributes of an escalation policy, such as its - description, name, and behavior on policy end. + name and behavior on policy end. properties: - description: - description: Provides a detailed text description of the escalation policy. - type: string name: description: Specifies the name of the escalation policy. - example: On-call Escalation Policy + example: On-Call Escalation Policy type: string resolve_page_on_policy_end: description: Indicates whether the page is automatically resolved when the @@ -13951,7 +13941,7 @@ components: targets. properties: targets: - $ref: '#/components/schemas/EscalationTarget' + $ref: '#/components/schemas/EscalationTargets' type: object EscalationPolicyStepTarget: description: Defines a single escalation target within a step for an escalation @@ -13992,7 +13982,6 @@ components: example: data: attributes: - description: Escalation Policy 1 description name: Escalation Policy 1 resolve_page_on_policy_end: false retries: 2 @@ -14042,12 +14031,9 @@ components: description: Defines the attributes that can be updated for an escalation policy, such as description, name, resolution behavior, retries, and steps. properties: - description: - description: Provides a detailed text description of the escalation policy. - type: string name: description: Specifies the name of the escalation policy. - example: On-call Escalation Policy + example: On-Call Escalation Policy type: string resolve_page_on_policy_end: description: Indicates whether the page is automatically resolved when the @@ -14154,6 +14140,15 @@ components: - $ref: '#/components/schemas/TeamTarget' - $ref: '#/components/schemas/UserTarget' - $ref: '#/components/schemas/ScheduleTarget' + EscalationTargets: + description: A list of escalation targets for a step + properties: + data: + description: The `EscalationTargets` `data`. + items: + $ref: '#/components/schemas/EscalationTarget' + type: array + type: object Event: description: The metadata associated with a request. properties: @@ -26578,6 +26573,18 @@ components: $ref: '#/components/schemas/OktaAccountResponseData' type: array type: object + OnCallPageTargetType: + description: The kind of target, `team_id` | `team_handle` | `user_id`. + enum: + - team_id + - team_handle + - user_id + example: team_id + type: string + x-enum-varnames: + - TEAM_ID + - TEAM_HANDLE + - USER_ID OnDemandConcurrencyCap: description: On-demand concurrency cap. properties: @@ -31424,9 +31431,6 @@ components: data: attributes: name: On-Call Schedule - tags: - - tag1 - - tag2 time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d relationships: @@ -31510,9 +31514,6 @@ components: start_time: 09:00:00 rotation_start: '2025-02-01T00:00:00Z' name: On-Call Schedule - tags: - - tag1 - - tag2 time_zone: America/New_York relationships: teams: @@ -31542,10 +31543,10 @@ components: type: object ScheduleCreateRequestDataAttributes: description: Describes the main attributes for creating a new schedule, including - name, layers, time zone, and tags. + name, layers, and time zone. properties: layers: - description: The layers of on-call coverage that define rotation intervals + description: The layers of On-Call coverage that define rotation intervals and restrictions. items: $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItems' @@ -31554,11 +31555,6 @@ components: description: A human-readable name for the new schedule. example: Team A On-Call type: string - tags: - description: A list of tags for categorizing or filtering the schedule. - items: - type: string - type: array time_zone: description: The time zone in which the schedule is defined. example: America/New_York @@ -31646,18 +31642,13 @@ components: - type type: object ScheduleDataAttributes: - description: Provides core properties of a schedule object, such as its name, - time zone, and tags. + description: Provides core properties of a schedule object such as its name + and time zone. properties: name: description: A short name for the schedule. example: Primary On-Call type: string - tags: - description: A list of tags associated with this schedule. - items: - type: string - type: array time_zone: description: The time zone in which this schedule operates. example: America/New_York @@ -31863,10 +31854,6 @@ components: start_time: 09:00:00 rotation_start: '2025-02-01T00:00:00Z' name: On-Call Schedule Updated - tags: - - tag1 - - tag2 - - tag3 time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d relationships: @@ -31883,7 +31870,7 @@ components: type: object ScheduleUpdateRequestData: description: Contains all data needed to update an existing schedule, including - its attributes (such as name, layers, or tags) and any relationships to teams. + its attributes (such as name and time zone) and any relationships to teams. properties: attributes: $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributes' @@ -31902,7 +31889,7 @@ components: type: object ScheduleUpdateRequestDataAttributes: description: Defines the updatable attributes for a schedule, such as name, - time zone, tags, and layers. + time zone, and layers. properties: layers: description: The updated list of layers (rotations) for this schedule. @@ -31913,14 +31900,6 @@ components: description: A short name for the schedule. example: Primary On-Call type: string - tags: - description: A list of tags that you can associate with this schedule. - example: - - front-end - - team-a - items: - type: string - type: array time_zone: description: The time zone used when interpreting rotation times. example: America/New_York @@ -37861,8 +37840,6 @@ components: id: description: The team's unique identifier. type: string - relationships: - $ref: '#/components/schemas/TeamReferenceRelationships' type: $ref: '#/components/schemas/TeamReferenceType' required: @@ -37885,46 +37862,6 @@ components: description: The full, human-readable name of the team. type: string type: object - TeamReferenceRelationships: - description: Collects the key relationship fields for a team reference, specifically - on-call users. - properties: - oncall_users: - $ref: '#/components/schemas/TeamReferenceRelationshipsOncallUsers' - type: object - TeamReferenceRelationshipsOncallUsers: - description: Defines which users are on-call within a team, stored as an array - of references. - properties: - data: - description: The list of user references who are on-call for this team. - items: - $ref: '#/components/schemas/TeamReferenceRelationshipsOncallUsersDataItems' - type: array - type: object - TeamReferenceRelationshipsOncallUsersDataItems: - description: References a user who is on-call within this team, identified by - `id` and `type`. - properties: - id: - description: The unique identifier of the user. - example: 00000000-aba1-0000-0000-000000000000 - type: string - type: - $ref: '#/components/schemas/TeamReferenceRelationshipsOncallUsersDataItemsType' - required: - - type - - id - type: object - TeamReferenceRelationshipsOncallUsersDataItemsType: - default: users - description: Users resource type. - enum: - - users - example: users - type: string - x-enum-varnames: - - USERS TeamReferenceType: default: teams description: Teams resource type. @@ -51623,7 +51560,7 @@ paths: contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/on-call/escalation-policies: post: - description: Create a new on-call escalation policy + description: Create a new On-Call escalation policy operationId: CreateOnCallEscalationPolicy parameters: - description: 'Comma-separated list of included relationships to be returned. @@ -51657,7 +51594,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Create on-call escalation policy + summary: Create On-Call escalation policy tags: - On-Call x-permission: @@ -51666,7 +51603,7 @@ paths: - on_call_write /api/v2/on-call/escalation-policies/{policy_id}: delete: - description: Delete an on-call escalation policy + description: Delete an On-Call escalation policy operationId: DeleteOnCallEscalationPolicy parameters: - description: The ID of the escalation policy @@ -51691,7 +51628,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Delete on-call escalation policy + summary: Delete On-Call escalation policy tags: - On-Call x-permission: @@ -51699,7 +51636,7 @@ paths: permissions: - on_call_write get: - description: Get an on-call escalation policy + description: Get an On-Call escalation policy operationId: GetOnCallEscalationPolicy parameters: - description: The ID of the escalation policy @@ -51736,7 +51673,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Get on-call escalation policy + summary: Get On-Call escalation policy tags: - On-Call x-permission: @@ -51744,7 +51681,7 @@ paths: permissions: - on_call_read put: - description: Update an on-call escalation policy + description: Update an On-Call escalation policy operationId: UpdateOnCallEscalationPolicy parameters: - description: The ID of the escalation policy @@ -51787,7 +51724,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Update on-call escalation policy + summary: Update On-Call escalation policy tags: - On-Call x-permission: @@ -52017,7 +51954,7 @@ paths: - On-Call Paging /api/v2/on-call/schedules: post: - description: Create a new on-call schedule + description: Create a new On-Call schedule operationId: CreateOnCallSchedule parameters: - description: 'Comma-separated list of included relationships to be returned. @@ -52051,7 +51988,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Create on-call schedule + summary: Create On-Call schedule tags: - On-Call x-permission: @@ -52060,7 +51997,7 @@ paths: - on_call_write /api/v2/on-call/schedules/{schedule_id}: delete: - description: Delete an on-call schedule + description: Delete an On-Call schedule operationId: DeleteOnCallSchedule parameters: - description: The ID of the schedule @@ -52085,7 +52022,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Delete on-call schedule + summary: Delete On-Call schedule tags: - On-Call x-permission: @@ -52093,7 +52030,7 @@ paths: permissions: - on_call_write get: - description: Get an on-call schedule + description: Get an On-Call schedule operationId: GetOnCallSchedule parameters: - description: 'Comma-separated list of included relationships to be returned. @@ -52128,7 +52065,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Get on-call schedule + summary: Get On-Call schedule tags: - On-Call x-permission: @@ -52136,7 +52073,7 @@ paths: permissions: - on_call_read put: - description: Update a new on-call schedule + description: Update a new On-Call schedule operationId: UpdateOnCallSchedule parameters: - description: 'Comma-separated list of included relationships to be returned. @@ -52179,7 +52116,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Update on-call schedule + summary: Update On-Call schedule tags: - On-Call x-permission: @@ -52238,7 +52175,7 @@ paths: - On-Call /api/v2/on-call/teams/{team_id}/routing-rules: get: - description: Get a team's on-call routing rules + description: Get a team's On-Call routing rules operationId: GetOnCallTeamRoutingRules parameters: - description: The team ID @@ -52267,7 +52204,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Get on-call team routing rules + summary: Get On-Call team routing rules tags: - On-Call x-permission: @@ -52275,7 +52212,7 @@ paths: permissions: - on_call_read put: - description: Set a team's on-call routing rules + description: Set a team's On-Call routing rules operationId: SetOnCallTeamRoutingRules parameters: - description: The team ID @@ -52310,7 +52247,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Set on-call team routing rules + summary: Set On-Call team routing rules tags: - On-Call x-permission: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 4d4bb76799..62c83b2c24 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -5744,6 +5744,13 @@ datadog\_api\_client.v2.model.escalation\_target module :members: :show-inheritance: +datadog\_api\_client.v2.model.escalation\_targets module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.escalation_targets + :members: + :show-inheritance: + datadog\_api\_client.v2.model.event module ------------------------------------------ @@ -11337,6 +11344,13 @@ datadog\_api\_client.v2.model.okta\_accounts\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.on\_call\_page\_target\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.on_call_page_target_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.on\_demand\_concurrency\_cap module ----------------------------------------------------------------- @@ -16440,34 +16454,6 @@ datadog\_api\_client.v2.model.team\_reference\_attributes module :members: :show-inheritance: -datadog\_api\_client.v2.model.team\_reference\_relationships module -------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_reference_relationships - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_reference\_relationships\_oncall\_users module ----------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_reference_relationships_oncall_users - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_reference\_relationships\_oncall\_users\_data\_items module ------------------------------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_reference\_relationships\_oncall\_users\_data\_items\_type module ------------------------------------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items_type - :members: - :show-inheritance: - datadog\_api\_client.v2.model.team\_reference\_type module ---------------------------------------------------------- diff --git a/examples/v2/on-call-paging/CreateOnCallPage.py b/examples/v2/on-call-paging/CreateOnCallPage.py index 441d565341..07bd9ee800 100644 --- a/examples/v2/on-call-paging/CreateOnCallPage.py +++ b/examples/v2/on-call-paging/CreateOnCallPage.py @@ -9,6 +9,7 @@ from datadog_api_client.v2.model.create_page_request_data_attributes import CreatePageRequestDataAttributes from datadog_api_client.v2.model.create_page_request_data_attributes_target import CreatePageRequestDataAttributesTarget from datadog_api_client.v2.model.create_page_request_data_type import CreatePageRequestDataType +from datadog_api_client.v2.model.on_call_page_target_type import OnCallPageTargetType from datadog_api_client.v2.model.page_urgency import PageUrgency body = CreatePageRequest( @@ -20,7 +21,7 @@ ], target=CreatePageRequestDataAttributesTarget( identifier="my-team", - type="team_handle", + type=OnCallPageTargetType.TEAM_HANDLE, ), title="Page title", urgency=PageUrgency.LOW, diff --git a/examples/v2/on-call/CreateOnCallEscalationPolicy.py b/examples/v2/on-call/CreateOnCallEscalationPolicy.py index 593953d5c1..cc30b56f98 100644 --- a/examples/v2/on-call/CreateOnCallEscalationPolicy.py +++ b/examples/v2/on-call/CreateOnCallEscalationPolicy.py @@ -1,5 +1,5 @@ """ -Create on-call escalation policy returns "Created" response +Create On-Call escalation policy returns "Created" response """ from os import environ @@ -38,7 +38,6 @@ body = EscalationPolicyCreateRequest( data=EscalationPolicyCreateRequestData( attributes=EscalationPolicyCreateRequestDataAttributes( - description="Escalation Policy 1 description", name="Example-On-Call", resolve_page_on_policy_end=True, retries=2, @@ -90,6 +89,6 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = OnCallApi(api_client) - response = api_instance.create_on_call_escalation_policy(body=body) + response = api_instance.create_on_call_escalation_policy(include="steps.targets", body=body) print(response) diff --git a/examples/v2/on-call/CreateOnCallSchedule.py b/examples/v2/on-call/CreateOnCallSchedule.py index fb3ba1e6fb..7df3174d58 100644 --- a/examples/v2/on-call/CreateOnCallSchedule.py +++ b/examples/v2/on-call/CreateOnCallSchedule.py @@ -1,5 +1,5 @@ """ -Create on-call schedule returns "Created" response +Create On-Call schedule returns "Created" response """ from datetime import datetime @@ -66,10 +66,6 @@ ), ], name="Example-On-Call", - tags=[ - "tag1", - "tag2", - ], time_zone="America/New_York", ), relationships=ScheduleCreateRequestDataRelationships( diff --git a/examples/v2/on-call/DeleteOnCallEscalationPolicy.py b/examples/v2/on-call/DeleteOnCallEscalationPolicy.py index 80bbaa540b..f186d7b297 100644 --- a/examples/v2/on-call/DeleteOnCallEscalationPolicy.py +++ b/examples/v2/on-call/DeleteOnCallEscalationPolicy.py @@ -1,5 +1,5 @@ """ -Delete on-call escalation policy returns "No Content" response +Delete On-Call escalation policy returns "No Content" response """ from os import environ diff --git a/examples/v2/on-call/DeleteOnCallSchedule.py b/examples/v2/on-call/DeleteOnCallSchedule.py index cdb1f94f9f..99e0957600 100644 --- a/examples/v2/on-call/DeleteOnCallSchedule.py +++ b/examples/v2/on-call/DeleteOnCallSchedule.py @@ -1,5 +1,5 @@ """ -Delete on-call schedule returns "No Content" response +Delete On-Call schedule returns "No Content" response """ from os import environ diff --git a/examples/v2/on-call/GetOnCallEscalationPolicy.py b/examples/v2/on-call/GetOnCallEscalationPolicy.py index 33d2b08ace..bbfc4b9916 100644 --- a/examples/v2/on-call/GetOnCallEscalationPolicy.py +++ b/examples/v2/on-call/GetOnCallEscalationPolicy.py @@ -1,5 +1,5 @@ """ -Get on-call escalation policy returns "OK" response +Get On-Call escalation policy returns "OK" response """ from os import environ @@ -14,6 +14,7 @@ api_instance = OnCallApi(api_client) response = api_instance.get_on_call_escalation_policy( policy_id=ESCALATION_POLICY_DATA_ID, + include="steps.targets", ) print(response) diff --git a/examples/v2/on-call/GetOnCallSchedule.py b/examples/v2/on-call/GetOnCallSchedule.py index 727f8651fc..6f56b8e93c 100644 --- a/examples/v2/on-call/GetOnCallSchedule.py +++ b/examples/v2/on-call/GetOnCallSchedule.py @@ -1,5 +1,5 @@ """ -Get on-call schedule returns "OK" response +Get On-Call schedule returns "OK" response """ from os import environ diff --git a/examples/v2/on-call/GetOnCallTeamRoutingRules.py b/examples/v2/on-call/GetOnCallTeamRoutingRules.py index 700e9abf9a..c540d4c236 100644 --- a/examples/v2/on-call/GetOnCallTeamRoutingRules.py +++ b/examples/v2/on-call/GetOnCallTeamRoutingRules.py @@ -1,5 +1,5 @@ """ -Get on-call team routing rules returns "OK" response +Get On-Call team routing rules returns "OK" response """ from datadog_api_client import ApiClient, Configuration diff --git a/examples/v2/on-call/SetOnCallTeamRoutingRules.py b/examples/v2/on-call/SetOnCallTeamRoutingRules.py index 4f82dd2bef..228fd43a94 100644 --- a/examples/v2/on-call/SetOnCallTeamRoutingRules.py +++ b/examples/v2/on-call/SetOnCallTeamRoutingRules.py @@ -1,5 +1,5 @@ """ -Set on-call team routing rules returns "OK" response +Set On-Call team routing rules returns "OK" response """ from os import environ diff --git a/examples/v2/on-call/UpdateOnCallEscalationPolicy.py b/examples/v2/on-call/UpdateOnCallEscalationPolicy.py index d3ffdefa7e..71e5376cbe 100644 --- a/examples/v2/on-call/UpdateOnCallEscalationPolicy.py +++ b/examples/v2/on-call/UpdateOnCallEscalationPolicy.py @@ -1,5 +1,5 @@ """ -Update on-call escalation policy returns "OK" response +Update On-Call escalation policy returns "OK" response """ from os import environ @@ -39,7 +39,6 @@ body = EscalationPolicyUpdateRequest( data=EscalationPolicyUpdateRequestData( attributes=EscalationPolicyUpdateRequestDataAttributes( - description="Example-On-Call", name="Example-On-Call-updated", resolve_page_on_policy_end=False, retries=0, diff --git a/examples/v2/on-call/UpdateOnCallSchedule.py b/examples/v2/on-call/UpdateOnCallSchedule.py index bfb4466c81..8c3500d2ee 100644 --- a/examples/v2/on-call/UpdateOnCallSchedule.py +++ b/examples/v2/on-call/UpdateOnCallSchedule.py @@ -1,5 +1,5 @@ """ -Update on-call schedule returns "OK" response +Update On-Call schedule returns "OK" response """ from datetime import datetime @@ -72,11 +72,6 @@ ), ], name="Example-On-Call", - tags=[ - "tag1", - "tag2", - "tag3", - ], time_zone="America/New_York", ), relationships=ScheduleUpdateRequestDataRelationships( diff --git a/src/datadog_api_client/v2/api/on_call_api.py b/src/datadog_api_client/v2/api/on_call_api.py index 8c1373179b..580a21fce0 100644 --- a/src/datadog_api_client/v2/api/on_call_api.py +++ b/src/datadog_api_client/v2/api/on_call_api.py @@ -345,9 +345,9 @@ def create_on_call_escalation_policy( *, include: Union[str, UnsetType] = unset, ) -> EscalationPolicy: - """Create on-call escalation policy. + """Create On-Call escalation policy. - Create a new on-call escalation policy + Create a new On-Call escalation policy :type body: EscalationPolicyCreateRequest :param include: Comma-separated list of included relationships to be returned. Allowed values: ``teams`` , ``steps`` , ``steps.targets``. @@ -368,9 +368,9 @@ def create_on_call_schedule( *, include: Union[str, UnsetType] = unset, ) -> Schedule: - """Create on-call schedule. + """Create On-Call schedule. - Create a new on-call schedule + Create a new On-Call schedule :type body: ScheduleCreateRequest :param include: Comma-separated list of included relationships to be returned. Allowed values: ``teams`` , ``layers`` , ``layers.members`` , ``layers.members.user``. @@ -389,9 +389,9 @@ def delete_on_call_escalation_policy( self, policy_id: str, ) -> None: - """Delete on-call escalation policy. + """Delete On-Call escalation policy. - Delete an on-call escalation policy + Delete an On-Call escalation policy :param policy_id: The ID of the escalation policy :type policy_id: str @@ -406,9 +406,9 @@ def delete_on_call_schedule( self, schedule_id: str, ) -> None: - """Delete on-call schedule. + """Delete On-Call schedule. - Delete an on-call schedule + Delete an On-Call schedule :param schedule_id: The ID of the schedule :type schedule_id: str @@ -425,9 +425,9 @@ def get_on_call_escalation_policy( *, include: Union[str, UnsetType] = unset, ) -> EscalationPolicy: - """Get on-call escalation policy. + """Get On-Call escalation policy. - Get an on-call escalation policy + Get an On-Call escalation policy :param policy_id: The ID of the escalation policy :type policy_id: str @@ -449,9 +449,9 @@ def get_on_call_schedule( *, include: Union[str, UnsetType] = unset, ) -> Schedule: - """Get on-call schedule. + """Get On-Call schedule. - Get an on-call schedule + Get an On-Call schedule :param schedule_id: The ID of the schedule :type schedule_id: str @@ -473,9 +473,9 @@ def get_on_call_team_routing_rules( *, include: Union[str, UnsetType] = unset, ) -> TeamRoutingRules: - """Get on-call team routing rules. + """Get On-Call team routing rules. - Get a team's on-call routing rules + Get a team's On-Call routing rules :param team_id: The team ID :type team_id: str @@ -528,9 +528,9 @@ def set_on_call_team_routing_rules( *, include: Union[str, UnsetType] = unset, ) -> TeamRoutingRules: - """Set on-call team routing rules. + """Set On-Call team routing rules. - Set a team's on-call routing rules + Set a team's On-Call routing rules :param team_id: The team ID :type team_id: str @@ -556,9 +556,9 @@ def update_on_call_escalation_policy( *, include: Union[str, UnsetType] = unset, ) -> EscalationPolicy: - """Update on-call escalation policy. + """Update On-Call escalation policy. - Update an on-call escalation policy + Update an On-Call escalation policy :param policy_id: The ID of the escalation policy :type policy_id: str @@ -584,9 +584,9 @@ def update_on_call_schedule( *, include: Union[str, UnsetType] = unset, ) -> Schedule: - """Update on-call schedule. + """Update On-Call schedule. - Update a new on-call schedule + Update a new On-Call schedule :param schedule_id: The ID of the schedule :type schedule_id: str diff --git a/src/datadog_api_client/v2/model/create_page_request_data_attributes_target.py b/src/datadog_api_client/v2/model/create_page_request_data_attributes_target.py index dab8d6b0ad..9a9787a7f1 100644 --- a/src/datadog_api_client/v2/model/create_page_request_data_attributes_target.py +++ b/src/datadog_api_client/v2/model/create_page_request_data_attributes_target.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -13,12 +13,18 @@ ) +if TYPE_CHECKING: + from datadog_api_client.v2.model.on_call_page_target_type import OnCallPageTargetType + + class CreatePageRequestDataAttributesTarget(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.on_call_page_target_type import OnCallPageTargetType + return { "identifier": (str,), - "type": (str,), + "type": (OnCallPageTargetType,), } attribute_map = { @@ -26,15 +32,17 @@ def openapi_types(_): "type": "type", } - def __init__(self_, identifier: Union[str, UnsetType] = unset, type: Union[str, UnsetType] = unset, **kwargs): + def __init__( + self_, identifier: Union[str, UnsetType] = unset, type: Union[OnCallPageTargetType, UnsetType] = unset, **kwargs + ): """ Information about the target to notify (such as a team or user). - :param identifier: A unique ID for the target (for example, team handle or user UUID). + :param identifier: Identifier for the target (for example, team handle or user ID). :type identifier: str, optional - :param type: The kind of target, ``team_uuid`` | ``team_handle`` | ``user_uuid``. - :type type: str, optional + :param type: The kind of target, ``team_id`` | ``team_handle`` | ``user_id``. + :type type: OnCallPageTargetType, optional """ if identifier is not unset: kwargs["identifier"] = identifier diff --git a/src/datadog_api_client/v2/model/escalation_policy_create_request_data_attributes.py b/src/datadog_api_client/v2/model/escalation_policy_create_request_data_attributes.py index c222d8a9b8..2d34a37a95 100644 --- a/src/datadog_api_client/v2/model/escalation_policy_create_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/escalation_policy_create_request_data_attributes.py @@ -27,7 +27,6 @@ def openapi_types(_): ) return { - "description": (str,), "name": (str,), "resolve_page_on_policy_end": (bool,), "retries": (int,), @@ -35,7 +34,6 @@ def openapi_types(_): } attribute_map = { - "description": "description", "name": "name", "resolve_page_on_policy_end": "resolve_page_on_policy_end", "retries": "retries", @@ -46,7 +44,6 @@ def __init__( self_, name: str, steps: List[EscalationPolicyCreateRequestDataAttributesStepsItems], - description: Union[str, UnsetType] = unset, resolve_page_on_policy_end: Union[bool, UnsetType] = unset, retries: Union[int, UnsetType] = unset, **kwargs, @@ -54,9 +51,6 @@ def __init__( """ Defines the attributes for creating an escalation policy, including its description, name, resolution behavior, retries, and steps. - :param description: Provides a detailed text description of the new escalation policy. - :type description: str, optional - :param name: Specifies the name for the new escalation policy. :type name: str @@ -69,8 +63,6 @@ def __init__( :param steps: A list of escalation steps, each defining assignment, escalation timeout, and targets for the new policy. :type steps: [EscalationPolicyCreateRequestDataAttributesStepsItems] """ - if description is not unset: - kwargs["description"] = description if resolve_page_on_policy_end is not unset: kwargs["resolve_page_on_policy_end"] = resolve_page_on_policy_end if retries is not unset: diff --git a/src/datadog_api_client/v2/model/escalation_policy_data.py b/src/datadog_api_client/v2/model/escalation_policy_data.py index 6de5e22064..86059c6d5e 100644 --- a/src/datadog_api_client/v2/model/escalation_policy_data.py +++ b/src/datadog_api_client/v2/model/escalation_policy_data.py @@ -51,7 +51,7 @@ def __init__( """ Represents the data for a single escalation policy, including its attributes, ID, relationships, and resource type. - :param attributes: Defines the main attributes of an escalation policy, such as its description, name, and behavior on policy end. + :param attributes: Defines the main attributes of an escalation policy, such as its name and behavior on policy end. :type attributes: EscalationPolicyDataAttributes, optional :param id: Specifies the unique identifier of the escalation policy. diff --git a/src/datadog_api_client/v2/model/escalation_policy_data_attributes.py b/src/datadog_api_client/v2/model/escalation_policy_data_attributes.py index b34249ac64..054623b340 100644 --- a/src/datadog_api_client/v2/model/escalation_policy_data_attributes.py +++ b/src/datadog_api_client/v2/model/escalation_policy_data_attributes.py @@ -17,14 +17,12 @@ class EscalationPolicyDataAttributes(ModelNormal): @cached_property def openapi_types(_): return { - "description": (str,), "name": (str,), "resolve_page_on_policy_end": (bool,), "retries": (int,), } attribute_map = { - "description": "description", "name": "name", "resolve_page_on_policy_end": "resolve_page_on_policy_end", "retries": "retries", @@ -33,16 +31,12 @@ def openapi_types(_): def __init__( self_, name: str, - description: Union[str, UnsetType] = unset, resolve_page_on_policy_end: Union[bool, UnsetType] = unset, retries: Union[int, UnsetType] = unset, **kwargs, ): """ - Defines the main attributes of an escalation policy, such as its description, name, and behavior on policy end. - - :param description: Provides a detailed text description of the escalation policy. - :type description: str, optional + Defines the main attributes of an escalation policy, such as its name and behavior on policy end. :param name: Specifies the name of the escalation policy. :type name: str @@ -53,8 +47,6 @@ def __init__( :param retries: Specifies how many times the escalation sequence is retried if there is no response. :type retries: int, optional """ - if description is not unset: - kwargs["description"] = description if resolve_page_on_policy_end is not unset: kwargs["resolve_page_on_policy_end"] = resolve_page_on_policy_end if retries is not unset: diff --git a/src/datadog_api_client/v2/model/escalation_policy_included.py b/src/datadog_api_client/v2/model/escalation_policy_included.py index ecb5e6517a..155198a573 100644 --- a/src/datadog_api_client/v2/model/escalation_policy_included.py +++ b/src/datadog_api_client/v2/model/escalation_policy_included.py @@ -21,11 +21,11 @@ def __init__(self, **kwargs): :param id: The team's unique identifier. :type id: str, optional - :param relationships: Collects the key relationship fields for a team reference, specifically on-call users. - :type relationships: TeamReferenceRelationships, optional - :param type: Teams resource type. :type type: TeamReferenceType + + :param relationships: Represents the relationship of an escalation policy step to its targets. + :type relationships: EscalationPolicyStepRelationships, optional """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/escalation_policy_step_relationships.py b/src/datadog_api_client/v2/model/escalation_policy_step_relationships.py index 77fcaccff2..197d46d1d9 100644 --- a/src/datadog_api_client/v2/model/escalation_policy_step_relationships.py +++ b/src/datadog_api_client/v2/model/escalation_policy_step_relationships.py @@ -14,33 +14,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.escalation_target import EscalationTarget - from datadog_api_client.v2.model.team_target import TeamTarget - from datadog_api_client.v2.model.user_target import UserTarget - from datadog_api_client.v2.model.schedule_target import ScheduleTarget + from datadog_api_client.v2.model.escalation_targets import EscalationTargets class EscalationPolicyStepRelationships(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.escalation_target import EscalationTarget + from datadog_api_client.v2.model.escalation_targets import EscalationTargets return { - "targets": (EscalationTarget,), + "targets": (EscalationTargets,), } attribute_map = { "targets": "targets", } - def __init__( - self_, targets: Union[EscalationTarget, TeamTarget, UserTarget, ScheduleTarget, UnsetType] = unset, **kwargs - ): + def __init__(self_, targets: Union[EscalationTargets, UnsetType] = unset, **kwargs): """ Represents the relationship of an escalation policy step to its targets. - :param targets: Represents an escalation target, which can be a team, user, or schedule. - :type targets: EscalationTarget, optional + :param targets: A list of escalation targets for a step + :type targets: EscalationTargets, optional """ if targets is not unset: kwargs["targets"] = targets diff --git a/src/datadog_api_client/v2/model/escalation_policy_update_request_data_attributes.py b/src/datadog_api_client/v2/model/escalation_policy_update_request_data_attributes.py index ec1c080eb5..101ec3256d 100644 --- a/src/datadog_api_client/v2/model/escalation_policy_update_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/escalation_policy_update_request_data_attributes.py @@ -27,7 +27,6 @@ def openapi_types(_): ) return { - "description": (str,), "name": (str,), "resolve_page_on_policy_end": (bool,), "retries": (int,), @@ -35,7 +34,6 @@ def openapi_types(_): } attribute_map = { - "description": "description", "name": "name", "resolve_page_on_policy_end": "resolve_page_on_policy_end", "retries": "retries", @@ -46,7 +44,6 @@ def __init__( self_, name: str, steps: List[EscalationPolicyUpdateRequestDataAttributesStepsItems], - description: Union[str, UnsetType] = unset, resolve_page_on_policy_end: Union[bool, UnsetType] = unset, retries: Union[int, UnsetType] = unset, **kwargs, @@ -54,9 +51,6 @@ def __init__( """ Defines the attributes that can be updated for an escalation policy, such as description, name, resolution behavior, retries, and steps. - :param description: Provides a detailed text description of the escalation policy. - :type description: str, optional - :param name: Specifies the name of the escalation policy. :type name: str @@ -69,8 +63,6 @@ def __init__( :param steps: A list of escalation steps, each defining assignment, escalation timeout, and targets. :type steps: [EscalationPolicyUpdateRequestDataAttributesStepsItems] """ - if description is not unset: - kwargs["description"] = description if resolve_page_on_policy_end is not unset: kwargs["resolve_page_on_policy_end"] = resolve_page_on_policy_end if retries is not unset: diff --git a/src/datadog_api_client/v2/model/escalation_targets.py b/src/datadog_api_client/v2/model/escalation_targets.py new file mode 100644 index 0000000000..7d493a5800 --- /dev/null +++ b/src/datadog_api_client/v2/model/escalation_targets.py @@ -0,0 +1,49 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.escalation_target import EscalationTarget + from datadog_api_client.v2.model.team_target import TeamTarget + from datadog_api_client.v2.model.user_target import UserTarget + from datadog_api_client.v2.model.schedule_target import ScheduleTarget + + +class EscalationTargets(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.escalation_target import EscalationTarget + + return { + "data": ([EscalationTarget],), + } + + attribute_map = { + "data": "data", + } + + def __init__( + self_, + data: Union[List[Union[EscalationTarget, TeamTarget, UserTarget, ScheduleTarget]], UnsetType] = unset, + **kwargs, + ): + """ + A list of escalation targets for a step + + :param data: The ``EscalationTargets`` ``data``. + :type data: [EscalationTarget], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/on_call_page_target_type.py b/src/datadog_api_client/v2/model/on_call_page_target_type.py new file mode 100644 index 0000000000..83cb143987 --- /dev/null +++ b/src/datadog_api_client/v2/model/on_call_page_target_type.py @@ -0,0 +1,41 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OnCallPageTargetType(ModelSimple): + """ + The kind of target, `team_id` | `team_handle` | `user_id`. + + :param value: Must be one of ["team_id", "team_handle", "user_id"]. + :type value: str + """ + + allowed_values = { + "team_id", + "team_handle", + "user_id", + } + TEAM_ID: ClassVar["OnCallPageTargetType"] + TEAM_HANDLE: ClassVar["OnCallPageTargetType"] + USER_ID: ClassVar["OnCallPageTargetType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OnCallPageTargetType.TEAM_ID = OnCallPageTargetType("team_id") +OnCallPageTargetType.TEAM_HANDLE = OnCallPageTargetType("team_handle") +OnCallPageTargetType.USER_ID = OnCallPageTargetType("user_id") diff --git a/src/datadog_api_client/v2/model/schedule_create_request_data.py b/src/datadog_api_client/v2/model/schedule_create_request_data.py index 44bcdb24b1..301e2062c2 100644 --- a/src/datadog_api_client/v2/model/schedule_create_request_data.py +++ b/src/datadog_api_client/v2/model/schedule_create_request_data.py @@ -54,7 +54,7 @@ def __init__( """ The core data wrapper for creating a schedule, encompassing attributes, relationships, and the resource type. - :param attributes: Describes the main attributes for creating a new schedule, including name, layers, time zone, and tags. + :param attributes: Describes the main attributes for creating a new schedule, including name, layers, and time zone. :type attributes: ScheduleCreateRequestDataAttributes :param relationships: Gathers relationship objects for the schedule creation request, including the teams to associate. diff --git a/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py b/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py index a614f5360e..fcb67d1302 100644 --- a/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py @@ -3,13 +3,11 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import List, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, - unset, - UnsetType, ) @@ -29,42 +27,30 @@ def openapi_types(_): return { "layers": ([ScheduleCreateRequestDataAttributesLayersItems],), "name": (str,), - "tags": ([str],), "time_zone": (str,), } attribute_map = { "layers": "layers", "name": "name", - "tags": "tags", "time_zone": "time_zone", } def __init__( - self_, - layers: List[ScheduleCreateRequestDataAttributesLayersItems], - name: str, - time_zone: str, - tags: Union[List[str], UnsetType] = unset, - **kwargs, + self_, layers: List[ScheduleCreateRequestDataAttributesLayersItems], name: str, time_zone: str, **kwargs ): """ - Describes the main attributes for creating a new schedule, including name, layers, time zone, and tags. + Describes the main attributes for creating a new schedule, including name, layers, and time zone. - :param layers: The layers of on-call coverage that define rotation intervals and restrictions. + :param layers: The layers of On-Call coverage that define rotation intervals and restrictions. :type layers: [ScheduleCreateRequestDataAttributesLayersItems] :param name: A human-readable name for the new schedule. :type name: str - :param tags: A list of tags for categorizing or filtering the schedule. - :type tags: [str], optional - :param time_zone: The time zone in which the schedule is defined. :type time_zone: str """ - if tags is not unset: - kwargs["tags"] = tags super().__init__(kwargs) self_.layers = layers diff --git a/src/datadog_api_client/v2/model/schedule_data.py b/src/datadog_api_client/v2/model/schedule_data.py index 977b127b97..b1c2c1ab06 100644 --- a/src/datadog_api_client/v2/model/schedule_data.py +++ b/src/datadog_api_client/v2/model/schedule_data.py @@ -51,7 +51,7 @@ def __init__( """ Represents the primary data object for a schedule, linking attributes and relationships. - :param attributes: Provides core properties of a schedule object, such as its name, time zone, and tags. + :param attributes: Provides core properties of a schedule object such as its name and time zone. :type attributes: ScheduleDataAttributes, optional :param id: The schedule's unique identifier. diff --git a/src/datadog_api_client/v2/model/schedule_data_attributes.py b/src/datadog_api_client/v2/model/schedule_data_attributes.py index a0f7c742d6..210b97a10b 100644 --- a/src/datadog_api_client/v2/model/schedule_data_attributes.py +++ b/src/datadog_api_client/v2/model/schedule_data_attributes.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union +from typing import Union from datadog_api_client.model_utils import ( ModelNormal, @@ -18,39 +18,26 @@ class ScheduleDataAttributes(ModelNormal): def openapi_types(_): return { "name": (str,), - "tags": ([str],), "time_zone": (str,), } attribute_map = { "name": "name", - "tags": "tags", "time_zone": "time_zone", } - def __init__( - self_, - name: Union[str, UnsetType] = unset, - tags: Union[List[str], UnsetType] = unset, - time_zone: Union[str, UnsetType] = unset, - **kwargs, - ): + def __init__(self_, name: Union[str, UnsetType] = unset, time_zone: Union[str, UnsetType] = unset, **kwargs): """ - Provides core properties of a schedule object, such as its name, time zone, and tags. + Provides core properties of a schedule object such as its name and time zone. :param name: A short name for the schedule. :type name: str, optional - :param tags: A list of tags associated with this schedule. - :type tags: [str], optional - :param time_zone: The time zone in which this schedule operates. :type time_zone: str, optional """ if name is not unset: kwargs["name"] = name - if tags is not unset: - kwargs["tags"] = tags if time_zone is not unset: kwargs["time_zone"] = time_zone super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/schedule_data_included_item.py b/src/datadog_api_client/v2/model/schedule_data_included_item.py index c81fc311e6..f697af0a61 100644 --- a/src/datadog_api_client/v2/model/schedule_data_included_item.py +++ b/src/datadog_api_client/v2/model/schedule_data_included_item.py @@ -21,11 +21,11 @@ def __init__(self, **kwargs): :param id: The team's unique identifier. :type id: str, optional - :param relationships: Collects the key relationship fields for a team reference, specifically on-call users. - :type relationships: TeamReferenceRelationships, optional - :param type: Teams resource type. :type type: TeamReferenceType + + :param relationships: Holds references to objects related to the Layer entity, such as its members. + :type relationships: LayerRelationships, optional """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/schedule_update_request.py b/src/datadog_api_client/v2/model/schedule_update_request.py index 319cba809b..8815336b57 100644 --- a/src/datadog_api_client/v2/model/schedule_update_request.py +++ b/src/datadog_api_client/v2/model/schedule_update_request.py @@ -32,7 +32,7 @@ def __init__(self_, data: ScheduleUpdateRequestData, **kwargs): """ A top-level wrapper for a schedule update request, referring to the ``data`` object with the new details. - :param data: Contains all data needed to update an existing schedule, including its attributes (such as name, layers, or tags) and any relationships to teams. + :param data: Contains all data needed to update an existing schedule, including its attributes (such as name and time zone) and any relationships to teams. :type data: ScheduleUpdateRequestData """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/schedule_update_request_data.py b/src/datadog_api_client/v2/model/schedule_update_request_data.py index 2b6a2c706f..c8cc6bc278 100644 --- a/src/datadog_api_client/v2/model/schedule_update_request_data.py +++ b/src/datadog_api_client/v2/model/schedule_update_request_data.py @@ -55,9 +55,9 @@ def __init__( **kwargs, ): """ - Contains all data needed to update an existing schedule, including its attributes (such as name, layers, or tags) and any relationships to teams. + Contains all data needed to update an existing schedule, including its attributes (such as name and time zone) and any relationships to teams. - :param attributes: Defines the updatable attributes for a schedule, such as name, time zone, tags, and layers. + :param attributes: Defines the updatable attributes for a schedule, such as name, time zone, and layers. :type attributes: ScheduleUpdateRequestDataAttributes :param id: The ID of the schedule to be updated. diff --git a/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py b/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py index a1309975ef..8ea5a4931a 100644 --- a/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py @@ -3,13 +3,11 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import List, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, - unset, - UnsetType, ) @@ -29,27 +27,20 @@ def openapi_types(_): return { "layers": ([ScheduleUpdateRequestDataAttributesLayersItems],), "name": (str,), - "tags": ([str],), "time_zone": (str,), } attribute_map = { "layers": "layers", "name": "name", - "tags": "tags", "time_zone": "time_zone", } def __init__( - self_, - layers: List[ScheduleUpdateRequestDataAttributesLayersItems], - name: str, - time_zone: str, - tags: Union[List[str], UnsetType] = unset, - **kwargs, + self_, layers: List[ScheduleUpdateRequestDataAttributesLayersItems], name: str, time_zone: str, **kwargs ): """ - Defines the updatable attributes for a schedule, such as name, time zone, tags, and layers. + Defines the updatable attributes for a schedule, such as name, time zone, and layers. :param layers: The updated list of layers (rotations) for this schedule. :type layers: [ScheduleUpdateRequestDataAttributesLayersItems] @@ -57,14 +48,9 @@ def __init__( :param name: A short name for the schedule. :type name: str - :param tags: A list of tags that you can associate with this schedule. - :type tags: [str], optional - :param time_zone: The time zone used when interpreting rotation times. :type time_zone: str """ - if tags is not unset: - kwargs["tags"] = tags super().__init__(kwargs) self_.layers = layers diff --git a/src/datadog_api_client/v2/model/team_reference.py b/src/datadog_api_client/v2/model/team_reference.py index d80178b43c..0e7529fc75 100644 --- a/src/datadog_api_client/v2/model/team_reference.py +++ b/src/datadog_api_client/v2/model/team_reference.py @@ -15,7 +15,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.team_reference_attributes import TeamReferenceAttributes - from datadog_api_client.v2.model.team_reference_relationships import TeamReferenceRelationships from datadog_api_client.v2.model.team_reference_type import TeamReferenceType @@ -23,20 +22,17 @@ class TeamReference(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.team_reference_attributes import TeamReferenceAttributes - from datadog_api_client.v2.model.team_reference_relationships import TeamReferenceRelationships from datadog_api_client.v2.model.team_reference_type import TeamReferenceType return { "attributes": (TeamReferenceAttributes,), "id": (str,), - "relationships": (TeamReferenceRelationships,), "type": (TeamReferenceType,), } attribute_map = { "attributes": "attributes", "id": "id", - "relationships": "relationships", "type": "type", } @@ -45,7 +41,6 @@ def __init__( type: TeamReferenceType, attributes: Union[TeamReferenceAttributes, UnsetType] = unset, id: Union[str, UnsetType] = unset, - relationships: Union[TeamReferenceRelationships, UnsetType] = unset, **kwargs, ): """ @@ -57,9 +52,6 @@ def __init__( :param id: The team's unique identifier. :type id: str, optional - :param relationships: Collects the key relationship fields for a team reference, specifically on-call users. - :type relationships: TeamReferenceRelationships, optional - :param type: Teams resource type. :type type: TeamReferenceType """ @@ -67,8 +59,6 @@ def __init__( kwargs["attributes"] = attributes if id is not unset: kwargs["id"] = id - if relationships is not unset: - kwargs["relationships"] = relationships super().__init__(kwargs) self_.type = type diff --git a/src/datadog_api_client/v2/model/team_reference_relationships.py b/src/datadog_api_client/v2/model/team_reference_relationships.py deleted file mode 100644 index c529a62168..0000000000 --- a/src/datadog_api_client/v2/model/team_reference_relationships.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.team_reference_relationships_oncall_users import ( - TeamReferenceRelationshipsOncallUsers, - ) - - -class TeamReferenceRelationships(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_reference_relationships_oncall_users import ( - TeamReferenceRelationshipsOncallUsers, - ) - - return { - "oncall_users": (TeamReferenceRelationshipsOncallUsers,), - } - - attribute_map = { - "oncall_users": "oncall_users", - } - - def __init__(self_, oncall_users: Union[TeamReferenceRelationshipsOncallUsers, UnsetType] = unset, **kwargs): - """ - Collects the key relationship fields for a team reference, specifically on-call users. - - :param oncall_users: Defines which users are on-call within a team, stored as an array of references. - :type oncall_users: TeamReferenceRelationshipsOncallUsers, optional - """ - if oncall_users is not unset: - kwargs["oncall_users"] = oncall_users - super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users.py b/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users.py deleted file mode 100644 index 020a7be0da..0000000000 --- a/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import List, Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items import ( - TeamReferenceRelationshipsOncallUsersDataItems, - ) - - -class TeamReferenceRelationshipsOncallUsers(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items import ( - TeamReferenceRelationshipsOncallUsersDataItems, - ) - - return { - "data": ([TeamReferenceRelationshipsOncallUsersDataItems],), - } - - attribute_map = { - "data": "data", - } - - def __init__(self_, data: Union[List[TeamReferenceRelationshipsOncallUsersDataItems], UnsetType] = unset, **kwargs): - """ - Defines which users are on-call within a team, stored as an array of references. - - :param data: The list of user references who are on-call for this team. - :type data: [TeamReferenceRelationshipsOncallUsersDataItems], optional - """ - if data is not unset: - kwargs["data"] = data - super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users_data_items.py b/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users_data_items.py deleted file mode 100644 index 6a1843ac1f..0000000000 --- a/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users_data_items.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items_type import ( - TeamReferenceRelationshipsOncallUsersDataItemsType, - ) - - -class TeamReferenceRelationshipsOncallUsersDataItems(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items_type import ( - TeamReferenceRelationshipsOncallUsersDataItemsType, - ) - - return { - "id": (str,), - "type": (TeamReferenceRelationshipsOncallUsersDataItemsType,), - } - - attribute_map = { - "id": "id", - "type": "type", - } - - def __init__(self_, id: str, type: TeamReferenceRelationshipsOncallUsersDataItemsType, **kwargs): - """ - References a user who is on-call within this team, identified by ``id`` and ``type``. - - :param id: The unique identifier of the user. - :type id: str - - :param type: Users resource type. - :type type: TeamReferenceRelationshipsOncallUsersDataItemsType - """ - super().__init__(kwargs) - - self_.id = id - self_.type = type diff --git a/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users_data_items_type.py b/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users_data_items_type.py deleted file mode 100644 index 90ec35af30..0000000000 --- a/src/datadog_api_client/v2/model/team_reference_relationships_oncall_users_data_items_type.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelSimple, - cached_property, -) - -from typing import ClassVar - - -class TeamReferenceRelationshipsOncallUsersDataItemsType(ModelSimple): - """ - Users resource type. - - :param value: If omitted defaults to "users". Must be one of ["users"]. - :type value: str - """ - - allowed_values = { - "users", - } - USERS: ClassVar["TeamReferenceRelationshipsOncallUsersDataItemsType"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TeamReferenceRelationshipsOncallUsersDataItemsType.USERS = TeamReferenceRelationshipsOncallUsersDataItemsType("users") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 6a56c24208..5aa228cadd 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1103,6 +1103,7 @@ from datadog_api_client.v2.model.escalation_policy_user_attributes import EscalationPolicyUserAttributes from datadog_api_client.v2.model.escalation_policy_user_type import EscalationPolicyUserType from datadog_api_client.v2.model.escalation_target import EscalationTarget +from datadog_api_client.v2.model.escalation_targets import EscalationTargets from datadog_api_client.v2.model.event import Event from datadog_api_client.v2.model.event_attributes import EventAttributes from datadog_api_client.v2.model.event_category import EventCategory @@ -2315,6 +2316,7 @@ from datadog_api_client.v2.model.okta_account_update_request_attributes import OktaAccountUpdateRequestAttributes from datadog_api_client.v2.model.okta_account_update_request_data import OktaAccountUpdateRequestData from datadog_api_client.v2.model.okta_accounts_response import OktaAccountsResponse +from datadog_api_client.v2.model.on_call_page_target_type import OnCallPageTargetType from datadog_api_client.v2.model.on_demand_concurrency_cap import OnDemandConcurrencyCap from datadog_api_client.v2.model.on_demand_concurrency_cap_attributes import OnDemandConcurrencyCapAttributes from datadog_api_client.v2.model.on_demand_concurrency_cap_response import OnDemandConcurrencyCapResponse @@ -3225,14 +3227,6 @@ from datadog_api_client.v2.model.team_permission_settings_response import TeamPermissionSettingsResponse from datadog_api_client.v2.model.team_reference import TeamReference from datadog_api_client.v2.model.team_reference_attributes import TeamReferenceAttributes -from datadog_api_client.v2.model.team_reference_relationships import TeamReferenceRelationships -from datadog_api_client.v2.model.team_reference_relationships_oncall_users import TeamReferenceRelationshipsOncallUsers -from datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items import ( - TeamReferenceRelationshipsOncallUsersDataItems, -) -from datadog_api_client.v2.model.team_reference_relationships_oncall_users_data_items_type import ( - TeamReferenceRelationshipsOncallUsersDataItemsType, -) from datadog_api_client.v2.model.team_reference_type import TeamReferenceType from datadog_api_client.v2.model.team_relationships import TeamRelationships from datadog_api_client.v2.model.team_relationships_links import TeamRelationshipsLinks @@ -4257,6 +4251,7 @@ "EscalationPolicyUserAttributes", "EscalationPolicyUserType", "EscalationTarget", + "EscalationTargets", "Event", "EventAttributes", "EventCategory", @@ -5057,6 +5052,7 @@ "OktaAccountUpdateRequestAttributes", "OktaAccountUpdateRequestData", "OktaAccountsResponse", + "OnCallPageTargetType", "OnDemandConcurrencyCap", "OnDemandConcurrencyCapAttributes", "OnDemandConcurrencyCapResponse", @@ -5791,10 +5787,6 @@ "TeamPermissionSettingsResponse", "TeamReference", "TeamReferenceAttributes", - "TeamReferenceRelationships", - "TeamReferenceRelationshipsOncallUsers", - "TeamReferenceRelationshipsOncallUsersDataItems", - "TeamReferenceRelationshipsOncallUsersDataItemsType", "TeamReferenceType", "TeamRelationships", "TeamRelationshipsLinks", diff --git a/tests/v2/cassettes/test_scenarios/test_create_on_call_escalation_policy_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_on_call_escalation_policy_returns_created_response.frozen deleted file mode 100644 index 57dea2bb52..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_on_call_escalation_policy_returns_created_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-04-24T02:49:21.008Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_on_call_escalation_policy_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_on_call_escalation_policy_returns_created_response.yaml deleted file mode 100644 index ec9532ee0d..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_on_call_escalation_policy_returns_created_response.yaml +++ /dev/null @@ -1,138 +0,0 @@ -interactions: -- request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:21.008Z","end_date":"2025-05-04T02:49:21.008Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:21.008Z"}],"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/schedules - response: - body: - string: '{"data":{"id":"982c5000-f586-47ba-8a24-68cbfcb69dd8","type":"schedules","attributes":{"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"e0120c74-ba79-45ce-a6ee-23805f0b427a","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"handle":"test-handle-31c96645156f4753","name":"test-name-31c96645156f4753"},"type":"team"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/team - response: - body: - string: '{"data":{"type":"team","id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","attributes":{"name":"test-name-31c96645156f4753","handle":"test-handle-31c96645156f4753","summary":null,"description":null,"avatar":null,"banner":9,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:22.446146+00:00","modified_at":"2025-04-24T02:49:22.446154+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/1a2f4aba-af9a-4b7c-bfc1-27147b24f69a/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/1a2f4aba-af9a-4b7c-bfc1-27147b24f69a/permission-settings"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"email":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961@datadoghq.com","title":"user - title"},"type":"users"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/users - response: - body: - string: '{"data":{"type":"users","id":"ba36416f-20b6-11f0-80c3-2afe3706f727","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1745462961@datadoghq.com","created_at":"2025-04-24T02:49:22.874028+00:00","modified_at":"2025-04-24T02:49:22.874028+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1745462961@datadoghq.com","icon":"https://secure.gravatar.com/avatar/6a35b18888753aa49b46b0e245a5ce25?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"description":"Escalation Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"ba36416f-20b6-11f0-80c3-2afe3706f727","type":"users"},{"id":"982c5000-f586-47ba-8a24-68cbfcb69dd8","type":"schedules"},{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]}},"type":"policies"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies - response: - body: - string: '{"data":{"id":"027666b2-8fa2-47a5-a9c6-9a7bed58f140","type":"policies","attributes":{"description":"Escalation - Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"9d860392-4d2e-48d1-a5b4-09539bf5df12","type":"steps"},{"id":"75e94267-7fa6-4790-a81f-a6633f2e9c6e","type":"steps"}]},"teams":{"data":[{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/027666b2-8fa2-47a5-a9c6-9a7bed58f140 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/users/ba36416f-20b6-11f0-80c3-2afe3706f727 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/team/1a2f4aba-af9a-4b7c-bfc1-27147b24f69a - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/982c5000-f586-47ba-8a24-68cbfcb69dd8 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.frozen index 4200b1edc2..6ffd513131 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.frozen @@ -1 +1 @@ -2025-04-24T03:17:05.259Z \ No newline at end of file +2025-05-22T07:28:52.187Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.yaml index b333196ab4..ef34de821a 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_oncall_escalation_policy_returns_created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:05.259Z","end_date":"2025-05-04T03:17:05.259Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:05.259Z"}],"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-12T07:28:52.187Z","end_date":"2025-06-01T07:28:52.187Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-17T07:28:52.187Z"}],"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"2a44a887-add2-47f7-9535-92a2a8ebea79","type":"schedules","attributes":{"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"accb6605-37be-410c-86ad-a7d3400919a3","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"b1732c80-9bb6-47e6-878d-9e672e4148a6","type":"schedules","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"98d7c183-739e-4ef5-ae40-27e7612bf939","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -19,7 +19,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-e9912af3975c2380","name":"test-name-e9912af3975c2380"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-af3e241f3f3acc33","name":"test-name-af3e241f3f3acc33"},"type":"team"}}' headers: accept: - application/json @@ -29,7 +29,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"15667dfa-83d1-4a17-a100-d8474fdb723d","attributes":{"name":"test-name-e9912af3975c2380","handle":"test-handle-e9912af3975c2380","summary":null,"description":null,"avatar":null,"banner":1,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:06.086645+00:00","modified_at":"2025-04-24T03:17:06.086653+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/15667dfa-83d1-4a17-a100-d8474fdb723d/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/15667dfa-83d1-4a17-a100-d8474fdb723d/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"403df2c1-7163-494a-8f34-6b73a2e51893","attributes":{"name":"test-name-af3e241f3f3acc33","handle":"test-handle-af3e241f3f3acc33","summary":null,"description":null,"avatar":null,"banner":13,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-22T07:28:53.300763+00:00","modified_at":"2025-05-22T07:28:53.300772+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/403df2c1-7163-494a-8f34-6b73a2e51893/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/403df2c1-7163-494a-8f34-6b73a2e51893/permission-settings"}}}}} ' headers: @@ -39,7 +39,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"email":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -50,7 +50,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"99c39f2a-20ba-11f0-892a-8ed3debb4e3c","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1745464625@datadoghq.com","created_at":"2025-04-24T03:17:06.422591+00:00","modified_at":"2025-04-24T03:17:06.422591+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1745464625@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c1e19926cae1d8a175b99b6952c20aca?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"6a0710e3-36de-11f0-b303-0a167fbfaaab","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1747898932@datadoghq.com","created_at":"2025-05-22T07:28:53.797325+00:00","modified_at":"2025-05-22T07:28:53.797325+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1747898932@datadoghq.com","icon":"https://secure.gravatar.com/avatar/004cc14226c3e9b0e2d890d1cf40991a?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -61,18 +61,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"description":"Escalation Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"99c39f2a-20ba-11f0-892a-8ed3debb4e3c","type":"users"},{"id":"2a44a887-add2-47f7-9535-92a2a8ebea79","type":"schedules"},{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]}},"type":"policies"}}' + body: '{"data":{"attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"6a0710e3-36de-11f0-b303-0a167fbfaaab","type":"users"},{"id":"b1732c80-9bb6-47e6-878d-9e672e4148a6","type":"schedules"},{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams"}]}},"type":"policies"}}' headers: accept: - application/json content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies?include=steps.targets response: body: - string: '{"data":{"id":"9269a3cc-3191-435d-b878-438cbe9f288e","type":"policies","attributes":{"description":"Escalation - Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"b292cc93-8f52-426d-88fb-0ac2b4a6fa10","type":"steps"},{"id":"aa60c048-510f-4e0d-bb1d-fc51606a66a1","type":"steps"}]},"teams":{"data":[{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]}}}}' + string: '{"data":{"id":"7c3eb6f9-15e8-4709-a2f9-21897597d44b","type":"policies","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"896e047c-2219-467b-a1ba-897ec456044e","type":"steps"},{"id":"b405cc13-e555-4465-bb3f-7facb8ff8b4b","type":"steps"}]},"teams":{"data":[{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams"}]}}},"included":[{"id":"896e047c-2219-467b-a1ba-897ec456044e","type":"steps","attributes":{"assignment":"default","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"6a0710e3-36de-11f0-b303-0a167fbfaaab","type":"users"},{"id":"b1732c80-9bb6-47e6-878d-9e672e4148a6","type":"schedules"},{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams"}]}}},{"id":"b405cc13-e555-4465-bb3f-7facb8ff8b4b","type":"steps","attributes":{"assignment":"round-robin","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams"}]}}},{"id":"b1732c80-9bb6-47e6-878d-9e672e4148a6","type":"schedules","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"98d7c183-739e-4ef5-ae40-27e7612bf939","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}},{"id":"403df2c1-7163-494a-8f34-6b73a2e51893","type":"teams","attributes":{"avatar":"","description":"","handle":"test-handle-af3e241f3f3acc33","name":"test-name-af3e241f3f3acc33"}},{"id":"6a0710e3-36de-11f0-b303-0a167fbfaaab","type":"users","attributes":{"email":"test-create_on_call_escalation_policy_returns_created_response-1747898932@datadoghq.com","name":"","status":"pending"}}]}' headers: content-type: - application/vnd.api+json @@ -85,7 +84,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/9269a3cc-3191-435d-b878-438cbe9f288e + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7c3eb6f9-15e8-4709-a2f9-21897597d44b response: body: string: '' @@ -99,7 +98,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/99c39f2a-20ba-11f0-892a-8ed3debb4e3c + uri: https://api.datadoghq.com/api/v2/users/6a0710e3-36de-11f0-b303-0a167fbfaaab response: body: string: '' @@ -113,7 +112,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/15667dfa-83d1-4a17-a100-d8474fdb723d + uri: https://api.datadoghq.com/api/v2/team/403df2c1-7163-494a-8f34-6b73a2e51893 response: body: string: '' @@ -127,7 +126,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/2a44a887-add2-47f7-9535-92a2a8ebea79 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/b1732c80-9bb6-47e6-878d-9e672e4148a6 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.frozen index 89de8af07b..435d9b833f 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.frozen @@ -1 +1 @@ -2025-04-24T02:49:27.251Z \ No newline at end of file +2025-05-21T11:01:51.393Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.yaml index 775cce58a4..c027511a51 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_oncall_schedule_returns_created_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Create_on_call_schedule_returns_Created_response-1745462967@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Create_On_Call_schedule_returns_Created_response-1747825311@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"bd4b5c17-20b6-11f0-9b89-56a869ed3f0e","attributes":{"name":null,"handle":"test-create_on_call_schedule_returns_created_response-1745462967@datadoghq.com","created_at":"2025-04-24T02:49:28.045501+00:00","modified_at":"2025-04-24T02:49:28.045501+00:00","email":"test-create_on_call_schedule_returns_created_response-1745462967@datadoghq.com","icon":"https://secure.gravatar.com/avatar/774508323ca0432fa93ee1fdf7111c87?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"ffb657ae-3632-11f0-8139-36deebce65db","attributes":{"name":null,"handle":"test-create_on_call_schedule_returns_created_response-1747825311@datadoghq.com","created_at":"2025-05-21T11:01:51.489047+00:00","modified_at":"2025-05-21T11:01:51.489047+00:00","email":"test-create_on_call_schedule_returns_created_response-1747825311@datadoghq.com","icon":"https://secure.gravatar.com/avatar/fe3b4171de3845d28a158ca806834463?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,7 +22,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-3bb36357ae7d207e","name":"test-name-3bb36357ae7d207e"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-74af482e94498992","name":"test-name-74af482e94498992"},"type":"team"}}' headers: accept: - application/json @@ -32,7 +32,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"04f134fc-d975-4111-825d-5447611962c3","attributes":{"name":"test-name-3bb36357ae7d207e","handle":"test-handle-3bb36357ae7d207e","summary":null,"description":null,"avatar":null,"banner":0,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:28.946742+00:00","modified_at":"2025-04-24T02:49:28.946751+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/04f134fc-d975-4111-825d-5447611962c3/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/04f134fc-d975-4111-825d-5447611962c3/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"85d4d10d-ce4a-4bc6-91a4-2f391b4979db","attributes":{"name":"test-name-74af482e94498992","handle":"test-handle-74af482e94498992","summary":null,"description":null,"avatar":null,"banner":9,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-21T11:01:51.607592+00:00","modified_at":"2025-05-21T11:01:51.607602+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/85d4d10d-ce4a-4bc6-91a4-2f391b4979db/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/85d4d10d-ce4a-4bc6-91a4-2f391b4979db/permission-settings"}}}}} ' headers: @@ -42,8 +42,8 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:27.251Z","end_date":"2025-05-04T02:49:27.251Z","interval":{"days":1},"members":[{"user":{"id":"bd4b5c17-20b6-11f0-9b89-56a869ed3f0e"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:27.251Z"}],"name":"Test-Create_on_call_schedule_returns_Created_response-1745462967","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"04f134fc-d975-4111-825d-5447611962c3","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:51.393Z","end_date":"2025-05-31T11:01:51.393Z","interval":{"days":1},"members":[{"user":{"id":"ffb657ae-3632-11f0-8139-36deebce65db"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:51.393Z"}],"name":"Test-Create_On_Call_schedule_returns_Created_response-1747825311","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"85d4d10d-ce4a-4bc6-91a4-2f391b4979db","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -53,7 +53,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"123b1c19-c34b-45b6-9c33-41f9e4dda1dd","type":"schedules","attributes":{"name":"Test-Create_on_call_schedule_returns_Created_response-1745462967","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"ed1f2d1b-726e-4a53-b54e-1c6bf2b5901e","type":"layers"}]},"teams":{"data":[{"id":"04f134fc-d975-4111-825d-5447611962c3","type":"teams"}]}}}}' + string: '{"data":{"id":"4f083dc5-6d02-49ee-9f93-6937253db90b","type":"schedules","attributes":{"name":"Test-Create_On_Call_schedule_returns_Created_response-1747825311","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"dfa67783-0231-4672-80dc-7d1c634eb068","type":"layers"}]},"teams":{"data":[{"id":"85d4d10d-ce4a-4bc6-91a4-2f391b4979db","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -66,7 +66,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/123b1c19-c34b-45b6-9c33-41f9e4dda1dd + uri: https://api.datadoghq.com/api/v2/on-call/schedules/4f083dc5-6d02-49ee-9f93-6937253db90b response: body: string: '' @@ -80,7 +80,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/04f134fc-d975-4111-825d-5447611962c3 + uri: https://api.datadoghq.com/api/v2/team/85d4d10d-ce4a-4bc6-91a4-2f391b4979db response: body: string: '' @@ -94,7 +94,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/bd4b5c17-20b6-11f0-9b89-56a869ed3f0e + uri: https://api.datadoghq.com/api/v2/users/ffb657ae-3632-11f0-8139-36deebce65db response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_delete_on_call_escalation_policy_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_on_call_escalation_policy_returns_no_content_response.frozen deleted file mode 100644 index 934268745e..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_delete_on_call_escalation_policy_returns_no_content_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-04-24T02:49:32.262Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_on_call_escalation_policy_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_on_call_escalation_policy_returns_no_content_response.yaml deleted file mode 100644 index fe0a78cdad..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_delete_on_call_escalation_policy_returns_no_content_response.yaml +++ /dev/null @@ -1,154 +0,0 @@ -interactions: -- request: - body: '{"data":{"attributes":{"email":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972@datadoghq.com","title":"user - title"},"type":"users"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/users - response: - body: - string: '{"data":{"type":"users","id":"c02f8d1c-20b6-11f0-ab2c-227bd670db64","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1745462972@datadoghq.com","created_at":"2025-04-24T02:49:32.896419+00:00","modified_at":"2025-04-24T02:49:32.896419+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1745462972@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c62c48dab244e5889d7e9acaf2f87894?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"handle":"test-handle-7e60a3022d9f9ad9","name":"test-name-7e60a3022d9f9ad9"},"type":"team"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/team - response: - body: - string: '{"data":{"type":"team","id":"2deba622-02f4-4c79-8120-0dc23ce700fc","attributes":{"name":"test-name-7e60a3022d9f9ad9","handle":"test-handle-7e60a3022d9f9ad9","summary":null,"description":null,"avatar":null,"banner":7,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:33.597906+00:00","modified_at":"2025-04-24T02:49:33.597915+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/2deba622-02f4-4c79-8120-0dc23ce700fc/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/2deba622-02f4-4c79-8120-0dc23ce700fc/permission-settings"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:32.262Z","end_date":"2025-05-04T02:49:32.262Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:32.262Z"}],"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/schedules - response: - body: - string: '{"data":{"id":"b521cc12-a23b-4fa2-b3d4-891484f6271c","type":"schedules","attributes":{"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"a50d4ce3-8ae0-4bda-b9b3-05d37298a129","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"},{"id":"b521cc12-a23b-4fa2-b3d4-891484f6271c","type":"schedules"},{"id":"c02f8d1c-20b6-11f0-ab2c-227bd670db64","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"}]}},"type":"policies"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies - response: - body: - string: '{"data":{"id":"44dd85a9-41bc-44f2-ac29-08ccbc4f1a21","type":"policies","attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"51a3a324-9905-4d72-9131-980f991160f6","type":"steps"},{"id":"170630ee-f429-4cf2-9e11-22d5b4ff7ab2","type":"steps"}]},"teams":{"data":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/44dd85a9-41bc-44f2-ac29-08ccbc4f1a21 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/44dd85a9-41bc-44f2-ac29-08ccbc4f1a21 - response: - body: - string: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[44dd85a9-41bc-44f2-ac29-08ccbc4f1a21] - not found"}]}' - headers: - content-type: - - application/vnd.api+json - status: - code: 404 - message: Not Found -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/b521cc12-a23b-4fa2-b3d4-891484f6271c - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/team/2deba622-02f4-4c79-8120-0dc23ce700fc - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/users/c02f8d1c-20b6-11f0-ab2c-227bd670db64 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.frozen index 0f49465de0..957b16f864 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.frozen @@ -1 +1 @@ -2025-04-24T03:17:07.960Z \ No newline at end of file +2025-05-21T11:01:52.363Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.yaml index 449dba641c..e2bf649282 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_delete_oncall_escalation_policy_returns_no_content_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"9ac4c097-20ba-11f0-93bd-fe1e9003413a","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1745464627@datadoghq.com","created_at":"2025-04-24T03:17:08.107723+00:00","modified_at":"2025-04-24T03:17:08.107723+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1745464627@datadoghq.com","icon":"https://secure.gravatar.com/avatar/086fc14d750fb41c41edb93f40a83331?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"004c79ee-3633-11f0-a44d-32fc981820e1","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1747825312@datadoghq.com","created_at":"2025-05-21T11:01:52.473018+00:00","modified_at":"2025-05-21T11:01:52.473018+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1747825312@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ad3c6a2c3812a95dae5fa21afd4d2431?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,7 +22,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-25a086ee0229070e","name":"test-name-25a086ee0229070e"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-da5b39657e7d313b","name":"test-name-da5b39657e7d313b"},"type":"team"}}' headers: accept: - application/json @@ -32,7 +32,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","attributes":{"name":"test-name-25a086ee0229070e","handle":"test-handle-25a086ee0229070e","summary":null,"description":null,"avatar":null,"banner":13,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:08.284107+00:00","modified_at":"2025-04-24T03:17:08.284117+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/f4d93724-d4f7-462e-b1de-1abf73d182cb/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/f4d93724-d4f7-462e-b1de-1abf73d182cb/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"9c6994c3-9ea3-44df-8321-0b83ceb1af69","attributes":{"name":"test-name-da5b39657e7d313b","handle":"test-handle-da5b39657e7d313b","summary":null,"description":null,"avatar":null,"banner":11,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-21T11:01:52.600302+00:00","modified_at":"2025-05-21T11:01:52.600311+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/9c6994c3-9ea3-44df-8321-0b83ceb1af69/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/9c6994c3-9ea3-44df-8321-0b83ceb1af69/permission-settings"}}}}} ' headers: @@ -42,8 +42,8 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:07.960Z","end_date":"2025-05-04T03:17:07.960Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:07.960Z"}],"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:52.363Z","end_date":"2025-05-31T11:01:52.363Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:52.363Z"}],"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -53,7 +53,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"bfab7bf6-9cbb-4cb5-911c-1e8ad6483589","type":"schedules","attributes":{"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"d65f680f-89e4-4643-baf8-d113f88b0efb","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"48c6b04f-1120-46b0-9600-b85a5253965c","type":"schedules","attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"3e17a286-28fa-4525-9336-94bb0d8fac37","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -61,7 +61,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"},{"id":"bfab7bf6-9cbb-4cb5-911c-1e8ad6483589","type":"schedules"},{"id":"9ac4c097-20ba-11f0-93bd-fe1e9003413a","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"}]}},"type":"policies"}}' + body: '{"data":{"attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"9c6994c3-9ea3-44df-8321-0b83ceb1af69","type":"teams"},{"id":"48c6b04f-1120-46b0-9600-b85a5253965c","type":"schedules"},{"id":"004c79ee-3633-11f0-a44d-32fc981820e1","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"9c6994c3-9ea3-44df-8321-0b83ceb1af69","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"9c6994c3-9ea3-44df-8321-0b83ceb1af69","type":"teams"}]}},"type":"policies"}}' headers: accept: - application/json @@ -71,7 +71,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: body: - string: '{"data":{"id":"b33d5cd2-3ba0-4201-925f-f5421f439786","type":"policies","attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"25aa772a-6f29-42a8-acf2-ba77cd1017fa","type":"steps"},{"id":"4428e9bb-f628-4f28-ae9a-e4390e2e3591","type":"steps"}]},"teams":{"data":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"}]}}}}' + string: '{"data":{"id":"4b1100c9-814e-4444-9eab-7b42fa66865d","type":"policies","attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"4b81dc5d-0d54-4b9a-8864-0f5ed3591c14","type":"steps"},{"id":"c0227ecd-8eb6-49ff-abb4-c7f9e22438df","type":"steps"}]},"teams":{"data":[{"id":"9c6994c3-9ea3-44df-8321-0b83ceb1af69","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -84,7 +84,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b33d5cd2-3ba0-4201-925f-f5421f439786 + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/4b1100c9-814e-4444-9eab-7b42fa66865d response: body: string: '' @@ -98,10 +98,10 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b33d5cd2-3ba0-4201-925f-f5421f439786 + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/4b1100c9-814e-4444-9eab-7b42fa66865d response: body: - string: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[b33d5cd2-3ba0-4201-925f-f5421f439786] + string: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[4b1100c9-814e-4444-9eab-7b42fa66865d] not found"}]}' headers: content-type: @@ -115,7 +115,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/bfab7bf6-9cbb-4cb5-911c-1e8ad6483589 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/48c6b04f-1120-46b0-9600-b85a5253965c response: body: string: '' @@ -129,7 +129,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/f4d93724-d4f7-462e-b1de-1abf73d182cb + uri: https://api.datadoghq.com/api/v2/team/9c6994c3-9ea3-44df-8321-0b83ceb1af69 response: body: string: '' @@ -143,7 +143,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/9ac4c097-20ba-11f0-93bd-fe1e9003413a + uri: https://api.datadoghq.com/api/v2/users/004c79ee-3633-11f0-a44d-32fc981820e1 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.frozen index 34bf952c75..9d8615cb28 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.frozen @@ -1 +1 @@ -2025-04-24T02:49:38.725Z \ No newline at end of file +2025-05-21T11:01:53.526Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.yaml index c2b7dc7e7b..7e3ae3a65f 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_delete_oncall_schedule_returns_no_content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:38.725Z","end_date":"2025-05-04T02:49:38.725Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:38.725Z"}],"name":"Test-Delete_on_call_schedule_returns_No_Content_response-1745462978","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:53.526Z","end_date":"2025-05-31T11:01:53.526Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:53.526Z"}],"name":"Test-Delete_On_Call_schedule_returns_No_Content_response-1747825313","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"f35f8c7d-faeb-47b6-bd93-0f5f6690f480","type":"schedules","attributes":{"name":"Test-Delete_on_call_schedule_returns_No_Content_response-1745462978","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"08b5e153-5fe7-422c-93b1-4a0c03fffeb1","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"cb45fcec-a893-423f-94d1-a401bd31e09c","type":"schedules","attributes":{"name":"Test-Delete_On_Call_schedule_returns_No_Content_response-1747825313","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"56bdebe0-3f79-4571-a92f-c8fb422c7a3e","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -24,7 +24,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/f35f8c7d-faeb-47b6-bd93-0f5f6690f480 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/cb45fcec-a893-423f-94d1-a401bd31e09c response: body: string: '' @@ -38,10 +38,10 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/f35f8c7d-faeb-47b6-bd93-0f5f6690f480 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/cb45fcec-a893-423f-94d1-a401bd31e09c response: body: - string: '{"errors":[{"title":"Generic Error","detail":"schedule[f35f8c7d-faeb-47b6-bd93-0f5f6690f480] + string: '{"errors":[{"title":"Generic Error","detail":"schedule[cb45fcec-a893-423f-94d1-a401bd31e09c] not found"}]}' headers: content-type: diff --git a/tests/v2/cassettes/test_scenarios/test_get_on_call_escalation_policy_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_on_call_escalation_policy_returns_ok_response.frozen deleted file mode 100644 index 9f3ddd2fab..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_on_call_escalation_policy_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-04-24T02:49:40.684Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_on_call_escalation_policy_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_on_call_escalation_policy_returns_ok_response.yaml deleted file mode 100644 index c23f35c1ba..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_on_call_escalation_policy_returns_ok_response.yaml +++ /dev/null @@ -1,153 +0,0 @@ -interactions: -- request: - body: '{"data":{"attributes":{"email":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980@datadoghq.com","title":"user - title"},"type":"users"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/users - response: - body: - string: '{"data":{"type":"users","id":"c52fbdf7-20b6-11f0-9fba-9e18c50abaf7","attributes":{"name":null,"handle":"test-get_on_call_escalation_policy_returns_ok_response-1745462980@datadoghq.com","created_at":"2025-04-24T02:49:41.286277+00:00","modified_at":"2025-04-24T02:49:41.286277+00:00","email":"test-get_on_call_escalation_policy_returns_ok_response-1745462980@datadoghq.com","icon":"https://secure.gravatar.com/avatar/353d353320f41d073ed3b9ac3377a373?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"handle":"test-handle-8daac668ecee431a","name":"test-name-8daac668ecee431a"},"type":"team"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/team - response: - body: - string: '{"data":{"type":"team","id":"c0735ecc-f533-4a25-9677-18899e041a6d","attributes":{"name":"test-name-8daac668ecee431a","handle":"test-handle-8daac668ecee431a","summary":null,"description":null,"avatar":null,"banner":7,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:41.969128+00:00","modified_at":"2025-04-24T02:49:41.969136+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/c0735ecc-f533-4a25-9677-18899e041a6d/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/c0735ecc-f533-4a25-9677-18899e041a6d/permission-settings"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:40.684Z","end_date":"2025-05-04T02:49:40.684Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:40.684Z"}],"name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/schedules - response: - body: - string: '{"data":{"id":"dc1207ba-103f-48f3-b12a-47bdaf445fe8","type":"schedules","attributes":{"name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"81eb06b1-e7e9-4dab-ab70-857841269370","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"description":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"c0735ecc-f533-4a25-9677-18899e041a6d","type":"teams"},{"id":"dc1207ba-103f-48f3-b12a-47bdaf445fe8","type":"schedules"},{"id":"c52fbdf7-20b6-11f0-9fba-9e18c50abaf7","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"c0735ecc-f533-4a25-9677-18899e041a6d","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"c0735ecc-f533-4a25-9677-18899e041a6d","type":"teams"}]}},"type":"policies"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies - response: - body: - string: '{"data":{"id":"34dcaf58-bd09-4f13-b832-9ef37eee4188","type":"policies","attributes":{"description":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"e1412324-b7d2-4547-8648-f6df812bbe94","type":"steps"},{"id":"fe4f58e3-211d-4ff7-b0fe-94b1fd595e45","type":"steps"}]},"teams":{"data":[{"id":"c0735ecc-f533-4a25-9677-18899e041a6d","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: null - headers: - accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/34dcaf58-bd09-4f13-b832-9ef37eee4188 - response: - body: - string: '{"data":{"id":"34dcaf58-bd09-4f13-b832-9ef37eee4188","type":"policies","attributes":{"description":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745462980","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"e1412324-b7d2-4547-8648-f6df812bbe94","type":"steps"},{"id":"fe4f58e3-211d-4ff7-b0fe-94b1fd595e45","type":"steps"}]},"teams":{"data":[{"id":"c0735ecc-f533-4a25-9677-18899e041a6d","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/34dcaf58-bd09-4f13-b832-9ef37eee4188 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/dc1207ba-103f-48f3-b12a-47bdaf445fe8 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/team/c0735ecc-f533-4a25-9677-18899e041a6d - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/users/c52fbdf7-20b6-11f0-9fba-9e18c50abaf7 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.frozen index 177e6f7502..948876221d 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.frozen @@ -1 +1 @@ -2025-04-24T03:17:10.072Z \ No newline at end of file +2025-05-22T08:13:16.150Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.yaml index fdbd87c1a7..8eb0ad981c 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_oncall_escalation_policy_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"9c0e2ae7-20ba-11f0-93bd-fe1e9003413a","attributes":{"name":null,"handle":"test-get_on_call_escalation_policy_returns_ok_response-1745464630@datadoghq.com","created_at":"2025-04-24T03:17:10.266577+00:00","modified_at":"2025-04-24T03:17:10.266577+00:00","email":"test-get_on_call_escalation_policy_returns_ok_response-1745464630@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c4a99cbd483f4f0f486bb7a3892860c2?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"9d53cb80-36e4-11f0-a925-6205a5ac8b82","attributes":{"name":null,"handle":"test-get_on_call_escalation_policy_returns_ok_response-1747901596@datadoghq.com","created_at":"2025-05-22T08:13:16.844359+00:00","modified_at":"2025-05-22T08:13:16.844359+00:00","email":"test-get_on_call_escalation_policy_returns_ok_response-1747901596@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e764229bedd0fcaaf713b8470d33ff30?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,7 +22,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-c43638d5a0d7eb06","name":"test-name-c43638d5a0d7eb06"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-59a9a0ccb3d041ed","name":"test-name-59a9a0ccb3d041ed"},"type":"team"}}' headers: accept: - application/json @@ -32,7 +32,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"69ebc6fd-3f33-4944-9d0d-c81584ef7c51","attributes":{"name":"test-name-c43638d5a0d7eb06","handle":"test-handle-c43638d5a0d7eb06","summary":null,"description":null,"avatar":null,"banner":0,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:10.499509+00:00","modified_at":"2025-04-24T03:17:10.499518+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/69ebc6fd-3f33-4944-9d0d-c81584ef7c51/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/69ebc6fd-3f33-4944-9d0d-c81584ef7c51/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","attributes":{"name":"test-name-59a9a0ccb3d041ed","handle":"test-handle-59a9a0ccb3d041ed","summary":null,"description":null,"avatar":null,"banner":12,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-22T08:13:17.120509+00:00","modified_at":"2025-05-22T08:13:17.120518+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/11dfbd58-960b-4b61-b2ee-a1d754a0c968/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/11dfbd58-960b-4b61-b2ee-a1d754a0c968/permission-settings"}}}}} ' headers: @@ -42,8 +42,8 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:10.072Z","end_date":"2025-05-04T03:17:10.072Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:10.072Z"}],"name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-12T08:13:16.150Z","end_date":"2025-06-01T08:13:16.150Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-17T08:13:16.150Z"}],"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -53,7 +53,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"7aac310e-2db6-4285-92cc-7352cceab519","type":"schedules","attributes":{"name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"30c77e3d-af69-46bf-bc64-86b8bc3053be","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"f4321cbc-072d-49c7-9f2d-dd63e6b17604","type":"schedules","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"c0103435-9e63-49bc-b358-e3509d4538d9","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -61,7 +61,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"description":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"69ebc6fd-3f33-4944-9d0d-c81584ef7c51","type":"teams"},{"id":"7aac310e-2db6-4285-92cc-7352cceab519","type":"schedules"},{"id":"9c0e2ae7-20ba-11f0-93bd-fe1e9003413a","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"69ebc6fd-3f33-4944-9d0d-c81584ef7c51","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"69ebc6fd-3f33-4944-9d0d-c81584ef7c51","type":"teams"}]}},"type":"policies"}}' + body: '{"data":{"attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"},{"id":"f4321cbc-072d-49c7-9f2d-dd63e6b17604","type":"schedules"},{"id":"9d53cb80-36e4-11f0-a925-6205a5ac8b82","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"}]}},"type":"policies"}}' headers: accept: - application/json @@ -71,7 +71,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: body: - string: '{"data":{"id":"5dbf6b01-fcbf-4cfb-80b8-88a6bf8e995e","type":"policies","attributes":{"description":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"99b17a25-0c2f-449f-a8b7-3d2be65abb1e","type":"steps"},{"id":"84f4cfe9-2867-4630-b5aa-439d5ada46ac","type":"steps"}]},"teams":{"data":[{"id":"69ebc6fd-3f33-4944-9d0d-c81584ef7c51","type":"teams"}]}}}}' + string: '{"data":{"id":"76c1a88a-9590-40a0-b848-b64a3acc3668","type":"policies","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"69b0a8d5-9706-49cd-92a1-2d5ddb96cbee","type":"steps"},{"id":"aa2918d5-9024-4ca6-b214-69238907fdf9","type":"steps"}]},"teams":{"data":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -84,10 +84,10 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/5dbf6b01-fcbf-4cfb-80b8-88a6bf8e995e + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/76c1a88a-9590-40a0-b848-b64a3acc3668?include=steps.targets response: body: - string: '{"data":{"id":"5dbf6b01-fcbf-4cfb-80b8-88a6bf8e995e","type":"policies","attributes":{"description":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","name":"Test-Get_on_call_escalation_policy_returns_OK_response-1745464630","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"99b17a25-0c2f-449f-a8b7-3d2be65abb1e","type":"steps"},{"id":"84f4cfe9-2867-4630-b5aa-439d5ada46ac","type":"steps"}]},"teams":{"data":[{"id":"69ebc6fd-3f33-4944-9d0d-c81584ef7c51","type":"teams"}]}}}}' + string: '{"data":{"id":"76c1a88a-9590-40a0-b848-b64a3acc3668","type":"policies","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"69b0a8d5-9706-49cd-92a1-2d5ddb96cbee","type":"steps"},{"id":"aa2918d5-9024-4ca6-b214-69238907fdf9","type":"steps"}]},"teams":{"data":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"}]}}},"included":[{"id":"69b0a8d5-9706-49cd-92a1-2d5ddb96cbee","type":"steps","attributes":{"assignment":"default","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"},{"id":"f4321cbc-072d-49c7-9f2d-dd63e6b17604","type":"schedules"},{"id":"9d53cb80-36e4-11f0-a925-6205a5ac8b82","type":"users"}]}}},{"id":"aa2918d5-9024-4ca6-b214-69238907fdf9","type":"steps","attributes":{"assignment":"round-robin","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams"}]}}},{"id":"11dfbd58-960b-4b61-b2ee-a1d754a0c968","type":"teams","attributes":{"avatar":"","description":"","handle":"test-handle-59a9a0ccb3d041ed","name":"test-name-59a9a0ccb3d041ed"}},{"id":"f4321cbc-072d-49c7-9f2d-dd63e6b17604","type":"schedules","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"c0103435-9e63-49bc-b358-e3509d4538d9","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}},{"id":"9d53cb80-36e4-11f0-a925-6205a5ac8b82","type":"users","attributes":{"email":"test-get_on_call_escalation_policy_returns_ok_response-1747901596@datadoghq.com","name":"","status":"pending"}}]}' headers: content-type: - application/vnd.api+json @@ -100,7 +100,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/5dbf6b01-fcbf-4cfb-80b8-88a6bf8e995e + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/76c1a88a-9590-40a0-b848-b64a3acc3668 response: body: string: '' @@ -114,7 +114,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/7aac310e-2db6-4285-92cc-7352cceab519 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/f4321cbc-072d-49c7-9f2d-dd63e6b17604 response: body: string: '' @@ -128,7 +128,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/69ebc6fd-3f33-4944-9d0d-c81584ef7c51 + uri: https://api.datadoghq.com/api/v2/team/11dfbd58-960b-4b61-b2ee-a1d754a0c968 response: body: string: '' @@ -142,7 +142,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/9c0e2ae7-20ba-11f0-93bd-fe1e9003413a + uri: https://api.datadoghq.com/api/v2/users/9d53cb80-36e4-11f0-a925-6205a5ac8b82 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.frozen index a050f793a1..e218d1ad69 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.frozen @@ -1 +1 @@ -2025-04-24T02:49:47.598Z \ No newline at end of file +2025-05-21T11:01:55.033Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.yaml index 61ff094216..0d594ea485 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_oncall_schedule_returns_ok_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:47.598Z","end_date":"2025-05-04T02:49:47.598Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:47.598Z"}],"name":"Test-Get_on_call_schedule_returns_OK_response-1745462987","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:55.033Z","end_date":"2025-05-31T11:01:55.033Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:55.033Z"}],"name":"Test-Get_On_Call_schedule_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"512937e2-423b-4f87-b48c-886c60795556","type":"schedules","attributes":{"name":"Test-Get_on_call_schedule_returns_OK_response-1745462987","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"c06d3fa1-b68c-4ea4-a2bf-ce8af43c1e8b","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"68403f49-4f50-4307-bdf2-663ebab53587","type":"schedules","attributes":{"name":"Test-Get_On_Call_schedule_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"15bf3013-34f8-474c-925f-87f468e3eaff","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -24,10 +24,10 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/on-call/schedules/512937e2-423b-4f87-b48c-886c60795556 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/68403f49-4f50-4307-bdf2-663ebab53587 response: body: - string: '{"data":{"id":"512937e2-423b-4f87-b48c-886c60795556","type":"schedules","attributes":{"name":"Test-Get_on_call_schedule_returns_OK_response-1745462987","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"c06d3fa1-b68c-4ea4-a2bf-ce8af43c1e8b","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"68403f49-4f50-4307-bdf2-663ebab53587","type":"schedules","attributes":{"name":"Test-Get_On_Call_schedule_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"15bf3013-34f8-474c-925f-87f468e3eaff","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -40,7 +40,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/512937e2-423b-4f87-b48c-886c60795556 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/68403f49-4f50-4307-bdf2-663ebab53587 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.frozen index e788455d93..6d73c6656d 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.frozen @@ -1 +1 @@ -2025-05-13T23:33:52.641Z \ No newline at end of file +2025-05-21T11:01:55.256Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.yaml index 2d2ba1e5e2..d52b21d65e 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_the_schedule_oncall_user_returns_ok_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-03T23:33:52.641Z","end_date":"2025-05-23T23:33:52.641Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-08T23:33:52.641Z"}],"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1747179232","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:55.256Z","end_date":"2025-05-31T11:01:55.256Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:55.256Z"}],"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"37ca26fb-0143-4b2a-802c-8c01cd2179ab","type":"schedules","attributes":{"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1747179232","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"bf12302a-842c-4d31-bfe8-198ac926c41c","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"253ef9a9-6ab9-4c53-9f16-abcf2942b39d","type":"schedules","attributes":{"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"d1f6d8a7-ad53-45c9-a226-ebd60587cc80","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -24,10 +24,10 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/on-call/schedules/37ca26fb-0143-4b2a-802c-8c01cd2179ab/on-call + uri: https://api.datadoghq.com/api/v2/on-call/schedules/253ef9a9-6ab9-4c53-9f16-abcf2942b39d/on-call response: body: - string: '{"data":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596-2025-05-13T19:33:53-04:00-2025-05-14T19:33:52-04:00","type":"shifts","attributes":{"end":"2025-05-14T19:33:52-04:00","start":"2025-05-13T19:33:53.520152-04:00"},"relationships":{"user":{"data":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596","type":"users"}}}}}' + string: '{"data":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596-2025-05-21T07:01:55-04:00-2025-05-22T07:01:55-04:00","type":"shifts","attributes":{"end":"2025-05-22T07:01:55-04:00","start":"2025-05-21T07:01:55.332323-04:00"},"relationships":{"user":{"data":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596","type":"users"}}}}}' headers: content-type: - application/vnd.api+json @@ -40,7 +40,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/37ca26fb-0143-4b2a-802c-8c01cd2179ab + uri: https://api.datadoghq.com/api/v2/on-call/schedules/253ef9a9-6ab9-4c53-9f16-abcf2942b39d response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.frozen index aa8d3dd92e..8f21581f61 100644 --- a/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.frozen @@ -1 +1 @@ -2025-05-02T07:28:35.869Z \ No newline at end of file +2025-05-21T11:01:55.512Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.yaml index eddf918fa3..d222034c48 100644 --- a/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_set_oncall_team_routing_rules_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1747825315@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"0f6790f5-2727-11f0-a9cb-b6ff84ad8646","attributes":{"name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1746170915@datadoghq.com","created_at":"2025-05-02T07:28:36.413905+00:00","modified_at":"2025-05-02T07:28:36.413905+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1746170915@datadoghq.com","icon":"https://secure.gravatar.com/avatar/b9e2f38a22d0273582e08252ffbae94a?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"022c3a60-3633-11f0-b7ed-ce2381807b05","attributes":{"name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1747825315@datadoghq.com","created_at":"2025-05-21T11:01:55.617066+00:00","modified_at":"2025-05-21T11:01:55.617066+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1747825315@datadoghq.com","icon":"https://secure.gravatar.com/avatar/83f881635a4cf010167f0bf22fa154a3?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,7 +22,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-f6cbca2a9dc51017","name":"test-name-f6cbca2a9dc51017"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-deb316d25d38fe23","name":"test-name-deb316d25d38fe23"},"type":"team"}}' headers: accept: - application/json @@ -32,7 +32,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","attributes":{"name":"test-name-f6cbca2a9dc51017","handle":"test-handle-f6cbca2a9dc51017","summary":null,"description":null,"avatar":null,"banner":9,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-02T07:28:36.528008+00:00","modified_at":"2025-05-02T07:28:36.528018+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/0db9884c-62de-4b52-ae74-1d256d8ecb75/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/0db9884c-62de-4b52-ae74-1d256d8ecb75/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","attributes":{"name":"test-name-deb316d25d38fe23","handle":"test-handle-deb316d25d38fe23","summary":null,"description":null,"avatar":null,"banner":1,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-21T11:01:55.737730+00:00","modified_at":"2025-05-21T11:01:55.737740+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/68a584b9-c8e4-414a-aedd-31f30ab44d27/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/68a584b9-c8e4-414a-aedd-31f30ab44d27/permission-settings"}}}}} ' headers: @@ -42,8 +42,8 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-22T07:28:35.869Z","end_date":"2025-05-12T07:28:35.869Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-27T07:28:35.869Z"}],"name":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:55.512Z","end_date":"2025-05-31T11:01:55.512Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:55.512Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -53,7 +53,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"f4ae5b94-3985-490a-bdc0-e7f64890968c","type":"schedules","attributes":{"name":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"498723e5-43d7-407c-b7cb-171e9c08f402","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"b1819128-6086-4eb2-b555-87f33398825d","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1747825315","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"19e523ad-b55a-4f32-8c41-008ba17be5fe","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -61,7 +61,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"description":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915","name":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","type":"teams"},{"id":"f4ae5b94-3985-490a-bdc0-e7f64890968c","type":"schedules"},{"id":"0f6790f5-2727-11f0-a9cb-b6ff84ad8646","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","type":"teams"}]}},"type":"policies"}}' + body: '{"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1747825315","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","type":"teams"},{"id":"b1819128-6086-4eb2-b555-87f33398825d","type":"schedules"},{"id":"022c3a60-3633-11f0-b7ed-ce2381807b05","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","type":"teams"}]}},"type":"policies"}}' headers: accept: - application/json @@ -71,7 +71,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: body: - string: '{"data":{"id":"b79d430d-1e03-4840-a933-a1ee9baae339","type":"policies","attributes":{"description":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915","name":"Test-Set_on_call_team_routing_rules_returns_OK_response-1746170915","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"46b170a7-ad4a-4cc3-b933-386af8fbee11","type":"steps"},{"id":"11c45a97-a232-4f34-a086-77005522ea7a","type":"steps"}]},"teams":{"data":[{"id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","type":"teams"}]}}}}' + string: '{"data":{"id":"4926e7bf-727c-4899-ab45-3cbf3bed0c23","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1747825315","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"0b8001d8-17ab-46ab-979e-b426e69b6423","type":"steps"},{"id":"b02f1fc4-3cdc-4b70-bcf2-fae24d5b09f9","type":"steps"}]},"teams":{"data":[{"id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -79,17 +79,17 @@ interactions: code: 201 message: Created - request: - body: '{"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"},"urgency":"high"},{"policy_id":"b79d430d-1e03-4840-a933-a1ee9baae339","query":"","urgency":"low"}]},"id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","type":"team_routing_rules"}}' + body: '{"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"},"urgency":"high"},{"policy_id":"4926e7bf-727c-4899-ab45-3cbf3bed0c23","query":"","urgency":"low"}]},"id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","type":"team_routing_rules"}}' headers: accept: - application/json content-type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/teams/0db9884c-62de-4b52-ae74-1d256d8ecb75/routing-rules + uri: https://api.datadoghq.com/api/v2/on-call/teams/68a584b9-c8e4-414a-aedd-31f30ab44d27/routing-rules response: body: - string: '{"data":{"id":"0db9884c-62de-4b52-ae74-1d256d8ecb75","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-0db9884c-62de-4b52-ae74-1d256d8ecb75-rule-0","type":"team_routing_rules"},{"id":"virtual-0db9884c-62de-4b52-ae74-1d256d8ecb75-rule-1","type":"team_routing_rules"}]}}}}' + string: '{"data":{"id":"68a584b9-c8e4-414a-aedd-31f30ab44d27","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-68a584b9-c8e4-414a-aedd-31f30ab44d27-rule-0","type":"team_routing_rules"},{"id":"virtual-68a584b9-c8e4-414a-aedd-31f30ab44d27-rule-1","type":"team_routing_rules"}]}}}}' headers: content-type: - application/vnd.api+json @@ -102,10 +102,10 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b79d430d-1e03-4840-a933-a1ee9baae339 + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/4926e7bf-727c-4899-ab45-3cbf3bed0c23 response: body: - string: '{"errors":[{"title":"Generic Error","detail":"policy[b79d430d-1e03-4840-a933-a1ee9baae339] + string: '{"errors":[{"title":"Generic Error","detail":"policy[4926e7bf-727c-4899-ab45-3cbf3bed0c23] is in use"}]}' headers: content-type: @@ -119,10 +119,10 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/f4ae5b94-3985-490a-bdc0-e7f64890968c + uri: https://api.datadoghq.com/api/v2/on-call/schedules/b1819128-6086-4eb2-b555-87f33398825d response: body: - string: '{"errors":[{"title":"Generic Error","detail":"schedule[f4ae5b94-3985-490a-bdc0-e7f64890968c] + string: '{"errors":[{"title":"Generic Error","detail":"schedule[b1819128-6086-4eb2-b555-87f33398825d] is in use"}]}' headers: content-type: @@ -136,7 +136,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/0db9884c-62de-4b52-ae74-1d256d8ecb75 + uri: https://api.datadoghq.com/api/v2/team/68a584b9-c8e4-414a-aedd-31f30ab44d27 response: body: string: '' @@ -150,7 +150,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/0f6790f5-2727-11f0-a9cb-b6ff84ad8646 + uri: https://api.datadoghq.com/api/v2/users/022c3a60-3633-11f0-b7ed-ce2381807b05 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_on_call_escalation_policy_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_on_call_escalation_policy_returns_ok_response.frozen deleted file mode 100644 index 478929d577..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_update_on_call_escalation_policy_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-04-24T02:49:49.725Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_on_call_escalation_policy_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_on_call_escalation_policy_returns_ok_response.yaml deleted file mode 100644 index f25b175d1b..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_update_on_call_escalation_policy_returns_ok_response.yaml +++ /dev/null @@ -1,155 +0,0 @@ -interactions: -- request: - body: '{"data":{"attributes":{"email":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989@datadoghq.com","title":"user - title"},"type":"users"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/users - response: - body: - string: '{"data":{"type":"users","id":"cab15683-20b6-11f0-892a-8ed3debb4e3c","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1745462989@datadoghq.com","created_at":"2025-04-24T02:49:50.524204+00:00","modified_at":"2025-04-24T02:49:50.524204+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1745462989@datadoghq.com","icon":"https://secure.gravatar.com/avatar/3db85ef85a418748eceea3fdcc017842?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"handle":"test-handle-aef238a64e0a3053","name":"test-name-aef238a64e0a3053"},"type":"team"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/team - response: - body: - string: '{"data":{"type":"team","id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","attributes":{"name":"test-name-aef238a64e0a3053","handle":"test-handle-aef238a64e0a3053","summary":null,"description":null,"avatar":null,"banner":2,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:51.170217+00:00","modified_at":"2025-04-24T02:49:51.170244+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/8e19da47-5b16-4f4a-856e-19e8c207a8e8/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/8e19da47-5b16-4f4a-856e-19e8c207a8e8/permission-settings"}}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:49.725Z","end_date":"2025-05-04T02:49:49.725Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:49.725Z"}],"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/schedules - response: - body: - string: '{"data":{"id":"cbebffd6-9d48-4b03-b847-ee5f8a93d92a","type":"schedules","attributes":{"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9451cf82-df43-4c50-aa13-41db5b92aca6","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"},{"id":"cbebffd6-9d48-4b03-b847-ee5f8a93d92a","type":"schedules"},{"id":"cab15683-20b6-11f0-892a-8ed3debb4e3c","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}},"type":"policies"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies - response: - body: - string: '{"data":{"id":"7f889d2e-2657-40a3-b27d-700ed017dbbf","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"a3e73c74-1840-41ac-8855-466fd073b603","type":"steps"},{"id":"644fdcae-f647-4191-ae79-f99e5d2d21ea","type":"steps"}]},"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 201 - message: Created -- request: - body: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"a3e73c74-1840-41ac-8855-466fd073b603","targets":[{"id":"cab15683-20b6-11f0-892a-8ed3debb4e3c","type":"users"}]}]},"id":"7f889d2e-2657-40a3-b27d-700ed017dbbf","relationships":{"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}},"type":"policies"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7f889d2e-2657-40a3-b27d-700ed017dbbf - response: - body: - string: '{"data":{"id":"7f889d2e-2657-40a3-b27d-700ed017dbbf","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"a3e73c74-1840-41ac-8855-466fd073b603","type":"steps"}]},"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}}}}' - headers: - content-type: - - application/vnd.api+json - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7f889d2e-2657-40a3-b27d-700ed017dbbf - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/cbebffd6-9d48-4b03-b847-ee5f8a93d92a - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/team/8e19da47-5b16-4f4a-856e-19e8c207a8e8 - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/users/cab15683-20b6-11f0-892a-8ed3debb4e3c - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.frozen index fa920124ca..58d9762aac 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.frozen @@ -1 +1 @@ -2025-04-24T03:17:12.320Z \ No newline at end of file +2025-05-21T11:01:56.877Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.yaml index e2490a9c58..416b9ea35d 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_oncall_escalation_policy_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"9d64aed1-20ba-11f0-9fba-9e18c50abaf7","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1745464632@datadoghq.com","created_at":"2025-04-24T03:17:12.511290+00:00","modified_at":"2025-04-24T03:17:12.511290+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1745464632@datadoghq.com","icon":"https://secure.gravatar.com/avatar/5eab1952bf2bb1dd7e013fe5aff37205?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"02f97155-3633-11f0-8139-36deebce65db","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1747825316@datadoghq.com","created_at":"2025-05-21T11:01:56.961957+00:00","modified_at":"2025-05-21T11:01:56.961957+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1747825316@datadoghq.com","icon":"https://secure.gravatar.com/avatar/58d047300afed96db7357b8216864a2b?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,7 +22,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-f9de9970024d1bd3","name":"test-name-f9de9970024d1bd3"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-7e1038d48a039cbc","name":"test-name-7e1038d48a039cbc"},"type":"team"}}' headers: accept: - application/json @@ -32,7 +32,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"2265b16b-975f-494b-b6c7-d12774580f81","attributes":{"name":"test-name-f9de9970024d1bd3","handle":"test-handle-f9de9970024d1bd3","summary":null,"description":null,"avatar":null,"banner":10,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:12.716884+00:00","modified_at":"2025-04-24T03:17:12.716893+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/2265b16b-975f-494b-b6c7-d12774580f81/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/2265b16b-975f-494b-b6c7-d12774580f81/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"593274dc-43a7-4281-930c-58cb572b5004","attributes":{"name":"test-name-7e1038d48a039cbc","handle":"test-handle-7e1038d48a039cbc","summary":null,"description":null,"avatar":null,"banner":2,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-21T11:01:57.059563+00:00","modified_at":"2025-05-21T11:01:57.059594+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/593274dc-43a7-4281-930c-58cb572b5004/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/593274dc-43a7-4281-930c-58cb572b5004/permission-settings"}}}}} ' headers: @@ -42,8 +42,8 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:12.320Z","end_date":"2025-05-04T03:17:12.320Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:12.320Z"}],"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:56.877Z","end_date":"2025-05-31T11:01:56.877Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:56.877Z"}],"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -53,7 +53,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"75777407-04a6-4136-add3-514e5dfb2a75","type":"schedules","attributes":{"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9787ba9f-bdc0-4be1-80df-d51c12e5c0be","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"6c875bbd-947b-44bd-bad5-e0da7c69db5c","type":"schedules","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"0fa01fe6-c072-42ca-a7ed-5923dca7f0b8","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -61,7 +61,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"},{"id":"75777407-04a6-4136-add3-514e5dfb2a75","type":"schedules"},{"id":"9d64aed1-20ba-11f0-9fba-9e18c50abaf7","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}},"type":"policies"}}' + body: '{"data":{"attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"593274dc-43a7-4281-930c-58cb572b5004","type":"teams"},{"id":"6c875bbd-947b-44bd-bad5-e0da7c69db5c","type":"schedules"},{"id":"02f97155-3633-11f0-8139-36deebce65db","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"593274dc-43a7-4281-930c-58cb572b5004","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"593274dc-43a7-4281-930c-58cb572b5004","type":"teams"}]}},"type":"policies"}}' headers: accept: - application/json @@ -71,7 +71,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: body: - string: '{"data":{"id":"2c8f57da-076d-40ed-a23c-c96d147b95da","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"c085d5a2-a692-4576-9585-4196e6106796","type":"steps"},{"id":"d6e074c5-ef00-4bad-938b-3ef9a3f276d1","type":"steps"}]},"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}}}}' + string: '{"data":{"id":"b41d541f-8f83-49f9-9661-0a5ee93bd3be","type":"policies","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"b84eeb10-55be-461c-8e0f-c60dfd0fbfd6","type":"steps"},{"id":"7cbf9415-79ef-4ce3-acef-5fce960278b7","type":"steps"}]},"teams":{"data":[{"id":"593274dc-43a7-4281-930c-58cb572b5004","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -79,17 +79,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"c085d5a2-a692-4576-9585-4196e6106796","targets":[{"id":"9d64aed1-20ba-11f0-9fba-9e18c50abaf7","type":"users"}]}]},"id":"2c8f57da-076d-40ed-a23c-c96d147b95da","relationships":{"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}},"type":"policies"}}' + body: '{"data":{"attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"b84eeb10-55be-461c-8e0f-c60dfd0fbfd6","targets":[{"id":"02f97155-3633-11f0-8139-36deebce65db","type":"users"}]}]},"id":"b41d541f-8f83-49f9-9661-0a5ee93bd3be","relationships":{"teams":{"data":[{"id":"593274dc-43a7-4281-930c-58cb572b5004","type":"teams"}]}},"type":"policies"}}' headers: accept: - application/json content-type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/2c8f57da-076d-40ed-a23c-c96d147b95da + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b41d541f-8f83-49f9-9661-0a5ee93bd3be response: body: - string: '{"data":{"id":"2c8f57da-076d-40ed-a23c-c96d147b95da","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"c085d5a2-a692-4576-9585-4196e6106796","type":"steps"}]},"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}}}}' + string: '{"data":{"id":"b41d541f-8f83-49f9-9661-0a5ee93bd3be","type":"policies","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"b84eeb10-55be-461c-8e0f-c60dfd0fbfd6","type":"steps"}]},"teams":{"data":[{"id":"593274dc-43a7-4281-930c-58cb572b5004","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -102,7 +102,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/2c8f57da-076d-40ed-a23c-c96d147b95da + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b41d541f-8f83-49f9-9661-0a5ee93bd3be response: body: string: '' @@ -116,7 +116,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/75777407-04a6-4136-add3-514e5dfb2a75 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/6c875bbd-947b-44bd-bad5-e0da7c69db5c response: body: string: '' @@ -130,7 +130,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/2265b16b-975f-494b-b6c7-d12774580f81 + uri: https://api.datadoghq.com/api/v2/team/593274dc-43a7-4281-930c-58cb572b5004 response: body: string: '' @@ -144,7 +144,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/9d64aed1-20ba-11f0-9fba-9e18c50abaf7 + uri: https://api.datadoghq.com/api/v2/users/02f97155-3633-11f0-8139-36deebce65db response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.frozen index 6edc2d04d4..20f2c22855 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.frozen @@ -1 +1 @@ -2025-04-24T02:49:56.699Z \ No newline at end of file +2025-05-21T11:01:58.116Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.yaml index 37b3425b6d..8409ced297 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_oncall_schedule_returns_ok_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:56.699Z","end_date":"2025-05-04T02:49:56.699Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:56.699Z"}],"name":"Test-Update_on_call_schedule_returns_OK_response-1745462996","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:58.116Z","end_date":"2025-05-31T11:01:58.116Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:58.116Z"}],"name":"Test-Update_On_Call_schedule_returns_OK_response-1747825318","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/on-call/schedules response: body: - string: '{"data":{"id":"63b955bd-42ab-42a2-95be-64cdaf5fad05","type":"schedules","attributes":{"name":"Test-Update_on_call_schedule_returns_OK_response-1745462996","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"3342fc63-b752-4cb7-84af-acdd25170a72","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"65e112fe-2c12-4a2b-8406-522b07cccd1c","type":"schedules","attributes":{"name":"Test-Update_On_Call_schedule_returns_OK_response-1747825318","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"7f8a6ed7-bc86-48ef-872b-f68b05b28f6b","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -19,7 +19,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"email":"Test-Update_on_call_schedule_returns_OK_response-1745462996@datadoghq.com","title":"user + body: '{"data":{"attributes":{"email":"Test-Update_On_Call_schedule_returns_OK_response-1747825318@datadoghq.com","title":"user title"},"type":"users"}}' headers: accept: @@ -30,7 +30,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/users response: body: - string: '{"data":{"type":"users","id":"cf1fc825-20b6-11f0-964a-9205f68d2dbc","attributes":{"name":null,"handle":"test-update_on_call_schedule_returns_ok_response-1745462996@datadoghq.com","created_at":"2025-04-24T02:49:57.958893+00:00","modified_at":"2025-04-24T02:49:57.958893+00:00","email":"test-update_on_call_schedule_returns_ok_response-1745462996@datadoghq.com","icon":"https://secure.gravatar.com/avatar/9745d12cfe2ad4741f4a01920dbaddbd?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"03c4b5bd-3633-11f0-8139-36deebce65db","attributes":{"name":null,"handle":"test-update_on_call_schedule_returns_ok_response-1747825318@datadoghq.com","created_at":"2025-05-21T11:01:58.294092+00:00","modified_at":"2025-05-21T11:01:58.294092+00:00","email":"test-update_on_call_schedule_returns_ok_response-1747825318@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e928709686b830ca3733b32dcf0e20e6?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -41,7 +41,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"handle":"test-handle-6bd41aedce052a30","name":"test-name-6bd41aedce052a30"},"type":"team"}}' + body: '{"data":{"attributes":{"handle":"test-handle-190dee1bd22c94a1","name":"test-name-190dee1bd22c94a1"},"type":"team"}}' headers: accept: - application/json @@ -51,7 +51,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/team response: body: - string: '{"data":{"type":"team","id":"45f3bb52-ff48-44f4-b7ec-e6ca4cc6e972","attributes":{"name":"test-name-6bd41aedce052a30","handle":"test-handle-6bd41aedce052a30","summary":null,"description":null,"avatar":null,"banner":2,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:58.638187+00:00","modified_at":"2025-04-24T02:49:58.638196+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/45f3bb52-ff48-44f4-b7ec-e6ca4cc6e972/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/45f3bb52-ff48-44f4-b7ec-e6ca4cc6e972/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"72687222-d9aa-4f6a-8af2-1f1811c66378","attributes":{"name":"test-name-190dee1bd22c94a1","handle":"test-handle-190dee1bd22c94a1","summary":null,"description":null,"avatar":null,"banner":7,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-21T11:01:58.429935+00:00","modified_at":"2025-05-21T11:01:58.429944+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/72687222-d9aa-4f6a-8af2-1f1811c66378/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/72687222-d9aa-4f6a-8af2-1f1811c66378/permission-settings"}}}}} ' headers: @@ -61,18 +61,18 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:56.699Z","end_date":"2025-05-04T02:49:56.699Z","id":"3342fc63-b752-4cb7-84af-acdd25170a72","interval":{"seconds":300},"members":[{"user":{"id":"cf1fc825-20b6-11f0-964a-9205f68d2dbc"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:56.699Z"}],"name":"Test-Update_on_call_schedule_returns_OK_response-1745462996","tags":["tag1","tag2","tag3"],"time_zone":"America/New_York"},"id":"63b955bd-42ab-42a2-95be-64cdaf5fad05","relationships":{"teams":{"data":[{"id":"45f3bb52-ff48-44f4-b7ec-e6ca4cc6e972","type":"teams"}]}},"type":"schedules"}}' + body: '{"data":{"attributes":{"layers":[{"effective_date":"2025-05-11T11:01:58.116Z","end_date":"2025-05-31T11:01:58.116Z","id":"7f8a6ed7-bc86-48ef-872b-f68b05b28f6b","interval":{"seconds":300},"members":[{"user":{"id":"03c4b5bd-3633-11f0-8139-36deebce65db"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-16T11:01:58.116Z"}],"name":"Test-Update_On_Call_schedule_returns_OK_response-1747825318","time_zone":"America/New_York"},"id":"65e112fe-2c12-4a2b-8406-522b07cccd1c","relationships":{"teams":{"data":[{"id":"72687222-d9aa-4f6a-8af2-1f1811c66378","type":"teams"}]}},"type":"schedules"}}' headers: accept: - application/json content-type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/schedules/63b955bd-42ab-42a2-95be-64cdaf5fad05 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/65e112fe-2c12-4a2b-8406-522b07cccd1c response: body: - string: '{"data":{"id":"63b955bd-42ab-42a2-95be-64cdaf5fad05","type":"schedules","attributes":{"name":"Test-Update_on_call_schedule_returns_OK_response-1745462996","tags":["tag1","tag2","tag3"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"3342fc63-b752-4cb7-84af-acdd25170a72","type":"layers"}]},"teams":{"data":[{"id":"45f3bb52-ff48-44f4-b7ec-e6ca4cc6e972","type":"teams"}]}}}}' + string: '{"data":{"id":"65e112fe-2c12-4a2b-8406-522b07cccd1c","type":"schedules","attributes":{"name":"Test-Update_On_Call_schedule_returns_OK_response-1747825318","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"7f8a6ed7-bc86-48ef-872b-f68b05b28f6b","type":"layers"}]},"teams":{"data":[{"id":"72687222-d9aa-4f6a-8af2-1f1811c66378","type":"teams"}]}}}}' headers: content-type: - application/vnd.api+json @@ -85,7 +85,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/45f3bb52-ff48-44f4-b7ec-e6ca4cc6e972 + uri: https://api.datadoghq.com/api/v2/team/72687222-d9aa-4f6a-8af2-1f1811c66378 response: body: string: '' @@ -99,7 +99,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/cf1fc825-20b6-11f0-964a-9205f68d2dbc + uri: https://api.datadoghq.com/api/v2/users/03c4b5bd-3633-11f0-8139-36deebce65db response: body: string: '' @@ -113,7 +113,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/63b955bd-42ab-42a2-95be-64cdaf5fad05 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/65e112fe-2c12-4a2b-8406-522b07cccd1c response: body: string: '' diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 696fef088c..d2dfb4183c 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -476,7 +476,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"resolve_page_on_policy_end\": true,\n \"retries\": 2,\n \"steps\": [\n {\n \"assignment\": \"default\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n },\n {\n \"id\": \"{{ schedule.data.id }}\",\n \"type\": \"schedules\"\n },\n {\n \"id\": \"{{ user.data.id }}\",\n \"type\": \"users\"\n }\n ]\n },\n {\n \"assignment\": \"round-robin\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n ]\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"policies\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"resolve_page_on_policy_end\": true,\n \"retries\": 2,\n \"steps\": [\n {\n \"assignment\": \"default\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n },\n {\n \"id\": \"{{ schedule.data.id }}\",\n \"type\": \"schedules\"\n },\n {\n \"id\": \"{{ user.data.id }}\",\n \"type\": \"users\"\n }\n ]\n },\n {\n \"assignment\": \"round-robin\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n ]\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"policies\"\n }\n}" } ], "step": "there is a valid \"escalation_policy\" in the system", @@ -488,7 +488,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"layers\": [\n {\n \"effective_date\": \"{{ timeISO('now - 10d') }}\",\n \"end_date\": \"{{ timeISO('now + 10d') }}\",\n \"interval\": {\n \"days\": 1\n },\n \"members\": [\n {\n \"user\": {\n \"id\": \"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"\n }\n }\n ],\n \"name\": \"Layer 1\",\n \"restrictions\": [\n {\n \"end_day\": \"friday\",\n \"end_time\": \"17:00:00\",\n \"start_day\": \"monday\",\n \"start_time\": \"09:00:00\"\n }\n ],\n \"rotation_start\": \"{{ timeISO('now - 5d') }}\"\n }\n ],\n \"name\": \"{{ unique }}\",\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"time_zone\": \"America/New_York\"\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"schedules\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"layers\": [\n {\n \"effective_date\": \"{{ timeISO('now - 10d') }}\",\n \"end_date\": \"{{ timeISO('now + 10d') }}\",\n \"interval\": {\n \"days\": 1\n },\n \"members\": [\n {\n \"user\": {\n \"id\": \"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"\n }\n }\n ],\n \"name\": \"Layer 1\",\n \"restrictions\": [\n {\n \"end_day\": \"friday\",\n \"end_time\": \"17:00:00\",\n \"start_day\": \"monday\",\n \"start_time\": \"09:00:00\"\n }\n ],\n \"rotation_start\": \"{{ timeISO('now - 5d') }}\"\n }\n ],\n \"name\": \"{{ unique }}\",\n \"time_zone\": \"America/New_York\"\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"schedules\"\n }\n}" } ], "step": "there is a valid \"schedule\" in the system", diff --git a/tests/v2/features/on-call.feature b/tests/v2/features/on-call.feature index aef3e5f6a2..6ce9161125 100644 --- a/tests/v2/features/on-call.feature +++ b/tests/v2/features/on-call.feature @@ -10,40 +10,41 @@ Feature: On-Call And an instance of "On-Call" API @generated @skip @team:DataDog/bugle - Scenario: Create on-call escalation policy returns "Bad Request" response + Scenario: Create On-Call escalation policy returns "Bad Request" response Given new "CreateOnCallEscalationPolicy" request - And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "name": "Escalation Policy 1", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}, {"id": "00000000-aba3-0000-0000-000000000000", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-abb1-0000-0000-000000000000", "type": "users"}]}]}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "Escalation Policy 1", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}, {"id": "00000000-aba3-0000-0000-000000000000", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-abb1-0000-0000-000000000000", "type": "users"}]}]}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/bugle - Scenario: Create on-call escalation policy returns "Created" response + Scenario: Create On-Call escalation policy returns "Created" response Given new "CreateOnCallEscalationPolicy" request And there is a valid "schedule" in the system And there is a valid "dd_team" in the system And there is a valid "user" in the system - And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "name": "{{ unique }}", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "{{ user.data.id }}", "type": "users"}, {"id": "{{ schedule.data.id }}", "type": "schedules"}, {"id": "{{ dd_team.data.id }}", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}]}, "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "{{ unique }}", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "{{ user.data.id }}", "type": "users"}, {"id": "{{ schedule.data.id }}", "type": "schedules"}, {"id": "{{ dd_team.data.id }}", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}]}, "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} + And request contains "include" parameter with value "steps.targets" When the request is sent Then the response status is 201 Created @generated @skip @team:DataDog/bugle - Scenario: Create on-call schedule returns "Bad Request" response + Scenario: Create On-Call schedule returns "Bad Request" response Given new "CreateOnCallSchedule" request - And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"days": 1}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule", "tags": ["tag1", "tag2"], "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"days": 1}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/bugle - Scenario: Create on-call schedule returns "Created" response + Scenario: Create On-Call schedule returns "Created" response Given new "CreateOnCallSchedule" request And there is a valid "user" in the system And there is a valid "dd_team" in the system - And body with value {"data": {"attributes": {"layers": [{"effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"days": 1}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "tags": ["tag1", "tag2"], "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{dd_team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"days": 1}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{dd_team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 201 Created @team:DataDog/bugle - Scenario: Delete on-call escalation policy returns "No Content" response + Scenario: Delete On-Call escalation policy returns "No Content" response Given new "DeleteOnCallEscalationPolicy" request And there is a valid "user" in the system And there is a valid "dd_team" in the system @@ -54,14 +55,14 @@ Feature: On-Call Then the response status is 204 No Content @generated @skip @team:DataDog/bugle - Scenario: Delete on-call escalation policy returns "Not Found" response + Scenario: Delete On-Call escalation policy returns "Not Found" response Given new "DeleteOnCallEscalationPolicy" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/bugle - Scenario: Delete on-call schedule returns "No Content" response + Scenario: Delete On-Call schedule returns "No Content" response Given new "DeleteOnCallSchedule" request And there is a valid "schedule" in the system And request contains "schedule_id" parameter from "schedule.data.id" @@ -69,46 +70,47 @@ Feature: On-Call Then the response status is 204 No Content @generated @skip @team:DataDog/bugle - Scenario: Delete on-call schedule returns "Not Found" response + Scenario: Delete On-Call schedule returns "Not Found" response Given new "DeleteOnCallSchedule" request And request contains "schedule_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/bugle - Scenario: Get on-call escalation policy returns "Bad Request" response + Scenario: Get On-Call escalation policy returns "Bad Request" response Given new "GetOnCallEscalationPolicy" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/bugle - Scenario: Get on-call escalation policy returns "Not Found" response + Scenario: Get On-Call escalation policy returns "Not Found" response Given new "GetOnCallEscalationPolicy" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/bugle - Scenario: Get on-call escalation policy returns "OK" response + Scenario: Get On-Call escalation policy returns "OK" response Given new "GetOnCallEscalationPolicy" request And there is a valid "user" in the system And there is a valid "dd_team" in the system And there is a valid "schedule" in the system And there is a valid "escalation_policy" in the system And request contains "policy_id" parameter from "escalation_policy.data.id" + And request contains "include" parameter with value "steps.targets" When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/bugle - Scenario: Get on-call schedule returns "Not Found" response + Scenario: Get On-Call schedule returns "Not Found" response Given new "GetOnCallSchedule" request And request contains "schedule_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/bugle - Scenario: Get on-call schedule returns "OK" response + Scenario: Get On-Call schedule returns "OK" response Given new "GetOnCallSchedule" request And there is a valid "schedule" in the system And request contains "schedule_id" parameter from "schedule.data.id" @@ -116,7 +118,7 @@ Feature: On-Call Then the response status is 200 OK @generated @skip @team:DataDog/bugle - Scenario: Get on-call team routing rules returns "OK" response + Scenario: Get On-Call team routing rules returns "OK" response Given new "GetOnCallTeamRoutingRules" request And request contains "team_id" parameter from "REPLACE.ME" When the request is sent @@ -145,7 +147,7 @@ Feature: On-Call Then the response status is 200 OK @skip-python @team:DataDog/bugle - Scenario: Set on-call team routing rules returns "OK" response + Scenario: Set On-Call team routing rules returns "OK" response Given new "SetOnCallTeamRoutingRules" request And there is a valid "user" in the system And there is a valid "dd_team" in the system @@ -157,56 +159,56 @@ Feature: On-Call Then the response status is 200 OK @generated @skip @team:DataDog/bugle - Scenario: Update on-call escalation policy returns "Bad Request" response + Scenario: Update On-Call escalation policy returns "Bad Request" response Given new "UpdateOnCallEscalationPolicy" request And request contains "policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "name": "Escalation Policy 1", "resolve_page_on_policy_end": false, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "00000000-aba1-0000-0000-000000000000", "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}]}]}, "id": "a3000000-0000-0000-0000-000000000000", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "Escalation Policy 1", "resolve_page_on_policy_end": false, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "00000000-aba1-0000-0000-000000000000", "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}]}]}, "id": "a3000000-0000-0000-0000-000000000000", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/bugle - Scenario: Update on-call escalation policy returns "Not Found" response + Scenario: Update On-Call escalation policy returns "Not Found" response Given new "UpdateOnCallEscalationPolicy" request And request contains "policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "name": "Escalation Policy 1", "resolve_page_on_policy_end": false, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "00000000-aba1-0000-0000-000000000000", "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}]}]}, "id": "a3000000-0000-0000-0000-000000000000", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "Escalation Policy 1", "resolve_page_on_policy_end": false, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "00000000-aba1-0000-0000-000000000000", "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}]}]}, "id": "a3000000-0000-0000-0000-000000000000", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} When the request is sent Then the response status is 404 Not Found @team:DataDog/bugle - Scenario: Update on-call escalation policy returns "OK" response + Scenario: Update On-Call escalation policy returns "OK" response Given new "UpdateOnCallEscalationPolicy" request And there is a valid "user" in the system And there is a valid "dd_team" in the system And there is a valid "schedule" in the system And there is a valid "escalation_policy" in the system And request contains "policy_id" parameter from "escalation_policy.data.id" - And body with value {"data": {"attributes": {"description": "{{ unique }}", "name": "{{ unique }}-updated", "resolve_page_on_policy_end": false, "retries": 0, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "{{ escalation_policy.data.relationships.steps.data[0].id }}", "targets": [{"id": "{{ user.data.id }}", "type": "users"}]}]}, "id": "{{ escalation_policy.data.id }}", "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "{{ unique }}-updated", "resolve_page_on_policy_end": false, "retries": 0, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "{{ escalation_policy.data.relationships.steps.data[0].id }}", "targets": [{"id": "{{ user.data.id }}", "type": "users"}]}]}, "id": "{{ escalation_policy.data.id }}", "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/bugle - Scenario: Update on-call schedule returns "Bad Request" response + Scenario: Update On-Call schedule returns "Bad Request" response Given new "UpdateOnCallSchedule" request And request contains "schedule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 300}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "tags": ["tag1", "tag2", "tag3"], "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 300}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/bugle - Scenario: Update on-call schedule returns "Not Found" response + Scenario: Update On-Call schedule returns "Not Found" response Given new "UpdateOnCallSchedule" request And request contains "schedule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 300}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "tags": ["tag1", "tag2", "tag3"], "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 300}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 404 Not Found @team:DataDog/bugle - Scenario: Update on-call schedule returns "OK" response + Scenario: Update On-Call schedule returns "OK" response Given new "UpdateOnCallSchedule" request And there is a valid "schedule" in the system And there is a valid "user" in the system And there is a valid "dd_team" in the system And request contains "schedule_id" parameter from "schedule.data.id" - And body with value {"data": { "id": "{{ schedule.data.id }}", "attributes": {"layers": [{"id": "{{ schedule.data.relationships.layers.data[0].id }}" , "effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"seconds": 300}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "tags": ["tag1", "tag2", "tag3"], "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{dd_team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": { "id": "{{ schedule.data.id }}", "attributes": {"layers": [{"id": "{{ schedule.data.relationships.layers.data[0].id }}" , "effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"seconds": 300}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{dd_team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 200 OK