Skip to content

Commit 5940071

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4095999 of spec repo
1 parent abd984a commit 5940071

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
@@ -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

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
@@ -2790,6 +2790,7 @@ def overrides
27902790
"v2.deployment_gate_response_data_attributes_created_by" => "DeploymentGateResponseDataAttributesCreatedBy",
27912791
"v2.deployment_gate_response_data_attributes_updated_by" => "DeploymentGateResponseDataAttributesUpdatedBy",
27922792
"v2.deployment_gate_rules_response" => "DeploymentGateRulesResponse",
2793+
"v2.deployment_gates_evaluation_configuration" => "DeploymentGatesEvaluationConfiguration",
27932794
"v2.deployment_gates_evaluation_request" => "DeploymentGatesEvaluationRequest",
27942795
"v2.deployment_gates_evaluation_request_attributes" => "DeploymentGatesEvaluationRequestAttributes",
27952796
"v2.deployment_gates_evaluation_request_data" => "DeploymentGatesEvaluationRequestData",
@@ -2803,9 +2804,16 @@ def overrides
28032804
"v2.deployment_gates_evaluation_result_response_attributes_gate_status" => "DeploymentGatesEvaluationResultResponseAttributesGateStatus",
28042805
"v2.deployment_gates_evaluation_result_response_data" => "DeploymentGatesEvaluationResultResponseData",
28052806
"v2.deployment_gates_evaluation_result_response_data_type" => "DeploymentGatesEvaluationResultResponseDataType",
2807+
"v2.deployment_gates_evaluation_rule" => "DeploymentGatesEvaluationRule",
2808+
"v2.deployment_gates_fdd_rule" => "DeploymentGatesFDDRule",
2809+
"v2.deployment_gates_fdd_rule_options" => "DeploymentGatesFDDRuleOptions",
2810+
"v2.deployment_gates_fdd_rule_type" => "DeploymentGatesFDDRuleType",
28062811
"v2.deployment_gates_list_response" => "DeploymentGatesListResponse",
28072812
"v2.deployment_gates_list_response_meta" => "DeploymentGatesListResponseMeta",
28082813
"v2.deployment_gates_list_response_meta_page" => "DeploymentGatesListResponseMetaPage",
2814+
"v2.deployment_gates_monitor_rule" => "DeploymentGatesMonitorRule",
2815+
"v2.deployment_gates_monitor_rule_options" => "DeploymentGatesMonitorRuleOptions",
2816+
"v2.deployment_gates_monitor_rule_type" => "DeploymentGatesMonitorRuleType",
28092817
"v2.deployment_gates_rule_response" => "DeploymentGatesRuleResponse",
28102818
"v2.deployment_metadata" => "DeploymentMetadata",
28112819
"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)