Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20960,6 +20960,29 @@ components:
type: string
type: array
type: object
DeploymentRuleOptionsFaultyDeploymentDetectionResponse:
additionalProperties: false
description: Faulty deployment detection options returned in deployment rule
responses. The `excluded_resources` field is always present, which allows
disambiguating this type from monitor options when both share a `duration`
field.
properties:
duration:
description: The duration for faulty deployment detection.
example: 3600
format: int64
type: integer
excluded_resources:
description: Resources to exclude from faulty deployment detection.
example:
- resource1
- resource2
items:
type: string
type: array
required:
- excluded_resources
type: object
DeploymentRuleOptionsMonitor:
additionalProperties: false
description: Monitor options for deployment rules.
Expand Down Expand Up @@ -21022,7 +21045,7 @@ components:
example: My deployment rule
type: string
options:
$ref: '#/components/schemas/DeploymentRulesOptions'
$ref: '#/components/schemas/DeploymentRulesOptionsResponse'
type:
$ref: '#/components/schemas/DeploymentRuleResponseDataAttributesType'
updated_at:
Expand Down Expand Up @@ -21087,11 +21110,18 @@ components:
- id
type: object
DeploymentRulesOptions:
description: Options for deployment rule response representing either faulty
description: Options for deployment rule requests representing either faulty
deployment detection or monitor options.
oneOf:
- $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection'
- $ref: '#/components/schemas/DeploymentRuleOptionsMonitor'
DeploymentRulesOptionsResponse:
description: Options returned in deployment rule responses representing either
faulty deployment detection or monitor options. Faulty deployment detection
responses always include `excluded_resources`, making the two variants unambiguous.
oneOf:
- $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetectionResponse'
- $ref: '#/components/schemas/DeploymentRuleOptionsMonitor'
DetachCaseRequest:
description: Request for detaching security findings from their case.
properties:
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8376,6 +8376,13 @@ datadog\_api\_client.v2.model.deployment\_rule\_options\_faulty\_deployment\_det
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rule\_options\_faulty\_deployment\_detection\_response module
-------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rule\_options\_monitor module
-----------------------------------------------------------------------

Expand Down Expand Up @@ -8432,6 +8439,13 @@ datadog\_api\_client.v2.model.deployment\_rules\_options module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rules\_options\_response module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.deployment_rules_options_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.detach\_case\_request module
----------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
:param name: The name of the deployment rule.
:type name: str

:param options: Options for deployment rule response representing either faulty deployment detection or monitor options.
:param options: Options for deployment rule requests representing either faulty deployment detection or monitor options.
:type options: DeploymentRulesOptions

:param type: The type of the deployment rule (faulty_deployment_detection or monitor).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 List, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class DeploymentRuleOptionsFaultyDeploymentDetectionResponse(ModelNormal):
@cached_property
def additional_properties_type(_):
return None

@cached_property
def openapi_types(_):
return {
"duration": (int,),
"excluded_resources": ([str],),
}

attribute_map = {
"duration": "duration",
"excluded_resources": "excluded_resources",
}

def __init__(self_, excluded_resources: List[str], duration: Union[int, UnsetType] = unset, **kwargs):
"""
Faulty deployment detection options returned in deployment rule responses. The ``excluded_resources`` field is always present, which allows disambiguating this type from monitor options when both share a ``duration`` field.

:param duration: The duration for faulty deployment detection.
:type duration: int, optional

:param excluded_resources: Resources to exclude from faulty deployment detection.
:type excluded_resources: [str]
"""
if duration is not unset:
kwargs["duration"] = duration
super().__init__(kwargs)

self_.excluded_resources = excluded_resources
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_created_by import (
DeploymentRuleResponseDataAttributesCreatedBy,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.deployment_rules_options_response import DeploymentRulesOptionsResponse
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_type import (
DeploymentRuleResponseDataAttributesType,
)
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_updated_by import (
DeploymentRuleResponseDataAttributesUpdatedBy,
)
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import (
DeploymentRuleOptionsFaultyDeploymentDetection,
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response import (
DeploymentRuleOptionsFaultyDeploymentDetectionResponse,
)
from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor

Expand All @@ -37,7 +37,7 @@ def openapi_types(_):
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_created_by import (
DeploymentRuleResponseDataAttributesCreatedBy,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.deployment_rules_options_response import DeploymentRulesOptionsResponse
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_type import (
DeploymentRuleResponseDataAttributesType,
)
Expand All @@ -51,7 +51,7 @@ def openapi_types(_):
"dry_run": (bool,),
"gate_id": (str,),
"name": (str,),
"options": (DeploymentRulesOptions,),
"options": (DeploymentRulesOptionsResponse,),
"type": (DeploymentRuleResponseDataAttributesType,),
"updated_at": (datetime,),
"updated_by": (DeploymentRuleResponseDataAttributesUpdatedBy,),
Expand All @@ -77,7 +77,9 @@ def __init__(
gate_id: str,
name: str,
options: Union[
DeploymentRulesOptions, DeploymentRuleOptionsFaultyDeploymentDetection, DeploymentRuleOptionsMonitor
DeploymentRulesOptionsResponse,
DeploymentRuleOptionsFaultyDeploymentDetectionResponse,
DeploymentRuleOptionsMonitor,
],
type: DeploymentRuleResponseDataAttributesType,
updated_at: Union[datetime, UnsetType] = unset,
Expand All @@ -102,8 +104,8 @@ def __init__(
:param name: The name of the deployment rule.
:type name: str

:param options: Options for deployment rule response representing either faulty deployment detection or monitor options.
:type options: DeploymentRulesOptions
:param options: Options returned in deployment rule responses representing either faulty deployment detection or monitor options. Faulty deployment detection responses always include ``excluded_resources`` , making the two variants unambiguous.
:type options: DeploymentRulesOptionsResponse

:param type: The type of the deployment rule.
:type type: DeploymentRuleResponseDataAttributesType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class DeploymentRulesOptions(ModelComposed):
def __init__(self, **kwargs):
"""
Options for deployment rule response representing either faulty deployment detection or monitor options.
Options for deployment rule requests representing either faulty deployment detection or monitor options.

:param duration: The duration for faulty deployment detection.
:type duration: int, optional
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 datadog_api_client.model_utils import (
ModelComposed,
cached_property,
)


class DeploymentRulesOptionsResponse(ModelComposed):
def __init__(self, **kwargs):
"""
Options returned in deployment rule responses representing either faulty deployment detection or monitor options. Faulty deployment detection responses always include ``excluded_resources`` , making the two variants unambiguous.

:param duration: The duration for faulty deployment detection.
:type duration: int, optional

:param excluded_resources: Resources to exclude from faulty deployment detection.
:type excluded_resources: [str]

:param query: Monitors that match this query are evaluated.
:type query: str
"""
super().__init__(kwargs)

@cached_property
def _composed_schemas(_):
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error because the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response import (
DeploymentRuleOptionsFaultyDeploymentDetectionResponse,
)
from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor

return {
"oneOf": [
DeploymentRuleOptionsFaultyDeploymentDetectionResponse,
DeploymentRuleOptionsMonitor,
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
:param name: The name of the deployment rule.
:type name: str

:param options: Options for deployment rule response representing either faulty deployment detection or monitor options.
:param options: Options for deployment rule requests representing either faulty deployment detection or monitor options.
:type options: DeploymentRulesOptions
"""
super().__init__(kwargs)
Expand Down
6 changes: 6 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,9 @@
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import (
DeploymentRuleOptionsFaultyDeploymentDetection,
)
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response import (
DeploymentRuleOptionsFaultyDeploymentDetectionResponse,
)
from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor
from datadog_api_client.v2.model.deployment_rule_response import DeploymentRuleResponse
from datadog_api_client.v2.model.deployment_rule_response_data import DeploymentRuleResponseData
Expand All @@ -1706,6 +1709,7 @@
DeploymentRuleResponseDataAttributesUpdatedBy,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.deployment_rules_options_response import DeploymentRulesOptionsResponse
from datadog_api_client.v2.model.detach_case_request import DetachCaseRequest
from datadog_api_client.v2.model.detach_case_request_data import DetachCaseRequestData
from datadog_api_client.v2.model.detach_case_request_data_relationships import DetachCaseRequestDataRelationships
Expand Down Expand Up @@ -7682,6 +7686,7 @@
"DeploymentRelationshipData",
"DeploymentRuleDataType",
"DeploymentRuleOptionsFaultyDeploymentDetection",
"DeploymentRuleOptionsFaultyDeploymentDetectionResponse",
"DeploymentRuleOptionsMonitor",
"DeploymentRuleResponse",
"DeploymentRuleResponseData",
Expand All @@ -7690,6 +7695,7 @@
"DeploymentRuleResponseDataAttributesType",
"DeploymentRuleResponseDataAttributesUpdatedBy",
"DeploymentRulesOptions",
"DeploymentRulesOptionsResponse",
"DetachCaseRequest",
"DetachCaseRequestData",
"DetachCaseRequestDataRelationships",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-12-10T09:23:50.780Z
2026-03-11T14:49:58.105Z
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interactions:
- request:
body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1765358630","service":"my-service"},"type":"deployment_gate"}}'
body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1773240598","service":"my-service"},"type":"deployment_gate"}}'
headers:
accept:
- application/json
Expand All @@ -10,8 +10,8 @@ interactions:
uri: https://api.datadoghq.com/api/v2/deployment_gates
response:
body:
string: '{"data":{"id":"24d967fe-1dec-4957-bf77-7eda18a65d47","type":"deployment_gate","attributes":{"created_at":"2025-12-10T09:23:50.813397Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1765358630","service":"my-service","updated_at":"2025-12-10T09:23:50.813397Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
string: '{"data":{"id":"2f5dd6f5-d95a-484e-854d-deef73efb664","type":"deployment_gate","attributes":{"created_at":"2026-03-11T14:49:58.708133Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1773240598","service":"my-service","updated_at":"2026-03-11T14:49:58.708133Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}'
headers:
content-type:
Expand All @@ -27,12 +27,12 @@ interactions:
content-type:
- application/json
method: POST
uri: https://api.datadoghq.com/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47/rules
uri: https://api.datadoghq.com/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664/rules
response:
body:
string: '{"data":{"id":"ebe85a93-a82d-49ec-8925-6d3d569012bb","type":"deployment_rule","attributes":{"created_at":"2025-12-10T09:23:50.871951Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"24d967fe-1dec-4957-bf77-7eda18a65d47","name":"My
deployment rule","options":{},"type":"faulty_deployment_detection","updated_at":"2025-12-10T09:23:50.871951Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
string: '{"data":{"id":"cd2c3087-0e8b-4696-a8a1-7af14e218e46","type":"deployment_rule","attributes":{"created_at":"2026-03-11T14:49:59.023723Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"2f5dd6f5-d95a-484e-854d-deef73efb664","name":"My
deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-11T14:49:59.023723Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}'
headers:
content-type:
Expand All @@ -46,7 +46,7 @@ interactions:
accept:
- '*/*'
method: DELETE
uri: https://api.datadoghq.com/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47/rules/ebe85a93-a82d-49ec-8925-6d3d569012bb
uri: https://api.datadoghq.com/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664/rules/cd2c3087-0e8b-4696-a8a1-7af14e218e46
response:
body:
string: ''
Expand All @@ -60,7 +60,7 @@ interactions:
accept:
- '*/*'
method: DELETE
uri: https://api.datadoghq.com/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47
uri: https://api.datadoghq.com/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664
response:
body:
string: ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-12-10T09:23:51.998Z
2026-03-11T14:49:59.730Z
Loading
Loading