Skip to content

Commit 1baf72e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4095999 of spec repo
1 parent 420cc90 commit 1baf72e

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
@@ -30035,6 +30035,25 @@ components:
3003530035
data:
3003630036
$ref: "#/components/schemas/ListDeploymentRuleResponseData"
3003730037
type: object
30038+
DeploymentGatesEvaluationConfiguration:
30039+
description: |-
30040+
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
30041+
directly from this configuration instead of using the preconfigured gate rules.
30042+
At least one rule is required.
30043+
properties:
30044+
dry_run:
30045+
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.
30046+
example: false
30047+
type: boolean
30048+
rules:
30049+
description: The list of rules to evaluate. At least one rule is required.
30050+
items:
30051+
$ref: "#/components/schemas/DeploymentGatesEvaluationRule"
30052+
minItems: 1
30053+
type: array
30054+
required:
30055+
- rules
30056+
type: object
3003830057
DeploymentGatesEvaluationRequest:
3003930058
description: Request body for triggering a deployment gate evaluation.
3004030059
properties:
@@ -30044,8 +30063,13 @@ components:
3004430063
- data
3004530064
type: object
3004630065
DeploymentGatesEvaluationRequestAttributes:
30047-
description: Attributes for a deployment gate evaluation request.
30066+
description: |-
30067+
Attributes for a deployment gate evaluation request.
30068+
When `configuration` is provided, rules are evaluated inline from that configuration.
30069+
When omitted, rules are resolved from the preconfigured gate for the given service and environment.
3004830070
properties:
30071+
configuration:
30072+
$ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration"
3004930073
env:
3005030074
description: The environment of the deployment.
3005130075
example: "staging"
@@ -30215,6 +30239,60 @@ components:
3021530239
type: string
3021630240
x-enum-varnames:
3021730241
- DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE
30242+
DeploymentGatesEvaluationRule:
30243+
description: A rule to evaluate as part of a deployment gate evaluation.
30244+
discriminator:
30245+
mapping:
30246+
faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule"
30247+
monitor: "#/components/schemas/DeploymentGatesMonitorRule"
30248+
propertyName: type
30249+
oneOf:
30250+
- $ref: "#/components/schemas/DeploymentGatesMonitorRule"
30251+
- $ref: "#/components/schemas/DeploymentGatesFDDRule"
30252+
DeploymentGatesFDDRule:
30253+
description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
30254+
properties:
30255+
dry_run:
30256+
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.
30257+
example: false
30258+
type: boolean
30259+
name:
30260+
description: Human-readable name for this rule.
30261+
example: "apm faulty deployment"
30262+
type: string
30263+
options:
30264+
$ref: "#/components/schemas/DeploymentGatesFDDRuleOptions"
30265+
type:
30266+
$ref: "#/components/schemas/DeploymentGatesFDDRuleType"
30267+
required:
30268+
- type
30269+
- name
30270+
type: object
30271+
DeploymentGatesFDDRuleOptions:
30272+
description: Options for a `faulty_deployment_detection` rule.
30273+
properties:
30274+
duration:
30275+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
30276+
example: 900
30277+
format: int64
30278+
maximum: 7200
30279+
type: integer
30280+
excluded_resources:
30281+
description: APM resource names to exclude from analysis.
30282+
example:
30283+
- "GET /healthcheck"
30284+
items:
30285+
type: string
30286+
type: array
30287+
type: object
30288+
DeploymentGatesFDDRuleType:
30289+
description: The type identifier for a faulty deployment detection rule.
30290+
enum:
30291+
- faulty_deployment_detection
30292+
example: faulty_deployment_detection
30293+
type: string
30294+
x-enum-varnames:
30295+
- FAULTY_DEPLOYMENT_DETECTION
3021830296
DeploymentGatesListResponse:
3021930297
description: Response containing a paginated list of deployment gates.
3022030298
properties:
@@ -30249,6 +30327,49 @@ components:
3024930327
minimum: 1
3025030328
type: integer
3025130329
type: object
30330+
DeploymentGatesMonitorRule:
30331+
description: A monitor rule to evaluate as part of a deployment gate evaluation.
30332+
properties:
30333+
dry_run:
30334+
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.
30335+
example: false
30336+
type: boolean
30337+
name:
30338+
description: Human-readable name for this rule.
30339+
example: "error rate monitors"
30340+
type: string
30341+
options:
30342+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions"
30343+
type:
30344+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleType"
30345+
required:
30346+
- type
30347+
- name
30348+
type: object
30349+
DeploymentGatesMonitorRuleOptions:
30350+
description: Options for a `monitor` rule.
30351+
properties:
30352+
duration:
30353+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
30354+
example: 300
30355+
format: int64
30356+
maximum: 7200
30357+
type: integer
30358+
query:
30359+
description: Monitor search query.
30360+
example: "service:transaction-backend env:production"
30361+
type: string
30362+
required:
30363+
- query
30364+
type: object
30365+
DeploymentGatesMonitorRuleType:
30366+
description: The type identifier for a monitor rule.
30367+
enum:
30368+
- monitor
30369+
example: monitor
30370+
type: string
30371+
x-enum-varnames:
30372+
- MONITOR
3025230373
DeploymentGatesRuleResponse:
3025330374
description: The result of a single rule evaluation.
3025430375
properties:
@@ -125627,12 +125748,17 @@ paths:
125627125748
Triggers an asynchronous deployment gate evaluation for the given service and environment.
125628125749
Returns an evaluation ID that can be used to poll for the result via the
125629125750
`GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
125751+
125752+
When the `configuration` attribute is provided, rules are evaluated inline from that configuration
125753+
and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
125754+
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
125630125755
operationId: TriggerDeploymentGatesEvaluation
125631125756
requestBody:
125632125757
content:
125633125758
application/json:
125634125759
examples:
125635125760
default:
125761+
summary: Evaluate a preconfigured gate
125636125762
value:
125637125763
data:
125638125764
attributes:
@@ -125642,6 +125768,31 @@ paths:
125642125768
service: transaction-backend
125643125769
version: v1.2.3
125644125770
type: deployment_gates_evaluation_request
125771+
with-configuration:
125772+
summary: Evaluate with inline rule configuration
125773+
value:
125774+
data:
125775+
attributes:
125776+
configuration:
125777+
dry_run: false
125778+
rules:
125779+
- dry_run: false
125780+
name: error rate monitors
125781+
options:
125782+
duration: 300
125783+
query: "service:transaction-backend env:production"
125784+
type: monitor
125785+
- dry_run: false
125786+
name: apm faulty deployment
125787+
options:
125788+
duration: 900
125789+
excluded_resources:
125790+
- "GET /healthcheck"
125791+
type: faulty_deployment_detection
125792+
env: production
125793+
service: transaction-backend
125794+
version: 1.2.3
125795+
type: deployment_gates_evaluation_request
125645125796
schema:
125646125797
$ref: "#/components/schemas/DeploymentGatesEvaluationRequest"
125647125798
required: true

docs/datadog_api_client.v2.model.rst

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

11662+
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_configuration module
11663+
---------------------------------------------------------------------------------
11664+
11665+
.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_configuration
11666+
:members:
11667+
:show-inheritance:
11668+
1166211669
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request module
1166311670
---------------------------------------------------------------------------
1166411671

@@ -11750,6 +11757,34 @@ datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_d
1175011757
:members:
1175111758
:show-inheritance:
1175211759

11760+
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_rule module
11761+
------------------------------------------------------------------------
11762+
11763+
.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_rule
11764+
:members:
11765+
:show-inheritance:
11766+
11767+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule module
11768+
-----------------------------------------------------------------
11769+
11770+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule
11771+
:members:
11772+
:show-inheritance:
11773+
11774+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule\_options module
11775+
--------------------------------------------------------------------------
11776+
11777+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule_options
11778+
:members:
11779+
:show-inheritance:
11780+
11781+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule\_type module
11782+
-----------------------------------------------------------------------
11783+
11784+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule_type
11785+
:members:
11786+
:show-inheritance:
11787+
1175311788
datadog\_api\_client.v2.model.deployment\_gates\_list\_response module
1175411789
----------------------------------------------------------------------
1175511790

@@ -11771,6 +11806,27 @@ datadog\_api\_client.v2.model.deployment\_gates\_list\_response\_meta\_page modu
1177111806
:members:
1177211807
:show-inheritance:
1177311808

11809+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule module
11810+
---------------------------------------------------------------------
11811+
11812+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule
11813+
:members:
11814+
:show-inheritance:
11815+
11816+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule\_options module
11817+
------------------------------------------------------------------------------
11818+
11819+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule_options
11820+
:members:
11821+
:show-inheritance:
11822+
11823+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule\_type module
11824+
---------------------------------------------------------------------------
11825+
11826+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule_type
11827+
:members:
11828+
:show-inheritance:
11829+
1177411830
datadog\_api\_client.v2.model.deployment\_gates\_rule\_response module
1177511831
----------------------------------------------------------------------
1177611832

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)