diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 620108cc5b..4ac4cbb66f 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -791,11 +791,6 @@ components: items: $ref: "#/components/schemas/ResourceProviderConfig" type: array - secretless_auth_enabled: - description: |- - (Preview) When enabled, Datadog authenticates with this app registration using federated workload identity credentials instead of a client secret. - example: true - type: boolean tenant_name: description: Your Azure Active Directory ID. example: "testc44-1234-5678-9101-cc00736ftest" diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 95a832b986..616703c246 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15902,6 +15902,154 @@ 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 backfilled degradation. + 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/CreateDegradationRequestDataAttributesComponentsAffectedItems" + 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 + 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 backfilled maintenance. + 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/CreateMaintenanceRequestDataAttributesComponentsAffectedItems" + 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 CreateCampaignRequest: description: Request to create a new campaign. properties: @@ -16383,6 +16531,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 +16572,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 component. Must be a component of type `component`. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus" + required: + - id + - status + type: object CreateDeploymentGateParams: description: Parameters for creating a deployment gate. properties: @@ -16788,6 +16978,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 +17009,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 component. Must be a component of type `component`. + 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: @@ -128262,6 +128505,69 @@ 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 /api/v2/statuspages/{page_id}/degradations/{degradation_id}: delete: description: Deletes a degradation by its ID. @@ -128478,6 +128784,69 @@ 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 /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..b76b13be66 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -6367,6 +6367,62 @@ 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\_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\_campaign\_request module -------------------------------------------------------------- @@ -6584,6 +6640,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 +6829,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 ------------------------------------------------------------------------------ diff --git a/examples/v1/azure-integration/UpdateAzureHostFilters.py b/examples/v1/azure-integration/UpdateAzureHostFilters.py index 10479b0877..ddb277349b 100644 --- a/examples/v1/azure-integration/UpdateAzureHostFilters.py +++ b/examples/v1/azure-integration/UpdateAzureHostFilters.py @@ -30,7 +30,6 @@ namespace="Microsoft.Compute", ), ], - secretless_auth_enabled=True, tenant_name="testc44-1234-5678-9101-cc00736ftest", usage_metrics_enabled=True, ) diff --git a/examples/v1/azure-integration/UpdateAzureIntegration.py b/examples/v1/azure-integration/UpdateAzureIntegration.py index a83eaca8fd..548a15dac6 100644 --- a/examples/v1/azure-integration/UpdateAzureIntegration.py +++ b/examples/v1/azure-integration/UpdateAzureIntegration.py @@ -21,7 +21,6 @@ new_client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", new_tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", resource_collection_enabled=True, - secretless_auth_enabled=True, tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", ) diff --git a/examples/v2/status-pages/CreateBackfilledDegradation.py b/examples/v2/status-pages/CreateBackfilledDegradation.py new file mode 100644 index 0000000000..e8dc171e41 --- /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_degradation_request_data_attributes_components_affected_items import ( + CreateDegradationRequestDataAttributesComponentsAffectedItems, +) +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.status_pages_component_data_attributes_status import ( + StatusPagesComponentDataAttributesStatus, +) + +# 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=[ + CreateDegradationRequestDataAttributesComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=StatusPagesComponentDataAttributesStatus.DEGRADED, + ), + ], + description="We detected elevated error rates in the API.", + started_at=(datetime.now() + relativedelta(hours=-1)), + status=CreateDegradationRequestDataAttributesStatus.INVESTIGATING, + ), + CreateBackfilledDegradationRequestDataAttributesUpdatesItems( + components_affected=[ + CreateDegradationRequestDataAttributesComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=StatusPagesComponentDataAttributesStatus.DEGRADED, + ), + ], + description="Root cause identified as a misconfigured deployment.", + started_at=(datetime.now() + relativedelta(minutes=-30)), + status=CreateDegradationRequestDataAttributesStatus.IDENTIFIED, + ), + CreateBackfilledDegradationRequestDataAttributesUpdatesItems( + components_affected=[ + CreateDegradationRequestDataAttributesComponentsAffectedItems( + id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status=StatusPagesComponentDataAttributesStatus.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..10e99c4a5b --- /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_maintenance_request_data_attributes_components_affected_items import ( + CreateMaintenanceRequestDataAttributesComponentsAffectedItems, +) +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=[ + CreateMaintenanceRequestDataAttributesComponentsAffectedItems( + 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=[ + CreateMaintenanceRequestDataAttributesComponentsAffectedItems( + 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/v1/model/azure_account.py b/src/datadog_api_client/v1/model/azure_account.py index df0f72dd8a..f82d098bae 100644 --- a/src/datadog_api_client/v1/model/azure_account.py +++ b/src/datadog_api_client/v1/model/azure_account.py @@ -38,7 +38,6 @@ def openapi_types(_): "new_tenant_name": (str,), "resource_collection_enabled": (bool,), "resource_provider_configs": ([ResourceProviderConfig],), - "secretless_auth_enabled": (bool,), "tenant_name": (str,), "usage_metrics_enabled": (bool,), } @@ -59,7 +58,6 @@ def openapi_types(_): "new_tenant_name": "new_tenant_name", "resource_collection_enabled": "resource_collection_enabled", "resource_provider_configs": "resource_provider_configs", - "secretless_auth_enabled": "secretless_auth_enabled", "tenant_name": "tenant_name", "usage_metrics_enabled": "usage_metrics_enabled", } @@ -81,7 +79,6 @@ def __init__( new_tenant_name: Union[str, UnsetType] = unset, resource_collection_enabled: Union[bool, UnsetType] = unset, resource_provider_configs: Union[List[ResourceProviderConfig], UnsetType] = unset, - secretless_auth_enabled: Union[bool, UnsetType] = unset, tenant_name: Union[str, UnsetType] = unset, usage_metrics_enabled: Union[bool, UnsetType] = unset, **kwargs, @@ -138,9 +135,6 @@ def __init__( :param resource_provider_configs: Configuration settings applied to resources from the specified Azure resource providers. :type resource_provider_configs: [ResourceProviderConfig], optional - :param secretless_auth_enabled: (Preview) When enabled, Datadog authenticates with this app registration using federated workload identity credentials instead of a client secret. - :type secretless_auth_enabled: bool, optional - :param tenant_name: Your Azure Active Directory ID. :type tenant_name: str, optional @@ -177,8 +171,6 @@ def __init__( kwargs["resource_collection_enabled"] = resource_collection_enabled if resource_provider_configs is not unset: kwargs["resource_provider_configs"] = resource_provider_configs - if secretless_auth_enabled is not unset: - kwargs["secretless_auth_enabled"] = secretless_auth_enabled if tenant_name is not unset: kwargs["tenant_name"] = tenant_name if usage_metrics_enabled is not unset: 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..cbb260d1fc --- /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 backfilled degradation. + :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..92a9da7ab2 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_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_components_affected_items import ( + CreateDegradationRequestDataAttributesComponentsAffectedItems, + ) + 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_degradation_request_data_attributes_components_affected_items import ( + CreateDegradationRequestDataAttributesComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + return { + "components_affected": ([CreateDegradationRequestDataAttributesComponentsAffectedItems],), + "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[CreateDegradationRequestDataAttributesComponentsAffectedItems], 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: [CreateDegradationRequestDataAttributesComponentsAffectedItems], 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_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..268c19a0a9 --- /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 backfilled maintenance. + :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..ce70f3d99e --- /dev/null +++ b/src/datadog_api_client/v2/model/create_backfilled_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_components_affected_items import ( + CreateMaintenanceRequestDataAttributesComponentsAffectedItems, + ) + 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_maintenance_request_data_attributes_components_affected_items import ( + CreateMaintenanceRequestDataAttributesComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_maintenance_request_data_attributes_updates_items_status import ( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, + ) + + return { + "components_affected": ([CreateMaintenanceRequestDataAttributesComponentsAffectedItems],), + "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[CreateMaintenanceRequestDataAttributesComponentsAffectedItems], 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: [CreateMaintenanceRequestDataAttributesComponentsAffectedItems], 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_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..3a485df988 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_degradation_request_data_attributes_updates_items_components_affected_items.py @@ -0,0 +1,64 @@ +# 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.status_pages_component_data_attributes_status import ( + StatusPagesComponentDataAttributesStatus, + ) + + +class CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.status_pages_component_data_attributes_status import ( + StatusPagesComponentDataAttributesStatus, + ) + + return { + "id": (str,), + "name": (str,), + "status": (StatusPagesComponentDataAttributesStatus,), + } + + attribute_map = { + "id": "id", + "name": "name", + "status": "status", + } + read_only_vars = { + "name", + } + + def __init__( + self_, id: str, status: StatusPagesComponentDataAttributesStatus, name: Union[str, UnsetType] = unset, **kwargs + ): + """ + A component affected by a degradation update. + + :param id: The ID of the component. Must be a component of type ``component``. + :type id: str + + :param name: The name of the component. + :type name: str, optional + + :param status: The status of the component. + :type status: StatusPagesComponentDataAttributesStatus + """ + 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..058f51ec89 --- /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 component. Must be a component of type ``component``. + :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/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e3055977a2..dd30d34d70 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1196,6 +1196,26 @@ 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_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_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 +1269,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 +1312,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 @@ -8396,6 +8431,14 @@ "CreateAttachmentRequestData", "CreateAttachmentRequestDataAttributes", "CreateAttachmentRequestDataAttributesAttachment", + "CreateBackfilledDegradationRequest", + "CreateBackfilledDegradationRequestData", + "CreateBackfilledDegradationRequestDataAttributes", + "CreateBackfilledDegradationRequestDataAttributesUpdatesItems", + "CreateBackfilledMaintenanceRequest", + "CreateBackfilledMaintenanceRequestData", + "CreateBackfilledMaintenanceRequestDataAttributes", + "CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems", "CreateCampaignRequest", "CreateCampaignRequestAttributes", "CreateCampaignRequestData", @@ -8427,6 +8470,8 @@ "CreateDegradationRequestDataAttributes", "CreateDegradationRequestDataAttributesComponentsAffectedItems", "CreateDegradationRequestDataAttributesStatus", + "CreateDegradationRequestDataAttributesUpdatesItems", + "CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems", "CreateDeploymentGateParams", "CreateDeploymentGateParamsData", "CreateDeploymentGateParamsDataAttributes", @@ -8452,6 +8497,9 @@ "CreateMaintenanceRequestData", "CreateMaintenanceRequestDataAttributes", "CreateMaintenanceRequestDataAttributesComponentsAffectedItems", + "CreateMaintenanceRequestDataAttributesUpdatesItems", + "CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems", + "CreateMaintenanceRequestDataAttributesUpdatesItemsStatus", "CreateNotificationChannelAttributes", "CreateNotificationChannelConfig", "CreateNotificationChannelData", diff --git a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen index fc085ae47b..4cf590b2a0 100644 --- a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen @@ -1 +1 @@ -2026-05-04T13:56:51.846Z \ No newline at end of file +2024-12-17T21:43:00.678Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml index bdb5b1af70..11bd3382ac 100644 --- a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17779030-0000-0000-0000-177790301100","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_enabled":true,"metrics_enabled_default":true,"new_client_id":"17779030-0000-0000-0000-177790301100","new_tenant_name":"17779030-0000-0000-0000-177790301100","resource_collection_enabled":true,"resource_provider_configs":[{"metrics_enabled":false,"namespace":"Microsoft.Compute"},{"metrics_enabled":false,"namespace":"Microsoft.Web"}],"secretless_auth_enabled":false,"tenant_name":"17779030-0000-0000-0000-177790301100","usage_metrics_enabled":true}' + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17344717-0000-0000-0000-173447178000","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_enabled":true,"metrics_enabled_default":true,"new_client_id":"17344717-0000-0000-0000-173447178000","new_tenant_name":"17344717-0000-0000-0000-173447178000","resource_collection_enabled":true,"resource_provider_configs":[{"metrics_enabled":false,"namespace":"Microsoft.Compute"},{"metrics_enabled":false,"namespace":"Microsoft.Web"}],"tenant_name":"17344717-0000-0000-0000-173447178000","usage_metrics_enabled":true}' headers: accept: - application/json @@ -20,7 +20,7 @@ interactions: code: 200 message: OK - request: - body: '{"client_id":"17779030-0000-0000-0000-177790301100","tenant_name":"17779030-0000-0000-0000-177790301100"}' + body: '{"client_id":"17344717-0000-0000-0000-173447178000","tenant_name":"17344717-0000-0000-0000-173447178000"}' headers: accept: - application/json @@ -40,7 +40,7 @@ interactions: code: 200 message: OK - request: - body: '{"client_id":"17779030-0000-0000-0000-177790301100","tenant_name":"17779030-0000-0000-0000-177790301100"}' + body: '{"client_id":"17344717-0000-0000-0000-173447178000","tenant_name":"17344717-0000-0000-0000-173447178000"}' headers: accept: - application/json diff --git a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen index 08d5b0bf6a..d500dc214e 100644 --- a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen @@ -1 +1 @@ -2026-05-04T13:56:52.686Z \ No newline at end of file +2024-12-17T21:43:01.129Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml index bb5c4d8683..92ac1431f1 100644 --- a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17779030-0000-0000-0000-177790301200","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_enabled":true,"metrics_enabled_default":true,"new_client_id":"17779030-0000-0000-0000-177790301200","new_tenant_name":"17779030-0000-0000-0000-177790301200","resource_collection_enabled":true,"resource_provider_configs":[{"metrics_enabled":false,"namespace":"Microsoft.Compute"},{"metrics_enabled":false,"namespace":"Microsoft.Web"}],"secretless_auth_enabled":false,"tenant_name":"17779030-0000-0000-0000-177790301200","usage_metrics_enabled":true}' + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17344717-0000-0000-0000-173447178100","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_enabled":true,"metrics_enabled_default":true,"new_client_id":"17344717-0000-0000-0000-173447178100","new_tenant_name":"17344717-0000-0000-0000-173447178100","resource_collection_enabled":true,"resource_provider_configs":[{"metrics_enabled":false,"namespace":"Microsoft.Compute"},{"metrics_enabled":false,"namespace":"Microsoft.Web"}],"tenant_name":"17344717-0000-0000-0000-173447178100","usage_metrics_enabled":true}' headers: accept: - application/json @@ -20,7 +20,7 @@ interactions: code: 200 message: OK - request: - body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17779030-0000-0000-0000-177790301200","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17779030-0000-0000-0000-177790301200","new_tenant_name":"17779030-0000-0000-0000-177790301200","resource_collection_enabled":true,"secretless_auth_enabled":true,"tenant_name":"17779030-0000-0000-0000-177790301200"}' + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17344717-0000-0000-0000-173447178100","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17344717-0000-0000-0000-173447178100","new_tenant_name":"17344717-0000-0000-0000-173447178100","resource_collection_enabled":true,"tenant_name":"17344717-0000-0000-0000-173447178100"}' headers: accept: - application/json @@ -40,7 +40,7 @@ interactions: code: 200 message: OK - request: - body: '{"client_id":"17779030-0000-0000-0000-177790301200","tenant_name":"17779030-0000-0000-0000-177790301200"}' + body: '{"client_id":"17344717-0000-0000-0000-173447178100","tenant_name":"17344717-0000-0000-0000-173447178100"}' headers: accept: - application/json diff --git a/tests/v1/features/azure_integration.feature b/tests/v1/features/azure_integration.feature index 6ba40e91e5..8d31237b5b 100644 --- a/tests/v1/features/azure_integration.feature +++ b/tests/v1/features/azure_integration.feature @@ -12,7 +12,7 @@ Feature: Azure Integration @generated @skip @team:DataDog/azure-integrations Scenario: Create an Azure integration returns "Bad Request" response Given new "CreateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "secretless_auth_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @@ -26,7 +26,7 @@ Feature: Azure Integration @generated @skip @team:DataDog/azure-integrations Scenario: Delete an Azure integration returns "Bad Request" response Given new "DeleteAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "secretless_auth_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @@ -53,21 +53,21 @@ Feature: Azure Integration @generated @skip @team:DataDog/azure-integrations Scenario: Update Azure integration host filters returns "Bad Request" response Given new "UpdateAzureHostFilters" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "secretless_auth_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/azure-integrations Scenario: Update Azure integration host filters returns "OK" response Given new "UpdateAzureHostFilters" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "secretless_auth_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/azure-integrations Scenario: Update an Azure integration returns "Bad Request" response Given new "UpdateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "secretless_auth_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @@ -75,6 +75,6 @@ Feature: Azure Integration Scenario: Update an Azure integration returns "OK" response Given there is a valid "azure_account" in the system And new "UpdateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "secretless_auth_enabled": true, "tenant_name": "{{ uuid }}"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "tenant_name": "{{ uuid }}"} When the request is sent Then the response status is 200 OK diff --git a/tests/v1/features/given.json b/tests/v1/features/given.json index 4415a28bc0..2606012caa 100644 --- a/tests/v1/features/given.json +++ b/tests/v1/features/given.json @@ -117,7 +117,7 @@ { "name": "body", "origin": "request", - "value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"TestingRh2nx664kUy5dIApvM54T4AtO\",\n \"container_app_filters\": \"key:value,filter:example\",\n \"cspm_enabled\": true,\n \"custom_metrics_enabled\": true,\n \"errors\": [\"*\"],\n \"host_filters\": \"key:value,filter:example\",\n \"metrics_enabled\": true,\n \"metrics_enabled_default\": true,\n \"new_client_id\": \"{{ uuid }}\",\n \"new_tenant_name\": \"{{ uuid }}\",\n \"resource_collection_enabled\": true,\n \"resource_provider_configs\": [\n {\n \"namespace\": \"Microsoft.Compute\",\n \"metrics_enabled\": false\n },\n {\n \"namespace\": \"Microsoft.Web\",\n \"metrics_enabled\": false\n }\n ],\n \"secretless_auth_enabled\": false,\n \"tenant_name\": \"{{ uuid }}\",\n \"usage_metrics_enabled\": true\n}" + "value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"TestingRh2nx664kUy5dIApvM54T4AtO\",\n \"container_app_filters\": \"key:value,filter:example\",\n \"cspm_enabled\": true,\n \"custom_metrics_enabled\": true,\n \"errors\": [\"*\"],\n \"host_filters\": \"key:value,filter:example\",\n \"metrics_enabled\": true,\n \"metrics_enabled_default\": true,\n \"new_client_id\": \"{{ uuid }}\",\n \"new_tenant_name\": \"{{ uuid }}\",\n \"resource_collection_enabled\": true,\n \"resource_provider_configs\": [\n {\n \"namespace\": \"Microsoft.Compute\",\n \"metrics_enabled\": false\n },\n {\n \"namespace\": \"Microsoft.Web\",\n \"metrics_enabled\": false\n }\n ],\n \"tenant_name\": \"{{ uuid }}\",\n \"usage_metrics_enabled\": true\n}" } ], "step": "there is a valid \"azure_account\" in the system", 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": {