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.
This endpoint requires the deployment_gates_evaluate permission.
// Trigger a deployment gates evaluation returns "Accepted" responsepackagemainimport("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")funcmain(){// there is a valid "deployment_gate" in the systemDeploymentGateDataAttributesIdentifier:=os.Getenv("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER")body:=datadogV2.DeploymentGatesEvaluationRequest{Data:datadogV2.DeploymentGatesEvaluationRequestData{Attributes:datadogV2.DeploymentGatesEvaluationRequestAttributes{Env:"production",Identifier:datadog.PtrString(DeploymentGateDataAttributesIdentifier),Service:"my-service",},Type:datadogV2.DEPLOYMENTGATESEVALUATIONREQUESTDATATYPE_DEPLOYMENT_GATES_EVALUATION_REQUEST,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.TriggerDeploymentGatesEvaluation",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.TriggerDeploymentGatesEvaluation(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.TriggerDeploymentGatesEvaluation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.TriggerDeploymentGatesEvaluation`:\n%s\n",responseContent)}
// Trigger a deployment gates evaluation returns "Accepted" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestAttributes;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestData;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestDataType;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.triggerDeploymentGatesEvaluation",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=System.getenv("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER");DeploymentGatesEvaluationRequestbody=newDeploymentGatesEvaluationRequest().data(newDeploymentGatesEvaluationRequestData().attributes(newDeploymentGatesEvaluationRequestAttributes().env("production").identifier(DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER).service("my-service")).type(DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST));try{DeploymentGatesEvaluationResponseresult=apiInstance.triggerDeploymentGatesEvaluation(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#triggerDeploymentGatesEvaluation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Trigger a deployment gates evaluation returns "Accepted" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApifromdatadog_api_client.v2.model.deployment_gates_evaluation_requestimportDeploymentGatesEvaluationRequestfromdatadog_api_client.v2.model.deployment_gates_evaluation_request_attributesimport(DeploymentGatesEvaluationRequestAttributes,)fromdatadog_api_client.v2.model.deployment_gates_evaluation_request_dataimportDeploymentGatesEvaluationRequestDatafromdatadog_api_client.v2.model.deployment_gates_evaluation_request_data_typeimport(DeploymentGatesEvaluationRequestDataType,)# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=environ["DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"]body=DeploymentGatesEvaluationRequest(data=DeploymentGatesEvaluationRequestData(attributes=DeploymentGatesEvaluationRequestAttributes(env="production",identifier=DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER,service="my-service",),type=DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST,),)configuration=Configuration()configuration.unstable_operations["trigger_deployment_gates_evaluation"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.trigger_deployment_gates_evaluation(body=body)print(response)
# Trigger a deployment gates evaluation returns "Accepted" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.trigger_deployment_gates_evaluation".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=ENV["DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"]body=DatadogAPIClient::V2::DeploymentGatesEvaluationRequest.new({data:DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData.new({attributes:DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes.new({env:"production",identifier:DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER,service:"my-service",}),type:DatadogAPIClient::V2::DeploymentGatesEvaluationRequestDataType::DEPLOYMENT_GATES_EVALUATION_REQUEST,}),})papi_instance.trigger_deployment_gates_evaluation(body)
// Trigger a deployment gates evaluation returns "Accepted" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequest;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestAttributes;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestData;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestDataType;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_attributes_identifier=std::env::var("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER").unwrap();letbody=DeploymentGatesEvaluationRequest::new(DeploymentGatesEvaluationRequestData::new(DeploymentGatesEvaluationRequestAttributes::new("production".to_string(),"my-service".to_string(),).identifier(deployment_gate_data_attributes_identifier.clone()),DeploymentGatesEvaluationRequestDataType::DEPLOYMENT_GATES_EVALUATION_REQUEST,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.TriggerDeploymentGatesEvaluation",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.trigger_deployment_gates_evaluation(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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
/**
* Trigger a deployment gates evaluation returns "Accepted" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.triggerDeploymentGatesEvaluation"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=process.env.DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIERasstring;constparams: v2.DeploymentGatesApiTriggerDeploymentGatesEvaluationRequest={body:{data:{attributes:{env:"production",identifier: DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER,service:"my-service",},type:"deployment_gates_evaluation_request",},},};apiInstance.triggerDeploymentGatesEvaluation(params).then((data: v2.DeploymentGatesEvaluationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));