From 1d232d9f289fef73ea3d85433ebecb224b7ee13a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 4 May 2026 18:45:03 +0000 Subject: [PATCH] Regenerate client from commit 730a0f9 of spec repo --- .generator/schemas/v2/openapi.yaml | 554 ++++++++++++++---- docs/datadog_api_client.v2.model.rst | 119 +++- .../CreateBackfilledDegradation.py | 86 +++ .../CreateBackfilledMaintenance.py | 75 +++ src/datadog_api_client/configuration.py | 2 + .../v2/api/status_pages_api.py | 120 ++++ .../create_backfilled_degradation_request.py | 46 ++ ...ate_backfilled_degradation_request_data.py | 60 ++ ...led_degradation_request_data_attributes.py | 52 ++ ...n_request_data_attributes_updates_items.py | 85 +++ ...updates_items_components_affected_items.py | 68 +++ .../create_backfilled_maintenance_request.py | 46 ++ ...ate_backfilled_maintenance_request_data.py | 60 ++ ...led_maintenance_request_data_attributes.py | 52 ++ ...e_request_data_attributes_updates_items.py | 85 +++ ...updates_items_components_affected_items.py | 68 +++ ...ate_degradation_request_data_attributes.py | 14 + ...n_request_data_attributes_updates_items.py | 83 +++ ...updates_items_components_affected_items.py | 68 +++ ...ate_maintenance_request_data_attributes.py | 18 +- ...e_request_data_attributes_updates_items.py | 83 +++ ...updates_items_components_affected_items.py | 68 +++ ...st_data_attributes_updates_items_status.py | 47 ++ .../v2/model/org_group_list_response.py | 12 +- .../org_group_membership_list_response.py | 17 +- .../v2/model/org_group_pagination_links.py | 73 --- .../v2/model/org_group_pagination_meta.py | 16 +- .../model/org_group_pagination_meta_page.py | 80 +-- .../model/org_group_policy_list_response.py | 17 +- ...org_group_policy_override_list_response.py | 17 +- ...ibutes_components_affected_items_status.py | 52 ++ src/datadog_api_client/v2/models/__init__.py | 62 +- ...egradation_returns_created_response.frozen | 1 + ..._degradation_returns_created_response.yaml | 76 +++ ...aintenance_returns_created_response.frozen | 1 + ..._maintenance_returns_created_response.yaml | 61 ++ tests/v2/features/status_pages.feature | 20 + tests/v2/features/undo.json | 23 + 38 files changed, 2147 insertions(+), 340 deletions(-) create mode 100644 examples/v2/status-pages/CreateBackfilledDegradation.py create mode 100644 examples/v2/status-pages/CreateBackfilledMaintenance.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_degradation_request.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_degradation_request_data.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_maintenance_request.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py create mode 100644 src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items.py create mode 100644 src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items.py create mode 100644 src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items_components_affected_items.py create mode 100644 src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items.py create mode 100644 src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_components_affected_items.py create mode 100644 src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_status.py delete mode 100644 src/datadog_api_client/v2/model/org_group_pagination_links.py create mode 100644 src/datadog_api_client/v2/model/patch_degradation_template_request_data_attributes_components_affected_items_status.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 614a39995e..75ecce0084 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15902,6 +15902,188 @@ components: example: Postmortem-IR-123 type: string type: object + CreateBackfilledDegradationRequest: + description: Request object for creating a backfilled degradation. + example: + data: + attributes: + title: Past API Outage + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: We detected elevated error rates in the API. + started_at: "2026-04-27T13:37:31.038001628Z" + status: investigating + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: Root cause identified as a misconfigured deployment. + started_at: "2026-04-27T14:07:31.038001628Z" + status: identified + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: The issue has been resolved and API is operating normally. + started_at: "2026-04-27T14:37:31.038001628Z" + status: resolved + type: degradations + properties: + data: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestData" + type: object + CreateBackfilledDegradationRequestData: + description: The data object for creating a backfilled degradation. + properties: + attributes: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributes" + type: + $ref: "#/components/schemas/PatchDegradationRequestDataType" + required: + - type + type: object + CreateBackfilledDegradationRequestDataAttributes: + description: The supported attributes for creating a backfilled degradation. + properties: + title: + description: The title of the resource. + example: "" + type: string + updates: + description: The list of updates. + items: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributesUpdatesItems" + type: array + required: + - title + - updates + type: object + CreateBackfilledDegradationRequestDataAttributesUpdatesItems: + description: A backfilled degradation update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + required: + - started_at + type: object + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a backfilled degradation update. + properties: + id: + description: The ID of the resource. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus" + required: + - id + - status + type: object + CreateBackfilledMaintenanceRequest: + description: Request object for creating a backfilled maintenance. + example: + data: + attributes: + title: Past Database Maintenance + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: maintenance + description: Database maintenance is in progress. + started_at: "2026-04-27T13:37:31.038003786Z" + status: in_progress + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: Database maintenance has been completed successfully. + started_at: "2026-04-27T14:37:31.038003786Z" + status: completed + type: maintenances + properties: + data: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestData" + type: object + CreateBackfilledMaintenanceRequestData: + description: The data object for creating a backfilled maintenance. + properties: + attributes: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributes" + type: + $ref: "#/components/schemas/PatchMaintenanceRequestDataType" + required: + - type + type: object + CreateBackfilledMaintenanceRequestDataAttributes: + description: The supported attributes for creating a backfilled maintenance. + properties: + title: + description: The title of the resource. + example: "" + type: string + updates: + description: The list of updates. + items: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems" + type: array + required: + - title + - updates + type: object + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems: + description: A backfilled maintenance update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" + required: + - started_at + type: object + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a backfilled maintenance update. + properties: + id: + description: The ID of the resource. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus" + required: + - id + - status + type: object CreateCampaignRequest: description: Request to create a new campaign. properties: @@ -16383,6 +16565,10 @@ components: description: The title of the degradation. example: Elevated API Latency type: string + updates: + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItems" + type: array required: - components_affected - status @@ -16420,6 +16606,44 @@ components: - IDENTIFIED - MONITORING - RESOLVED + CreateDegradationRequestDataAttributesUpdatesItems: + description: A degradation update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + required: + - started_at + type: object + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a degradation update. + properties: + id: + description: The ID of the resource. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus" + required: + - id + - status + type: object CreateDeploymentGateParams: description: Parameters for creating a deployment gate. properties: @@ -16788,6 +17012,10 @@ components: description: The title of the maintenance. example: "API Maintenance" type: string + updates: + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItems" + type: array required: - components_affected - title @@ -16815,6 +17043,55 @@ components: - id - status type: object + CreateMaintenanceRequestDataAttributesUpdatesItems: + description: A maintenance update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" + required: + - started_at + type: object + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a maintenance update. + properties: + id: + description: The ID of the resource. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus" + required: + - id + - status + type: object + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus: + description: The status of a maintenance update. + enum: + - in_progress + - completed + - canceled + type: string + x-enum-varnames: + - IN_PROGRESS + - COMPLETED + - CANCELED CreateNotificationChannelAttributes: description: Attributes for creating an on-call notification channel. properties: @@ -52255,8 +52532,6 @@ components: items: $ref: "#/components/schemas/OrgGroupMembershipData" type: array - links: - $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -52374,8 +52649,6 @@ components: items: $ref: "#/components/schemas/OrgGroupMembershipData" type: array - links: - $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -52476,71 +52749,24 @@ components: required: - data type: object - OrgGroupPaginationLinks: - description: Pagination links for navigating between pages of an org group list response. - properties: - first: - description: Link to the first page. - type: string - last: - description: Link to the last page. - type: string - next: - description: Link to the next page. - nullable: true - type: string - prev: - description: Link to the previous page. - nullable: true - type: string - self: - description: Link to the current page. - type: string - type: object OrgGroupPaginationMeta: - description: Pagination metadata for org group list responses. + description: Pagination metadata. properties: page: $ref: "#/components/schemas/OrgGroupPaginationMetaPage" + required: + - page type: object OrgGroupPaginationMetaPage: - description: Page-based pagination details for org group list responses. + description: Page-based pagination details. properties: - first_number: - description: First page number. - format: int64 - type: integer - last_number: - description: Last page number. - format: int64 - nullable: true - type: integer - next_number: - description: Next page number. - format: int64 - nullable: true - type: integer - number: - description: Page number. - format: int64 - type: integer - prev_number: - description: Previous page number. - format: int64 - nullable: true - type: integer - size: - description: Page size. - format: int64 - type: integer - total: - description: Total number of results. + total_count: + description: The total number of items. + example: 42 format: int64 type: integer - type: - description: Pagination type. - example: "number_size" - type: string + required: + - total_count type: object OrgGroupPolicyAttributes: description: Attributes of an org group policy. @@ -52730,8 +52956,6 @@ components: items: $ref: "#/components/schemas/OrgGroupPolicyData" type: array - links: - $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -52845,8 +53069,6 @@ components: items: $ref: "#/components/schemas/OrgGroupPolicyOverrideData" type: array - links: - $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -53889,6 +54111,20 @@ components: type: string x-enum-varnames: - DEGRADATIONS + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus: + description: The status of a component affected by a degradation update. + enum: + - operational + - degraded + - partial_outage + - major_outage + example: operational + type: string + x-enum-varnames: + - OPERATIONAL + - DEGRADED + - PARTIAL_OUTAGE + - MAJOR_OUTAGE PatchIncidentNotificationTemplateRequest: description: Update request for a notification template. properties: @@ -112046,22 +112282,9 @@ paths: id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups type: org_group_memberships - links: - first: "https://api.datadoghq.com/api/v2/org_group_memberships?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" - last: "https://api.datadoghq.com/api/v2/org_group_memberships?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" - next: - prev: - self: "https://api.datadoghq.com/api/v2/org_group_memberships?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - first_number: 0 - last_number: 0 - next_number: - number: 0 - prev_number: - size: 50 - total: 1 - type: number_size + total_count: 1 schema: $ref: "#/components/schemas/OrgGroupMembershipListResponse" description: OK @@ -112360,22 +112583,9 @@ paths: id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups type: org_group_policies - links: - first: "https://api.datadoghq.com/api/v2/org_group_policies?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" - last: "https://api.datadoghq.com/api/v2/org_group_policies?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" - next: - prev: - self: "https://api.datadoghq.com/api/v2/org_group_policies?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - first_number: 0 - last_number: 0 - next_number: - number: 0 - prev_number: - size: 50 - total: 1 - type: number_size + total_count: 1 schema: $ref: "#/components/schemas/OrgGroupPolicyListResponse" description: OK @@ -112764,22 +112974,9 @@ paths: id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies type: org_group_policy_overrides - links: - first: "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" - last: "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" - next: - prev: - self: "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - first_number: 0 - last_number: 0 - next_number: - number: 0 - prev_number: - size: 50 - total: 1 - type: number_size + total_count: 1 schema: $ref: "#/components/schemas/OrgGroupPolicyOverrideListResponse" description: OK @@ -113118,22 +113315,9 @@ paths: owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups - links: - first: "https://api.datadoghq.com/api/v2/org_groups?page%5Bnumber%5D=0&page%5Bsize%5D=50" - last: "https://api.datadoghq.com/api/v2/org_groups?page%5Bnumber%5D=0&page%5Bsize%5D=50" - next: - prev: - self: "https://api.datadoghq.com/api/v2/org_groups?page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - first_number: 0 - last_number: 0 - next_number: - number: 0 - prev_number: - size: 50 - total: 1 - type: number_size + total_count: 1 schema: $ref: "#/components/schemas/OrgGroupListResponse" description: OK @@ -128209,6 +128393,71 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/degradations/backfill: + post: + description: Creates a new backfilled degradation with pre-defined updates. + operationId: CreateBackfilledDegradation + parameters: + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page." + in: query + name: include + schema: + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + title: Past API Outage + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: We detected elevated error rates in the API. + started_at: "2026-04-27T13:37:31Z" + status: investigating + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: The issue has been resolved. + started_at: "2026-04-27T14:37:31Z" + status: resolved + type: degradations + schema: + $ref: "#/components/schemas/CreateBackfilledDegradationRequest" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/Degradation" + description: Created + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create backfilled degradation + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write + x-unstable: |- + **Note**: This endpoint is in preview and may change in the future. /api/v2/statuspages/{page_id}/degradations/{degradation_id}: delete: description: Deletes a degradation by its ID. @@ -128425,6 +128674,71 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/maintenances/backfill: + post: + description: Creates a new backfilled maintenance with pre-defined updates. + operationId: CreateBackfilledMaintenance + parameters: + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page." + in: query + name: include + schema: + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + title: Past Database Maintenance + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: maintenance + description: Database maintenance is in progress. + started_at: "2026-04-27T13:37:31Z" + status: in_progress + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: Database maintenance has been completed. + started_at: "2026-04-27T14:37:31Z" + status: completed + type: maintenances + schema: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequest" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/Maintenance" + description: Created + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create backfilled maintenance + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write + x-unstable: |- + **Note**: This endpoint is in preview and may change in the future. /api/v2/statuspages/{page_id}/maintenances/{maintenance_id}: get: description: Retrieves a specific maintenance by its ID. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 5c291d979b..f9e7972227 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -6367,6 +6367,76 @@ datadog\_api\_client.v2.model.create\_attachment\_request\_data\_attributes\_att :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_backfilled\_degradation\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_degradation_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_degradation\_request\_data module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_degradation_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_degradation\_request\_data\_attributes module +----------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_degradation\_request\_data\_attributes\_updates\_items module +--------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_degradation\_request\_data\_attributes\_updates\_items\_components\_affected\_items module +-------------------------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_maintenance\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_maintenance_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_maintenance\_request\_data module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_maintenance_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_maintenance\_request\_data\_attributes module +----------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_maintenance\_request\_data\_attributes\_updates\_items module +--------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_backfilled\_maintenance\_request\_data\_attributes\_updates\_items\_components\_affected\_items module +-------------------------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_campaign\_request module -------------------------------------------------------------- @@ -6584,6 +6654,20 @@ datadog\_api\_client.v2.model.create\_degradation\_request\_data\_attributes\_st :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_degradation\_request\_data\_attributes\_updates\_items module +--------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_degradation\_request\_data\_attributes\_updates\_items\_components\_affected\_items module +-------------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items_components_affected_items + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_deployment\_gate\_params module --------------------------------------------------------------------- @@ -6759,6 +6843,27 @@ datadog\_api\_client.v2.model.create\_maintenance\_request\_data\_attributes\_co :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_maintenance\_request\_data\_attributes\_updates\_items module +--------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_maintenance\_request\_data\_attributes\_updates\_items\_components\_affected\_items module +-------------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_components_affected_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_maintenance\_request\_data\_attributes\_updates\_items\_status module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_notification\_channel\_attributes module ------------------------------------------------------------------------------ @@ -23027,13 +23132,6 @@ datadog\_api\_client.v2.model.org\_group\_memberships\_relationship module :members: :show-inheritance: -datadog\_api\_client.v2.model.org\_group\_pagination\_links module ------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.org_group_pagination_links - :members: - :show-inheritance: - datadog\_api\_client.v2.model.org\_group\_pagination\_meta module ----------------------------------------------------------------- @@ -23706,6 +23804,13 @@ datadog\_api\_client.v2.model.patch\_degradation\_request\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.patch\_degradation\_template\_request\_data\_attributes\_components\_affected\_items\_status module +--------------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_degradation_template_request_data_attributes_components_affected_items_status + :members: + :show-inheritance: + datadog\_api\_client.v2.model.patch\_incident\_notification\_template\_request module ------------------------------------------------------------------------------------- diff --git a/examples/v2/status-pages/CreateBackfilledDegradation.py b/examples/v2/status-pages/CreateBackfilledDegradation.py new file mode 100644 index 0000000000..2f22651a98 --- /dev/null +++ b/examples/v2/status-pages/CreateBackfilledDegradation.py @@ -0,0 +1,86 @@ +""" +Create backfilled degradation returns "Created" response +""" + +from datetime import datetime +from dateutil.relativedelta import relativedelta +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.status_pages_api import StatusPagesApi +from datadog_api_client.v2.model.create_backfilled_degradation_request import CreateBackfilledDegradationRequest +from datadog_api_client.v2.model.create_backfilled_degradation_request_data import ( + CreateBackfilledDegradationRequestData, +) +from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes import ( + CreateBackfilledDegradationRequestDataAttributes, +) +from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItems, +) +from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, +) +from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, +) +from datadog_api_client.v2.model.patch_degradation_request_data_type import PatchDegradationRequestDataType +from datadog_api_client.v2.model.patch_degradation_template_request_data_attributes_components_affected_items_status import ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, +) + +# there is a valid "status_page" in the system +STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = environ[ + "STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID" +] +STATUS_PAGE_DATA_ID = environ["STATUS_PAGE_DATA_ID"] + +body = CreateBackfilledDegradationRequest( + data=CreateBackfilledDegradationRequestData( + attributes=CreateBackfilledDegradationRequestDataAttributes( + title="Past API Outage", + updates=[ + CreateBackfilledDegradationRequestDataAttributesUpdatesItems( + components_affected=[ + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.DEGRADED, + ), + ], + description="We detected elevated error rates in the API.", + started_at=(datetime.now() + relativedelta(hours=-1)), + status=CreateDegradationRequestDataAttributesStatus.INVESTIGATING, + ), + CreateBackfilledDegradationRequestDataAttributesUpdatesItems( + components_affected=[ + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.DEGRADED, + ), + ], + description="Root cause identified as a misconfigured deployment.", + started_at=(datetime.now() + relativedelta(minutes=-30)), + status=CreateDegradationRequestDataAttributesStatus.IDENTIFIED, + ), + CreateBackfilledDegradationRequestDataAttributesUpdatesItems( + components_affected=[ + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.OPERATIONAL, + ), + ], + description="The issue has been resolved and API is operating normally.", + started_at=datetime.now(), + status=CreateDegradationRequestDataAttributesStatus.RESOLVED, + ), + ], + ), + type=PatchDegradationRequestDataType.DEGRADATIONS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatusPagesApi(api_client) + response = api_instance.create_backfilled_degradation(page_id=STATUS_PAGE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/status-pages/CreateBackfilledMaintenance.py b/examples/v2/status-pages/CreateBackfilledMaintenance.py new file mode 100644 index 0000000000..1e00ed7782 --- /dev/null +++ b/examples/v2/status-pages/CreateBackfilledMaintenance.py @@ -0,0 +1,75 @@ +""" +Create backfilled maintenance returns "Created" response +""" + +from datetime import datetime +from dateutil.relativedelta import relativedelta +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.status_pages_api import StatusPagesApi +from datadog_api_client.v2.model.create_backfilled_maintenance_request import CreateBackfilledMaintenanceRequest +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data import ( + CreateBackfilledMaintenanceRequestData, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes import ( + CreateBackfilledMaintenanceRequestDataAttributes, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, +) +from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, +) +from datadog_api_client.v2.model.patch_maintenance_request_data_attributes_components_affected_items_status import ( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, +) +from datadog_api_client.v2.model.patch_maintenance_request_data_type import PatchMaintenanceRequestDataType + +# there is a valid "status_page" in the system +STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = environ[ + "STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID" +] +STATUS_PAGE_DATA_ID = environ["STATUS_PAGE_DATA_ID"] + +body = CreateBackfilledMaintenanceRequest( + data=CreateBackfilledMaintenanceRequestData( + attributes=CreateBackfilledMaintenanceRequestDataAttributes( + title="Past Database Maintenance", + updates=[ + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems( + components_affected=[ + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus.MAINTENANCE, + ), + ], + description="Database maintenance is in progress.", + started_at=(datetime.now() + relativedelta(hours=-1)), + status=CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.IN_PROGRESS, + ), + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems( + components_affected=[ + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus.OPERATIONAL, + ), + ], + description="Database maintenance has been completed successfully.", + started_at=datetime.now(), + status=CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.COMPLETED, + ), + ], + ), + type=PatchMaintenanceRequestDataType.MAINTENANCES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatusPagesApi(api_client) + response = api_instance.create_backfilled_maintenance(page_id=STATUS_PAGE_DATA_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 6e38061ac6..6a0c556ea8 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -517,6 +517,8 @@ def __init__( "v2.list_custom_rule_revisions": False, "v2.revert_custom_rule_revision": False, "v2.update_custom_ruleset": False, + "v2.create_backfilled_degradation": False, + "v2.create_backfilled_maintenance": False, "v2.add_member_team": False, "v2.list_member_teams": False, "v2.remove_member_team": False, diff --git a/src/datadog_api_client/v2/api/status_pages_api.py b/src/datadog_api_client/v2/api/status_pages_api.py index e423e03ff4..7cfafc7c8e 100644 --- a/src/datadog_api_client/v2/api/status_pages_api.py +++ b/src/datadog_api_client/v2/api/status_pages_api.py @@ -24,9 +24,11 @@ from datadog_api_client.v2.model.patch_component_request import PatchComponentRequest from datadog_api_client.v2.model.degradation import Degradation from datadog_api_client.v2.model.create_degradation_request import CreateDegradationRequest +from datadog_api_client.v2.model.create_backfilled_degradation_request import CreateBackfilledDegradationRequest from datadog_api_client.v2.model.patch_degradation_request import PatchDegradationRequest from datadog_api_client.v2.model.maintenance import Maintenance from datadog_api_client.v2.model.create_maintenance_request import CreateMaintenanceRequest +from datadog_api_client.v2.model.create_backfilled_maintenance_request import CreateBackfilledMaintenanceRequest from datadog_api_client.v2.model.patch_maintenance_request import PatchMaintenanceRequest @@ -40,6 +42,68 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_backfilled_degradation_endpoint = _Endpoint( + settings={ + "response_type": (Degradation,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/statuspages/{page_id}/degradations/backfill", + "operation_id": "create_backfilled_degradation", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "page_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "page_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CreateBackfilledDegradationRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_backfilled_maintenance_endpoint = _Endpoint( + settings={ + "response_type": (Maintenance,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/statuspages/{page_id}/maintenances/backfill", + "operation_id": "create_backfilled_maintenance", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "page_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "page_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CreateBackfilledMaintenanceRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_component_endpoint = _Endpoint( settings={ "response_type": (StatusPagesComponent,), @@ -741,6 +805,62 @@ def __init__(self, api_client=None): api_client=api_client, ) + def create_backfilled_degradation( + self, + page_id: UUID, + body: CreateBackfilledDegradationRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> Degradation: + """Create backfilled degradation. + + Creates a new backfilled degradation with pre-defined updates. + + :param page_id: The ID of the status page. + :type page_id: UUID + :type body: CreateBackfilledDegradationRequest + :param include: Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page. + :type include: str, optional + :rtype: Degradation + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + kwargs["page_id"] = page_id + + kwargs["body"] = body + + return self._create_backfilled_degradation_endpoint.call_with_http_info(**kwargs) + + def create_backfilled_maintenance( + self, + page_id: UUID, + body: CreateBackfilledMaintenanceRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> Maintenance: + """Create backfilled maintenance. + + Creates a new backfilled maintenance with pre-defined updates. + + :param page_id: The ID of the status page. + :type page_id: UUID + :type body: CreateBackfilledMaintenanceRequest + :param include: Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page. + :type include: str, optional + :rtype: Maintenance + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + kwargs["page_id"] = page_id + + kwargs["body"] = body + + return self._create_backfilled_maintenance_endpoint.call_with_http_info(**kwargs) + def create_component( self, page_id: UUID, diff --git a/src/datadog_api_client/v2/model/create_backfilled_degradation_request.py b/src/datadog_api_client/v2/model/create_backfilled_degradation_request.py new file mode 100644 index 0000000000..360f9534be --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_degradation_request.py @@ -0,0 +1,46 @@ +# 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.create_backfilled_degradation_request_data import ( + CreateBackfilledDegradationRequestData, + ) + + +class CreateBackfilledDegradationRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_degradation_request_data import ( + CreateBackfilledDegradationRequestData, + ) + + return { + "data": (CreateBackfilledDegradationRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateBackfilledDegradationRequestData, UnsetType] = unset, **kwargs): + """ + Request object for creating a backfilled degradation. + + :param data: The data object for creating a backfilled degradation. + :type data: CreateBackfilledDegradationRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data.py b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data.py new file mode 100644 index 0000000000..392dce461c --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data.py @@ -0,0 +1,60 @@ +# 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.create_backfilled_degradation_request_data_attributes import ( + CreateBackfilledDegradationRequestDataAttributes, + ) + from datadog_api_client.v2.model.patch_degradation_request_data_type import PatchDegradationRequestDataType + + +class CreateBackfilledDegradationRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes import ( + CreateBackfilledDegradationRequestDataAttributes, + ) + from datadog_api_client.v2.model.patch_degradation_request_data_type import PatchDegradationRequestDataType + + return { + "attributes": (CreateBackfilledDegradationRequestDataAttributes,), + "type": (PatchDegradationRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: PatchDegradationRequestDataType, + attributes: Union[CreateBackfilledDegradationRequestDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The data object for creating a backfilled degradation. + + :param attributes: The supported attributes for creating a backfilled degradation. + :type attributes: CreateBackfilledDegradationRequestDataAttributes, optional + + :param type: Degradations resource type. + :type type: PatchDegradationRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes.py b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes.py new file mode 100644 index 0000000000..7a0fd14016 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes.py @@ -0,0 +1,52 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItems, + ) + + +class CreateBackfilledDegradationRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItems, + ) + + return { + "title": (str,), + "updates": ([CreateBackfilledDegradationRequestDataAttributesUpdatesItems],), + } + + attribute_map = { + "title": "title", + "updates": "updates", + } + + def __init__( + self_, title: str, updates: List[CreateBackfilledDegradationRequestDataAttributesUpdatesItems], **kwargs + ): + """ + The supported attributes for creating a backfilled degradation. + + :param title: The title of the resource. + :type title: str + + :param updates: The list of updates. + :type updates: [CreateBackfilledDegradationRequestDataAttributesUpdatesItems] + """ + super().__init__(kwargs) + + self_.title = title + self_.updates = updates diff --git a/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items.py b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items.py new file mode 100644 index 0000000000..983cfddfa1 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items.py @@ -0,0 +1,85 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + +class CreateBackfilledDegradationRequestDataAttributesUpdatesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + return { + "components_affected": ( + [CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems], + ), + "description": (str,), + "started_at": (datetime,), + "status": (CreateDegradationRequestDataAttributesStatus,), + } + + attribute_map = { + "components_affected": "components_affected", + "description": "description", + "started_at": "started_at", + "status": "status", + } + + def __init__( + self_, + started_at: datetime, + components_affected: Union[ + List[CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems], UnsetType + ] = unset, + description: Union[str, UnsetType] = unset, + status: Union[CreateDegradationRequestDataAttributesStatus, UnsetType] = unset, + **kwargs, + ): + """ + A backfilled degradation update entry. + + :param components_affected: The components affected. + :type components_affected: [CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems], optional + + :param description: A description of the update. + :type description: str, optional + + :param started_at: Timestamp of when the update occurred. + :type started_at: datetime + + :param status: The status of the degradation. + :type status: CreateDegradationRequestDataAttributesStatus, optional + """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected + if description is not unset: + kwargs["description"] = description + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) + + self_.started_at = started_at diff --git a/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items.py b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items.py new file mode 100644 index 0000000000..0cd4463715 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items.py @@ -0,0 +1,68 @@ +# 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.patch_degradation_template_request_data_attributes_components_affected_items_status import ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, + ) + + +class CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_degradation_template_request_data_attributes_components_affected_items_status import ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, + ) + + return { + "id": (str,), + "name": (str,), + "status": (PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus,), + } + + attribute_map = { + "id": "id", + "name": "name", + "status": "status", + } + read_only_vars = { + "name", + } + + def __init__( + self_, + id: str, + status: PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A component affected by a backfilled degradation update. + + :param id: The ID of the resource. + :type id: str + + :param name: The name of the component. + :type name: str, optional + + :param status: The status of a component affected by a degradation update. + :type status: PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.id = id + self_.status = status diff --git a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request.py b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request.py new file mode 100644 index 0000000000..b3f720a308 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request.py @@ -0,0 +1,46 @@ +# 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.create_backfilled_maintenance_request_data import ( + CreateBackfilledMaintenanceRequestData, + ) + + +class CreateBackfilledMaintenanceRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_maintenance_request_data import ( + CreateBackfilledMaintenanceRequestData, + ) + + return { + "data": (CreateBackfilledMaintenanceRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateBackfilledMaintenanceRequestData, UnsetType] = unset, **kwargs): + """ + Request object for creating a backfilled maintenance. + + :param data: The data object for creating a backfilled maintenance. + :type data: CreateBackfilledMaintenanceRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data.py b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data.py new file mode 100644 index 0000000000..636ca1635d --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data.py @@ -0,0 +1,60 @@ +# 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.create_backfilled_maintenance_request_data_attributes import ( + CreateBackfilledMaintenanceRequestDataAttributes, + ) + from datadog_api_client.v2.model.patch_maintenance_request_data_type import PatchMaintenanceRequestDataType + + +class CreateBackfilledMaintenanceRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes import ( + CreateBackfilledMaintenanceRequestDataAttributes, + ) + from datadog_api_client.v2.model.patch_maintenance_request_data_type import PatchMaintenanceRequestDataType + + return { + "attributes": (CreateBackfilledMaintenanceRequestDataAttributes,), + "type": (PatchMaintenanceRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: PatchMaintenanceRequestDataType, + attributes: Union[CreateBackfilledMaintenanceRequestDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The data object for creating a backfilled maintenance. + + :param attributes: The supported attributes for creating a backfilled maintenance. + :type attributes: CreateBackfilledMaintenanceRequestDataAttributes, optional + + :param type: Maintenances resource type. + :type type: PatchMaintenanceRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes.py b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes.py new file mode 100644 index 0000000000..51b581c81b --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes.py @@ -0,0 +1,52 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems, + ) + + +class CreateBackfilledMaintenanceRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems, + ) + + return { + "title": (str,), + "updates": ([CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems],), + } + + attribute_map = { + "title": "title", + "updates": "updates", + } + + def __init__( + self_, title: str, updates: List[CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems], **kwargs + ): + """ + The supported attributes for creating a backfilled maintenance. + + :param title: The title of the resource. + :type title: str + + :param updates: The list of updates. + :type updates: [CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems] + """ + super().__init__(kwargs) + + self_.title = title + self_.updates = updates diff --git a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py new file mode 100644 index 0000000000..9e732a587a --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py @@ -0,0 +1,85 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, + ) + + +class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, + ) + + return { + "components_affected": ( + [CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems], + ), + "description": (str,), + "started_at": (datetime,), + "status": (CreateMaintenanceRequestDataAttributesUpdatesItemsStatus,), + } + + attribute_map = { + "components_affected": "components_affected", + "description": "description", + "started_at": "started_at", + "status": "status", + } + + def __init__( + self_, + started_at: datetime, + components_affected: Union[ + List[CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems], UnsetType + ] = unset, + description: Union[str, UnsetType] = unset, + status: Union[CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, UnsetType] = unset, + **kwargs, + ): + """ + A backfilled maintenance update entry. + + :param components_affected: The components affected. + :type components_affected: [CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems], optional + + :param description: A description of the update. + :type description: str, optional + + :param started_at: Timestamp of when the update occurred. + :type started_at: datetime + + :param status: The status of a maintenance update. + :type status: CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, optional + """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected + if description is not unset: + kwargs["description"] = description + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) + + self_.started_at = started_at diff --git a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items.py b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items.py new file mode 100644 index 0000000000..da3ee445e5 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items.py @@ -0,0 +1,68 @@ +# 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.patch_maintenance_request_data_attributes_components_affected_items_status import ( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, + ) + + +class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_maintenance_request_data_attributes_components_affected_items_status import ( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, + ) + + return { + "id": (str,), + "name": (str,), + "status": (PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus,), + } + + attribute_map = { + "id": "id", + "name": "name", + "status": "status", + } + read_only_vars = { + "name", + } + + def __init__( + self_, + id: str, + status: PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A component affected by a backfilled maintenance update. + + :param id: The ID of the resource. + :type id: str + + :param name: The name of the component. + :type name: str, optional + + :param status: The status of the component. + :type status: PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.id = id + self_.status = status diff --git a/src/datadog_api_client/v2/model/create_degradation_request_data_attributes.py b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes.py index a1ec844a09..9a422a26ea 100644 --- a/src/datadog_api_client/v2/model/create_degradation_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes.py @@ -20,6 +20,9 @@ from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( CreateDegradationRequestDataAttributesStatus, ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items import ( + CreateDegradationRequestDataAttributesUpdatesItems, + ) class CreateDegradationRequestDataAttributes(ModelNormal): @@ -31,12 +34,16 @@ def openapi_types(_): from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( CreateDegradationRequestDataAttributesStatus, ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items import ( + CreateDegradationRequestDataAttributesUpdatesItems, + ) return { "components_affected": ([CreateDegradationRequestDataAttributesComponentsAffectedItems],), "description": (str,), "status": (CreateDegradationRequestDataAttributesStatus,), "title": (str,), + "updates": ([CreateDegradationRequestDataAttributesUpdatesItems],), } attribute_map = { @@ -44,6 +51,7 @@ def openapi_types(_): "description": "description", "status": "status", "title": "title", + "updates": "updates", } def __init__( @@ -52,6 +60,7 @@ def __init__( status: CreateDegradationRequestDataAttributesStatus, title: str, description: Union[str, UnsetType] = unset, + updates: Union[List[CreateDegradationRequestDataAttributesUpdatesItems], UnsetType] = unset, **kwargs, ): """ @@ -68,9 +77,14 @@ def __init__( :param title: The title of the degradation. :type title: str + + :param updates: + :type updates: [CreateDegradationRequestDataAttributesUpdatesItems], optional """ if description is not unset: kwargs["description"] = description + if updates is not unset: + kwargs["updates"] = updates super().__init__(kwargs) self_.components_affected = components_affected diff --git a/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items.py b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items.py new file mode 100644 index 0000000000..a9aa5fa9f3 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items.py @@ -0,0 +1,83 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + +class CreateDegradationRequestDataAttributesUpdatesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + return { + "components_affected": ([CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems],), + "description": (str,), + "started_at": (datetime,), + "status": (CreateDegradationRequestDataAttributesStatus,), + } + + attribute_map = { + "components_affected": "components_affected", + "description": "description", + "started_at": "started_at", + "status": "status", + } + + def __init__( + self_, + started_at: datetime, + components_affected: Union[ + List[CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems], UnsetType + ] = unset, + description: Union[str, UnsetType] = unset, + status: Union[CreateDegradationRequestDataAttributesStatus, UnsetType] = unset, + **kwargs, + ): + """ + A degradation update entry. + + :param components_affected: The components affected. + :type components_affected: [CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems], optional + + :param description: A description of the update. + :type description: str, optional + + :param started_at: Timestamp of when the update occurred. + :type started_at: datetime + + :param status: The status of the degradation. + :type status: CreateDegradationRequestDataAttributesStatus, optional + """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected + if description is not unset: + kwargs["description"] = description + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) + + self_.started_at = started_at diff --git a/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items_components_affected_items.py b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items_components_affected_items.py new file mode 100644 index 0000000000..04ff428ea0 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items_components_affected_items.py @@ -0,0 +1,68 @@ +# 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.patch_degradation_template_request_data_attributes_components_affected_items_status import ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, + ) + + +class CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_degradation_template_request_data_attributes_components_affected_items_status import ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, + ) + + return { + "id": (str,), + "name": (str,), + "status": (PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus,), + } + + attribute_map = { + "id": "id", + "name": "name", + "status": "status", + } + read_only_vars = { + "name", + } + + def __init__( + self_, + id: str, + status: PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A component affected by a degradation update. + + :param id: The ID of the resource. + :type id: str + + :param name: The name of the component. + :type name: str, optional + + :param status: The status of a component affected by a degradation update. + :type status: PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.id = id + self_.status = status diff --git a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py index f9c14319c3..45efcc6868 100644 --- a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py @@ -3,12 +3,14 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, datetime, + unset, + UnsetType, ) @@ -16,6 +18,9 @@ from datadog_api_client.v2.model.create_maintenance_request_data_attributes_components_affected_items import ( CreateMaintenanceRequestDataAttributesComponentsAffectedItems, ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items import ( + CreateMaintenanceRequestDataAttributesUpdatesItems, + ) class CreateMaintenanceRequestDataAttributes(ModelNormal): @@ -24,6 +29,9 @@ def openapi_types(_): from datadog_api_client.v2.model.create_maintenance_request_data_attributes_components_affected_items import ( CreateMaintenanceRequestDataAttributesComponentsAffectedItems, ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items import ( + CreateMaintenanceRequestDataAttributesUpdatesItems, + ) return { "completed_date": (datetime,), @@ -33,6 +41,7 @@ def openapi_types(_): "scheduled_description": (str,), "start_date": (datetime,), "title": (str,), + "updates": ([CreateMaintenanceRequestDataAttributesUpdatesItems],), } attribute_map = { @@ -43,6 +52,7 @@ def openapi_types(_): "scheduled_description": "scheduled_description", "start_date": "start_date", "title": "title", + "updates": "updates", } def __init__( @@ -54,6 +64,7 @@ def __init__( scheduled_description: str, start_date: datetime, title: str, + updates: Union[List[CreateMaintenanceRequestDataAttributesUpdatesItems], UnsetType] = unset, **kwargs, ): """ @@ -79,7 +90,12 @@ def __init__( :param title: The title of the maintenance. :type title: str + + :param updates: + :type updates: [CreateMaintenanceRequestDataAttributesUpdatesItems], optional """ + if updates is not unset: + kwargs["updates"] = updates super().__init__(kwargs) self_.completed_date = completed_date diff --git a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items.py b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items.py new file mode 100644 index 0000000000..1463deec5f --- /dev/null +++ b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items.py @@ -0,0 +1,83 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, + ) + + +class CreateMaintenanceRequestDataAttributesUpdatesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, + ) + + return { + "components_affected": ([CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems],), + "description": (str,), + "started_at": (datetime,), + "status": (CreateMaintenanceRequestDataAttributesUpdatesItemsStatus,), + } + + attribute_map = { + "components_affected": "components_affected", + "description": "description", + "started_at": "started_at", + "status": "status", + } + + def __init__( + self_, + started_at: datetime, + components_affected: Union[ + List[CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems], UnsetType + ] = unset, + description: Union[str, UnsetType] = unset, + status: Union[CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, UnsetType] = unset, + **kwargs, + ): + """ + A maintenance update entry. + + :param components_affected: The components affected. + :type components_affected: [CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems], optional + + :param description: A description of the update. + :type description: str, optional + + :param started_at: Timestamp of when the update occurred. + :type started_at: datetime + + :param status: The status of a maintenance update. + :type status: CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, optional + """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected + if description is not unset: + kwargs["description"] = description + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) + + self_.started_at = started_at diff --git a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_components_affected_items.py b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_components_affected_items.py new file mode 100644 index 0000000000..0a649491b6 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_components_affected_items.py @@ -0,0 +1,68 @@ +# 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.patch_maintenance_request_data_attributes_components_affected_items_status import ( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, + ) + + +class CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_maintenance_request_data_attributes_components_affected_items_status import ( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, + ) + + return { + "id": (str,), + "name": (str,), + "status": (PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus,), + } + + attribute_map = { + "id": "id", + "name": "name", + "status": "status", + } + read_only_vars = { + "name", + } + + def __init__( + self_, + id: str, + status: PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A component affected by a maintenance update. + + :param id: The ID of the resource. + :type id: str + + :param name: The name of the component. + :type name: str, optional + + :param status: The status of the component. + :type status: PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.id = id + self_.status = status diff --git a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_status.py b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_status.py new file mode 100644 index 0000000000..87534b56ac --- /dev/null +++ b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes_updates_items_status.py @@ -0,0 +1,47 @@ +# 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 CreateMaintenanceRequestDataAttributesUpdatesItemsStatus(ModelSimple): + """ + The status of a maintenance update. + + :param value: Must be one of ["in_progress", "completed", "canceled"]. + :type value: str + """ + + allowed_values = { + "in_progress", + "completed", + "canceled", + } + IN_PROGRESS: ClassVar["CreateMaintenanceRequestDataAttributesUpdatesItemsStatus"] + COMPLETED: ClassVar["CreateMaintenanceRequestDataAttributesUpdatesItemsStatus"] + CANCELED: ClassVar["CreateMaintenanceRequestDataAttributesUpdatesItemsStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.IN_PROGRESS = ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus("in_progress") +) +CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.COMPLETED = ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus("completed") +) +CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.CANCELED = ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus("canceled") +) diff --git a/src/datadog_api_client/v2/model/org_group_list_response.py b/src/datadog_api_client/v2/model/org_group_list_response.py index 4459581568..2788f986b2 100644 --- a/src/datadog_api_client/v2/model/org_group_list_response.py +++ b/src/datadog_api_client/v2/model/org_group_list_response.py @@ -16,7 +16,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.org_group_data import OrgGroupData from datadog_api_client.v2.model.org_group_membership_data import OrgGroupMembershipData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta @@ -25,20 +24,17 @@ class OrgGroupListResponse(ModelNormal): def openapi_types(_): from datadog_api_client.v2.model.org_group_data import OrgGroupData from datadog_api_client.v2.model.org_group_membership_data import OrgGroupMembershipData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta return { "data": ([OrgGroupData],), "included": ([OrgGroupMembershipData],), - "links": (OrgGroupPaginationLinks,), "meta": (OrgGroupPaginationMeta,), } attribute_map = { "data": "data", "included": "included", - "links": "links", "meta": "meta", } @@ -46,7 +42,6 @@ def __init__( self_, data: List[OrgGroupData], included: Union[List[OrgGroupMembershipData], UnsetType] = unset, - links: Union[OrgGroupPaginationLinks, UnsetType] = unset, meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, **kwargs, ): @@ -59,16 +54,11 @@ def __init__( :param included: Related resources included in the response when requested with the ``include`` parameter. :type included: [OrgGroupMembershipData], optional - :param links: Pagination links for navigating between pages of an org group list response. - :type links: OrgGroupPaginationLinks, optional - - :param meta: Pagination metadata for org group list responses. + :param meta: Pagination metadata. :type meta: OrgGroupPaginationMeta, optional """ if included is not unset: kwargs["included"] = included - if links is not unset: - kwargs["links"] = links if meta is not unset: kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_group_membership_list_response.py b/src/datadog_api_client/v2/model/org_group_membership_list_response.py index 00146fc08b..3579abda02 100644 --- a/src/datadog_api_client/v2/model/org_group_membership_list_response.py +++ b/src/datadog_api_client/v2/model/org_group_membership_list_response.py @@ -15,7 +15,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.org_group_membership_data import OrgGroupMembershipData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta @@ -23,27 +22,20 @@ class OrgGroupMembershipListResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.org_group_membership_data import OrgGroupMembershipData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta return { "data": ([OrgGroupMembershipData],), - "links": (OrgGroupPaginationLinks,), "meta": (OrgGroupPaginationMeta,), } attribute_map = { "data": "data", - "links": "links", "meta": "meta", } def __init__( - self_, - data: List[OrgGroupMembershipData], - links: Union[OrgGroupPaginationLinks, UnsetType] = unset, - meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, - **kwargs, + self_, data: List[OrgGroupMembershipData], meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, **kwargs ): """ Response containing a list of org group memberships. @@ -51,14 +43,9 @@ def __init__( :param data: An array of org group memberships. :type data: [OrgGroupMembershipData] - :param links: Pagination links for navigating between pages of an org group list response. - :type links: OrgGroupPaginationLinks, optional - - :param meta: Pagination metadata for org group list responses. + :param meta: Pagination metadata. :type meta: OrgGroupPaginationMeta, optional """ - if links is not unset: - kwargs["links"] = links if meta is not unset: kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_group_pagination_links.py b/src/datadog_api_client/v2/model/org_group_pagination_links.py deleted file mode 100644 index 2ac7dcaedf..0000000000 --- a/src/datadog_api_client/v2/model/org_group_pagination_links.py +++ /dev/null @@ -1,73 +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 - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - none_type, - unset, - UnsetType, -) - - -class OrgGroupPaginationLinks(ModelNormal): - @cached_property - def openapi_types(_): - return { - "first": (str,), - "last": (str,), - "next": (str, none_type), - "prev": (str, none_type), - "self": (str,), - } - - attribute_map = { - "first": "first", - "last": "last", - "next": "next", - "prev": "prev", - "self": "self", - } - - def __init__( - self_, - first: Union[str, UnsetType] = unset, - last: Union[str, UnsetType] = unset, - next: Union[str, none_type, UnsetType] = unset, - prev: Union[str, none_type, UnsetType] = unset, - self: Union[str, UnsetType] = unset, - **kwargs, - ): - """ - Pagination links for navigating between pages of an org group list response. - - :param first: Link to the first page. - :type first: str, optional - - :param last: Link to the last page. - :type last: str, optional - - :param next: Link to the next page. - :type next: str, none_type, optional - - :param prev: Link to the previous page. - :type prev: str, none_type, optional - - :param self: Link to the current page. - :type self: str, optional - """ - if first is not unset: - kwargs["first"] = first - if last is not unset: - kwargs["last"] = last - if next is not unset: - kwargs["next"] = next - if prev is not unset: - kwargs["prev"] = prev - if self is not unset: - kwargs["self"] = self - super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_group_pagination_meta.py b/src/datadog_api_client/v2/model/org_group_pagination_meta.py index d25d16f706..ac1c11cdcb 100644 --- a/src/datadog_api_client/v2/model/org_group_pagination_meta.py +++ b/src/datadog_api_client/v2/model/org_group_pagination_meta.py @@ -3,13 +3,11 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union, TYPE_CHECKING +from typing import TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, - unset, - UnsetType, ) @@ -30,13 +28,13 @@ def openapi_types(_): "page": "page", } - def __init__(self_, page: Union[OrgGroupPaginationMetaPage, UnsetType] = unset, **kwargs): + def __init__(self_, page: OrgGroupPaginationMetaPage, **kwargs): """ - Pagination metadata for org group list responses. + Pagination metadata. - :param page: Page-based pagination details for org group list responses. - :type page: OrgGroupPaginationMetaPage, optional + :param page: Page-based pagination details. + :type page: OrgGroupPaginationMetaPage """ - if page is not unset: - kwargs["page"] = page super().__init__(kwargs) + + self_.page = page diff --git a/src/datadog_api_client/v2/model/org_group_pagination_meta_page.py b/src/datadog_api_client/v2/model/org_group_pagination_meta_page.py index 107929d57b..b175b08295 100644 --- a/src/datadog_api_client/v2/model/org_group_pagination_meta_page.py +++ b/src/datadog_api_client/v2/model/org_group_pagination_meta_page.py @@ -3,14 +3,10 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union from datadog_api_client.model_utils import ( ModelNormal, cached_property, - none_type, - unset, - UnsetType, ) @@ -18,80 +14,20 @@ class OrgGroupPaginationMetaPage(ModelNormal): @cached_property def openapi_types(_): return { - "first_number": (int,), - "last_number": (int, none_type), - "next_number": (int, none_type), - "number": (int,), - "prev_number": (int, none_type), - "size": (int,), - "total": (int,), - "type": (str,), + "total_count": (int,), } attribute_map = { - "first_number": "first_number", - "last_number": "last_number", - "next_number": "next_number", - "number": "number", - "prev_number": "prev_number", - "size": "size", - "total": "total", - "type": "type", + "total_count": "total_count", } - def __init__( - self_, - first_number: Union[int, UnsetType] = unset, - last_number: Union[int, none_type, UnsetType] = unset, - next_number: Union[int, none_type, UnsetType] = unset, - number: Union[int, UnsetType] = unset, - prev_number: Union[int, none_type, UnsetType] = unset, - size: Union[int, UnsetType] = unset, - total: Union[int, UnsetType] = unset, - type: Union[str, UnsetType] = unset, - **kwargs, - ): + def __init__(self_, total_count: int, **kwargs): """ - Page-based pagination details for org group list responses. + Page-based pagination details. - :param first_number: First page number. - :type first_number: int, optional - - :param last_number: Last page number. - :type last_number: int, none_type, optional - - :param next_number: Next page number. - :type next_number: int, none_type, optional - - :param number: Page number. - :type number: int, optional - - :param prev_number: Previous page number. - :type prev_number: int, none_type, optional - - :param size: Page size. - :type size: int, optional - - :param total: Total number of results. - :type total: int, optional - - :param type: Pagination type. - :type type: str, optional + :param total_count: The total number of items. + :type total_count: int """ - if first_number is not unset: - kwargs["first_number"] = first_number - if last_number is not unset: - kwargs["last_number"] = last_number - if next_number is not unset: - kwargs["next_number"] = next_number - if number is not unset: - kwargs["number"] = number - if prev_number is not unset: - kwargs["prev_number"] = prev_number - if size is not unset: - kwargs["size"] = size - if total is not unset: - kwargs["total"] = total - if type is not unset: - kwargs["type"] = type super().__init__(kwargs) + + self_.total_count = total_count diff --git a/src/datadog_api_client/v2/model/org_group_policy_list_response.py b/src/datadog_api_client/v2/model/org_group_policy_list_response.py index 75f9f7aa4f..0a16ebf49d 100644 --- a/src/datadog_api_client/v2/model/org_group_policy_list_response.py +++ b/src/datadog_api_client/v2/model/org_group_policy_list_response.py @@ -15,7 +15,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.org_group_policy_data import OrgGroupPolicyData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta @@ -23,27 +22,20 @@ class OrgGroupPolicyListResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.org_group_policy_data import OrgGroupPolicyData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta return { "data": ([OrgGroupPolicyData],), - "links": (OrgGroupPaginationLinks,), "meta": (OrgGroupPaginationMeta,), } attribute_map = { "data": "data", - "links": "links", "meta": "meta", } def __init__( - self_, - data: List[OrgGroupPolicyData], - links: Union[OrgGroupPaginationLinks, UnsetType] = unset, - meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, - **kwargs, + self_, data: List[OrgGroupPolicyData], meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, **kwargs ): """ Response containing a list of org group policies. @@ -51,14 +43,9 @@ def __init__( :param data: An array of org group policies. :type data: [OrgGroupPolicyData] - :param links: Pagination links for navigating between pages of an org group list response. - :type links: OrgGroupPaginationLinks, optional - - :param meta: Pagination metadata for org group list responses. + :param meta: Pagination metadata. :type meta: OrgGroupPaginationMeta, optional """ - if links is not unset: - kwargs["links"] = links if meta is not unset: kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_group_policy_override_list_response.py b/src/datadog_api_client/v2/model/org_group_policy_override_list_response.py index 781bf47693..7e07d086eb 100644 --- a/src/datadog_api_client/v2/model/org_group_policy_override_list_response.py +++ b/src/datadog_api_client/v2/model/org_group_policy_override_list_response.py @@ -15,7 +15,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.org_group_policy_override_data import OrgGroupPolicyOverrideData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta @@ -23,27 +22,20 @@ class OrgGroupPolicyOverrideListResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.org_group_policy_override_data import OrgGroupPolicyOverrideData - from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta return { "data": ([OrgGroupPolicyOverrideData],), - "links": (OrgGroupPaginationLinks,), "meta": (OrgGroupPaginationMeta,), } attribute_map = { "data": "data", - "links": "links", "meta": "meta", } def __init__( - self_, - data: List[OrgGroupPolicyOverrideData], - links: Union[OrgGroupPaginationLinks, UnsetType] = unset, - meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, - **kwargs, + self_, data: List[OrgGroupPolicyOverrideData], meta: Union[OrgGroupPaginationMeta, UnsetType] = unset, **kwargs ): """ Response containing a list of org group policy overrides. @@ -51,14 +43,9 @@ def __init__( :param data: An array of org group policy overrides. :type data: [OrgGroupPolicyOverrideData] - :param links: Pagination links for navigating between pages of an org group list response. - :type links: OrgGroupPaginationLinks, optional - - :param meta: Pagination metadata for org group list responses. + :param meta: Pagination metadata. :type meta: OrgGroupPaginationMeta, optional """ - if links is not unset: - kwargs["links"] = links if meta is not unset: kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_degradation_template_request_data_attributes_components_affected_items_status.py b/src/datadog_api_client/v2/model/patch_degradation_template_request_data_attributes_components_affected_items_status.py new file mode 100644 index 0000000000..7c583fb688 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_degradation_template_request_data_attributes_components_affected_items_status.py @@ -0,0 +1,52 @@ +# 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 PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus(ModelSimple): + """ + The status of a component affected by a degradation update. + + :param value: Must be one of ["operational", "degraded", "partial_outage", "major_outage"]. + :type value: str + """ + + allowed_values = { + "operational", + "degraded", + "partial_outage", + "major_outage", + } + OPERATIONAL: ClassVar["PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus"] + DEGRADED: ClassVar["PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus"] + PARTIAL_OUTAGE: ClassVar["PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus"] + MAJOR_OUTAGE: ClassVar["PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.OPERATIONAL = ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus("operational") +) +PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.DEGRADED = ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus("degraded") +) +PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.PARTIAL_OUTAGE = ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus("partial_outage") +) +PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus.MAJOR_OUTAGE = ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus("major_outage") +) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e3055977a2..b6f65194b5 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1196,6 +1196,32 @@ from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import ( CreateAttachmentRequestDataAttributesAttachment, ) +from datadog_api_client.v2.model.create_backfilled_degradation_request import CreateBackfilledDegradationRequest +from datadog_api_client.v2.model.create_backfilled_degradation_request_data import ( + CreateBackfilledDegradationRequestData, +) +from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes import ( + CreateBackfilledDegradationRequestDataAttributes, +) +from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItems, +) +from datadog_api_client.v2.model.create_backfilled_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request import CreateBackfilledMaintenanceRequest +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data import ( + CreateBackfilledMaintenanceRequestData, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes import ( + CreateBackfilledMaintenanceRequestDataAttributes, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems, +) +from datadog_api_client.v2.model.create_backfilled_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, +) from datadog_api_client.v2.model.create_campaign_request import CreateCampaignRequest from datadog_api_client.v2.model.create_campaign_request_attributes import CreateCampaignRequestAttributes from datadog_api_client.v2.model.create_campaign_request_data import CreateCampaignRequestData @@ -1249,6 +1275,12 @@ from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( CreateDegradationRequestDataAttributesStatus, ) +from datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items import ( + CreateDegradationRequestDataAttributesUpdatesItems, +) +from datadog_api_client.v2.model.create_degradation_request_data_attributes_updates_items_components_affected_items import ( + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, +) from datadog_api_client.v2.model.create_deployment_gate_params import CreateDeploymentGateParams from datadog_api_client.v2.model.create_deployment_gate_params_data import CreateDeploymentGateParamsData from datadog_api_client.v2.model.create_deployment_gate_params_data_attributes import ( @@ -1286,6 +1318,15 @@ from datadog_api_client.v2.model.create_maintenance_request_data_attributes_components_affected_items import ( CreateMaintenanceRequestDataAttributesComponentsAffectedItems, ) +from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items import ( + CreateMaintenanceRequestDataAttributesUpdatesItems, +) +from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_components_affected_items import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, +) +from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, +) from datadog_api_client.v2.model.create_notification_channel_attributes import CreateNotificationChannelAttributes from datadog_api_client.v2.model.create_notification_channel_config import CreateNotificationChannelConfig from datadog_api_client.v2.model.create_notification_channel_data import CreateNotificationChannelData @@ -4745,7 +4786,6 @@ from datadog_api_client.v2.model.org_group_membership_update_relationships import OrgGroupMembershipUpdateRelationships from datadog_api_client.v2.model.org_group_membership_update_request import OrgGroupMembershipUpdateRequest from datadog_api_client.v2.model.org_group_memberships_relationship import OrgGroupMembershipsRelationship -from datadog_api_client.v2.model.org_group_pagination_links import OrgGroupPaginationLinks from datadog_api_client.v2.model.org_group_pagination_meta import OrgGroupPaginationMeta from datadog_api_client.v2.model.org_group_pagination_meta_page import OrgGroupPaginationMetaPage from datadog_api_client.v2.model.org_group_policy_attributes import OrgGroupPolicyAttributes @@ -4856,6 +4896,9 @@ PatchDegradationRequestDataAttributesStatus, ) from datadog_api_client.v2.model.patch_degradation_request_data_type import PatchDegradationRequestDataType +from datadog_api_client.v2.model.patch_degradation_template_request_data_attributes_components_affected_items_status import ( + PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus, +) from datadog_api_client.v2.model.patch_incident_notification_template_request import ( PatchIncidentNotificationTemplateRequest, ) @@ -8396,6 +8439,16 @@ "CreateAttachmentRequestData", "CreateAttachmentRequestDataAttributes", "CreateAttachmentRequestDataAttributesAttachment", + "CreateBackfilledDegradationRequest", + "CreateBackfilledDegradationRequestData", + "CreateBackfilledDegradationRequestDataAttributes", + "CreateBackfilledDegradationRequestDataAttributesUpdatesItems", + "CreateBackfilledDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems", + "CreateBackfilledMaintenanceRequest", + "CreateBackfilledMaintenanceRequestData", + "CreateBackfilledMaintenanceRequestDataAttributes", + "CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems", + "CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems", "CreateCampaignRequest", "CreateCampaignRequestAttributes", "CreateCampaignRequestData", @@ -8427,6 +8480,8 @@ "CreateDegradationRequestDataAttributes", "CreateDegradationRequestDataAttributesComponentsAffectedItems", "CreateDegradationRequestDataAttributesStatus", + "CreateDegradationRequestDataAttributesUpdatesItems", + "CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems", "CreateDeploymentGateParams", "CreateDeploymentGateParamsData", "CreateDeploymentGateParamsDataAttributes", @@ -8452,6 +8507,9 @@ "CreateMaintenanceRequestData", "CreateMaintenanceRequestDataAttributes", "CreateMaintenanceRequestDataAttributesComponentsAffectedItems", + "CreateMaintenanceRequestDataAttributesUpdatesItems", + "CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems", + "CreateMaintenanceRequestDataAttributesUpdatesItemsStatus", "CreateNotificationChannelAttributes", "CreateNotificationChannelConfig", "CreateNotificationChannelData", @@ -10777,7 +10835,6 @@ "OrgGroupMembershipUpdateRelationships", "OrgGroupMembershipUpdateRequest", "OrgGroupMembershipsRelationship", - "OrgGroupPaginationLinks", "OrgGroupPaginationMeta", "OrgGroupPaginationMetaPage", "OrgGroupPolicyAttributes", @@ -10874,6 +10931,7 @@ "PatchDegradationRequestDataAttributesComponentsAffectedItems", "PatchDegradationRequestDataAttributesStatus", "PatchDegradationRequestDataType", + "PatchDegradationTemplateRequestDataAttributesComponentsAffectedItemsStatus", "PatchIncidentNotificationTemplateRequest", "PatchMaintenanceRequest", "PatchMaintenanceRequestData", diff --git a/tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.frozen new file mode 100644 index 0000000000..29a31337fe --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.frozen @@ -0,0 +1 @@ +2026-05-04T14:30:13.862Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.yaml new file mode 100644 index 0000000000..a64d6036ec --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_backfilled_degradation_returns_created_response.yaml @@ -0,0 +1,76 @@ +interactions: +- request: + body: '{"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"2aea4cad6466d9b2","name":"A + Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages + response: + body: + string: '{"data":{"id":"a8c9f5bc-864f-4984-8420-736468d76baf","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"5f67ec78-bc7f-4930-91ae-b29b64e4440e","name":"Application","type":"group","position":0,"components":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","type":"component","status":"operational","position":0},{"id":"6eba0779-8989-43e2-994d-56d244a4ffac","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-05-04T14:30:15.791383Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"2aea4cad6466d9b2","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-05-04T14:30:15.791383Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/a8c9f5bc-864f-4984-8420-736468d76baf/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"title":"Past API Outage","updates":[{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","status":"degraded"}],"description":"We + detected elevated error rates in the API.","started_at":"2026-05-04T13:30:13.862Z","status":"investigating"},{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","status":"degraded"}],"description":"Root + cause identified as a misconfigured deployment.","started_at":"2026-05-04T14:00:13.862Z","status":"identified"},{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","status":"operational"}],"description":"The + issue has been resolved and API is operating normally.","started_at":"2026-05-04T14:30:13.862Z","status":"resolved"}]},"type":"degradations"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf/degradations/backfill + response: + body: + string: '{"data":{"id":"6d4e1a6f-df56-4178-88c3-f950b9da3f95","type":"degradations","attributes":{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"operational"}],"created_at":"2026-05-04T13:30:13.862Z","description":"The + issue has been resolved and API is operating normally.","modified_at":"2026-05-04T14:30:16.509023Z","status":"resolved","title":"Past + API Outage","updates":[{"id":"7acc1fa8-556f-4fa8-978a-58f5c19bcc6d","created_at":"2026-05-04T14:30:16.509023Z","modified_at":"2026-05-04T14:30:16.509023Z","started_at":"2026-05-04T13:30:13.862Z","status":"investigating","description":"We + detected elevated error rates in the API.","components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"degraded"}]},{"id":"e927896e-cd9e-4c1a-bf41-427ce44e8372","created_at":"2026-05-04T14:30:16.509023Z","modified_at":"2026-05-04T14:30:16.509023Z","started_at":"2026-05-04T14:00:13.862Z","status":"identified","description":"Root + cause identified as a misconfigured deployment.","components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"degraded"}]},{"id":"82326cfc-b8f7-4276-bde4-d023d5958541","created_at":"2026-05-04T14:30:16.509023Z","modified_at":"2026-05-04T14:30:16.509023Z","started_at":"2026-05-04T14:30:13.862Z","status":"resolved","description":"The + issue has been resolved and API is operating normally.","components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"operational"}]}]},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"status_page":{"data":{"id":"a8c9f5bc-864f-4984-8420-736468d76baf","type":"status_pages"}}}}}' + 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/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf/degradations/6d4e1a6f-df56-4178-88c3-f950b9da3f95 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.frozen new file mode 100644 index 0000000000..ddbc04f32e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.frozen @@ -0,0 +1 @@ +2026-05-04T14:30:17.282Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.yaml new file mode 100644 index 0000000000..12549347d1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_backfilled_maintenance_returns_created_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"29b08dd63fb635d7","name":"A + Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages + response: + body: + string: '{"data":{"id":"bbf96c2c-48cf-4951-96d2-f5b503c93c49","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"b7d32c93-3ab3-4d77-af3b-541a45eb3553","name":"Application","type":"group","position":0,"components":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","type":"component","status":"operational","position":0},{"id":"b99b72d3-4df4-4242-82d9-ebb96c301c8d","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-05-04T14:30:17.408759Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"29b08dd63fb635d7","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-05-04T14:30:17.408759Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/bbf96c2c-48cf-4951-96d2-f5b503c93c49/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"title":"Past Database Maintenance","updates":[{"components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","status":"maintenance"}],"description":"Database + maintenance is in progress.","started_at":"2026-05-04T13:30:17.282Z","status":"in_progress"},{"components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","status":"operational"}],"description":"Database + maintenance has been completed successfully.","started_at":"2026-05-04T14:30:17.282Z","status":"completed"}]},"type":"maintenances"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages/bbf96c2c-48cf-4951-96d2-f5b503c93c49/maintenances/backfill + response: + body: + string: '{"data":{"id":"1f1ccbc5-14dd-45e2-9e81-b767b4d342f0","type":"maintenances","attributes":{"completed_date":"2026-05-04T14:30:17.282Z","completed_description":"Database + maintenance has been completed successfully.","components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","status":"operational"}],"in_progress_description":"Database + maintenance is in progress.","modified_at":"2026-05-04T14:30:17.979727Z","published_date":"2026-05-04T13:30:17.282Z","scheduled_description":"","start_date":"2026-05-04T13:30:17.282Z","status":"completed","title":"Past + Database Maintenance","updates":[{"id":"56f63654-5c40-4eed-8af0-dd53a7bb251c","created_at":"2026-05-04T14:30:17.979727Z","modified_at":"2026-05-04T14:30:17.979727Z","started_at":"2026-05-04T13:30:17.282Z","manual_transition":false,"status":"in_progress","description":"Database + maintenance is in progress.","components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","status":"maintenance"}]},{"id":"7e2dd268-c76e-4186-9a2c-b7ca7039485b","created_at":"2026-05-04T14:30:17.979727Z","modified_at":"2026-05-04T14:30:17.979727Z","started_at":"2026-05-04T14:30:17.282Z","manual_transition":false,"status":"completed","description":"Database + maintenance has been completed successfully.","components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","status":"operational"}]}]},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"status_page":{"data":{"id":"bbf96c2c-48cf-4951-96d2-f5b503c93c49","type":"status_pages"}}}}}' + 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/statuspages/bbf96c2c-48cf-4951-96d2-f5b503c93c49 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/status_pages.feature b/tests/v2/features/status_pages.feature index 2a4cb273a6..4e671f186d 100644 --- a/tests/v2/features/status_pages.feature +++ b/tests/v2/features/status_pages.feature @@ -10,6 +10,26 @@ Feature: Status Pages And a valid "appKeyAuth" key in the system And an instance of "StatusPages" API + @team:DataDog/incident-app + Scenario: Create backfilled degradation returns "Created" response + Given there is a valid "status_page" in the system + And new "CreateBackfilledDegradation" request + And request contains "page_id" parameter from "status_page.data.id" + And body with value {"data": {"attributes": {"title": "Past API Outage", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "We detected elevated error rates in the API.", "started_at": "{{ timeISO('now - 1h') }}", "status": "investigating"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "Root cause identified as a misconfigured deployment.", "started_at": "{{ timeISO('now - 30m') }}", "status": "identified"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "The issue has been resolved and API is operating normally.", "started_at": "{{ timeISO('now') }}", "status": "resolved"}]}, "type": "degradations"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.title" is equal to "Past API Outage" + + @team:DataDog/incident-app + Scenario: Create backfilled maintenance returns "Created" response + Given there is a valid "status_page" in the system + And new "CreateBackfilledMaintenance" request + And request contains "page_id" parameter from "status_page.data.id" + And body with value {"data": {"attributes": {"title": "Past Database Maintenance", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "maintenance"}], "description": "Database maintenance is in progress.", "started_at": "{{ timeISO('now - 1h') }}", "status": "in_progress"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "Database maintenance has been completed successfully.", "started_at": "{{ timeISO('now') }}", "status": "completed"}]}, "type": "maintenances"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.title" is equal to "Past Database Maintenance" + @team:DataDog/incident-app Scenario: Create component returns "Created" response Given there is a valid "status_page" in the system diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 21d7896f03..4fc30a1e65 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6380,6 +6380,23 @@ "type": "unsafe" } }, + "CreateBackfilledDegradation": { + "tag": "Status Pages", + "undo": { + "operationId": "DeleteDegradation", + "parameters": [ + { + "name": "page_id", + "source": "data.relationships.status_page.data.id" + }, + { + "name": "degradation_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, "DeleteDegradation": { "tag": "Status Pages", "undo": { @@ -6404,6 +6421,12 @@ "type": "safe" } }, + "CreateBackfilledMaintenance": { + "tag": "Status Pages", + "undo": { + "type": "safe" + } + }, "GetMaintenance": { "tag": "Status Pages", "undo": {