Skip to content

Commit 6eab694

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e1f3e97 of spec repo
1 parent 436a1d4 commit 6eab694

13 files changed

+569
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16972,6 +16972,89 @@ components:
1697216972
- started_at
1697316973
- finished_at
1697416974
type: object
16975+
DORADeploymentPatchRemediation:
16976+
description: Remediation details for the deployment.
16977+
properties:
16978+
id:
16979+
description: The ID of the remediation action.
16980+
example: eG42zNIkVjM
16981+
type: string
16982+
type:
16983+
$ref: '#/components/schemas/DORADeploymentPatchRemediationType'
16984+
required:
16985+
- id
16986+
- type
16987+
type: object
16988+
DORADeploymentPatchRemediationType:
16989+
description: The type of remediation action taken.
16990+
enum:
16991+
- rollback
16992+
- rollforward
16993+
example: rollback
16994+
type: string
16995+
x-enum-varnames:
16996+
- ROLLBACK
16997+
- ROLLFORWARD
16998+
DORADeploymentPatchRequest:
16999+
description: Request to patch a DORA deployment event.
17000+
example:
17001+
data:
17002+
attributes:
17003+
change_failure: true
17004+
remediation:
17005+
id: eG42zNIkVjM
17006+
type: rollback
17007+
id: z_RwVLi7v4Y
17008+
type: dora_deployment_patch_request
17009+
properties:
17010+
data:
17011+
$ref: '#/components/schemas/DORADeploymentPatchRequestData'
17012+
required:
17013+
- data
17014+
type: object
17015+
DORADeploymentPatchRequestAttributes:
17016+
description: Attributes for patching a DORA deployment event.
17017+
properties:
17018+
change_failure:
17019+
description: Indicates whether the deployment resulted in a change failure.
17020+
example: true
17021+
type: boolean
17022+
remediation:
17023+
$ref: '#/components/schemas/DORADeploymentPatchRemediation'
17024+
type: object
17025+
DORADeploymentPatchRequestData:
17026+
description: The JSON:API data for patching a deployment.
17027+
example:
17028+
attributes:
17029+
change_failure: true
17030+
remediation:
17031+
id: eG42zNIkVjM
17032+
type: rollback
17033+
id: z_RwVLi7v4Y
17034+
type: dora_deployment_patch_request
17035+
properties:
17036+
attributes:
17037+
$ref: '#/components/schemas/DORADeploymentPatchRequestAttributes'
17038+
id:
17039+
description: The ID of the deployment to patch.
17040+
example: z_RwVLi7v4Y
17041+
type: string
17042+
type:
17043+
$ref: '#/components/schemas/DORADeploymentPatchRequestDataType'
17044+
required:
17045+
- type
17046+
- id
17047+
- attributes
17048+
type: object
17049+
DORADeploymentPatchRequestDataType:
17050+
default: dora_deployment_patch_request
17051+
description: JSON:API type for DORA deployment patch request.
17052+
enum:
17053+
- dora_deployment_patch_request
17054+
example: dora_deployment_patch_request
17055+
type: string
17056+
x-enum-varnames:
17057+
- DORA_DEPLOYMENT_PATCH_REQUEST
1697517058
DORADeploymentRequest:
1697617059
description: Request to create a DORA deployment event.
1697717060
properties:
@@ -74114,6 +74197,50 @@ paths:
7411474197
operator: OR
7411574198
permissions:
7411674199
- dora_metrics_read
74200+
patch:
74201+
description: Use this API endpoint to patch a deployment event.
74202+
operationId: PatchDORADeployment
74203+
parameters:
74204+
- description: The ID of the deployment event.
74205+
in: path
74206+
name: deployment_id
74207+
required: true
74208+
schema:
74209+
type: string
74210+
requestBody:
74211+
content:
74212+
application/json:
74213+
schema:
74214+
$ref: '#/components/schemas/DORADeploymentPatchRequest'
74215+
required: true
74216+
responses:
74217+
'202':
74218+
content:
74219+
application/json:
74220+
schema:
74221+
$ref: '#/components/schemas/DORADeploymentFetchResponse'
74222+
description: Accepted
74223+
'400':
74224+
content:
74225+
application/json:
74226+
schema:
74227+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74228+
description: Bad Request
74229+
'403':
74230+
$ref: '#/components/responses/NotAuthorizedResponse'
74231+
'429':
74232+
$ref: '#/components/responses/TooManyRequestsResponse'
74233+
security:
74234+
- apiKeyAuth: []
74235+
appKeyAuth: []
74236+
summary: Patch a deployment event
74237+
tags:
74238+
- DORA Metrics
74239+
x-codegen-request-body-name: body
74240+
x-permission:
74241+
operator: OR
74242+
permissions:
74243+
- dora_metrics_write
7411774244
/api/v2/dora/failure:
7411874245
post:
7411974246
description: 'Use this API endpoint to provide failure data.

docs/datadog_api_client.v2.model.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7760,6 +7760,48 @@ datadog\_api\_client.v2.model.dora\_deployment\_object\_attributes module
77607760
:members:
77617761
:show-inheritance:
77627762

7763+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_remediation module
7764+
-------------------------------------------------------------------------
7765+
7766+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_remediation
7767+
:members:
7768+
:show-inheritance:
7769+
7770+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_remediation\_type module
7771+
-------------------------------------------------------------------------------
7772+
7773+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_remediation_type
7774+
:members:
7775+
:show-inheritance:
7776+
7777+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_request module
7778+
---------------------------------------------------------------------
7779+
7780+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_request
7781+
:members:
7782+
:show-inheritance:
7783+
7784+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_request\_attributes module
7785+
---------------------------------------------------------------------------------
7786+
7787+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_request_attributes
7788+
:members:
7789+
:show-inheritance:
7790+
7791+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_request\_data module
7792+
---------------------------------------------------------------------------
7793+
7794+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_request_data
7795+
:members:
7796+
:show-inheritance:
7797+
7798+
datadog\_api\_client.v2.model.dora\_deployment\_patch\_request\_data\_type module
7799+
---------------------------------------------------------------------------------
7800+
7801+
.. automodule:: datadog_api_client.v2.model.dora_deployment_patch_request_data_type
7802+
:members:
7803+
:show-inheritance:
7804+
77637805
datadog\_api\_client.v2.model.dora\_deployment\_request module
77647806
--------------------------------------------------------------
77657807

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Patch a deployment event 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_remediation import DORADeploymentPatchRemediation
8+
from datadog_api_client.v2.model.dora_deployment_patch_remediation_type import DORADeploymentPatchRemediationType
9+
from datadog_api_client.v2.model.dora_deployment_patch_request import DORADeploymentPatchRequest
10+
from datadog_api_client.v2.model.dora_deployment_patch_request_attributes import DORADeploymentPatchRequestAttributes
11+
from datadog_api_client.v2.model.dora_deployment_patch_request_data import DORADeploymentPatchRequestData
12+
from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import DORADeploymentPatchRequestDataType
13+
14+
body = DORADeploymentPatchRequest(
15+
data=DORADeploymentPatchRequestData(
16+
attributes=DORADeploymentPatchRequestAttributes(
17+
change_failure=True,
18+
remediation=DORADeploymentPatchRemediation(
19+
id="eG42zNIkVjM",
20+
type=DORADeploymentPatchRemediationType.ROLLBACK,
21+
),
22+
),
23+
id="z_RwVLi7v4Y",
24+
type=DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST,
25+
),
26+
)
27+
28+
configuration = Configuration()
29+
with ApiClient(configuration) as api_client:
30+
api_instance = DORAMetricsApi(api_client)
31+
response = api_instance.patch_dora_deployment(deployment_id="deployment_id", body=body)
32+
33+
print(response)

src/datadog_api_client/v2/api/dora_metrics_api.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from datadog_api_client.v2.model.dora_deployments_list_response import DORADeploymentsListResponse
1414
from datadog_api_client.v2.model.dora_list_deployments_request import DORAListDeploymentsRequest
1515
from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse
16+
from datadog_api_client.v2.model.dora_deployment_patch_request import DORADeploymentPatchRequest
1617
from datadog_api_client.v2.model.dora_failure_response import DORAFailureResponse
1718
from datadog_api_client.v2.model.dora_failure_request import DORAFailureRequest
1819
from datadog_api_client.v2.model.dora_failures_list_response import DORAFailuresListResponse
@@ -224,6 +225,32 @@ def __init__(self, api_client=None):
224225
api_client=api_client,
225226
)
226227

228+
self._patch_dora_deployment_endpoint = _Endpoint(
229+
settings={
230+
"response_type": (DORADeploymentFetchResponse,),
231+
"auth": ["apiKeyAuth", "appKeyAuth"],
232+
"endpoint_path": "/api/v2/dora/deployments/{deployment_id}",
233+
"operation_id": "patch_dora_deployment",
234+
"http_method": "PATCH",
235+
"version": "v2",
236+
},
237+
params_map={
238+
"deployment_id": {
239+
"required": True,
240+
"openapi_types": (str,),
241+
"attribute": "deployment_id",
242+
"location": "path",
243+
},
244+
"body": {
245+
"required": True,
246+
"openapi_types": (DORADeploymentPatchRequest,),
247+
"location": "body",
248+
},
249+
},
250+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
251+
api_client=api_client,
252+
)
253+
227254
def create_dora_deployment(
228255
self,
229256
body: DORADeploymentRequest,
@@ -390,3 +417,24 @@ def list_dora_failures(
390417
kwargs["body"] = body
391418

392419
return self._list_dora_failures_endpoint.call_with_http_info(**kwargs)
420+
421+
def patch_dora_deployment(
422+
self,
423+
deployment_id: str,
424+
body: DORADeploymentPatchRequest,
425+
) -> DORADeploymentFetchResponse:
426+
"""Patch a deployment event.
427+
428+
Use this API endpoint to patch a deployment event.
429+
430+
:param deployment_id: The ID of the deployment event.
431+
:type deployment_id: str
432+
:type body: DORADeploymentPatchRequest
433+
:rtype: DORADeploymentFetchResponse
434+
"""
435+
kwargs: Dict[str, Any] = {}
436+
kwargs["deployment_id"] = deployment_id
437+
438+
kwargs["body"] = body
439+
440+
return self._patch_dora_deployment_endpoint.call_with_http_info(**kwargs)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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_remediation_type import DORADeploymentPatchRemediationType
16+
17+
18+
class DORADeploymentPatchRemediation(ModelNormal):
19+
@cached_property
20+
def openapi_types(_):
21+
from datadog_api_client.v2.model.dora_deployment_patch_remediation_type import (
22+
DORADeploymentPatchRemediationType,
23+
)
24+
25+
return {
26+
"id": (str,),
27+
"type": (DORADeploymentPatchRemediationType,),
28+
}
29+
30+
attribute_map = {
31+
"id": "id",
32+
"type": "type",
33+
}
34+
35+
def __init__(self_, id: str, type: DORADeploymentPatchRemediationType, **kwargs):
36+
"""
37+
Remediation details for the deployment.
38+
39+
:param id: The ID of the remediation action.
40+
:type id: str
41+
42+
:param type: The type of remediation action taken.
43+
:type type: DORADeploymentPatchRemediationType
44+
"""
45+
super().__init__(kwargs)
46+
47+
self_.id = id
48+
self_.type = type
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class DORADeploymentPatchRemediationType(ModelSimple):
16+
"""
17+
The type of remediation action taken.
18+
19+
:param value: Must be one of ["rollback", "rollforward"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"rollback",
25+
"rollforward",
26+
}
27+
ROLLBACK: ClassVar["DORADeploymentPatchRemediationType"]
28+
ROLLFORWARD: ClassVar["DORADeploymentPatchRemediationType"]
29+
30+
@cached_property
31+
def openapi_types(_):
32+
return {
33+
"value": (str,),
34+
}
35+
36+
37+
DORADeploymentPatchRemediationType.ROLLBACK = DORADeploymentPatchRemediationType("rollback")
38+
DORADeploymentPatchRemediationType.ROLLFORWARD = DORADeploymentPatchRemediationType("rollforward")

0 commit comments

Comments
 (0)