Skip to content

Commit 2a5f494

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 4095999 of spec repo (#3664)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent b784bfa commit 2a5f494

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
@@ -29999,6 +29999,25 @@ components:
2999929999
data:
3000030000
$ref: "#/components/schemas/ListDeploymentRuleResponseData"
3000130001
type: object
30002+
DeploymentGatesEvaluationConfiguration:
30003+
description: |-
30004+
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
30005+
directly from this configuration instead of using the preconfigured gate rules.
30006+
At least one rule is required.
30007+
properties:
30008+
dry_run:
30009+
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.
30010+
example: false
30011+
type: boolean
30012+
rules:
30013+
description: The list of rules to evaluate. At least one rule is required.
30014+
items:
30015+
$ref: "#/components/schemas/DeploymentGatesEvaluationRule"
30016+
minItems: 1
30017+
type: array
30018+
required:
30019+
- rules
30020+
type: object
3000230021
DeploymentGatesEvaluationRequest:
3000330022
description: Request body for triggering a deployment gate evaluation.
3000430023
properties:
@@ -30008,8 +30027,13 @@ components:
3000830027
- data
3000930028
type: object
3001030029
DeploymentGatesEvaluationRequestAttributes:
30011-
description: Attributes for a deployment gate evaluation request.
30030+
description: |-
30031+
Attributes for a deployment gate evaluation request.
30032+
When `configuration` is provided, rules are evaluated inline from that configuration.
30033+
When omitted, rules are resolved from the preconfigured gate for the given service and environment.
3001230034
properties:
30035+
configuration:
30036+
$ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration"
3001330037
env:
3001430038
description: The environment of the deployment.
3001530039
example: "staging"
@@ -30179,6 +30203,60 @@ components:
3017930203
type: string
3018030204
x-enum-varnames:
3018130205
- DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE
30206+
DeploymentGatesEvaluationRule:
30207+
description: A rule to evaluate as part of a deployment gate evaluation.
30208+
discriminator:
30209+
mapping:
30210+
faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule"
30211+
monitor: "#/components/schemas/DeploymentGatesMonitorRule"
30212+
propertyName: type
30213+
oneOf:
30214+
- $ref: "#/components/schemas/DeploymentGatesMonitorRule"
30215+
- $ref: "#/components/schemas/DeploymentGatesFDDRule"
30216+
DeploymentGatesFDDRule:
30217+
description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
30218+
properties:
30219+
dry_run:
30220+
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.
30221+
example: false
30222+
type: boolean
30223+
name:
30224+
description: Human-readable name for this rule.
30225+
example: "apm faulty deployment"
30226+
type: string
30227+
options:
30228+
$ref: "#/components/schemas/DeploymentGatesFDDRuleOptions"
30229+
type:
30230+
$ref: "#/components/schemas/DeploymentGatesFDDRuleType"
30231+
required:
30232+
- type
30233+
- name
30234+
type: object
30235+
DeploymentGatesFDDRuleOptions:
30236+
description: Options for a `faulty_deployment_detection` rule.
30237+
properties:
30238+
duration:
30239+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
30240+
example: 900
30241+
format: int64
30242+
maximum: 7200
30243+
type: integer
30244+
excluded_resources:
30245+
description: APM resource names to exclude from analysis.
30246+
example:
30247+
- "GET /healthcheck"
30248+
items:
30249+
type: string
30250+
type: array
30251+
type: object
30252+
DeploymentGatesFDDRuleType:
30253+
description: The type identifier for a faulty deployment detection rule.
30254+
enum:
30255+
- faulty_deployment_detection
30256+
example: faulty_deployment_detection
30257+
type: string
30258+
x-enum-varnames:
30259+
- FAULTY_DEPLOYMENT_DETECTION
3018230260
DeploymentGatesListResponse:
3018330261
description: Response containing a paginated list of deployment gates.
3018430262
properties:
@@ -30213,6 +30291,49 @@ components:
3021330291
minimum: 1
3021430292
type: integer
3021530293
type: object
30294+
DeploymentGatesMonitorRule:
30295+
description: A monitor rule to evaluate as part of a deployment gate evaluation.
30296+
properties:
30297+
dry_run:
30298+
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.
30299+
example: false
30300+
type: boolean
30301+
name:
30302+
description: Human-readable name for this rule.
30303+
example: "error rate monitors"
30304+
type: string
30305+
options:
30306+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions"
30307+
type:
30308+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleType"
30309+
required:
30310+
- type
30311+
- name
30312+
type: object
30313+
DeploymentGatesMonitorRuleOptions:
30314+
description: Options for a `monitor` rule.
30315+
properties:
30316+
duration:
30317+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
30318+
example: 300
30319+
format: int64
30320+
maximum: 7200
30321+
type: integer
30322+
query:
30323+
description: Monitor search query.
30324+
example: "service:transaction-backend env:production"
30325+
type: string
30326+
required:
30327+
- query
30328+
type: object
30329+
DeploymentGatesMonitorRuleType:
30330+
description: The type identifier for a monitor rule.
30331+
enum:
30332+
- monitor
30333+
example: monitor
30334+
type: string
30335+
x-enum-varnames:
30336+
- MONITOR
3021630337
DeploymentGatesRuleResponse:
3021730338
description: The result of a single rule evaluation.
3021830339
properties:
@@ -127285,12 +127406,17 @@ paths:
127285127406
Triggers an asynchronous deployment gate evaluation for the given service and environment.
127286127407
Returns an evaluation ID that can be used to poll for the result via the
127287127408
`GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
127409+
127410+
When the `configuration` attribute is provided, rules are evaluated inline from that configuration
127411+
and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
127412+
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
127288127413
operationId: TriggerDeploymentGatesEvaluation
127289127414
requestBody:
127290127415
content:
127291127416
application/json:
127292127417
examples:
127293127418
default:
127419+
summary: Evaluate a preconfigured gate
127294127420
value:
127295127421
data:
127296127422
attributes:
@@ -127300,6 +127426,31 @@ paths:
127300127426
service: transaction-backend
127301127427
version: v1.2.3
127302127428
type: deployment_gates_evaluation_request
127429+
with-configuration:
127430+
summary: Evaluate with inline rule configuration
127431+
value:
127432+
data:
127433+
attributes:
127434+
configuration:
127435+
dry_run: false
127436+
rules:
127437+
- dry_run: false
127438+
name: error rate monitors
127439+
options:
127440+
duration: 300
127441+
query: "service:transaction-backend env:production"
127442+
type: monitor
127443+
- dry_run: false
127444+
name: apm faulty deployment
127445+
options:
127446+
duration: 900
127447+
excluded_resources:
127448+
- "GET /healthcheck"
127449+
type: faulty_deployment_detection
127450+
env: production
127451+
service: transaction-backend
127452+
version: 1.2.3
127453+
type: deployment_gates_evaluation_request
127303127454
schema:
127304127455
$ref: "#/components/schemas/DeploymentGatesEvaluationRequest"
127305127456
required: true

docs/datadog_api_client.v2.model.rst

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

11620+
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_configuration module
11621+
---------------------------------------------------------------------------------
11622+
11623+
.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_configuration
11624+
:members:
11625+
:show-inheritance:
11626+
1162011627
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request module
1162111628
---------------------------------------------------------------------------
1162211629

@@ -11708,6 +11715,34 @@ datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_d
1170811715
:members:
1170911716
:show-inheritance:
1171011717

11718+
datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_rule module
11719+
------------------------------------------------------------------------
11720+
11721+
.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_rule
11722+
:members:
11723+
:show-inheritance:
11724+
11725+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule module
11726+
-----------------------------------------------------------------
11727+
11728+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule
11729+
:members:
11730+
:show-inheritance:
11731+
11732+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule\_options module
11733+
--------------------------------------------------------------------------
11734+
11735+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule_options
11736+
:members:
11737+
:show-inheritance:
11738+
11739+
datadog\_api\_client.v2.model.deployment\_gates\_fdd\_rule\_type module
11740+
-----------------------------------------------------------------------
11741+
11742+
.. automodule:: datadog_api_client.v2.model.deployment_gates_fdd_rule_type
11743+
:members:
11744+
:show-inheritance:
11745+
1171111746
datadog\_api\_client.v2.model.deployment\_gates\_list\_response module
1171211747
----------------------------------------------------------------------
1171311748

@@ -11729,6 +11764,27 @@ datadog\_api\_client.v2.model.deployment\_gates\_list\_response\_meta\_page modu
1172911764
:members:
1173011765
:show-inheritance:
1173111766

11767+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule module
11768+
---------------------------------------------------------------------
11769+
11770+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule
11771+
:members:
11772+
:show-inheritance:
11773+
11774+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule\_options module
11775+
------------------------------------------------------------------------------
11776+
11777+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule_options
11778+
:members:
11779+
:show-inheritance:
11780+
11781+
datadog\_api\_client.v2.model.deployment\_gates\_monitor\_rule\_type module
11782+
---------------------------------------------------------------------------
11783+
11784+
.. automodule:: datadog_api_client.v2.model.deployment_gates_monitor_rule_type
11785+
:members:
11786+
:show-inheritance:
11787+
1173211788
datadog\_api\_client.v2.model.deployment\_gates\_rule\_response module
1173311789
----------------------------------------------------------------------
1173411790

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)