Get a deployment gate evaluation result

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/deployments/gates/evaluation/{id}https://api.ap2.datadoghq.com/api/v2/deployments/gates/evaluation/{id}https://api.datadoghq.eu/api/v2/deployments/gates/evaluation/{id}https://api.ddog-gov.com/api/v2/deployments/gates/evaluation/{id}https://api.us2.ddog-gov.com/api/v2/deployments/gates/evaluation/{id}https://api.datadoghq.com/api/v2/deployments/gates/evaluation/{id}https://api.us3.datadoghq.com/api/v2/deployments/gates/evaluation/{id}https://api.us5.datadoghq.com/api/v2/deployments/gates/evaluation/{id}

Overview

Retrieves the result of a deployment gate evaluation by its evaluation ID. If the evaluation is still in progress, data.attributes.gate_status will be in_progress; continue polling until it returns pass or fail. Polling every 10-20 seconds is recommended. The endpoint may return a 404 if called too soon after triggering; retry after a few seconds. This endpoint requires the deployment_gates_evaluate permission.

Arguments

Path Parameters

Name

Type

Description

id [required]

string

The evaluation ID returned by the trigger endpoint.

Response

OK

Response containing the result of a deployment gate evaluation.

Expand All

Field

Type

Description

data

object

Data for a deployment gate evaluation result response.

attributes [required]

object

Attributes for a deployment gate evaluation result response.

dry_run [required]

boolean

Whether the gate was evaluated in dry-run mode.

evaluation_id [required]

string

The unique identifier of the gate evaluation.

evaluation_url [required]

string

A URL to view the evaluation details in the Datadog UI.

gate_id [required]

uuid

The unique identifier of the deployment gate.

gate_status [required]

enum

The overall status of the gate evaluation.

  • in_progress: The evaluation is still running.
  • pass: All rules passed successfully and the deployment is allowed to proceed.
  • fail: One or more rules did not pass; the deployment should not proceed. Allowed enum values: in_progress,pass,fail

rules [required]

[object]

The results of individual rule evaluations.

dry_run

boolean

Whether this rule was evaluated in dry-run mode.

name

string

The name of the rule.

reason

string

The reason for the rule result, if applicable.

status

enum

The overall status of the gate evaluation.

  • in_progress: The evaluation is still running.
  • pass: All rules passed successfully and the deployment is allowed to proceed.
  • fail: One or more rules did not pass; the deployment should not proceed. Allowed enum values: in_progress,pass,fail

id [required]

string

The unique identifier of the evaluation.

type [required]

enum

JSON:API type for a deployment gate evaluation result response. Allowed enum values: deployment_gates_evaluation_result_response

default: deployment_gates_evaluation_result_response

{
  "data": {
    "attributes": {
      "dry_run": false,
      "evaluation_id": "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9",
      "evaluation_url": "https://app.datadoghq.com/ci/deployment-gates/evaluations?index=cdgates\u0026query=level%3Agate+%40evaluation_id%3Ae9d2f04f-4f4b-494b-86e5-52f03e10c8e9",
      "gate_id": "e140302e-0cba-40d2-978c-6780647f8f1c",
      "gate_status": "pass",
      "rules": [
        {
          "dry_run": false,
          "name": "Check service monitors",
          "reason": "One or more monitors in ALERT state",
          "status": "pass"
        }
      ]
    },
    "id": "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9",
    "type": "deployment_gates_evaluation_result_response"
  }
}

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.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/deployments/gates/evaluation/${id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get a deployment gate evaluation result returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_deployment_gates_evaluation_result"] = True
with ApiClient(configuration) as api_client:
    api_instance = DeploymentGatesApi(api_client)
    response = api_instance.get_deployment_gates_evaluation_result(
        id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
    )

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get a deployment gate evaluation result returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_deployment_gates_evaluation_result".to_sym] = true
end
api_instance = DatadogAPIClient::V2::DeploymentGatesAPI.new
p api_instance.get_deployment_gates_evaluation_result("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get a deployment gate evaluation result returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
	"github.com/google/uuid"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetDeploymentGatesEvaluationResult", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDeploymentGatesApi(apiClient)
	resp, r, err := api.GetDeploymentGatesEvaluationResult(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"))

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DeploymentGatesApi.GetDeploymentGatesEvaluationResult`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DeploymentGatesApi.GetDeploymentGatesEvaluationResult`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get a deployment gate evaluation result returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DeploymentGatesApi;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResultResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getDeploymentGatesEvaluationResult", true);
    DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient);

    try {
      DeploymentGatesEvaluationResultResponse result =
          apiInstance.getDeploymentGatesEvaluationResult(
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling DeploymentGatesApi#getDeploymentGatesEvaluationResult");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get a deployment gate evaluation result returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetDeploymentGatesEvaluationResult", true);
    let api = DeploymentGatesAPI::with_config(configuration);
    let resp = api
        .get_deployment_gates_evaluation_result(
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get a deployment gate evaluation result returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getDeploymentGatesEvaluationResult"] =
  true;
const apiInstance = new v2.DeploymentGatesApi(configuration);

const params: v2.DeploymentGatesApiGetDeploymentGatesEvaluationResultRequest = {
  id: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
  .getDeploymentGatesEvaluationResult(params)
  .then((data: v2.DeploymentGatesEvaluationResultResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"