Note : This endpoint is in preview and may be subject to change.
If you have any feedback, contact Datadog support .
POST https://api.ap1.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules https://api.ap2.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules https://api.datadoghq.eu/api/v2/deployment_gates/{gate_id}/rules https://api.ddog-gov.com/api/v2/deployment_gates/{gate_id}/rules https://api.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules https://api.us3.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules https://api.us5.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules
Overview Endpoint to create a deployment rule. A gate for the rule must already exist.
This endpoint requires the deployment_gates_write permission.
Arguments Path Parameters The ID of the deployment gate.
Request Body Data (required)
Expand All
Parameters for creating a deployment rule.
Parameters for creating a deployment rule.
Whether this rule is run in dry-run mode.
The name of the deployment rule.
Options for deployment rule response representing either faulty deployment detection or monitor options.
Faulty deployment detection options for deployment rules.
The duration for faulty deployment detection.
Resources to exclude from faulty deployment detection.
Monitor options for deployment rules.
Seconds the monitor needs to stay in OK status for the rule to pass.
Monitors that match this query are evaluated.
The type of the deployment rule (faulty_deployment_detection or monitor).
Deployment rule resource type.
Allowed enum values: deployment_rule
{
"data" : {
"attributes" : {
"dry_run" : false ,
"name" : "My deployment rule" ,
"options" : {
"excluded_resources" : []
},
"type" : "faulty_deployment_detection"
},
"type" : "deployment_rule"
}
} Response OK
Response for a deployment rule.
Expand All
Data for a deployment rule.
Basic information about a deployment rule.
The timestamp when the deployment rule was created.
Information about the user who created the deployment rule.
The handle of the user who created the deployment rule.
The ID of the user who created the deployment rule.
The name of the user who created the deployment rule.
Whether this rule is run in dry-run mode.
The ID of the deployment gate.
The name of the deployment rule.
Options for deployment rule response representing either faulty deployment detection or monitor options.
Faulty deployment detection options for deployment rules.
The duration for faulty deployment detection.
Resources to exclude from faulty deployment detection.
Monitor options for deployment rules.
Seconds the monitor needs to stay in OK status for the rule to pass.
Monitors that match this query are evaluated.
The type of the deployment rule.
Allowed enum values: faulty_deployment_detection,monitor
The timestamp when the deployment rule was last updated.
Information about the user who updated the deployment rule.
The handle of the user who updated the deployment rule.
The ID of the user who updated the deployment rule.
The name of the user who updated the deployment rule.
Unique identifier of the deployment rule.
Deployment rule resource type.
Allowed enum values: deployment_rule
{
"data" : {
"attributes" : {
"created_at" : "2021-01-01T00:00:00Z" ,
"created_by" : {
"handle" : "test-user" ,
"id" : "1111-2222-3333-4444-555566667777" ,
"name" : "Test User"
},
"dry_run" : false ,
"gate_id" : "1111-2222-3333-4444-555566667777" ,
"name" : "My deployment rule" ,
"options" : {
"duration" : 3600 ,
"excluded_resources" : [
"resource1" ,
"resource2"
]
},
"type" : "faulty_deployment_detection" ,
"updated_at" : "2019-09-19T10:00:00.000Z" ,
"updated_by" : {
"handle" : "test-user" ,
"id" : "1111-2222-3333-4444-555566667777" ,
"name" : "Test User"
}
},
"id" : "1111-2222-3333-4444-555566667777" ,
"type" : "deployment_rule"
}
} Bad request.
{
"errors" : [
{
"detail" : "Malformed payload" ,
"status" : "400" ,
"title" : "Bad Request"
}
]
} Unauthorized
{
"errors" : [
"Bad Request"
]
} Forbidden
{
"errors" : [
"Bad Request"
]
} Too many requests
{
"errors" : [
"Bad Request"
]
} Internal Server Error
{
"errors" : [
{
"detail" : "Malformed payload" ,
"status" : "400" ,
"title" : "Bad Request"
}
]
} Code Example Copy
# Path parameters export gate_id = "CHANGE_ME" # Curl command curl -X POST "https://api.ap1.datadoghq.com "https://api.ap2.datadoghq.com "https://api.datadoghq.eu "https://api.ddog-gov.com "https://api.datadoghq.com "https://api.us3.datadoghq.com "https://api.us5.datadoghq.com /api/v2/deployment_gates/${gate_id}/rules " \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY} " \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY} " \
-d @- << EOF
{
"data": {
"attributes": {
"dry_run": false,
"name": "My deployment rule",
"options": {
"excluded_resources": []
},
"type": "faulty_deployment_detection"
},
"type": "deployment_rule"
}
}
EOF