-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathTriggerDeploymentGatesEvaluation.py
More file actions
35 lines (31 loc) · 1.42 KB
/
Copy pathTriggerDeploymentGatesEvaluation.py
File metadata and controls
35 lines (31 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Trigger a deployment gate evaluation returns "Accepted" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi
from datadog_api_client.v2.model.deployment_gates_evaluation_request import DeploymentGatesEvaluationRequest
from datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes import (
DeploymentGatesEvaluationRequestAttributes,
)
from datadog_api_client.v2.model.deployment_gates_evaluation_request_data import DeploymentGatesEvaluationRequestData
from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import (
DeploymentGatesEvaluationRequestDataType,
)
body = DeploymentGatesEvaluationRequest(
data=DeploymentGatesEvaluationRequestData(
attributes=DeploymentGatesEvaluationRequestAttributes(
env="staging",
identifier="pre-deploy",
primary_tag="region:us-east-1",
service="transaction-backend",
version="v1.2.3",
),
type=DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST,
),
)
configuration = Configuration()
configuration.unstable_operations["trigger_deployment_gates_evaluation"] = True
with ApiClient(configuration) as api_client:
api_instance = DeploymentGatesApi(api_client)
response = api_instance.trigger_deployment_gates_evaluation(body=body)
print(response)