Skip to content

Commit 7c5d329

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d14a379 of spec repo
1 parent bd76ff3 commit 7c5d329

16 files changed

Lines changed: 674 additions & 9 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 144 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29678,15 +29678,111 @@ components:
2967829678
- service
2967929679
- started_at
2968029680
type: object
29681+
DORADeploymentPatchByVersionRemediation:
29682+
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. Specify either `id` or `version` to identify the remediation deployment, but not both.
29683+
oneOf:
29684+
- $ref: "#/components/schemas/DORADeploymentPatchByVersionRemediationByID"
29685+
- $ref: "#/components/schemas/DORADeploymentPatchByVersionRemediationByVersion"
29686+
DORADeploymentPatchByVersionRemediationByID:
29687+
additionalProperties: false
29688+
description: Remediation details identified by the ID of the remediation deployment.
29689+
properties:
29690+
id:
29691+
description: The ID of the remediation deployment.
29692+
example: eG42zNIkVjM
29693+
type: string
29694+
type:
29695+
$ref: "#/components/schemas/DORADeploymentPatchRemediationType"
29696+
required:
29697+
- id
29698+
- type
29699+
type: object
29700+
DORADeploymentPatchByVersionRemediationByVersion:
29701+
additionalProperties: false
29702+
description: Remediation details identified by the version of the remediation deployment, matched against the same service and environment as the failed deployment.
29703+
properties:
29704+
type:
29705+
$ref: "#/components/schemas/DORADeploymentPatchRemediationType"
29706+
version:
29707+
description: The version of the remediation deployment.
29708+
example: v1.2.4
29709+
type: string
29710+
required:
29711+
- version
29712+
- type
29713+
type: object
29714+
DORADeploymentPatchByVersionRequest:
29715+
description: Request to patch a DORA deployment event identified by service, environment, and version.
29716+
example:
29717+
data:
29718+
attributes:
29719+
change_failure: true
29720+
env: "production"
29721+
remediation:
29722+
type: "rollback"
29723+
version: "v1.2.2"
29724+
service: "my-service"
29725+
version: "v1.2.3"
29726+
type: "dora_deployment_patch_request"
29727+
properties:
29728+
data:
29729+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequestData"
29730+
required:
29731+
- data
29732+
type: object
29733+
DORADeploymentPatchByVersionRequestAttributes:
29734+
description: Attributes for patching a DORA deployment event identified by service, environment, and version.
29735+
properties:
29736+
change_failure:
29737+
description: Indicates whether the deployment resulted in a change failure.
29738+
example: true
29739+
type: boolean
29740+
env:
29741+
description: The environment the deployment was performed in.
29742+
example: prod
29743+
type: string
29744+
remediation:
29745+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRemediation"
29746+
service:
29747+
description: The name of the service that was deployed.
29748+
example: my-service
29749+
type: string
29750+
version:
29751+
description: "The version deployed. This can be seen in the Service Catalog or in the APM Deployment Tracking."
29752+
example: v1.2.3
29753+
type: string
29754+
required:
29755+
- service
29756+
- env
29757+
- version
29758+
- change_failure
29759+
type: object
29760+
DORADeploymentPatchByVersionRequestData:
29761+
description: The JSON:API data for patching a deployment identified by service, environment, and version.
29762+
properties:
29763+
attributes:
29764+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequestAttributes"
29765+
type:
29766+
$ref: "#/components/schemas/DORADeploymentPatchRequestDataType"
29767+
required:
29768+
- type
29769+
- attributes
29770+
type: object
2968129771
DORADeploymentPatchRemediation:
29682-
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time.
29772+
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. Specify either `id` or `version` to identify the remediation deployment, but not both.
2968329773
properties:
2968429774
id:
29685-
description: The ID of the remediation deployment. Required when the failed deployment must be linked to a remediation deployment.
29775+
description: The ID of the remediation deployment. Use this or `version` to identify the remediation deployment, but not both.
2968629776
example: eG42zNIkVjM
2968729777
type: string
2968829778
type:
2968929779
$ref: "#/components/schemas/DORADeploymentPatchRemediationType"
29780+
version:
29781+
description: The version of the remediation deployment, matched against the same service and environment as the failed deployment. Use this or `id` to identify the remediation deployment, but not both.
29782+
example: v1.2.4
29783+
type: string
29784+
required:
29785+
- type
2969029786
type: object
2969129787
DORADeploymentPatchRemediationType:
2969229788
description: The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
@@ -140417,6 +140513,52 @@ paths:
140417140513
permissions:
140418140514
- dora_metrics_write
140419140515
/api/v2/dora/deployments:
140516+
patch:
140517+
description: |-
140518+
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.
140519+
operationId: PatchDORADeploymentByVersion
140520+
requestBody:
140521+
content:
140522+
application/json:
140523+
examples:
140524+
default:
140525+
value:
140526+
data:
140527+
attributes:
140528+
change_failure: true
140529+
env: production
140530+
service: my-service
140531+
version: v1.2.3
140532+
type: dora_deployment_patch_request
140533+
schema:
140534+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequest"
140535+
required: true
140536+
responses:
140537+
"202":
140538+
description: Accepted
140539+
"400":
140540+
content:
140541+
application/json:
140542+
schema:
140543+
$ref: "#/components/schemas/JSONAPIErrorResponse"
140544+
description: Bad Request
140545+
"403":
140546+
$ref: "#/components/responses/NotAuthorizedResponse"
140547+
"429":
140548+
$ref: "#/components/responses/TooManyRequestsResponse"
140549+
security:
140550+
- apiKeyAuth: []
140551+
appKeyAuth: []
140552+
summary: Patch a deployment event by version
140553+
tags: ["DORA Metrics"]
140554+
x-codegen-request-body-name: body
140555+
x-permission:
140556+
operator: OR
140557+
permissions:
140558+
- dora_metrics_write
140559+
x-unstable: |-
140560+
**Note**: This endpoint is in preview and is subject to change.
140561+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
140420140562
post:
140421140563
description: |-
140422140564
Use this API endpoint to get a list of deployment events.

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13122,6 +13122,41 @@ datadog\_api\_client.v2.model.dora\_deployment\_object\_attributes module
1312213122
:members:
1312313123
:show-inheritance:
1312413124

13125+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_remediation module
13126+
--------------------------------------------------------------------------------------
13127+
13128+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_remediation
13129+
:members:
13130+
:show-inheritance:
13131+
13132+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_remediation\_by\_id module
13133+
----------------------------------------------------------------------------------------------
13134+
13135+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_remediation_by_id
13136+
:members:
13137+
:show-inheritance:
13138+
13139+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request module
13140+
----------------------------------------------------------------------------------
13141+
13142+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request
13143+
:members:
13144+
:show-inheritance:
13145+
13146+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_attributes module
13147+
----------------------------------------------------------------------------------------------
13148+
13149+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes
13150+
:members:
13151+
:show-inheritance:
13152+
13153+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_data module
13154+
----------------------------------------------------------------------------------------
13155+
13156+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data
13157+
:members:
13158+
:show-inheritance:
13159+
1312513160
datadog\_api\_client.v2.model.dora\_deployment\_patch\_remediation module
1312613161
-------------------------------------------------------------------------
1312713162

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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_remediation_by_version import (
8+
DORADeploymentPatchByVersionRemediationByVersion,
9+
)
10+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest
11+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes import (
12+
DORADeploymentPatchByVersionRequestAttributes,
13+
)
14+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data import (
15+
DORADeploymentPatchByVersionRequestData,
16+
)
17+
from datadog_api_client.v2.model.dora_deployment_patch_remediation_type import DORADeploymentPatchRemediationType
18+
from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import DORADeploymentPatchRequestDataType
19+
20+
body = DORADeploymentPatchByVersionRequest(
21+
data=DORADeploymentPatchByVersionRequestData(
22+
attributes=DORADeploymentPatchByVersionRequestAttributes(
23+
change_failure=True,
24+
env="production",
25+
remediation=DORADeploymentPatchByVersionRemediationByVersion(
26+
type=DORADeploymentPatchRemediationType.ROLLBACK,
27+
version="v1.2.2",
28+
),
29+
service="my-service",
30+
version="v1.2.3",
31+
),
32+
type=DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST,
33+
),
34+
)
35+
36+
configuration = Configuration()
37+
configuration.unstable_operations["patch_dora_deployment_by_version"] = True
38+
with ApiClient(configuration) as api_client:
39+
api_instance = DORAMetricsApi(api_client)
40+
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: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelComposed,
9+
cached_property,
10+
)
11+
12+
13+
class DORADeploymentPatchByVersionRemediation(ModelComposed):
14+
def __init__(self, **kwargs):
15+
"""
16+
Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. Specify either ``id`` or ``version`` to identify the remediation deployment, but not both.
17+
18+
:param id: The ID of the remediation deployment.
19+
:type id: str
20+
21+
:param type: The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
22+
:type type: DORADeploymentPatchRemediationType
23+
24+
:param version: The version of the remediation deployment.
25+
:type version: str
26+
"""
27+
super().__init__(kwargs)
28+
29+
@cached_property
30+
def _composed_schemas(_):
31+
# we need this here to make our import statements work
32+
# we must store _composed_schemas in here so the code is only run
33+
# when we invoke this method. If we kept this at the class
34+
# level we would get an error because the class level
35+
# code would be run when this module is imported, and these composed
36+
# classes don't exist yet because their module has not finished
37+
# loading
38+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_remediation_by_id import (
39+
DORADeploymentPatchByVersionRemediationByID,
40+
)
41+
from datadog_api_client.v2.model.dora_deployment_patch_by_version_remediation_by_version import (
42+
DORADeploymentPatchByVersionRemediationByVersion,
43+
)
44+
45+
return {
46+
"oneOf": [
47+
DORADeploymentPatchByVersionRemediationByID,
48+
DORADeploymentPatchByVersionRemediationByVersion,
49+
],
50+
}

0 commit comments

Comments
 (0)