Skip to content

Commit 93cc041

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 43e2a22 of spec repo
1 parent e9bfe98 commit 93cc041

11 files changed

Lines changed: 410 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29346,6 +29346,62 @@ components:
2934629346
- service
2934729347
- started_at
2934829348
type: object
29349+
DORADeploymentPatchByVersionRequest:
29350+
description: Request to patch a DORA deployment event identified by service, environment, and version.
29351+
example:
29352+
data:
29353+
attributes:
29354+
change_failure: true
29355+
env: "production"
29356+
remediation:
29357+
type: "rollback"
29358+
service: "my-service"
29359+
version: "v1.2.3"
29360+
type: "dora_deployment_patch_request"
29361+
properties:
29362+
data:
29363+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequestData"
29364+
required:
29365+
- data
29366+
type: object
29367+
DORADeploymentPatchByVersionRequestAttributes:
29368+
description: Attributes for patching a DORA deployment event identified by service, environment, and version.
29369+
properties:
29370+
change_failure:
29371+
description: Indicates whether the deployment resulted in a change failure.
29372+
example: true
29373+
type: boolean
29374+
env:
29375+
description: The environment the deployment was performed in.
29376+
example: production
29377+
type: string
29378+
remediation:
29379+
$ref: "#/components/schemas/DORADeploymentPatchRemediation"
29380+
service:
29381+
description: The name of the service that was deployed.
29382+
example: my-service
29383+
type: string
29384+
version:
29385+
description: "The version deployed. This is the same version used to correlate with [APM Deployment Tracking](https://docs.datadoghq.com/tracing/services/deployment_tracking/)."
29386+
example: v1.2.3
29387+
type: string
29388+
required:
29389+
- service
29390+
- env
29391+
- version
29392+
- change_failure
29393+
type: object
29394+
DORADeploymentPatchByVersionRequestData:
29395+
description: The JSON:API data for patching a deployment identified by service, environment, and version.
29396+
properties:
29397+
attributes:
29398+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequestAttributes"
29399+
type:
29400+
$ref: "#/components/schemas/DORADeploymentPatchRequestDataType"
29401+
required:
29402+
- type
29403+
- attributes
29404+
type: object
2934929405
DORADeploymentPatchRemediation:
2935029406
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time.
2935129407
properties:
@@ -139542,6 +139598,52 @@ paths:
139542139598
permissions:
139543139599
- dora_metrics_write
139544139600
/api/v2/dora/deployments:
139601+
patch:
139602+
description: |-
139603+
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.
139604+
operationId: PatchDORADeploymentByVersion
139605+
requestBody:
139606+
content:
139607+
application/json:
139608+
examples:
139609+
default:
139610+
value:
139611+
data:
139612+
attributes:
139613+
change_failure: true
139614+
env: production
139615+
service: my-service
139616+
version: v1.2.3
139617+
type: dora_deployment_patch_request
139618+
schema:
139619+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequest"
139620+
required: true
139621+
responses:
139622+
"202":
139623+
description: Accepted
139624+
"400":
139625+
content:
139626+
application/json:
139627+
schema:
139628+
$ref: "#/components/schemas/JSONAPIErrorResponse"
139629+
description: Bad Request
139630+
"403":
139631+
$ref: "#/components/responses/NotAuthorizedResponse"
139632+
"429":
139633+
$ref: "#/components/responses/TooManyRequestsResponse"
139634+
security:
139635+
- apiKeyAuth: []
139636+
appKeyAuth: []
139637+
summary: Patch a deployment event by version
139638+
tags: ["DORA Metrics"]
139639+
x-codegen-request-body-name: body
139640+
x-permission:
139641+
operator: OR
139642+
permissions:
139643+
- dora_metrics_write
139644+
x-unstable: |-
139645+
**Note**: This endpoint is in preview and is subject to change.
139646+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
139545139647
post:
139546139648
description: |-
139547139649
Use this API endpoint to get a list of deployment events.

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12807,6 +12807,27 @@ datadog\_api\_client.v2.model.dora\_deployment\_object\_attributes module
1280712807
:members:
1280812808
:show-inheritance:
1280912809

12810+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request module
12811+
----------------------------------------------------------------------------------
12812+
12813+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request
12814+
:members:
12815+
:show-inheritance:
12816+
12817+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_attributes module
12818+
----------------------------------------------------------------------------------------------
12819+
12820+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes
12821+
:members:
12822+
:show-inheritance:
12823+
12824+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_data module
12825+
----------------------------------------------------------------------------------------
12826+
12827+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data
12828+
:members:
12829+
:show-inheritance:
12830+
1281012831
datadog\_api\_client.v2.model.dora\_deployment\_patch\_remediation module
1281112832
-------------------------------------------------------------------------
1281212833

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""
2+
Patch a deployment event by version returns "Accepted" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
7+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest
8+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes import (
9+
DORADeploymentPatchByVersionRequestAttributes,
10+
)
11+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import (
12+
DORADeploymentPatchByVersionRequestData,
13+
)
14+
from datadog_api_client.v2.model.dora_deployment_patch_remediation import DORADeploymentPatchRemediation
15+
from datadog_api_client.v2.model.dora_deployment_patch_remediation_type import DORADeploymentPatchRemediationType
16+
from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import DORADeploymentPatchRequestDataType
17+
18+
body = DORADeploymentPatchByVersionRequest(
19+
data=DORADeploymentPatchByVersionRequestData(
20+
attributes=DORADeploymentPatchByVersionRequestAttributes(
21+
change_failure=True,
22+
env="production",
23+
remediation=DORADeploymentPatchRemediation(
24+
type=DORADeploymentPatchRemediationType.ROLLBACK,
25+
),
26+
service="my-service",
27+
version="v1.2.3",
28+
),
29+
type=DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST,
30+
),
31+
)
32+
33+
configuration = Configuration()
34+
configuration.unstable_operations["patch_dora_deployment_by_version"] = True
35+
with ApiClient(configuration) as api_client:
36+
api_instance = DORAMetricsApi(api_client)
37+
api_instance.patch_dora_deployment_by_version(body=body)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def __init__(
495495
"v2.trigger_deployment_gates_evaluation": False,
496496
"v2.update_deployment_gate": False,
497497
"v2.update_deployment_rule": False,
498+
"v2.patch_dora_deployment_by_version": False,
498499
"v2.clone_form": False,
499500
"v2.create_and_publish_form": False,
500501
"v2.create_form": False,

src/datadog_api_client/v2/api/dora_metrics_api.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from datadog_api_client.configuration import Configuration
1111
from datadog_api_client.v2.model.dora_deployment_response import DORADeploymentResponse
1212
from datadog_api_client.v2.model.dora_deployment_request import DORADeploymentRequest
13+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest
1314
from datadog_api_client.v2.model.dora_deployments_list_response import DORADeploymentsListResponse
1415
from datadog_api_client.v2.model.dora_list_deployments_request import DORAListDeploymentsRequest
1516
from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse
@@ -251,6 +252,26 @@ def __init__(self, api_client=None):
251252
api_client=api_client,
252253
)
253254

255+
self._patch_dora_deployment_by_version_endpoint = _Endpoint(
256+
settings={
257+
"response_type": None,
258+
"auth": ["apiKeyAuth", "appKeyAuth"],
259+
"endpoint_path": "/api/v2/dora/deployments",
260+
"operation_id": "patch_dora_deployment_by_version",
261+
"http_method": "PATCH",
262+
"version": "v2",
263+
},
264+
params_map={
265+
"body": {
266+
"required": True,
267+
"openapi_types": (DORADeploymentPatchByVersionRequest,),
268+
"location": "body",
269+
},
270+
},
271+
headers_map={"accept": ["*/*"], "content_type": ["application/json"]},
272+
api_client=api_client,
273+
)
274+
254275
def create_dora_deployment(
255276
self,
256277
body: DORADeploymentRequest,
@@ -432,3 +453,19 @@ def patch_dora_deployment(
432453
kwargs["body"] = body
433454

434455
return self._patch_dora_deployment_endpoint.call_with_http_info(**kwargs)
456+
457+
def patch_dora_deployment_by_version(
458+
self,
459+
body: DORADeploymentPatchByVersionRequest,
460+
) -> None:
461+
"""Patch a deployment event by version.
462+
463+
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.
464+
465+
:type body: DORADeploymentPatchByVersionRequest
466+
:rtype: None
467+
"""
468+
kwargs: Dict[str, Any] = {}
469+
kwargs["body"] = body
470+
471+
return self._patch_dora_deployment_by_version_endpoint.call_with_http_info(**kwargs)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import (
16+
DORADeploymentPatchByVersionRequestData,
17+
)
18+
19+
20+
class DORADeploymentPatchByVersionRequest(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import (
24+
DORADeploymentPatchByVersionRequestData,
25+
)
26+
27+
return {
28+
"data": (DORADeploymentPatchByVersionRequestData,),
29+
}
30+
31+
attribute_map = {
32+
"data": "data",
33+
}
34+
35+
def __init__(self_, data: DORADeploymentPatchByVersionRequestData, **kwargs):
36+
"""
37+
Request to patch a DORA deployment event identified by service, environment, and version.
38+
39+
:param data: The JSON:API data for patching a deployment identified by service, environment, and version.
40+
:type data: DORADeploymentPatchByVersionRequestData
41+
"""
42+
super().__init__(kwargs)
43+
44+
self_.data = data
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.dora_deployment_patch_remediation import DORADeploymentPatchRemediation
18+
19+
20+
class DORADeploymentPatchByVersionRequestAttributes(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.dora_deployment_patch_remediation import DORADeploymentPatchRemediation
24+
25+
return {
26+
"change_failure": (bool,),
27+
"env": (str,),
28+
"remediation": (DORADeploymentPatchRemediation,),
29+
"service": (str,),
30+
"version": (str,),
31+
}
32+
33+
attribute_map = {
34+
"change_failure": "change_failure",
35+
"env": "env",
36+
"remediation": "remediation",
37+
"service": "service",
38+
"version": "version",
39+
}
40+
41+
def __init__(
42+
self_,
43+
change_failure: bool,
44+
env: str,
45+
service: str,
46+
version: str,
47+
remediation: Union[DORADeploymentPatchRemediation, UnsetType] = unset,
48+
**kwargs,
49+
):
50+
"""
51+
Attributes for patching a DORA deployment event identified by service, environment, and version.
52+
53+
:param change_failure: Indicates whether the deployment resulted in a change failure.
54+
:type change_failure: bool
55+
56+
:param env: The environment the deployment was performed in.
57+
:type env: str
58+
59+
:param remediation: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time.
60+
:type remediation: DORADeploymentPatchRemediation, optional
61+
62+
:param service: The name of the service that was deployed.
63+
:type service: str
64+
65+
:param version: The version deployed. This is the same version used to correlate with `APM Deployment Tracking <https://docs.datadoghq.com/tracing/services/deployment_tracking/>`_.
66+
:type version: str
67+
"""
68+
if remediation is not unset:
69+
kwargs["remediation"] = remediation
70+
super().__init__(kwargs)
71+
72+
self_.change_failure = change_failure
73+
self_.env = env
74+
self_.service = service
75+
self_.version = version

0 commit comments

Comments
 (0)