Deployment Gates

Manage Deployment Gates using this API to reduce the likelihood and impact of incidents caused by deployments. See the Deployment Gates documentation for more information.

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_gateshttps://api.ap2.datadoghq.com/api/v2/deployment_gateshttps://api.datadoghq.eu/api/v2/deployment_gateshttps://api.ddog-gov.com/api/v2/deployment_gateshttps://api.datadoghq.com/api/v2/deployment_gateshttps://api.us3.datadoghq.com/api/v2/deployment_gateshttps://api.us5.datadoghq.com/api/v2/deployment_gates

Overview

Endpoint to create a deployment gate. This endpoint requires the deployment_gates_write permission.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Parameters for creating a deployment gate.

attributes [required]

object

Parameters for creating a deployment gate.

dry_run

boolean

Whether this gate is run in dry-run mode.

env [required]

string

The environment of the deployment gate.

identifier

string

The identifier of the deployment gate.

default: default

service [required]

string

The service of the deployment gate.

type [required]

enum

Deployment gate resource type. Allowed enum values: deployment_gate

{
  "data": {
    "attributes": {
      "dry_run": false,
      "env": "production",
      "identifier": "my-gate-1",
      "service": "my-service"
    },
    "type": "deployment_gate"
  }
}

Response

OK

Response for a deployment gate.

Expand All

Field

Type

Description

data

object

Data for a deployment gate.

attributes [required]

object

Basic information about a deployment gate.

created_at [required]

date-time

The timestamp when the deployment gate was created.

created_by [required]

object

Information about the user who created the deployment gate.

handle

string

The handle of the user who created the deployment rule.

id [required]

string

The ID of the user who created the deployment rule.

name

string

The name of the user who created the deployment rule.

dry_run [required]

boolean

Whether this gate is run in dry-run mode.

env [required]

string

The environment of the deployment gate.

identifier [required]

string

The identifier of the deployment gate.

service [required]

string

The service of the deployment gate.

updated_at

date-time

The timestamp when the deployment gate was last updated.

updated_by

object

Information about the user who updated the deployment gate.

handle

string

The handle of the user who updated the deployment rule.

id [required]

string

The ID of the user who updated the deployment rule.

name

string

The name of the user who updated the deployment rule.

id [required]

string

Unique identifier of the deployment gate.

type [required]

enum

Deployment gate resource type. Allowed enum values: deployment_gate

{
  "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,
      "env": "production",
      "identifier": "pre",
      "service": "my-service",
      "updated_at": "2021-01-01T00:00:00Z",
      "updated_by": {
        "handle": "test-user",
        "id": "1111-2222-3333-4444-555566667777",
        "name": "Test User"
      }
    },
    "id": "1111-2222-3333-4444-555566667777",
    "type": "deployment_gate"
  }
}

Bad request.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # 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" \ -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, "env": "production", "identifier": "my-gate-1", "service": "my-service" }, "type": "deployment_gate" } } EOF

Note: This endpoint is in preview and may be subject to change. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/deployment_gates/{id}https://api.ap2.datadoghq.com/api/v2/deployment_gates/{id}https://api.datadoghq.eu/api/v2/deployment_gates/{id}https://api.ddog-gov.com/api/v2/deployment_gates/{id}https://api.datadoghq.com/api/v2/deployment_gates/{id}https://api.us3.datadoghq.com/api/v2/deployment_gates/{id}https://api.us5.datadoghq.com/api/v2/deployment_gates/{id}

Overview

Endpoint to get a deployment gate. This endpoint requires the deployment_gates_read permission.

Arguments

Path Parameters

Name

Type

Description

id [required]

string

The ID of the deployment gate.

Response

OK

Response for a deployment gate.

Expand All

Field

Type

Description

data

object

Data for a deployment gate.

attributes [required]

object

Basic information about a deployment gate.

created_at [required]

date-time

The timestamp when the deployment gate was created.

created_by [required]

object

Information about the user who created the deployment gate.

handle

string

The handle of the user who created the deployment rule.

id [required]

string

The ID of the user who created the deployment rule.

name

string

The name of the user who created the deployment rule.

dry_run [required]

boolean

Whether this gate is run in dry-run mode.

env [required]

string

The environment of the deployment gate.

identifier [required]

string

The identifier of the deployment gate.

service [required]

string

The service of the deployment gate.

updated_at

date-time

The timestamp when the deployment gate was last updated.

updated_by

object

Information about the user who updated the deployment gate.

handle

string

The handle of the user who updated the deployment rule.

id [required]

string

The ID of the user who updated the deployment rule.

name

string

The name of the user who updated the deployment rule.

id [required]

string

Unique identifier of the deployment gate.

type [required]

enum

Deployment gate resource type. Allowed enum values: deployment_gate

{
  "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,
      "env": "production",
      "identifier": "pre",
      "service": "my-service",
      "updated_at": "2021-01-01T00:00:00Z",
      "updated_by": {
        "handle": "test-user",
        "id": "1111-2222-3333-4444-555566667777",
        "name": "Test User"
      }
    },
    "id": "1111-2222-3333-4444-555566667777",
    "type": "deployment_gate"
  }
}

Bad request.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Deployment gate not found.

Deployment gate not found.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export id="CHANGE_ME"
# Curl command
curl -X GET "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/${id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in preview and may be subject to change. If you have any feedback, contact Datadog support.

PUT https://api.ap1.datadoghq.com/api/v2/deployment_gates/{id}https://api.ap2.datadoghq.com/api/v2/deployment_gates/{id}https://api.datadoghq.eu/api/v2/deployment_gates/{id}https://api.ddog-gov.com/api/v2/deployment_gates/{id}https://api.datadoghq.com/api/v2/deployment_gates/{id}https://api.us3.datadoghq.com/api/v2/deployment_gates/{id}https://api.us5.datadoghq.com/api/v2/deployment_gates/{id}

Overview

Endpoint to update a deployment gate. This endpoint requires the deployment_gates_write permission.

Arguments

Path Parameters

Name

Type

Description

id [required]

string

The ID of the deployment gate.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Parameters for updating a deployment gate.

attributes [required]

object

Attributes for updating a deployment gate.

dry_run [required]

boolean

Whether to run in dry-run mode.

id [required]

string

Unique identifier of the deployment gate.

type [required]

enum

Deployment gate resource type. Allowed enum values: deployment_gate

{
  "data": {
    "attributes": {
      "dry_run": false
    },
    "id": "12345678-1234-1234-1234-123456789012",
    "type": "deployment_gate"
  }
}

Response

OK

Response for a deployment gate.

Expand All

Field

Type

Description

data

object

Data for a deployment gate.

attributes [required]

object

Basic information about a deployment gate.

created_at [required]

date-time

The timestamp when the deployment gate was created.

created_by [required]

object

Information about the user who created the deployment gate.

handle

string

The handle of the user who created the deployment rule.

id [required]

string

The ID of the user who created the deployment rule.

name

string

The name of the user who created the deployment rule.

dry_run [required]

boolean

Whether this gate is run in dry-run mode.

env [required]

string

The environment of the deployment gate.

identifier [required]

string

The identifier of the deployment gate.

service [required]

string

The service of the deployment gate.

updated_at

date-time

The timestamp when the deployment gate was last updated.

updated_by

object

Information about the user who updated the deployment gate.

handle

string

The handle of the user who updated the deployment rule.

id [required]

string

The ID of the user who updated the deployment rule.

name

string

The name of the user who updated the deployment rule.

id [required]

string

Unique identifier of the deployment gate.

type [required]

enum

Deployment gate resource type. Allowed enum values: deployment_gate

{
  "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,
      "env": "production",
      "identifier": "pre",
      "service": "my-service",
      "updated_at": "2021-01-01T00:00:00Z",
      "updated_by": {
        "handle": "test-user",
        "id": "1111-2222-3333-4444-555566667777",
        "name": "Test User"
      }
    },
    "id": "1111-2222-3333-4444-555566667777",
    "type": "deployment_gate"
  }
}

Bad request.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Deployment gate not found.

Deployment gate not found.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # Path parameters
export id="CHANGE_ME"
# Curl command
curl -X PUT "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/${id}" \ -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 }, "id": "12345678-1234-1234-1234-123456789012", "type": "deployment_gate" } } EOF

Note: This endpoint is in preview and may be subject to change. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/deployment_gates/{id}https://api.ap2.datadoghq.com/api/v2/deployment_gates/{id}https://api.datadoghq.eu/api/v2/deployment_gates/{id}https://api.ddog-gov.com/api/v2/deployment_gates/{id}https://api.datadoghq.com/api/v2/deployment_gates/{id}https://api.us3.datadoghq.com/api/v2/deployment_gates/{id}https://api.us5.datadoghq.com/api/v2/deployment_gates/{id}

Overview

Endpoint to delete a deployment gate. Rules associated with the gate are also deleted. This endpoint requires the deployment_gates_write permission.

Arguments

Path Parameters

Name

Type

Description

id [required]

string

The ID of the deployment gate.

Response

No Content

Bad request.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Deployment gate not found.

Deployment gate not found.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export id="CHANGE_ME"
# Curl command
curl -X DELETE "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/${id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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}/ruleshttps://api.ap2.datadoghq.com/api/v2/deployment_gates/{gate_id}/ruleshttps://api.datadoghq.eu/api/v2/deployment_gates/{gate_id}/ruleshttps://api.ddog-gov.com/api/v2/deployment_gates/{gate_id}/ruleshttps://api.datadoghq.com/api/v2/deployment_gates/{gate_id}/ruleshttps://api.us3.datadoghq.com/api/v2/deployment_gates/{gate_id}/ruleshttps://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

Name

Type

Description

gate_id [required]

string

The ID of the deployment gate.

Request

Body Data (required)

Expand All

Field

Type

Description

data

object

Parameters for creating a deployment rule.

attributes [required]

object

Parameters for creating a deployment rule.

dry_run

boolean

Whether this rule is run in dry-run mode.

name [required]

string

The name of the deployment rule.

options [required]

 <oneOf>

Options for deployment rule response representing either faulty deployment detection or monitor options.

Option 1

object

Faulty deployment detection options for deployment rules.

duration

int64

The duration for faulty deployment detection.

excluded_resources

[string]

Resources to exclude from faulty deployment detection.

Option 2

object

Monitor options for deployment rules.

duration

int64

Seconds the monitor needs to stay in OK status for the rule to pass.

query [required]

string

Monitors that match this query are evaluated.

type [required]

string

The type of the deployment rule (faulty_deployment_detection or monitor).

type [required]

enum

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

Field

Type

Description

data

object

Data for a deployment rule.

attributes [required]

object

Basic information about a deployment rule.

created_at [required]

date-time

The timestamp when the deployment rule was created.

created_by [required]

object

Information about the user who created the deployment rule.

handle

string

The handle of the user who created the deployment rule.

id [required]

string

The ID of the user who created the deployment rule.

name

string

The name of the user who created the deployment rule.

dry_run [required]

boolean

Whether this rule is run in dry-run mode.

gate_id [required]

string

The ID of the deployment gate.

name [required]

string

The name of the deployment rule.

options [required]

 <oneOf>

Options for deployment rule response representing either faulty deployment detection or monitor options.

Option 1

object

Faulty deployment detection options for deployment rules.

duration

int64

The duration for faulty deployment detection.

excluded_resources

[string]

Resources to exclude from faulty deployment detection.

Option 2

object

Monitor options for deployment rules.

duration

int64

Seconds the monitor needs to stay in OK status for the rule to pass.

query [required]

string

Monitors that match this query are evaluated.

type [required]

enum

The type of the deployment rule. Allowed enum values: faulty_deployment_detection,monitor

updated_at

date-time

The timestamp when the deployment rule was last updated.

updated_by

object

Information about the user who updated the deployment rule.

handle

string

The handle of the user who updated the deployment rule.

id [required]

string

The ID of the user who updated the deployment rule.

name

string

The name of the user who updated the deployment rule.

id [required]

string

Unique identifier of the deployment rule.

type [required]

enum

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.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # 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

Note: This endpoint is in preview and may be subject to change. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.ap2.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.datadoghq.eu/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.ddog-gov.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.us3.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.us5.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}

Overview

Endpoint to get a deployment rule. This endpoint requires the deployment_gates_read permission.

Arguments

Path Parameters

Name

Type

Description

gate_id [required]

string

The ID of the deployment gate.

id [required]

string

The ID of the deployment rule.

Response

OK

Response for a deployment rule.

Expand All

Field

Type

Description

data

object

Data for a deployment rule.

attributes [required]

object

Basic information about a deployment rule.

created_at [required]

date-time

The timestamp when the deployment rule was created.

created_by [required]

object

Information about the user who created the deployment rule.

handle

string

The handle of the user who created the deployment rule.

id [required]

string

The ID of the user who created the deployment rule.

name

string

The name of the user who created the deployment rule.

dry_run [required]

boolean

Whether this rule is run in dry-run mode.

gate_id [required]

string

The ID of the deployment gate.

name [required]

string

The name of the deployment rule.

options [required]

 <oneOf>

Options for deployment rule response representing either faulty deployment detection or monitor options.

Option 1

object

Faulty deployment detection options for deployment rules.

duration

int64

The duration for faulty deployment detection.

excluded_resources

[string]

Resources to exclude from faulty deployment detection.

Option 2

object

Monitor options for deployment rules.

duration

int64

Seconds the monitor needs to stay in OK status for the rule to pass.

query [required]

string

Monitors that match this query are evaluated.

type [required]

enum

The type of the deployment rule. Allowed enum values: faulty_deployment_detection,monitor

updated_at

date-time

The timestamp when the deployment rule was last updated.

updated_by

object

Information about the user who updated the deployment rule.

handle

string

The handle of the user who updated the deployment rule.

id [required]

string

The ID of the user who updated the deployment rule.

name

string

The name of the user who updated the deployment rule.

id [required]

string

Unique identifier of the deployment rule.

type [required]

enum

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.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Deployment rule not found.

Deployment rule not found.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export gate_id="CHANGE_ME"
export id="CHANGE_ME"
# Curl command
curl -X GET "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/${id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in preview and may be subject to change. If you have any feedback, contact Datadog support.

PUT https://api.ap1.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.ap2.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.datadoghq.eu/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.ddog-gov.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.us3.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.us5.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}

Overview

Endpoint to update a deployment rule. This endpoint requires the deployment_gates_write permission.

Arguments

Path Parameters

Name

Type

Description

gate_id [required]

string

The ID of the deployment gate.

id [required]

string

The ID of the deployment rule.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Parameters for updating a deployment rule.

attributes [required]

object

Parameters for updating a deployment rule.

dry_run [required]

boolean

Whether to run this rule in dry-run mode.

name [required]

string

The name of the deployment rule.

options [required]

 <oneOf>

Options for deployment rule response representing either faulty deployment detection or monitor options.

Option 1

object

Faulty deployment detection options for deployment rules.

duration

int64

The duration for faulty deployment detection.

excluded_resources

[string]

Resources to exclude from faulty deployment detection.

Option 2

object

Monitor options for deployment rules.

duration

int64

Seconds the monitor needs to stay in OK status for the rule to pass.

query [required]

string

Monitors that match this query are evaluated.

type [required]

enum

Deployment rule resource type. Allowed enum values: deployment_rule

{
  "data": {
    "attributes": {
      "dry_run": false,
      "name": "Updated deployment rule",
      "options": {
        "excluded_resources": []
      }
    },
    "type": "deployment_rule"
  }
}

Response

OK

Response for a deployment rule.

Expand All

Field

Type

Description

data

object

Data for a deployment rule.

attributes [required]

object

Basic information about a deployment rule.

created_at [required]

date-time

The timestamp when the deployment rule was created.

created_by [required]

object

Information about the user who created the deployment rule.

handle

string

The handle of the user who created the deployment rule.

id [required]

string

The ID of the user who created the deployment rule.

name

string

The name of the user who created the deployment rule.

dry_run [required]

boolean

Whether this rule is run in dry-run mode.

gate_id [required]

string

The ID of the deployment gate.

name [required]

string

The name of the deployment rule.

options [required]

 <oneOf>

Options for deployment rule response representing either faulty deployment detection or monitor options.

Option 1

object

Faulty deployment detection options for deployment rules.

duration

int64

The duration for faulty deployment detection.

excluded_resources

[string]

Resources to exclude from faulty deployment detection.

Option 2

object

Monitor options for deployment rules.

duration

int64

Seconds the monitor needs to stay in OK status for the rule to pass.

query [required]

string

Monitors that match this query are evaluated.

type [required]

enum

The type of the deployment rule. Allowed enum values: faulty_deployment_detection,monitor

updated_at

date-time

The timestamp when the deployment rule was last updated.

updated_by

object

Information about the user who updated the deployment rule.

handle

string

The handle of the user who updated the deployment rule.

id [required]

string

The ID of the user who updated the deployment rule.

name

string

The name of the user who updated the deployment rule.

id [required]

string

Unique identifier of the deployment rule.

type [required]

enum

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.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Deployment rule not found.

Deployment rule not found.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # Path parameters
export gate_id="CHANGE_ME"
export id="CHANGE_ME"
# Curl command
curl -X PUT "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/${id}" \ -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": "Updated deployment rule", "options": { "excluded_resources": [] } }, "type": "deployment_rule" } } EOF

Note: This endpoint is in preview and may be subject to change. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.ap2.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.datadoghq.eu/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.ddog-gov.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.us3.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}https://api.us5.datadoghq.com/api/v2/deployment_gates/{gate_id}/rules/{id}

Overview

Endpoint to delete a deployment rule. This endpoint requires the deployment_gates_write permission.

Arguments

Path Parameters

Name

Type

Description

gate_id [required]

string

The ID of the deployment gate.

id [required]

string

The ID of the deployment rule.

Response

No Content

Bad request.

Bad request.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Deployment gate not found.

Deployment gate not found.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

Errors occurred.

Expand All

Field

Type

Description

errors

[object]

Structured errors.

detail

string

Error message.

status

string

Error code.

title

string

Error title.

{
  "errors": [
    {
      "detail": "Malformed payload",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export gate_id="CHANGE_ME"
export id="CHANGE_ME"
# Curl command
curl -X DELETE "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/${id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"