Skip to content

Commit 1691f81

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4f95357 of spec repo
1 parent fa8d9ba commit 1691f81

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
@@ -29382,6 +29382,25 @@ components:
2938229382
data:
2938329383
$ref: "#/components/schemas/ListDeploymentRuleResponseData"
2938429384
type: object
29385+
DeploymentGatesEvaluationConfiguration:
29386+
description: |-
29387+
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
29388+
directly from this configuration instead of using the pre-configured gate rules.
29389+
At least one rule is required.
29390+
properties:
29391+
dry_run:
29392+
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.
29393+
example: false
29394+
type: boolean
29395+
rules:
29396+
description: The list of rules to evaluate. At least one rule is required.
29397+
items:
29398+
$ref: "#/components/schemas/DeploymentGatesEvaluationRule"
29399+
minItems: 1
29400+
type: array
29401+
required:
29402+
- rules
29403+
type: object
2938529404
DeploymentGatesEvaluationRequest:
2938629405
description: Request body for triggering a deployment gate evaluation.
2938729406
properties:
@@ -29391,8 +29410,13 @@ components:
2939129410
- data
2939229411
type: object
2939329412
DeploymentGatesEvaluationRequestAttributes:
29394-
description: Attributes for a deployment gate evaluation request.
29413+
description: |-
29414+
Attributes for a deployment gate evaluation request.
29415+
When `configuration` is provided, rules are evaluated inline from that configuration.
29416+
When omitted, rules are resolved from the pre-configured gate for the given service and environment.
2939529417
properties:
29418+
configuration:
29419+
$ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration"
2939629420
env:
2939729421
description: The environment of the deployment.
2939829422
example: "staging"
@@ -29562,6 +29586,60 @@ components:
2956229586
type: string
2956329587
x-enum-varnames:
2956429588
- DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE
29589+
DeploymentGatesEvaluationRule:
29590+
description: A rule to evaluate as part of a deployment gate evaluation.
29591+
discriminator:
29592+
mapping:
29593+
faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule"
29594+
monitor: "#/components/schemas/DeploymentGatesMonitorRule"
29595+
propertyName: type
29596+
oneOf:
29597+
- $ref: "#/components/schemas/DeploymentGatesMonitorRule"
29598+
- $ref: "#/components/schemas/DeploymentGatesFDDRule"
29599+
DeploymentGatesFDDRule:
29600+
description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
29601+
properties:
29602+
dry_run:
29603+
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.
29604+
example: false
29605+
type: boolean
29606+
name:
29607+
description: Human-readable name for this rule.
29608+
example: "apm faulty deployment"
29609+
type: string
29610+
options:
29611+
$ref: "#/components/schemas/DeploymentGatesFDDRuleOptions"
29612+
type:
29613+
$ref: "#/components/schemas/DeploymentGatesFDDRuleType"
29614+
required:
29615+
- type
29616+
- name
29617+
type: object
29618+
DeploymentGatesFDDRuleOptions:
29619+
description: Options for a `faulty_deployment_detection` rule.
29620+
properties:
29621+
duration:
29622+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
29623+
example: 900
29624+
format: int64
29625+
maximum: 7200
29626+
type: integer
29627+
excluded_resources:
29628+
description: APM resource names to exclude from analysis.
29629+
example:
29630+
- "GET /healthcheck"
29631+
items:
29632+
type: string
29633+
type: array
29634+
type: object
29635+
DeploymentGatesFDDRuleType:
29636+
description: The type identifier for a faulty deployment detection rule.
29637+
enum:
29638+
- faulty_deployment_detection
29639+
example: faulty_deployment_detection
29640+
type: string
29641+
x-enum-varnames:
29642+
- FAULTY_DEPLOYMENT_DETECTION
2956529643
DeploymentGatesListResponse:
2956629644
description: Response containing a paginated list of deployment gates.
2956729645
properties:
@@ -29596,6 +29674,49 @@ components:
2959629674
minimum: 1
2959729675
type: integer
2959829676
type: object
29677+
DeploymentGatesMonitorRule:
29678+
description: A monitor rule to evaluate as part of a deployment gate evaluation.
29679+
properties:
29680+
dry_run:
29681+
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.
29682+
example: false
29683+
type: boolean
29684+
name:
29685+
description: Human-readable name for this rule.
29686+
example: "error rate monitors"
29687+
type: string
29688+
options:
29689+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions"
29690+
type:
29691+
$ref: "#/components/schemas/DeploymentGatesMonitorRuleType"
29692+
required:
29693+
- type
29694+
- name
29695+
type: object
29696+
DeploymentGatesMonitorRuleOptions:
29697+
description: Options for a `monitor` rule.
29698+
properties:
29699+
duration:
29700+
description: Evaluation window in seconds. Maximum 7200 (2 hours).
29701+
example: 300
29702+
format: int64
29703+
maximum: 7200
29704+
type: integer
29705+
query:
29706+
description: Monitor search query.
29707+
example: "service:transaction-backend env:production"
29708+
type: string
29709+
required:
29710+
- query
29711+
type: object
29712+
DeploymentGatesMonitorRuleType:
29713+
description: The type identifier for a monitor rule.
29714+
enum:
29715+
- monitor
29716+
example: monitor
29717+
type: string
29718+
x-enum-varnames:
29719+
- MONITOR
2959929720
DeploymentGatesRuleResponse:
2960029721
description: The result of a single rule evaluation.
2960129722
properties:
@@ -121740,12 +121861,17 @@ paths:
121740121861
Triggers an asynchronous deployment gate evaluation for the given service and environment.
121741121862
Returns an evaluation ID that can be used to poll for the result via the
121742121863
`GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
121864+
121865+
When the `configuration` attribute is provided, rules are evaluated inline from that configuration
121866+
and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
121867+
gate pre-configured for the given service and environment via the Datadog UI, API, or Terraform.
121743121868
operationId: TriggerDeploymentGatesEvaluation
121744121869
requestBody:
121745121870
content:
121746121871
application/json:
121747121872
examples:
121748121873
default:
121874+
summary: Evaluate a pre-configured gate
121749121875
value:
121750121876
data:
121751121877
attributes:
@@ -121755,6 +121881,31 @@ paths:
121755121881
service: transaction-backend
121756121882
version: v1.2.3
121757121883
type: deployment_gates_evaluation_request
121884+
with-configuration:
121885+
summary: Evaluate with inline rule configuration
121886+
value:
121887+
data:
121888+
attributes:
121889+
configuration:
121890+
dry_run: false
121891+
rules:
121892+
- dry_run: false
121893+
name: error rate monitors
121894+
options:
121895+
duration: 300
121896+
query: "service:transaction-backend env:production"
121897+
type: monitor
121898+
- dry_run: false
121899+
name: apm faulty deployment
121900+
options:
121901+
duration: 900
121902+
excluded_resources:
121903+
- "GET /healthcheck"
121904+
type: faulty_deployment_detection
121905+
env: production
121906+
service: transaction-backend
121907+
version: 1.2.3
121908+
type: deployment_gates_evaluation_request
121758121909
schema:
121759121910
$ref: "#/components/schemas/DeploymentGatesEvaluationRequest"
121760121911
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
@@ -2756,6 +2756,7 @@ def overrides
27562756
"v2.deployment_gate_response_data_attributes_created_by" => "DeploymentGateResponseDataAttributesCreatedBy",
27572757
"v2.deployment_gate_response_data_attributes_updated_by" => "DeploymentGateResponseDataAttributesUpdatedBy",
27582758
"v2.deployment_gate_rules_response" => "DeploymentGateRulesResponse",
2759+
"v2.deployment_gates_evaluation_configuration" => "DeploymentGatesEvaluationConfiguration",
27592760
"v2.deployment_gates_evaluation_request" => "DeploymentGatesEvaluationRequest",
27602761
"v2.deployment_gates_evaluation_request_attributes" => "DeploymentGatesEvaluationRequestAttributes",
27612762
"v2.deployment_gates_evaluation_request_data" => "DeploymentGatesEvaluationRequestData",
@@ -2769,9 +2770,16 @@ def overrides
27692770
"v2.deployment_gates_evaluation_result_response_attributes_gate_status" => "DeploymentGatesEvaluationResultResponseAttributesGateStatus",
27702771
"v2.deployment_gates_evaluation_result_response_data" => "DeploymentGatesEvaluationResultResponseData",
27712772
"v2.deployment_gates_evaluation_result_response_data_type" => "DeploymentGatesEvaluationResultResponseDataType",
2773+
"v2.deployment_gates_evaluation_rule" => "DeploymentGatesEvaluationRule",
2774+
"v2.deployment_gates_fdd_rule" => "DeploymentGatesFDDRule",
2775+
"v2.deployment_gates_fdd_rule_options" => "DeploymentGatesFDDRuleOptions",
2776+
"v2.deployment_gates_fdd_rule_type" => "DeploymentGatesFDDRuleType",
27722777
"v2.deployment_gates_list_response" => "DeploymentGatesListResponse",
27732778
"v2.deployment_gates_list_response_meta" => "DeploymentGatesListResponseMeta",
27742779
"v2.deployment_gates_list_response_meta_page" => "DeploymentGatesListResponseMetaPage",
2780+
"v2.deployment_gates_monitor_rule" => "DeploymentGatesMonitorRule",
2781+
"v2.deployment_gates_monitor_rule_options" => "DeploymentGatesMonitorRuleOptions",
2782+
"v2.deployment_gates_monitor_rule_type" => "DeploymentGatesMonitorRuleType",
27752783
"v2.deployment_gates_rule_response" => "DeploymentGatesRuleResponse",
27762784
"v2.deployment_metadata" => "DeploymentMetadata",
27772785
"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 via 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)