Skip to content

Commit df96e13

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d455ef7 of spec repo
1 parent 9294cf9 commit df96e13

16 files changed

Lines changed: 702 additions & 5 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 152 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29986,6 +29986,25 @@ components:
2998629986
data:
2998729987
$ref: "#/components/schemas/ListDeploymentRuleResponseData"
2998829988
type: object
29989+
DeploymentGatesEvaluationConfiguration:
29990+
description: |-
29991+
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
29992+
directly from this configuration instead of using the preconfigured gate rules.
29993+
At least one rule is required.
29994+
properties:
29995+
dry_run:
29996+
description: Gate-level dry run. When enabled, the rules are evaluated normally but the gate always returns `pass`. The real result is visible in the Datadog UI.
29997+
example: false
29998+
type: boolean
29999+
rules:
30000+
description: The list of rules to evaluate. At least one rule is required.
30001+
items:
30002+
$ref: "#/components/schemas/DeploymentGatesEvaluationRule"
30003+
minItems: 1
30004+
type: array
30005+
required:
30006+
- rules
30007+
type: object
2998930008
DeploymentGatesEvaluationRequest:
2999030009
description: Request body for triggering a deployment gate evaluation.
2999130010
properties:
@@ -29995,8 +30014,13 @@ components:
2999530014
- data
2999630015
type: object
2999730016
DeploymentGatesEvaluationRequestAttributes:
29998-
description: Attributes for a deployment gate evaluation request.
30017+
description: |-
30018+
Attributes for a deployment gate evaluation request.
30019+
When `configuration` is provided, rules are evaluated inline from that configuration.
30020+
When omitted, rules are resolved from the preconfigured gate for the given service and environment.
2999930021
properties:
30022+
configuration:
30023+
$ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration"
3000030024
env:
3000130025
description: The environment of the deployment.
3000230026
example: "staging"
@@ -30166,6 +30190,60 @@ components:
3016630190
type: string
3016730191
x-enum-varnames:
3016830192
- DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE
30193+
DeploymentGatesEvaluationRule:
30194+
description: A rule to evaluate as part of a deployment gate evaluation.
30195+
discriminator:
30196+
mapping:
30197+
faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule"
30198+
monitor: "#/components/schemas/DeploymentGatesMonitorRule"
30199+
propertyName: type
30200+
oneOf:
30201+
- $ref: "#/components/schemas/DeploymentGatesMonitorRule"
30202+
- $ref: "#/components/schemas/DeploymentGatesFDDRule"
30203+
DeploymentGatesFDDRule:
30204+
description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
30205+
properties:
30206+
dry_run:
30207+
description: Rule-level dry run. When enabled, the rule is evaluated normally but it always returns `pass`. The real result is visible in the Datadog UI.
30208+
example: false
30209+
type: boolean
30210+
name:
30211+
description: Human-readable name for this rule.
30212+
example: "apm faulty deployment"
30213+
type: string
30214+
options:
30215+
$ref: "#/components/schemas/DeploymentGatesFDDRuleOptions"
30216+
type:
30217+
$ref: "#/components/schemas/DeploymentGatesFDDRuleType"
30218+
required:
30219+
- type
30220+
- name
30221+
type: object
30222+
DeploymentGatesFDDRuleOptions:
30223+
description: Options for a `faulty_deployment_detection` rule.
30224+
properties:
30225+
duration:
30226+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
30227+
example: 900
30228+
format: int64
30229+
maximum: 7200
30230+
type: integer
30231+
excluded_resources:
30232+
description: APM resource names to exclude from analysis.
30233+
example:
30234+
- "GET /healthcheck"
30235+
items:
30236+
type: string
30237+
type: array
30238+
type: object
30239+
DeploymentGatesFDDRuleType:
30240+
description: The type identifier for a faulty deployment detection rule.
30241+
enum:
30242+
- faulty_deployment_detection
30243+
example: faulty_deployment_detection
30244+
type: string
30245+
x-enum-varnames:
30246+
- FAULTY_DEPLOYMENT_DETECTION
3016930247
DeploymentGatesListResponse:
3017030248
description: Response containing a paginated list of deployment gates.
3017130249
properties:
@@ -30200,6 +30278,49 @@ components:
3020030278
minimum: 1
3020130279
type: integer
3020230280
type: object
30281+
DeploymentGatesMonitorRule:
30282+
description: A monitor rule to evaluate as part of a deployment gate evaluation.
30283+
properties:
30284+
dry_run:
30285+
description: Rule-level dry run. When enabled, the rule is evaluated normally but always returns `pass`. The real result is visible in the Datadog UI.
30286+
example: false
30287+
type: boolean
30288+
name:
30289+
description: Human-readable name for this rule.
30290+
example: "error rate monitors"
30291+
type: string
30292+
options:
30293+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions"
30294+
type:
30295+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleType"
30296+
required:
30297+
- type
30298+
- name
30299+
type: object
30300+
DeploymentGatesMonitorRuleOptions:
30301+
description: Options for a `monitor` rule.
30302+
properties:
30303+
duration:
30304+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
30305+
example: 300
30306+
format: int64
30307+
maximum: 7200
30308+
type: integer
30309+
query:
30310+
description: Monitor search query.
30311+
example: "service:transaction-backend env:production"
30312+
type: string
30313+
required:
30314+
- query
30315+
type: object
30316+
DeploymentGatesMonitorRuleType:
30317+
description: The type identifier for a monitor rule.
30318+
enum:
30319+
- monitor
30320+
example: monitor
30321+
type: string
30322+
x-enum-varnames:
30323+
- MONITOR
3020330324
DeploymentGatesRuleResponse:
3020430325
description: The result of a single rule evaluation.
3020530326
properties:
@@ -124667,12 +124788,17 @@ paths:
124667124788
Triggers an asynchronous deployment gate evaluation for the given service and environment.
124668124789
Returns an evaluation ID that can be used to poll for the result via the
124669124790
`GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
124791+
124792+
When the `configuration` attribute is provided, rules are evaluated inline from that configuration
124793+
and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
124794+
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
124670124795
operationId: TriggerDeploymentGatesEvaluation
124671124796
requestBody:
124672124797
content:
124673124798
application/json:
124674124799
examples:
124675124800
default:
124801+
summary: Evaluate a preconfigured gate
124676124802
value:
124677124803
data:
124678124804
attributes:
@@ -124682,6 +124808,31 @@ paths:
124682124808
service: transaction-backend
124683124809
version: v1.2.3
124684124810
type: deployment_gates_evaluation_request
124811+
with-configuration:
124812+
summary: Evaluate with inline rule configuration
124813+
value:
124814+
data:
124815+
attributes:
124816+
configuration:
124817+
dry_run: false
124818+
rules:
124819+
- dry_run: false
124820+
name: error rate monitors
124821+
options:
124822+
duration: 300
124823+
query: "service:transaction-backend env:production"
124824+
type: monitor
124825+
- dry_run: false
124826+
name: apm faulty deployment
124827+
options:
124828+
duration: 900
124829+
excluded_resources:
124830+
- "GET /healthcheck"
124831+
type: faulty_deployment_detection
124832+
env: production
124833+
service: transaction-backend
124834+
version: 1.2.3
124835+
type: deployment_gates_evaluation_request
124685124836
schema:
124686124837
$ref: "#/components/schemas/DeploymentGatesEvaluationRequest"
124687124838
required: true

docs/datadog_api_client.v2.model.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11638,6 +11638,13 @@ datadog\_api\_client.v2.model.deployment\_gate\_rules\_response module
1163811638
:members:
1163911639
:show-inheritance:
1164011640

11641+
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_configuration module
11642+
---------------------------------------------------------------------------------
11643+
11644+
.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_configuration
11645+
:members:
11646+
:show-inheritance:
11647+
1164111648
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request module
1164211649
---------------------------------------------------------------------------
1164311650

@@ -11729,6 +11736,34 @@ datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_d
1172911736
:members:
1173011737
:show-inheritance:
1173111738

11739+
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_rule module
11740+
------------------------------------------------------------------------
11741+
11742+
.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_rule
11743+
:members:
11744+
:show-inheritance:
11745+
11746+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule module
11747+
-----------------------------------------------------------------
11748+
11749+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule
11750+
:members:
11751+
:show-inheritance:
11752+
11753+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule\_options module
11754+
--------------------------------------------------------------------------
11755+
11756+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule_options
11757+
:members:
11758+
:show-inheritance:
11759+
11760+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule\_type module
11761+
-----------------------------------------------------------------------
11762+
11763+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule_type
11764+
:members:
11765+
:show-inheritance:
11766+
1173211767
datadog\_api\_client.v2.model.deployment\_gates\_list\_response module
1173311768
----------------------------------------------------------------------
1173411769

@@ -11750,6 +11785,27 @@ datadog\_api\_client.v2.model.deployment\_gates\_list\_response\_meta\_page modu
1175011785
:members:
1175111786
:show-inheritance:
1175211787

11788+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule module
11789+
---------------------------------------------------------------------
11790+
11791+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule
11792+
:members:
11793+
:show-inheritance:
11794+
11795+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule\_options module
11796+
------------------------------------------------------------------------------
11797+
11798+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule_options
11799+
:members:
11800+
:show-inheritance:
11801+
11802+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule\_type module
11803+
---------------------------------------------------------------------------
11804+
11805+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule_type
11806+
:members:
11807+
:show-inheritance:
11808+
1175311809
datadog\_api\_client.v2.model.deployment\_gates\_rule\_response module
1175411810
----------------------------------------------------------------------
1175511811

examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi
7+
from datadog_api_client.v2.model.deployment_gates_evaluation_configuration import DeploymentGatesEvaluationConfiguration
78
from datadog_api_client.v2.model.deployment_gates_evaluation_request import DeploymentGatesEvaluationRequest
89
from datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes import (
910
DeploymentGatesEvaluationRequestAttributes,
@@ -12,10 +13,27 @@
1213
from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import (
1314
DeploymentGatesEvaluationRequestDataType,
1415
)
16+
from datadog_api_client.v2.model.deployment_gates_monitor_rule import DeploymentGatesMonitorRule
17+
from datadog_api_client.v2.model.deployment_gates_monitor_rule_options import DeploymentGatesMonitorRuleOptions
18+
from datadog_api_client.v2.model.deployment_gates_monitor_rule_type import DeploymentGatesMonitorRuleType
1519

1620
body = DeploymentGatesEvaluationRequest(
1721
data=DeploymentGatesEvaluationRequestData(
1822
attributes=DeploymentGatesEvaluationRequestAttributes(
23+
configuration=DeploymentGatesEvaluationConfiguration(
24+
dry_run=False,
25+
rules=[
26+
DeploymentGatesMonitorRule(
27+
dry_run=False,
28+
name="error rate monitors",
29+
options=DeploymentGatesMonitorRuleOptions(
30+
duration=300,
31+
query="service:transaction-backend env:production",
32+
),
33+
type=DeploymentGatesMonitorRuleType.MONITOR,
34+
),
35+
],
36+
),
1937
env="staging",
2038
identifier="pre-deploy",
2139
primary_tag="region:us-east-1",

src/datadog_api_client/v2/api/deployment_gates_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ def trigger_deployment_gates_evaluation(
531531
Returns an evaluation ID that can be used to poll for the result via the
532532
``GET /api/v2/deployments/gates/evaluation/{id}`` endpoint.
533533
534+
When the ``configuration`` attribute is provided, rules are evaluated inline from that configuration
535+
and no pre-configured gate is required. When ``configuration`` is omitted, rules are resolved from the
536+
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
537+
534538
:type body: DeploymentGatesEvaluationRequest
535539
:rtype: DeploymentGatesEvaluationResponse
536540
"""
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 List, 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.deployment_gates_evaluation_rule import DeploymentGatesEvaluationRule
18+
from datadog_api_client.v2.model.deployment_gates_monitor_rule import DeploymentGatesMonitorRule
19+
from datadog_api_client.v2.model.deployment_gates_fdd_rule import DeploymentGatesFDDRule
20+
21+
22+
class DeploymentGatesEvaluationConfiguration(ModelNormal):
23+
validations = {
24+
"rules": {
25+
"min_items": 1,
26+
},
27+
}
28+
29+
@cached_property
30+
def openapi_types(_):
31+
from datadog_api_client.v2.model.deployment_gates_evaluation_rule import DeploymentGatesEvaluationRule
32+
33+
return {
34+
"dry_run": (bool,),
35+
"rules": ([DeploymentGatesEvaluationRule],),
36+
}
37+
38+
attribute_map = {
39+
"dry_run": "dry_run",
40+
"rules": "rules",
41+
}
42+
43+
def __init__(
44+
self_,
45+
rules: List[Union[DeploymentGatesEvaluationRule, DeploymentGatesMonitorRule, DeploymentGatesFDDRule]],
46+
dry_run: Union[bool, UnsetType] = unset,
47+
**kwargs,
48+
):
49+
"""
50+
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
51+
directly from this configuration instead of using the preconfigured gate rules.
52+
At least one rule is required.
53+
54+
:param dry_run: Gate-level dry run. When enabled, the rules are evaluated normally but the gate always returns ``pass``. The real result is visible in the Datadog UI.
55+
:type dry_run: bool, optional
56+
57+
:param rules: The list of rules to evaluate. At least one rule is required.
58+
:type rules: [DeploymentGatesEvaluationRule]
59+
"""
60+
if dry_run is not unset:
61+
kwargs["dry_run"] = dry_run
62+
super().__init__(kwargs)
63+
64+
self_.rules = rules

0 commit comments

Comments
 (0)