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.
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create deployment gate returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createDeploymentGate"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);constparams: v2.DeploymentGatesApiCreateDeploymentGateRequest={body:{data:{attributes:{dryRun: false,env:"production",identifier:"my-gate-1",service:"my-service",},type:"deployment_gate",},},};apiInstance.createDeploymentGate(params).then((data: v2.DeploymentGateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get deployment gate returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApi# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_deployment_gate"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.get_deployment_gate(id=DEPLOYMENT_GATE_DATA_ID,)print(response)
# Get deployment gate returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_deployment_gate".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]papi_instance.get_deployment_gate(DEPLOYMENT_GATE_DATA_ID)
// Get deployment gate returns "OK" 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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetDeploymentGate",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.GetDeploymentGate(ctx,DeploymentGateDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.GetDeploymentGate`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.GetDeploymentGate`:\n%s\n",responseContent)}
// Get deployment gate returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentGateResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getDeploymentGate",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");try{DeploymentGateResponseresult=apiInstance.getDeploymentGate(DEPLOYMENT_GATE_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#getDeploymentGate");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get deployment gate returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetDeploymentGate",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.get_deployment_gate(deployment_gate_data_id.clone()).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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get deployment gate returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getDeploymentGate"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;constparams: v2.DeploymentGatesApiGetDeploymentGateRequest={id: DEPLOYMENT_GATE_DATA_ID,};apiInstance.getDeploymentGate(params).then((data: v2.DeploymentGateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Update deployment gate returns "OK" 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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")body:=datadogV2.UpdateDeploymentGateParams{Data:datadogV2.UpdateDeploymentGateParamsData{Attributes:datadogV2.UpdateDeploymentGateParamsDataAttributes{DryRun:false,},Id:"12345678-1234-1234-1234-123456789012",Type:datadogV2.DEPLOYMENTGATEDATATYPE_DEPLOYMENT_GATE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateDeploymentGate",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.UpdateDeploymentGate(ctx,DeploymentGateDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.UpdateDeploymentGate`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.UpdateDeploymentGate`:\n%s\n",responseContent)}
// Update deployment gate returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentGateDataType;importcom.datadog.api.client.v2.model.DeploymentGateResponse;importcom.datadog.api.client.v2.model.UpdateDeploymentGateParams;importcom.datadog.api.client.v2.model.UpdateDeploymentGateParamsData;importcom.datadog.api.client.v2.model.UpdateDeploymentGateParamsDataAttributes;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateDeploymentGate",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");UpdateDeploymentGateParamsbody=newUpdateDeploymentGateParams().data(newUpdateDeploymentGateParamsData().attributes(newUpdateDeploymentGateParamsDataAttributes().dryRun(false)).id("12345678-1234-1234-1234-123456789012").type(DeploymentGateDataType.DEPLOYMENT_GATE));try{DeploymentGateResponseresult=apiInstance.updateDeploymentGate(DEPLOYMENT_GATE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#updateDeploymentGate");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update deployment gate returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApifromdatadog_api_client.v2.model.deployment_gate_data_typeimportDeploymentGateDataTypefromdatadog_api_client.v2.model.update_deployment_gate_paramsimportUpdateDeploymentGateParamsfromdatadog_api_client.v2.model.update_deployment_gate_params_dataimportUpdateDeploymentGateParamsDatafromdatadog_api_client.v2.model.update_deployment_gate_params_data_attributesimport(UpdateDeploymentGateParamsDataAttributes,)# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]body=UpdateDeploymentGateParams(data=UpdateDeploymentGateParamsData(attributes=UpdateDeploymentGateParamsDataAttributes(dry_run=False,),id="12345678-1234-1234-1234-123456789012",type=DeploymentGateDataType.DEPLOYMENT_GATE,),)configuration=Configuration()configuration.unstable_operations["update_deployment_gate"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.update_deployment_gate(id=DEPLOYMENT_GATE_DATA_ID,body=body)print(response)
# Update deployment gate returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_deployment_gate".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]body=DatadogAPIClient::V2::UpdateDeploymentGateParams.new({data:DatadogAPIClient::V2::UpdateDeploymentGateParamsData.new({attributes:DatadogAPIClient::V2::UpdateDeploymentGateParamsDataAttributes.new({dry_run:false,}),id:"12345678-1234-1234-1234-123456789012",type:DatadogAPIClient::V2::DeploymentGateDataType::DEPLOYMENT_GATE,}),})papi_instance.update_deployment_gate(DEPLOYMENT_GATE_DATA_ID,body)
// Update deployment gate returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;usedatadog_api_client::datadogV2::model::DeploymentGateDataType;usedatadog_api_client::datadogV2::model::UpdateDeploymentGateParams;usedatadog_api_client::datadogV2::model::UpdateDeploymentGateParamsData;usedatadog_api_client::datadogV2::model::UpdateDeploymentGateParamsDataAttributes;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();letbody=UpdateDeploymentGateParams::new(UpdateDeploymentGateParamsData::new(UpdateDeploymentGateParamsDataAttributes::new(false),"12345678-1234-1234-1234-123456789012".to_string(),DeploymentGateDataType::DEPLOYMENT_GATE,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateDeploymentGate",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.update_deployment_gate(deployment_gate_data_id.clone(),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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update deployment gate returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateDeploymentGate"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;constparams: v2.DeploymentGatesApiUpdateDeploymentGateRequest={body:{data:{attributes:{dryRun: false,},id:"12345678-1234-1234-1234-123456789012",type:"deployment_gate",},},id: DEPLOYMENT_GATE_DATA_ID,};apiInstance.updateDeploymentGate(params).then((data: v2.DeploymentGateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete deployment gate returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApi# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_deployment_gate"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)api_instance.delete_deployment_gate(id=DEPLOYMENT_GATE_DATA_ID,)
# Delete deployment gate returns "No Content" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_deployment_gate".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]api_instance.delete_deployment_gate(DEPLOYMENT_GATE_DATA_ID)
// Delete deployment gate returns "No Content" responsepackagemainimport("context""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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteDeploymentGate",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)r,err:=api.DeleteDeploymentGate(ctx,DeploymentGateDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.DeleteDeploymentGate`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete deployment gate returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteDeploymentGate",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");try{apiInstance.deleteDeploymentGate(DEPLOYMENT_GATE_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#deleteDeploymentGate");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete deployment gate returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteDeploymentGate",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.delete_deployment_gate(deployment_gate_data_id.clone()).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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete deployment gate returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteDeploymentGate"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;constparams: v2.DeploymentGatesApiDeleteDeploymentGateRequest={id: DEPLOYMENT_GATE_DATA_ID,};apiInstance.deleteDeploymentGate(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Create deployment rule returns "OK" 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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")body:=datadogV2.CreateDeploymentRuleParams{Data:&datadogV2.CreateDeploymentRuleParamsData{Attributes:datadogV2.CreateDeploymentRuleParamsDataAttributes{DryRun:datadog.PtrBool(false),Name:"My deployment rule",Options:datadogV2.DeploymentRulesOptions{DeploymentRuleOptionsFaultyDeploymentDetection:&datadogV2.DeploymentRuleOptionsFaultyDeploymentDetection{ExcludedResources:[]string{},}},Type:"faulty_deployment_detection",},Type:datadogV2.DEPLOYMENTRULEDATATYPE_DEPLOYMENT_RULE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateDeploymentRule",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.CreateDeploymentRule(ctx,DeploymentGateDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.CreateDeploymentRule`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.CreateDeploymentRule`:\n%s\n",responseContent)}
// Create deployment rule returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.CreateDeploymentRuleParams;importcom.datadog.api.client.v2.model.CreateDeploymentRuleParamsData;importcom.datadog.api.client.v2.model.CreateDeploymentRuleParamsDataAttributes;importcom.datadog.api.client.v2.model.DeploymentRuleDataType;importcom.datadog.api.client.v2.model.DeploymentRuleOptionsFaultyDeploymentDetection;importcom.datadog.api.client.v2.model.DeploymentRuleResponse;importcom.datadog.api.client.v2.model.DeploymentRulesOptions;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createDeploymentRule",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");CreateDeploymentRuleParamsbody=newCreateDeploymentRuleParams().data(newCreateDeploymentRuleParamsData().attributes(newCreateDeploymentRuleParamsDataAttributes().dryRun(false).name("My deployment rule").options(newDeploymentRulesOptions(newDeploymentRuleOptionsFaultyDeploymentDetection())).type("faulty_deployment_detection")).type(DeploymentRuleDataType.DEPLOYMENT_RULE));try{DeploymentRuleResponseresult=apiInstance.createDeploymentRule(DEPLOYMENT_GATE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#createDeploymentRule");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create deployment rule returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApifromdatadog_api_client.v2.model.create_deployment_rule_paramsimportCreateDeploymentRuleParamsfromdatadog_api_client.v2.model.create_deployment_rule_params_dataimportCreateDeploymentRuleParamsDatafromdatadog_api_client.v2.model.create_deployment_rule_params_data_attributesimport(CreateDeploymentRuleParamsDataAttributes,)fromdatadog_api_client.v2.model.deployment_rule_data_typeimportDeploymentRuleDataTypefromdatadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detectionimport(DeploymentRuleOptionsFaultyDeploymentDetection,)# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]body=CreateDeploymentRuleParams(data=CreateDeploymentRuleParamsData(attributes=CreateDeploymentRuleParamsDataAttributes(dry_run=False,name="My deployment rule",options=DeploymentRuleOptionsFaultyDeploymentDetection(excluded_resources=[],),type="faulty_deployment_detection",),type=DeploymentRuleDataType.DEPLOYMENT_RULE,),)configuration=Configuration()configuration.unstable_operations["create_deployment_rule"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.create_deployment_rule(gate_id=DEPLOYMENT_GATE_DATA_ID,body=body)print(response)
# Create deployment rule returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_deployment_rule".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]body=DatadogAPIClient::V2::CreateDeploymentRuleParams.new({data:DatadogAPIClient::V2::CreateDeploymentRuleParamsData.new({attributes:DatadogAPIClient::V2::CreateDeploymentRuleParamsDataAttributes.new({dry_run:false,name:"My deployment rule",options:DatadogAPIClient::V2::DeploymentRuleOptionsFaultyDeploymentDetection.new({excluded_resources:[],}),type:"faulty_deployment_detection",}),type:DatadogAPIClient::V2::DeploymentRuleDataType::DEPLOYMENT_RULE,}),})papi_instance.create_deployment_rule(DEPLOYMENT_GATE_DATA_ID,body)
// Create deployment rule returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;usedatadog_api_client::datadogV2::model::CreateDeploymentRuleParams;usedatadog_api_client::datadogV2::model::CreateDeploymentRuleParamsData;usedatadog_api_client::datadogV2::model::CreateDeploymentRuleParamsDataAttributes;usedatadog_api_client::datadogV2::model::DeploymentRuleDataType;usedatadog_api_client::datadogV2::model::DeploymentRuleOptionsFaultyDeploymentDetection;usedatadog_api_client::datadogV2::model::DeploymentRulesOptions;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();letbody=CreateDeploymentRuleParams::new().data(CreateDeploymentRuleParamsData::new(CreateDeploymentRuleParamsDataAttributes::new("My deployment rule".to_string(),DeploymentRulesOptions::DeploymentRuleOptionsFaultyDeploymentDetection(Box::new(DeploymentRuleOptionsFaultyDeploymentDetection::new().excluded_resources(vec![]),)),"faulty_deployment_detection".to_string(),).dry_run(false),DeploymentRuleDataType::DEPLOYMENT_RULE,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateDeploymentRule",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.create_deployment_rule(deployment_gate_data_id.clone(),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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create deployment rule returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createDeploymentRule"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;constparams: v2.DeploymentGatesApiCreateDeploymentRuleRequest={body:{data:{attributes:{dryRun: false,name:"My deployment rule",options:{excludedResources:[],},type:"faulty_deployment_detection",},type:"deployment_rule",},},gateId: DEPLOYMENT_GATE_DATA_ID,};apiInstance.createDeploymentRule(params).then((data: v2.DeploymentRuleResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get deployment rule returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApi# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]# there is a valid "deployment_rule" in the systemDEPLOYMENT_RULE_DATA_ID=environ["DEPLOYMENT_RULE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_deployment_rule"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.get_deployment_rule(gate_id=DEPLOYMENT_GATE_DATA_ID,id=DEPLOYMENT_RULE_DATA_ID,)print(response)
# Get deployment rule returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_deployment_rule".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]# there is a valid "deployment_rule" in the systemDEPLOYMENT_RULE_DATA_ID=ENV["DEPLOYMENT_RULE_DATA_ID"]papi_instance.get_deployment_rule(DEPLOYMENT_GATE_DATA_ID,DEPLOYMENT_RULE_DATA_ID)
// Get deployment rule returns "OK" 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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")// there is a valid "deployment_rule" in the systemDeploymentRuleDataID:=os.Getenv("DEPLOYMENT_RULE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetDeploymentRule",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.GetDeploymentRule(ctx,DeploymentGateDataID,DeploymentRuleDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.GetDeploymentRule`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.GetDeploymentRule`:\n%s\n",responseContent)}
// Get deployment rule returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentRuleResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getDeploymentRule",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");// there is a valid "deployment_rule" in the systemStringDEPLOYMENT_RULE_DATA_ID=System.getenv("DEPLOYMENT_RULE_DATA_ID");try{DeploymentRuleResponseresult=apiInstance.getDeploymentRule(DEPLOYMENT_GATE_DATA_ID,DEPLOYMENT_RULE_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#getDeploymentRule");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get deployment rule returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();// there is a valid "deployment_rule" in the system
letdeployment_rule_data_id=std::env::var("DEPLOYMENT_RULE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetDeploymentRule",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.get_deployment_rule(deployment_gate_data_id.clone(),deployment_rule_data_id.clone(),).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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get deployment rule returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getDeploymentRule"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;// there is a valid "deployment_rule" in the system
constDEPLOYMENT_RULE_DATA_ID=process.env.DEPLOYMENT_RULE_DATA_IDasstring;constparams: v2.DeploymentGatesApiGetDeploymentRuleRequest={gateId: DEPLOYMENT_GATE_DATA_ID,id: DEPLOYMENT_RULE_DATA_ID,};apiInstance.getDeploymentRule(params).then((data: v2.DeploymentRuleResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Update deployment rule returns "OK" 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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")// there is a valid "deployment_rule" in the systemDeploymentRuleDataID:=os.Getenv("DEPLOYMENT_RULE_DATA_ID")body:=datadogV2.UpdateDeploymentRuleParams{Data:datadogV2.UpdateDeploymentRuleParamsData{Attributes:datadogV2.UpdateDeploymentRuleParamsDataAttributes{DryRun:false,Name:"Updated deployment rule",Options:datadogV2.DeploymentRulesOptions{DeploymentRuleOptionsFaultyDeploymentDetection:&datadogV2.DeploymentRuleOptionsFaultyDeploymentDetection{ExcludedResources:[]string{},}},},Type:datadogV2.DEPLOYMENTRULEDATATYPE_DEPLOYMENT_RULE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateDeploymentRule",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.UpdateDeploymentRule(ctx,DeploymentGateDataID,DeploymentRuleDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.UpdateDeploymentRule`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.UpdateDeploymentRule`:\n%s\n",responseContent)}
// Update deployment rule returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentRuleDataType;importcom.datadog.api.client.v2.model.DeploymentRuleOptionsFaultyDeploymentDetection;importcom.datadog.api.client.v2.model.DeploymentRuleResponse;importcom.datadog.api.client.v2.model.DeploymentRulesOptions;importcom.datadog.api.client.v2.model.UpdateDeploymentRuleParams;importcom.datadog.api.client.v2.model.UpdateDeploymentRuleParamsData;importcom.datadog.api.client.v2.model.UpdateDeploymentRuleParamsDataAttributes;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateDeploymentRule",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");// there is a valid "deployment_rule" in the systemStringDEPLOYMENT_RULE_DATA_ID=System.getenv("DEPLOYMENT_RULE_DATA_ID");UpdateDeploymentRuleParamsbody=newUpdateDeploymentRuleParams().data(newUpdateDeploymentRuleParamsData().attributes(newUpdateDeploymentRuleParamsDataAttributes().dryRun(false).name("Updated deployment rule").options(newDeploymentRulesOptions(newDeploymentRuleOptionsFaultyDeploymentDetection()))).type(DeploymentRuleDataType.DEPLOYMENT_RULE));try{DeploymentRuleResponseresult=apiInstance.updateDeploymentRule(DEPLOYMENT_GATE_DATA_ID,DEPLOYMENT_RULE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#updateDeploymentRule");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update deployment rule returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApifromdatadog_api_client.v2.model.deployment_rule_data_typeimportDeploymentRuleDataTypefromdatadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detectionimport(DeploymentRuleOptionsFaultyDeploymentDetection,)fromdatadog_api_client.v2.model.update_deployment_rule_paramsimportUpdateDeploymentRuleParamsfromdatadog_api_client.v2.model.update_deployment_rule_params_dataimportUpdateDeploymentRuleParamsDatafromdatadog_api_client.v2.model.update_deployment_rule_params_data_attributesimport(UpdateDeploymentRuleParamsDataAttributes,)# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]# there is a valid "deployment_rule" in the systemDEPLOYMENT_RULE_DATA_ID=environ["DEPLOYMENT_RULE_DATA_ID"]body=UpdateDeploymentRuleParams(data=UpdateDeploymentRuleParamsData(attributes=UpdateDeploymentRuleParamsDataAttributes(dry_run=False,name="Updated deployment rule",options=DeploymentRuleOptionsFaultyDeploymentDetection(excluded_resources=[],),),type=DeploymentRuleDataType.DEPLOYMENT_RULE,),)configuration=Configuration()configuration.unstable_operations["update_deployment_rule"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.update_deployment_rule(gate_id=DEPLOYMENT_GATE_DATA_ID,id=DEPLOYMENT_RULE_DATA_ID,body=body)print(response)
# Update deployment rule returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_deployment_rule".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]# there is a valid "deployment_rule" in the systemDEPLOYMENT_RULE_DATA_ID=ENV["DEPLOYMENT_RULE_DATA_ID"]body=DatadogAPIClient::V2::UpdateDeploymentRuleParams.new({data:DatadogAPIClient::V2::UpdateDeploymentRuleParamsData.new({attributes:DatadogAPIClient::V2::UpdateDeploymentRuleParamsDataAttributes.new({dry_run:false,name:"Updated deployment rule",options:DatadogAPIClient::V2::DeploymentRuleOptionsFaultyDeploymentDetection.new({excluded_resources:[],}),}),type:DatadogAPIClient::V2::DeploymentRuleDataType::DEPLOYMENT_RULE,}),})papi_instance.update_deployment_rule(DEPLOYMENT_GATE_DATA_ID,DEPLOYMENT_RULE_DATA_ID,body)
// Update deployment rule returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;usedatadog_api_client::datadogV2::model::DeploymentRuleDataType;usedatadog_api_client::datadogV2::model::DeploymentRuleOptionsFaultyDeploymentDetection;usedatadog_api_client::datadogV2::model::DeploymentRulesOptions;usedatadog_api_client::datadogV2::model::UpdateDeploymentRuleParams;usedatadog_api_client::datadogV2::model::UpdateDeploymentRuleParamsData;usedatadog_api_client::datadogV2::model::UpdateDeploymentRuleParamsDataAttributes;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();// there is a valid "deployment_rule" in the system
letdeployment_rule_data_id=std::env::var("DEPLOYMENT_RULE_DATA_ID").unwrap();letbody=UpdateDeploymentRuleParams::new(UpdateDeploymentRuleParamsData::new(UpdateDeploymentRuleParamsDataAttributes::new(false,"Updated deployment rule".to_string(),DeploymentRulesOptions::DeploymentRuleOptionsFaultyDeploymentDetection(Box::new(DeploymentRuleOptionsFaultyDeploymentDetection::new().excluded_resources(vec![]),)),),DeploymentRuleDataType::DEPLOYMENT_RULE,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateDeploymentRule",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.update_deployment_rule(deployment_gate_data_id.clone(),deployment_rule_data_id.clone(),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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update deployment rule returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateDeploymentRule"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;// there is a valid "deployment_rule" in the system
constDEPLOYMENT_RULE_DATA_ID=process.env.DEPLOYMENT_RULE_DATA_IDasstring;constparams: v2.DeploymentGatesApiUpdateDeploymentRuleRequest={body:{data:{attributes:{dryRun: false,name:"Updated deployment rule",options:{excludedResources:[],},},type:"deployment_rule",},},gateId: DEPLOYMENT_GATE_DATA_ID,id: DEPLOYMENT_RULE_DATA_ID,};apiInstance.updateDeploymentRule(params).then((data: v2.DeploymentRuleResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete deployment rule returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApi# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]# there is a valid "deployment_rule" in the systemDEPLOYMENT_RULE_DATA_ID=environ["DEPLOYMENT_RULE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_deployment_rule"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)api_instance.delete_deployment_rule(gate_id=DEPLOYMENT_GATE_DATA_ID,id=DEPLOYMENT_RULE_DATA_ID,)
# Delete deployment rule returns "No Content" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_deployment_rule".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]# there is a valid "deployment_rule" in the systemDEPLOYMENT_RULE_DATA_ID=ENV["DEPLOYMENT_RULE_DATA_ID"]api_instance.delete_deployment_rule(DEPLOYMENT_GATE_DATA_ID,DEPLOYMENT_RULE_DATA_ID)
// Delete deployment rule returns "No Content" responsepackagemainimport("context""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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")// there is a valid "deployment_rule" in the systemDeploymentRuleDataID:=os.Getenv("DEPLOYMENT_RULE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteDeploymentRule",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)r,err:=api.DeleteDeploymentRule(ctx,DeploymentGateDataID,DeploymentRuleDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.DeleteDeploymentRule`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete deployment rule returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteDeploymentRule",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");// there is a valid "deployment_rule" in the systemStringDEPLOYMENT_RULE_DATA_ID=System.getenv("DEPLOYMENT_RULE_DATA_ID");try{apiInstance.deleteDeploymentRule(DEPLOYMENT_GATE_DATA_ID,DEPLOYMENT_RULE_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#deleteDeploymentRule");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete deployment rule returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();// there is a valid "deployment_rule" in the system
letdeployment_rule_data_id=std::env::var("DEPLOYMENT_RULE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteDeploymentRule",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.delete_deployment_rule(deployment_gate_data_id.clone(),deployment_rule_data_id.clone(),).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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete deployment rule returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteDeploymentRule"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;// there is a valid "deployment_rule" in the system
constDEPLOYMENT_RULE_DATA_ID=process.env.DEPLOYMENT_RULE_DATA_IDasstring;constparams: v2.DeploymentGatesApiDeleteDeploymentRuleRequest={gateId: DEPLOYMENT_GATE_DATA_ID,id: DEPLOYMENT_RULE_DATA_ID,};apiInstance.deleteDeploymentRule(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get rules for a deployment gate returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApi# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=environ["DEPLOYMENT_GATE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_deployment_gate_rules"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.get_deployment_gate_rules(gate_id=DEPLOYMENT_GATE_DATA_ID,)print(response)
# Get rules for a deployment gate returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_deployment_gate_rules".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ID=ENV["DEPLOYMENT_GATE_DATA_ID"]papi_instance.get_deployment_gate_rules(DEPLOYMENT_GATE_DATA_ID)
// Get rules for a deployment gate returns "OK" 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 systemDeploymentGateDataID:=os.Getenv("DEPLOYMENT_GATE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetDeploymentGateRules",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.GetDeploymentGateRules(ctx,DeploymentGateDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.GetDeploymentGateRules`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.GetDeploymentGateRules`:\n%s\n",responseContent)}
// Get rules for a deployment gate returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentGateRulesResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getDeploymentGateRules",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ID=System.getenv("DEPLOYMENT_GATE_DATA_ID");try{DeploymentGateRulesResponseresult=apiInstance.getDeploymentGateRules(DEPLOYMENT_GATE_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#getDeploymentGateRules");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get rules for a deployment gate returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_id=std::env::var("DEPLOYMENT_GATE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetDeploymentGateRules",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.get_deployment_gate_rules(deployment_gate_data_id.clone()).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.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get rules for a deployment gate returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getDeploymentGateRules"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ID=process.env.DEPLOYMENT_GATE_DATA_IDasstring;constparams: v2.DeploymentGatesApiGetDeploymentGateRulesRequest={gateId: DEPLOYMENT_GATE_DATA_ID,};apiInstance.getDeploymentGateRules(params).then((data: v2.DeploymentGateRulesResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));