Update a deployment’s change failure status, identifying the deployment by its service, environment, and version instead of its ID. Use this to mark a deployment as a change failure or back to stable. You can optionally include remediation details to enable failed deployment recovery time calculation. If multiple deployments match the given service, environment, and version, the most recently finished one is updated.
This endpoint requires the dora_metrics_write permission.
The JSON:API data for patching a deployment identified by service, environment, and version.
attributes [required]
object
Attributes for patching a DORA deployment event identified by service, environment, and version.
change_failure [required]
boolean
Indicates whether the deployment resulted in a change failure.
env [required]
string
The environment the deployment was performed in.
remediation
<oneOf>
Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. Specify either id or version to identify the remediation deployment, but not both.
Object 1
object
Remediation details identified by the ID of the remediation deployment.
id [required]
string
The ID of the remediation deployment.
type [required]
enum
The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
Allowed enum values: rollback,rollforward
Object 2
object
Remediation details identified by the version of the remediation deployment, matched against the same service and environment as the failed deployment.
type [required]
enum
The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
Allowed enum values: rollback,rollforward
version [required]
string
The version of the remediation deployment.
service [required]
string
The name of the service that was deployed.
version [required]
string
The version deployed. This can be seen in the Service Catalog or in the APM Deployment Tracking.
type [required]
enum
JSON:API type for DORA deployment patch request.
Allowed enum values: dora_deployment_patch_request
"""
Patch a deployment event by version returns "Accepted" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.dora_metrics_apiimportDORAMetricsApifromdatadog_api_client.v2.model.dora_deployment_patch_by_version_remediation_by_versionimport(DORADeploymentPatchByVersionRemediationByVersion,)fromdatadog_api_client.v2.model.dora_deployment_patch_by_version_requestimportDORADeploymentPatchByVersionRequestfromdatadog_api_client.v2.model.dora_deployment_patch_by_version_request_attributesimport(DORADeploymentPatchByVersionRequestAttributes,)fromdatadog_api_client.v2.model.dora_deployment_patch_by_version_request_dataimport(DORADeploymentPatchByVersionRequestData,)fromdatadog_api_client.v2.model.dora_deployment_patch_remediation_typeimportDORADeploymentPatchRemediationTypefromdatadog_api_client.v2.model.dora_deployment_patch_request_data_typeimportDORADeploymentPatchRequestDataTypebody=DORADeploymentPatchByVersionRequest(data=DORADeploymentPatchByVersionRequestData(attributes=DORADeploymentPatchByVersionRequestAttributes(change_failure=True,env="production",remediation=DORADeploymentPatchByVersionRemediationByVersion(type=DORADeploymentPatchRemediationType.ROLLBACK,version="v1.2.2",),service="my-service",version="v1.2.3",),type=DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST,),)configuration=Configuration()configuration.unstable_operations["patch_dora_deployment_by_version"]=TruewithApiClient(configuration)asapi_client:api_instance=DORAMetricsApi(api_client)api_instance.patch_dora_deployment_by_version(body=body)
# Patch a deployment event by version returns "Accepted" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.patch_dora_deployment_by_version".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DORAMetricsAPI.newbody=DatadogAPIClient::V2::DORADeploymentPatchByVersionRequest.new({data:DatadogAPIClient::V2::DORADeploymentPatchByVersionRequestData.new({attributes:DatadogAPIClient::V2::DORADeploymentPatchByVersionRequestAttributes.new({change_failure:true,env:"production",remediation:DatadogAPIClient::V2::DORADeploymentPatchByVersionRemediationByVersion.new({type:DatadogAPIClient::V2::DORADeploymentPatchRemediationType::ROLLBACK,version:"v1.2.2",}),service:"my-service",version:"v1.2.3",}),type:DatadogAPIClient::V2::DORADeploymentPatchRequestDataType::DORA_DEPLOYMENT_PATCH_REQUEST,}),})papi_instance.patch_dora_deployment_by_version(body)
// Patch a deployment event by version returns "Accepted" 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(){body:=datadogV2.DORADeploymentPatchByVersionRequest{Data:datadogV2.DORADeploymentPatchByVersionRequestData{Attributes:datadogV2.DORADeploymentPatchByVersionRequestAttributes{ChangeFailure:true,Env:"production",Remediation:&datadogV2.DORADeploymentPatchByVersionRemediation{DORADeploymentPatchByVersionRemediationByVersion:&datadogV2.DORADeploymentPatchByVersionRemediationByVersion{Type:datadogV2.DORADEPLOYMENTPATCHREMEDIATIONTYPE_ROLLBACK,Version:"v1.2.2",}},Service:"my-service",Version:"v1.2.3",},Type:datadogV2.DORADEPLOYMENTPATCHREQUESTDATATYPE_DORA_DEPLOYMENT_PATCH_REQUEST,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.PatchDORADeploymentByVersion",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDORAMetricsApi(apiClient)r,err:=api.PatchDORADeploymentByVersion(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DORAMetricsApi.PatchDORADeploymentByVersion`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Patch a deployment event by version returns "Accepted" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DoraMetricsApi;importcom.datadog.api.client.v2.model.DORADeploymentPatchByVersionRemediation;importcom.datadog.api.client.v2.model.DORADeploymentPatchByVersionRemediationByVersion;importcom.datadog.api.client.v2.model.DORADeploymentPatchByVersionRequest;importcom.datadog.api.client.v2.model.DORADeploymentPatchByVersionRequestAttributes;importcom.datadog.api.client.v2.model.DORADeploymentPatchByVersionRequestData;importcom.datadog.api.client.v2.model.DORADeploymentPatchRemediationType;importcom.datadog.api.client.v2.model.DORADeploymentPatchRequestDataType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.patchDORADeploymentByVersion",true);DoraMetricsApiapiInstance=newDoraMetricsApi(defaultClient);DORADeploymentPatchByVersionRequestbody=newDORADeploymentPatchByVersionRequest().data(newDORADeploymentPatchByVersionRequestData().attributes(newDORADeploymentPatchByVersionRequestAttributes().changeFailure(true).env("production").remediation(newDORADeploymentPatchByVersionRemediation(newDORADeploymentPatchByVersionRemediationByVersion().type(DORADeploymentPatchRemediationType.ROLLBACK).version("v1.2.2"))).service("my-service").version("v1.2.3")).type(DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST));try{apiInstance.patchDORADeploymentByVersion(body);}catch(ApiExceptione){System.err.println("Exception when calling DoraMetricsApi#patchDORADeploymentByVersion");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Patch a deployment event by version returns "Accepted" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI;usedatadog_api_client::datadogV2::model::DORADeploymentPatchByVersionRemediation;usedatadog_api_client::datadogV2::model::DORADeploymentPatchByVersionRemediationByVersion;usedatadog_api_client::datadogV2::model::DORADeploymentPatchByVersionRequest;usedatadog_api_client::datadogV2::model::DORADeploymentPatchByVersionRequestAttributes;usedatadog_api_client::datadogV2::model::DORADeploymentPatchByVersionRequestData;usedatadog_api_client::datadogV2::model::DORADeploymentPatchRemediationType;usedatadog_api_client::datadogV2::model::DORADeploymentPatchRequestDataType;#[tokio::main]asyncfnmain(){letbody=DORADeploymentPatchByVersionRequest::new(DORADeploymentPatchByVersionRequestData::new(DORADeploymentPatchByVersionRequestAttributes::new(true,"production".to_string(),"my-service".to_string(),"v1.2.3".to_string(),).remediation(DORADeploymentPatchByVersionRemediation::DORADeploymentPatchByVersionRemediationByVersion(Box::new(DORADeploymentPatchByVersionRemediationByVersion::new(DORADeploymentPatchRemediationType::ROLLBACK,"v1.2.2".to_string(),),),),),DORADeploymentPatchRequestDataType::DORA_DEPLOYMENT_PATCH_REQUEST,),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.PatchDORADeploymentByVersion",true);letapi=DORAMetricsAPI::with_config(configuration);letresp=api.patch_dora_deployment_by_version(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Patch a deployment event by version returns "Accepted" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.patchDORADeploymentByVersion"]=true;constapiInstance=newv2.DORAMetricsApi(configuration);constparams: v2.DORAMetricsApiPatchDORADeploymentByVersionRequest={body:{data:{attributes:{changeFailure: true,env:"production",remediation:{type:"rollback",version:"v1.2.2",},service:"my-service",version:"v1.2.3",},type:"dora_deployment_patch_request",},},};apiInstance.patchDORADeploymentByVersion(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));