Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 152 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29986,6 +29986,25 @@ components:
data:
$ref: "#/components/schemas/ListDeploymentRuleResponseData"
type: object
DeploymentGatesEvaluationConfiguration:
description: |-
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
directly from this configuration instead of using the preconfigured gate rules.
At least one rule is required.
properties:
dry_run:
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.
example: false
type: boolean
rules:
description: The list of rules to evaluate. At least one rule is required.
items:
$ref: "#/components/schemas/DeploymentGatesEvaluationRule"
minItems: 1
type: array
required:
- rules
type: object
DeploymentGatesEvaluationRequest:
description: Request body for triggering a deployment gate evaluation.
properties:
Expand All @@ -29995,8 +30014,13 @@ components:
- data
type: object
DeploymentGatesEvaluationRequestAttributes:
description: Attributes for a deployment gate evaluation request.
description: |-
Attributes for a deployment gate evaluation request.
When `configuration` is provided, rules are evaluated inline from that configuration.
When omitted, rules are resolved from the preconfigured gate for the given service and environment.
properties:
configuration:
$ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration"
env:
description: The environment of the deployment.
example: "staging"
Expand Down Expand Up @@ -30166,6 +30190,60 @@ components:
type: string
x-enum-varnames:
- DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE
DeploymentGatesEvaluationRule:
description: A rule to evaluate as part of a deployment gate evaluation.
discriminator:
mapping:
faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule"
monitor: "#/components/schemas/DeploymentGatesMonitorRule"
propertyName: type
oneOf:
- $ref: "#/components/schemas/DeploymentGatesMonitorRule"
- $ref: "#/components/schemas/DeploymentGatesFDDRule"
DeploymentGatesFDDRule:
description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
properties:
dry_run:
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.
example: false
type: boolean
name:
description: Human-readable name for this rule.
example: "apm faulty deployment"
type: string
options:
$ref: "#/components/schemas/DeploymentGatesFDDRuleOptions"
type:
$ref: "#/components/schemas/DeploymentGatesFDDRuleType"
required:
- type
- name
type: object
DeploymentGatesFDDRuleOptions:
description: Options for a `faulty_deployment_detection` rule.
properties:
duration:
description: Evaluation window in seconds. Maximum 7200 (2 hours).
example: 900
format: int64
maximum: 7200
type: integer
excluded_resources:
description: APM resource names to exclude from analysis.
example:
- "GET /healthcheck"
items:
type: string
type: array
type: object
DeploymentGatesFDDRuleType:
description: The type identifier for a faulty deployment detection rule.
enum:
- faulty_deployment_detection
example: faulty_deployment_detection
type: string
x-enum-varnames:
- FAULTY_DEPLOYMENT_DETECTION
DeploymentGatesListResponse:
description: Response containing a paginated list of deployment gates.
properties:
Expand Down Expand Up @@ -30200,6 +30278,49 @@ components:
minimum: 1
type: integer
type: object
DeploymentGatesMonitorRule:
description: A monitor rule to evaluate as part of a deployment gate evaluation.
properties:
dry_run:
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.
example: false
type: boolean
name:
description: Human-readable name for this rule.
example: "error rate monitors"
type: string
options:
$ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions"
type:
$ref: "#/components/schemas/DeploymentGatesMonitorRuleType"
required:
- type
- name
type: object
DeploymentGatesMonitorRuleOptions:
description: Options for a `monitor` rule.
properties:
duration:
description: Evaluation window in seconds. Maximum 7200 (2 hours).
example: 300
format: int64
maximum: 7200
type: integer
query:
description: Monitor search query.
example: "service:transaction-backend env:production"
type: string
required:
- query
type: object
DeploymentGatesMonitorRuleType:
description: The type identifier for a monitor rule.
enum:
- monitor
example: monitor
type: string
x-enum-varnames:
- MONITOR
DeploymentGatesRuleResponse:
description: The result of a single rule evaluation.
properties:
Expand Down Expand Up @@ -124667,12 +124788,17 @@ paths:
Triggers an asynchronous deployment gate evaluation for the given service and environment.
Returns an evaluation ID that can be used to poll for the result via the
`GET /api/v2/deployments/gates/evaluation/{id}` endpoint.

When the `configuration` attribute is provided, rules are evaluated inline from that configuration
and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
operationId: TriggerDeploymentGatesEvaluation
requestBody:
content:
application/json:
examples:
default:
summary: Evaluate a preconfigured gate
value:
data:
attributes:
Expand All @@ -124682,6 +124808,31 @@ paths:
service: transaction-backend
version: v1.2.3
type: deployment_gates_evaluation_request
with-configuration:
summary: Evaluate with inline rule configuration
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
- dry_run: false
name: apm faulty deployment
options:
duration: 900
excluded_resources:
- "GET /healthcheck"
type: faulty_deployment_detection
env: production
service: transaction-backend
version: 1.2.3
type: deployment_gates_evaluation_request
schema:
$ref: "#/components/schemas/DeploymentGatesEvaluationRequest"
required: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// Trigger a deployment gate evaluation returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;
use datadog_api_client::datadogV2::model::DeploymentGatesEvaluationConfiguration;
use datadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequest;
use datadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestAttributes;
use datadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestData;
use datadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestDataType;
use datadog_api_client::datadogV2::model::DeploymentGatesEvaluationRule;
use datadog_api_client::datadogV2::model::DeploymentGatesMonitorRule;
use datadog_api_client::datadogV2::model::DeploymentGatesMonitorRuleOptions;
use datadog_api_client::datadogV2::model::DeploymentGatesMonitorRuleType;

#[tokio::main]
async fn main() {
Expand All @@ -13,6 +18,24 @@ async fn main() {
"staging".to_string(),
"transaction-backend".to_string(),
)
.configuration(
DeploymentGatesEvaluationConfiguration::new(vec![
DeploymentGatesEvaluationRule::DeploymentGatesMonitorRule(Box::new(
DeploymentGatesMonitorRule::new(
"error rate monitors".to_string(),
DeploymentGatesMonitorRuleType::MONITOR,
)
.dry_run(false)
.options(
DeploymentGatesMonitorRuleOptions::new(
"service:transaction-backend env:production".to_string(),
)
.duration(300),
),
)),
])
.dry_run(false),
)
.identifier("pre-deploy".to_string())
.primary_tag("region:us-east-1".to_string())
.version("v1.2.3".to_string()),
Expand Down
8 changes: 8 additions & 0 deletions src/datadogV2/api/api_deployment_gates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,10 @@ impl DeploymentGatesAPI {
/// Triggers an asynchronous deployment gate evaluation for the given service and environment.
/// Returns an evaluation ID that can be used to poll for the result via the
/// `GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
///
/// When the `configuration` attribute is provided, rules are evaluated inline from that configuration
/// and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
/// gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
pub async fn trigger_deployment_gates_evaluation(
&self,
body: crate::datadogV2::model::DeploymentGatesEvaluationRequest,
Expand Down Expand Up @@ -1411,6 +1415,10 @@ impl DeploymentGatesAPI {
/// Triggers an asynchronous deployment gate evaluation for the given service and environment.
/// Returns an evaluation ID that can be used to poll for the result via the
/// `GET /api/v2/deployments/gates/evaluation/{id}` endpoint.
///
/// When the `configuration` attribute is provided, rules are evaluated inline from that configuration
/// and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
/// gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
pub async fn trigger_deployment_gates_evaluation_with_http_info(
&self,
body: crate::datadogV2::model::DeploymentGatesEvaluationRequest,
Expand Down
16 changes: 16 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3462,6 +3462,22 @@ pub mod model_deployment_gates_evaluation_request_data;
pub use self::model_deployment_gates_evaluation_request_data::DeploymentGatesEvaluationRequestData;
pub mod model_deployment_gates_evaluation_request_attributes;
pub use self::model_deployment_gates_evaluation_request_attributes::DeploymentGatesEvaluationRequestAttributes;
pub mod model_deployment_gates_evaluation_configuration;
pub use self::model_deployment_gates_evaluation_configuration::DeploymentGatesEvaluationConfiguration;
pub mod model_deployment_gates_monitor_rule;
pub use self::model_deployment_gates_monitor_rule::DeploymentGatesMonitorRule;
pub mod model_deployment_gates_monitor_rule_options;
pub use self::model_deployment_gates_monitor_rule_options::DeploymentGatesMonitorRuleOptions;
pub mod model_deployment_gates_monitor_rule_type;
pub use self::model_deployment_gates_monitor_rule_type::DeploymentGatesMonitorRuleType;
pub mod model_deployment_gates_fdd_rule;
pub use self::model_deployment_gates_fdd_rule::DeploymentGatesFDDRule;
pub mod model_deployment_gates_fdd_rule_options;
pub use self::model_deployment_gates_fdd_rule_options::DeploymentGatesFDDRuleOptions;
pub mod model_deployment_gates_fdd_rule_type;
pub use self::model_deployment_gates_fdd_rule_type::DeploymentGatesFDDRuleType;
pub mod model_deployment_gates_evaluation_rule;
pub use self::model_deployment_gates_evaluation_rule::DeploymentGatesEvaluationRule;
pub mod model_deployment_gates_evaluation_request_data_type;
pub use self::model_deployment_gates_evaluation_request_data_type::DeploymentGatesEvaluationRequestDataType;
pub mod model_deployment_gates_evaluation_response;
Expand Down
Loading
Loading