From 93cc041826dc1fb162ffd17bd2c7a555aced6063 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 5 Aug 2026 10:34:46 +0000 Subject: [PATCH] Regenerate client from commit 43e2a22 of spec repo --- .generator/schemas/v2/openapi.yaml | 102 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 21 ++++ .../PatchDORADeploymentByVersion.py | 37 +++++++ src/datadog_api_client/configuration.py | 1 + .../v2/api/dora_metrics_api.py | 37 +++++++ ...ora_deployment_patch_by_version_request.py | 44 ++++++++ ...ent_patch_by_version_request_attributes.py | 75 +++++++++++++ ...eployment_patch_by_version_request_data.py | 59 ++++++++++ src/datadog_api_client/v2/models/__init__.py | 10 ++ tests/v2/features/dora_metrics.feature | 18 ++++ tests/v2/features/undo.json | 6 ++ 11 files changed, 410 insertions(+) create mode 100644 examples/v2/dora-metrics/PatchDORADeploymentByVersion.py create mode 100644 src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request.py create mode 100644 src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_data.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bc4bd3a2c..6b7d331fc4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29346,6 +29346,62 @@ components: - service - started_at type: object + DORADeploymentPatchByVersionRequest: + description: Request to patch a DORA deployment event identified by service, environment, and version. + example: + data: + attributes: + change_failure: true + env: "production" + remediation: + type: "rollback" + service: "my-service" + version: "v1.2.3" + type: "dora_deployment_patch_request" + properties: + data: + $ref: "#/components/schemas/DORADeploymentPatchByVersionRequestData" + required: + - data + type: object + DORADeploymentPatchByVersionRequestAttributes: + description: Attributes for patching a DORA deployment event identified by service, environment, and version. + properties: + change_failure: + description: Indicates whether the deployment resulted in a change failure. + example: true + type: boolean + env: + description: The environment the deployment was performed in. + example: production + type: string + remediation: + $ref: "#/components/schemas/DORADeploymentPatchRemediation" + service: + description: The name of the service that was deployed. + example: my-service + type: string + version: + description: "The version deployed. This is the same version used to correlate with [APM Deployment Tracking](https://docs.datadoghq.com/tracing/services/deployment_tracking/)." + example: v1.2.3 + type: string + required: + - service + - env + - version + - change_failure + type: object + DORADeploymentPatchByVersionRequestData: + description: The JSON:API data for patching a deployment identified by service, environment, and version. + properties: + attributes: + $ref: "#/components/schemas/DORADeploymentPatchByVersionRequestAttributes" + type: + $ref: "#/components/schemas/DORADeploymentPatchRequestDataType" + required: + - type + - attributes + type: object DORADeploymentPatchRemediation: description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. properties: @@ -139542,6 +139598,52 @@ paths: permissions: - dora_metrics_write /api/v2/dora/deployments: + patch: + description: |- + Update a deployment's change failure status, identifying the deployment by its service, environment, and version instead of its ID. Use this to mark a deployment as a change failure or back to stable. You can optionally include remediation details to enable failed deployment recovery time calculation. If multiple deployments match the given service, environment, and version, the most recently finished one is updated. + operationId: PatchDORADeploymentByVersion + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + change_failure: true + env: production + service: my-service + version: v1.2.3 + type: dora_deployment_patch_request + schema: + $ref: "#/components/schemas/DORADeploymentPatchByVersionRequest" + required: true + responses: + "202": + description: Accepted + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Patch a deployment event by version + tags: ["DORA Metrics"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - dora_metrics_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Use this API endpoint to get a list of deployment events. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 465a9e2c9c..25403a038c 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -12807,6 +12807,27 @@ datadog\_api\_client.v2.model.dora\_deployment\_object\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_attributes module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_data module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.dora\_deployment\_patch\_remediation module ------------------------------------------------------------------------- diff --git a/examples/v2/dora-metrics/PatchDORADeploymentByVersion.py b/examples/v2/dora-metrics/PatchDORADeploymentByVersion.py new file mode 100644 index 0000000000..54e5a151a8 --- /dev/null +++ b/examples/v2/dora-metrics/PatchDORADeploymentByVersion.py @@ -0,0 +1,37 @@ +""" +Patch a deployment event by version returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes import ( + DORADeploymentPatchByVersionRequestAttributes, +) +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import ( + DORADeploymentPatchByVersionRequestData, +) +from datadog_api_client.v2.model.dora_deployment_patch_remediation import DORADeploymentPatchRemediation +from datadog_api_client.v2.model.dora_deployment_patch_remediation_type import DORADeploymentPatchRemediationType +from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import DORADeploymentPatchRequestDataType + +body = DORADeploymentPatchByVersionRequest( + data=DORADeploymentPatchByVersionRequestData( + attributes=DORADeploymentPatchByVersionRequestAttributes( + change_failure=True, + env="production", + remediation=DORADeploymentPatchRemediation( + type=DORADeploymentPatchRemediationType.ROLLBACK, + ), + service="my-service", + version="v1.2.3", + ), + type=DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["patch_dora_deployment_by_version"] = True +with ApiClient(configuration) as api_client: + api_instance = DORAMetricsApi(api_client) + api_instance.patch_dora_deployment_by_version(body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index e9ae82408c..a4be723500 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -495,6 +495,7 @@ def __init__( "v2.trigger_deployment_gates_evaluation": False, "v2.update_deployment_gate": False, "v2.update_deployment_rule": False, + "v2.patch_dora_deployment_by_version": False, "v2.clone_form": False, "v2.create_and_publish_form": False, "v2.create_form": False, diff --git a/src/datadog_api_client/v2/api/dora_metrics_api.py b/src/datadog_api_client/v2/api/dora_metrics_api.py index a2264709b6..4e912e092f 100644 --- a/src/datadog_api_client/v2/api/dora_metrics_api.py +++ b/src/datadog_api_client/v2/api/dora_metrics_api.py @@ -10,6 +10,7 @@ from datadog_api_client.configuration import Configuration from datadog_api_client.v2.model.dora_deployment_response import DORADeploymentResponse from datadog_api_client.v2.model.dora_deployment_request import DORADeploymentRequest +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest from datadog_api_client.v2.model.dora_deployments_list_response import DORADeploymentsListResponse from datadog_api_client.v2.model.dora_list_deployments_request import DORAListDeploymentsRequest from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse @@ -251,6 +252,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._patch_dora_deployment_by_version_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dora/deployments", + "operation_id": "patch_dora_deployment_by_version", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (DORADeploymentPatchByVersionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def create_dora_deployment( self, body: DORADeploymentRequest, @@ -432,3 +453,19 @@ def patch_dora_deployment( kwargs["body"] = body return self._patch_dora_deployment_endpoint.call_with_http_info(**kwargs) + + def patch_dora_deployment_by_version( + self, + body: DORADeploymentPatchByVersionRequest, + ) -> None: + """Patch a deployment event by version. + + Update a deployment's change failure status, identifying the deployment by its service, environment, and version instead of its ID. Use this to mark a deployment as a change failure or back to stable. You can optionally include remediation details to enable failed deployment recovery time calculation. If multiple deployments match the given service, environment, and version, the most recently finished one is updated. + + :type body: DORADeploymentPatchByVersionRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._patch_dora_deployment_by_version_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request.py b/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request.py new file mode 100644 index 0000000000..7eba7dc7e1 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import ( + DORADeploymentPatchByVersionRequestData, + ) + + +class DORADeploymentPatchByVersionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import ( + DORADeploymentPatchByVersionRequestData, + ) + + return { + "data": (DORADeploymentPatchByVersionRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DORADeploymentPatchByVersionRequestData, **kwargs): + """ + Request to patch a DORA deployment event identified by service, environment, and version. + + :param data: The JSON:API data for patching a deployment identified by service, environment, and version. + :type data: DORADeploymentPatchByVersionRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_attributes.py b/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_attributes.py new file mode 100644 index 0000000000..536d095223 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_attributes.py @@ -0,0 +1,75 @@ +# 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.dora_deployment_patch_remediation import DORADeploymentPatchRemediation + + +class DORADeploymentPatchByVersionRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_patch_remediation import DORADeploymentPatchRemediation + + return { + "change_failure": (bool,), + "env": (str,), + "remediation": (DORADeploymentPatchRemediation,), + "service": (str,), + "version": (str,), + } + + attribute_map = { + "change_failure": "change_failure", + "env": "env", + "remediation": "remediation", + "service": "service", + "version": "version", + } + + def __init__( + self_, + change_failure: bool, + env: str, + service: str, + version: str, + remediation: Union[DORADeploymentPatchRemediation, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for patching a DORA deployment event identified by service, environment, and version. + + :param change_failure: Indicates whether the deployment resulted in a change failure. + :type change_failure: bool + + :param env: The environment the deployment was performed in. + :type env: str + + :param remediation: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. + :type remediation: DORADeploymentPatchRemediation, optional + + :param service: The name of the service that was deployed. + :type service: str + + :param version: The version deployed. This is the same version used to correlate with `APM Deployment Tracking `_. + :type version: str + """ + if remediation is not unset: + kwargs["remediation"] = remediation + super().__init__(kwargs) + + self_.change_failure = change_failure + self_.env = env + self_.service = service + self_.version = version diff --git a/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_data.py b/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_data.py new file mode 100644 index 0000000000..6e272d671e --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_patch_by_version_request_data.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes import ( + DORADeploymentPatchByVersionRequestAttributes, + ) + from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import DORADeploymentPatchRequestDataType + + +class DORADeploymentPatchByVersionRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes import ( + DORADeploymentPatchByVersionRequestAttributes, + ) + from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import ( + DORADeploymentPatchRequestDataType, + ) + + return { + "attributes": (DORADeploymentPatchByVersionRequestAttributes,), + "type": (DORADeploymentPatchRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: DORADeploymentPatchByVersionRequestAttributes, + type: DORADeploymentPatchRequestDataType, + **kwargs, + ): + """ + The JSON:API data for patching a deployment identified by service, environment, and version. + + :param attributes: Attributes for patching a DORA deployment event identified by service, environment, and version. + :type attributes: DORADeploymentPatchByVersionRequestAttributes + + :param type: JSON:API type for DORA deployment patch request. + :type type: DORADeploymentPatchRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 9a2c10edc0..c9e5881a5a 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2161,6 +2161,13 @@ from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject from datadog_api_client.v2.model.dora_deployment_object_attributes import DORADeploymentObjectAttributes +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes import ( + DORADeploymentPatchByVersionRequestAttributes, +) +from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import ( + DORADeploymentPatchByVersionRequestData, +) from datadog_api_client.v2.model.dora_deployment_patch_remediation import DORADeploymentPatchRemediation from datadog_api_client.v2.model.dora_deployment_patch_remediation_type import DORADeploymentPatchRemediationType from datadog_api_client.v2.model.dora_deployment_patch_request import DORADeploymentPatchRequest @@ -11958,6 +11965,9 @@ "DORADeploymentFetchResponse", "DORADeploymentObject", "DORADeploymentObjectAttributes", + "DORADeploymentPatchByVersionRequest", + "DORADeploymentPatchByVersionRequestAttributes", + "DORADeploymentPatchByVersionRequestData", "DORADeploymentPatchRemediation", "DORADeploymentPatchRemediationType", "DORADeploymentPatchRequest", diff --git a/tests/v2/features/dora_metrics.feature b/tests/v2/features/dora_metrics.feature index d0dc8943ad..4308920ca0 100644 --- a/tests/v2/features/dora_metrics.feature +++ b/tests/v2/features/dora_metrics.feature @@ -148,6 +148,24 @@ Feature: DORA Metrics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend + Scenario: Patch a deployment event by version returns "Accepted" response + Given a valid "appKeyAuth" key in the system + And operation "PatchDORADeploymentByVersion" enabled + And new "PatchDORADeploymentByVersion" request + And body with value {"data": {"attributes": {"change_failure": true, "env": "production", "remediation": {"type": "rollback"}, "service": "my-service", "version": "v1.2.3"}, "type": "dora_deployment_patch_request"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Patch a deployment event by version returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "PatchDORADeploymentByVersion" enabled + And new "PatchDORADeploymentByVersion" request + And body with value {"data": {"attributes": {"change_failure": true, "env": "production", "remediation": {"type": "rollback"}, "service": "my-service", "version": "v1.2.3"}, "type": "dora_deployment_patch_request"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ci-app-backend Scenario: Patch a deployment event returns "Accepted" response Given a valid "appKeyAuth" key in the system diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 133ab9ade4..c2e3d75899 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2374,6 +2374,12 @@ "type": "idempotent" } }, + "PatchDORADeploymentByVersion": { + "tag": "DORA Metrics", + "undo": { + "type": "idempotent" + } + }, "ListDORADeployments": { "tag": "DORA Metrics", "undo": {