Skip to content

Commit fc87a38

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

15 files changed

Lines changed: 1045 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

examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
body = DatadogAPIClient::V2::DeploymentGatesEvaluationRequest.new({
1010
data: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData.new({
1111
attributes: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes.new({
12+
configuration: DatadogAPIClient::V2::DeploymentGatesEvaluationConfiguration.new({
13+
dry_run: false,
14+
rules: [
15+
DatadogAPIClient::V2::DeploymentGatesMonitorRule.new({
16+
dry_run: false,
17+
name: "error rate monitors",
18+
options: DatadogAPIClient::V2::DeploymentGatesMonitorRuleOptions.new({
19+
duration: 300,
20+
query: "service:transaction-backend env:production",
21+
}),
22+
type: DatadogAPIClient::V2::DeploymentGatesMonitorRuleType::MONITOR,
23+
}),
24+
],
25+
}),
1226
env: "staging",
1327
identifier: "pre-deploy",
1428
primary_tag: "region:us-east-1",

features/v2/deployment_gates.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,23 +286,23 @@ Feature: Deployment Gates
286286
Scenario: Trigger a deployment gate evaluation returns "Accepted" response
287287
Given operation "TriggerDeploymentGatesEvaluation" enabled
288288
And new "TriggerDeploymentGatesEvaluation" request
289-
And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
289+
And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
290290
When the request is sent
291291
Then the response status is 202 Accepted
292292

293293
@generated @skip @team:DataDog/ci-app-backend
294294
Scenario: Trigger a deployment gate evaluation returns "Bad request." response
295295
Given operation "TriggerDeploymentGatesEvaluation" enabled
296296
And new "TriggerDeploymentGatesEvaluation" request
297-
And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
297+
And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
298298
When the request is sent
299299
Then the response status is 400 Bad request.
300300

301301
@generated @skip @team:DataDog/ci-app-backend
302302
Scenario: Trigger a deployment gate evaluation returns "Deployment gate not found." response
303303
Given operation "TriggerDeploymentGatesEvaluation" enabled
304304
And new "TriggerDeploymentGatesEvaluation" request
305-
And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
305+
And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
306306
When the request is sent
307307
Then the response status is 404 Deployment gate not found.
308308

lib/datadog_api_client/inflector.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,7 @@ def overrides
27842784
"v2.deployment_gate_response_data_attributes_created_by" => "DeploymentGateResponseDataAttributesCreatedBy",
27852785
"v2.deployment_gate_response_data_attributes_updated_by" => "DeploymentGateResponseDataAttributesUpdatedBy",
27862786
"v2.deployment_gate_rules_response" => "DeploymentGateRulesResponse",
2787+
"v2.deployment_gates_evaluation_configuration" => "DeploymentGatesEvaluationConfiguration",
27872788
"v2.deployment_gates_evaluation_request" => "DeploymentGatesEvaluationRequest",
27882789
"v2.deployment_gates_evaluation_request_attributes" => "DeploymentGatesEvaluationRequestAttributes",
27892790
"v2.deployment_gates_evaluation_request_data" => "DeploymentGatesEvaluationRequestData",
@@ -2797,9 +2798,16 @@ def overrides
27972798
"v2.deployment_gates_evaluation_result_response_attributes_gate_status" => "DeploymentGatesEvaluationResultResponseAttributesGateStatus",
27982799
"v2.deployment_gates_evaluation_result_response_data" => "DeploymentGatesEvaluationResultResponseData",
27992800
"v2.deployment_gates_evaluation_result_response_data_type" => "DeploymentGatesEvaluationResultResponseDataType",
2801+
"v2.deployment_gates_evaluation_rule" => "DeploymentGatesEvaluationRule",
2802+
"v2.deployment_gates_fdd_rule" => "DeploymentGatesFDDRule",
2803+
"v2.deployment_gates_fdd_rule_options" => "DeploymentGatesFDDRuleOptions",
2804+
"v2.deployment_gates_fdd_rule_type" => "DeploymentGatesFDDRuleType",
28002805
"v2.deployment_gates_list_response" => "DeploymentGatesListResponse",
28012806
"v2.deployment_gates_list_response_meta" => "DeploymentGatesListResponseMeta",
28022807
"v2.deployment_gates_list_response_meta_page" => "DeploymentGatesListResponseMetaPage",
2808+
"v2.deployment_gates_monitor_rule" => "DeploymentGatesMonitorRule",
2809+
"v2.deployment_gates_monitor_rule_options" => "DeploymentGatesMonitorRuleOptions",
2810+
"v2.deployment_gates_monitor_rule_type" => "DeploymentGatesMonitorRuleType",
28032811
"v2.deployment_gates_rule_response" => "DeploymentGatesRuleResponse",
28042812
"v2.deployment_metadata" => "DeploymentMetadata",
28052813
"v2.deployment_relationship" => "DeploymentRelationship",

lib/datadog_api_client/v2/api/deployment_gates_api.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,10 @@ def trigger_deployment_gates_evaluation(body, opts = {})
705705
# Returns an evaluation ID that can be used to poll for the result via the
706706
# `GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
707707
#
708+
# When the `configuration` attribute is provided, rules are evaluated inline from that configuration
709+
# and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
710+
# gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
711+
#
708712
# @param body [DeploymentGatesEvaluationRequest]
709713
# @param opts [Hash] the optional parameters
710714
# @return [Array<(DeploymentGatesEvaluationResponse, Integer, Hash)>] DeploymentGatesEvaluationResponse data, response status code and response headers

0 commit comments

Comments
 (0)