Skip to content

Commit 3d10a64

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4256aa4 of spec repo
1 parent 782c76d commit 3d10a64

16 files changed

Lines changed: 668 additions & 5 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 142 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29827,15 +29827,109 @@ components:
2982729827
- service
2982829828
- started_at
2982929829
type: object
29830+
DORADeploymentPatchByVersionRemediation:
29831+
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.
29832+
oneOf:
29833+
- $ref: "#/components/schemas/DORADeploymentPatchByVersionRemediationByID"
29834+
- $ref: "#/components/schemas/DORADeploymentPatchByVersionRemediationByVersion"
29835+
DORADeploymentPatchByVersionRemediationByID:
29836+
additionalProperties: false
29837+
description: Remediation details identified by the ID of the remediation deployment.
29838+
properties:
29839+
id:
29840+
description: The ID of the remediation deployment.
29841+
example: eG42zNIkVjM
29842+
type: string
29843+
type:
29844+
$ref: "#/components/schemas/DORADeploymentPatchRemediationType"
29845+
required:
29846+
- id
29847+
- type
29848+
type: object
29849+
DORADeploymentPatchByVersionRemediationByVersion:
29850+
additionalProperties: false
29851+
description: Remediation details identified by the version of the remediation deployment, matched against the same service and environment as the failed deployment.
29852+
properties:
29853+
type:
29854+
$ref: "#/components/schemas/DORADeploymentPatchRemediationType"
29855+
version:
29856+
description: The version of the remediation deployment.
29857+
example: v1.2.4
29858+
type: string
29859+
required:
29860+
- version
29861+
- type
29862+
type: object
29863+
DORADeploymentPatchByVersionRequest:
29864+
description: Request to patch a DORA deployment event identified by service, environment, and version.
29865+
example:
29866+
data:
29867+
attributes:
29868+
change_failure: true
29869+
env: "production"
29870+
remediation:
29871+
type: "rollback"
29872+
version: "v1.2.2"
29873+
service: "my-service"
29874+
version: "v1.2.3"
29875+
type: "dora_deployment_patch_request"
29876+
properties:
29877+
data:
29878+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequestData"
29879+
required:
29880+
- data
29881+
type: object
29882+
DORADeploymentPatchByVersionRequestAttributes:
29883+
description: Attributes for patching a DORA deployment event identified by service, environment, and version.
29884+
properties:
29885+
change_failure:
29886+
description: Indicates whether the deployment resulted in a change failure.
29887+
example: true
29888+
type: boolean
29889+
env:
29890+
description: The environment the deployment was performed in.
29891+
example: prod
29892+
type: string
29893+
remediation:
29894+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRemediation"
29895+
service:
29896+
description: The name of the service that was deployed.
29897+
example: my-service
29898+
type: string
29899+
version:
29900+
description: "The version deployed. This can be seen in the Service Catalog or in the APM Deployment Tracking."
29901+
example: v1.2.3
29902+
type: string
29903+
required:
29904+
- service
29905+
- env
29906+
- version
29907+
- change_failure
29908+
type: object
29909+
DORADeploymentPatchByVersionRequestData:
29910+
description: The JSON:API data for patching a deployment identified by service, environment, and version.
29911+
properties:
29912+
attributes:
29913+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequestAttributes"
29914+
type:
29915+
$ref: "#/components/schemas/DORADeploymentPatchRequestDataType"
29916+
required:
29917+
- type
29918+
- attributes
29919+
type: object
2983029920
DORADeploymentPatchRemediation:
29831-
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time.
29921+
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.
2983229922
properties:
2983329923
id:
29834-
description: The ID of the remediation deployment. Required when the failed deployment must be linked to a remediation deployment.
29924+
description: The ID of the remediation deployment. Use this or `version` to identify the remediation deployment, but not both.
2983529925
example: eG42zNIkVjM
2983629926
type: string
2983729927
type:
2983829928
$ref: "#/components/schemas/DORADeploymentPatchRemediationType"
29929+
version:
29930+
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.
29931+
example: v1.2.4
29932+
type: string
2983929933
type: object
2984029934
DORADeploymentPatchRemediationType:
2984129935
description: The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
@@ -140896,6 +140990,52 @@ paths:
140896140990
permissions:
140897140991
- dora_metrics_write
140898140992
/api/v2/dora/deployments:
140993+
patch:
140994+
description: |-
140995+
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.
140996+
operationId: PatchDORADeploymentByVersion
140997+
requestBody:
140998+
content:
140999+
application/json:
141000+
examples:
141001+
default:
141002+
value:
141003+
data:
141004+
attributes:
141005+
change_failure: true
141006+
env: production
141007+
service: my-service
141008+
version: v1.2.3
141009+
type: dora_deployment_patch_request
141010+
schema:
141011+
$ref: "#/components/schemas/DORADeploymentPatchByVersionRequest"
141012+
required: true
141013+
responses:
141014+
"202":
141015+
description: Accepted
141016+
"400":
141017+
content:
141018+
application/json:
141019+
schema:
141020+
$ref: "#/components/schemas/JSONAPIErrorResponse"
141021+
description: Bad Request
141022+
"403":
141023+
$ref: "#/components/responses/NotAuthorizedResponse"
141024+
"429":
141025+
$ref: "#/components/responses/TooManyRequestsResponse"
141026+
security:
141027+
- apiKeyAuth: []
141028+
appKeyAuth: []
141029+
summary: Patch a deployment event by version
141030+
tags: ["DORA Metrics"]
141031+
x-codegen-request-body-name: body
141032+
x-permission:
141033+
operator: OR
141034+
permissions:
141035+
- dora_metrics_write
141036+
x-unstable: |-
141037+
**Note**: This endpoint is in preview and is subject to change.
141038+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
140899141039
post:
140900141040
description: |-
140901141041
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
@@ -13199,6 +13199,41 @@ datadog\_api\_client.v2.model.dora\_deployment\_object\_attributes module
1319913199
:members:
1320013200
:show-inheritance:
1320113201

13202+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_remediation module
13203+
--------------------------------------------------------------------------------------
13204+
13205+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_remediation
13206+
:members:
13207+
:show-inheritance:
13208+
13209+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_remediation\_by\_id module
13210+
----------------------------------------------------------------------------------------------
13211+
13212+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_remediation_by_id
13213+
:members:
13214+
:show-inheritance:
13215+
13216+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request module
13217+
----------------------------------------------------------------------------------
13218+
13219+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request
13220+
:members:
13221+
:show-inheritance:
13222+
13223+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_attributes module
13224+
----------------------------------------------------------------------------------------------
13225+
13226+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributes
13227+
:members:
13228+
:show-inheritance:
13229+
13230+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_by\_version\_request\_data module
13231+
----------------------------------------------------------------------------------------
13232+
13233+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_by_version_request_data
13234+
:members:
13235+
:show-inheritance:
13236+
1320213237
datadog\_api\_client.v2.model.dora\_deployment\_patch\_remediation module
1320313238
-------------------------------------------------------------------------
1320413239

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)