Environment name to where the service was deployed.
finished_at [required]
int64
Unix timestamp when the deployment finished. It must be in nanoseconds, milliseconds, or seconds, and it should not be older than 1 hour.
git
object
Git info for DORA Metrics events.
commit_sha [required]
string
Git Commit SHA.
repository_url [required]
string
Git Repository URL
id
string
Deployment ID.
service [required]
string
Service name.
started_at [required]
int64
Unix timestamp when the deployment started. It must be in nanoseconds, milliseconds, or seconds.
team
string
Name of the team owning the deployed service. If not provided, this is automatically populated with the team associated with the service in the Service Catalog.
// Send a deployment event for DORA Metrics returns "OK" response
packagemainimport("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(){body:=datadogV2.DORADeploymentRequest{Data:datadogV2.DORADeploymentRequestData{Attributes:datadogV2.DORADeploymentRequestAttributes{FinishedAt:1693491984000000000,Git:&datadogV2.DORAGitInfo{CommitSha:"66adc9350f2cc9b250b69abddab733dd55e1a588",RepositoryUrl:"https://github.com/organization/example-repository",},Service:"shopist",StartedAt:1693491974000000000,Version:datadog.PtrString("v1.12.07"),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateDORADeployment",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDORAMetricsApi(apiClient)resp,r,err:=api.CreateDORADeployment(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DORAMetricsApi.CreateDORADeployment`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DORAMetricsApi.CreateDORADeployment`:\n%s\n",responseContent)}
// Send a deployment event for DORA Metrics returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DoraMetricsApi;importcom.datadog.api.client.v2.model.DORADeploymentRequest;importcom.datadog.api.client.v2.model.DORADeploymentRequestAttributes;importcom.datadog.api.client.v2.model.DORADeploymentRequestData;importcom.datadog.api.client.v2.model.DORADeploymentResponse;importcom.datadog.api.client.v2.model.DORAGitInfo;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createDORADeployment",true);DoraMetricsApiapiInstance=newDoraMetricsApi(defaultClient);DORADeploymentRequestbody=newDORADeploymentRequest().data(newDORADeploymentRequestData().attributes(newDORADeploymentRequestAttributes().finishedAt(1693491984000000000L).git(newDORAGitInfo().commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588").repositoryUrl("https://github.com/organization/example-repository")).service("shopist").startedAt(1693491974000000000L).version("v1.12.07")));try{DORADeploymentResponseresult=apiInstance.createDORADeployment(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DoraMetricsApi#createDORADeployment");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Send a deployment event for DORA Metrics returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.dora_metrics_apiimportDORAMetricsApifromdatadog_api_client.v2.model.dora_deployment_requestimportDORADeploymentRequestfromdatadog_api_client.v2.model.dora_deployment_request_attributesimportDORADeploymentRequestAttributesfromdatadog_api_client.v2.model.dora_deployment_request_dataimportDORADeploymentRequestDatafromdatadog_api_client.v2.model.dora_git_infoimportDORAGitInfobody=DORADeploymentRequest(data=DORADeploymentRequestData(attributes=DORADeploymentRequestAttributes(finished_at=1693491984000000000,git=DORAGitInfo(commit_sha="66adc9350f2cc9b250b69abddab733dd55e1a588",repository_url="https://github.com/organization/example-repository",),service="shopist",started_at=1693491974000000000,version="v1.12.07",),),)configuration=Configuration()configuration.unstable_operations["create_dora_deployment"]=TruewithApiClient(configuration)asapi_client:api_instance=DORAMetricsApi(api_client)response=api_instance.create_dora_deployment(body=body)print(response)
# Send a deployment event for DORA Metrics returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_dora_deployment".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DORAMetricsAPI.newbody=DatadogAPIClient::V2::DORADeploymentRequest.new({data:DatadogAPIClient::V2::DORADeploymentRequestData.new({attributes:DatadogAPIClient::V2::DORADeploymentRequestAttributes.new({finished_at:1693491984000000000,git:DatadogAPIClient::V2::DORAGitInfo.new({commit_sha:"66adc9350f2cc9b250b69abddab733dd55e1a588",repository_url:"https://github.com/organization/example-repository",}),service:"shopist",started_at:1693491974000000000,version:"v1.12.07",}),}),})papi_instance.create_dora_deployment(body)
// Send a deployment event for DORA Metrics returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI;usedatadog_api_client::datadogV2::model::DORADeploymentRequest;usedatadog_api_client::datadogV2::model::DORADeploymentRequestAttributes;usedatadog_api_client::datadogV2::model::DORADeploymentRequestData;usedatadog_api_client::datadogV2::model::DORAGitInfo;#[tokio::main]asyncfnmain(){letbody=DORADeploymentRequest::new(DORADeploymentRequestData::new(DORADeploymentRequestAttributes::new(1693491984000000000,"shopist".to_string(),1693491974000000000,).git(DORAGitInfo::new("66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),"https://github.com/organization/example-repository".to_string(),)).version("v1.12.07".to_string()),));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateDORADeployment",true);letapi=DORAMetricsAPI::with_config(configuration);letresp=api.create_dora_deployment(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"cargo run
/**
* Send a deployment event for DORA Metrics returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createDORADeployment"]=true;constapiInstance=newv2.DORAMetricsApi(configuration);constparams: v2.DORAMetricsApiCreateDORADeploymentRequest={body:{data:{attributes:{finishedAt: 1693491984000000000,git:{commitSha:"66adc9350f2cc9b250b69abddab733dd55e1a588",repositoryUrl:"https://github.com/organization/example-repository",},service:"shopist",startedAt: 1693491974000000000,version:"v1.12.07",},},},};apiInstance.createDORADeployment(params).then((data: v2.DORADeploymentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
{"data":{"attributes":{"finished_at":1707842944600000000,"git":{"commit_sha":"66adc9350f2cc9b250b69abddab733dd55e1a588","repository_url":"https://github.com/organization/example-repository"},"name":"Webserver is down failing all requests","services":["shopist"],"severity":"High","started_at":1707842944500000000,"team":"backend","version":"v1.12.07"}}}
// Send an incident event for DORA Metrics returns "OK" response
packagemainimport("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(){body:=datadogV2.DORAIncidentRequest{Data:datadogV2.DORAIncidentRequestData{Attributes:datadogV2.DORAIncidentRequestAttributes{FinishedAt:datadog.PtrInt64(1707842944600000000),Git:&datadogV2.DORAGitInfo{CommitSha:"66adc9350f2cc9b250b69abddab733dd55e1a588",RepositoryUrl:"https://github.com/organization/example-repository",},Name:datadog.PtrString("Webserver is down failing all requests"),Services:[]string{"shopist",},Severity:datadog.PtrString("High"),StartedAt:1707842944500000000,Team:datadog.PtrString("backend"),Version:datadog.PtrString("v1.12.07"),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateDORAIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDORAMetricsApi(apiClient)resp,r,err:=api.CreateDORAIncident(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DORAMetricsApi.CreateDORAIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DORAMetricsApi.CreateDORAIncident`:\n%s\n",responseContent)}
// Send an incident event for DORA Metrics returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DoraMetricsApi;importcom.datadog.api.client.v2.model.DORAGitInfo;importcom.datadog.api.client.v2.model.DORAIncidentRequest;importcom.datadog.api.client.v2.model.DORAIncidentRequestAttributes;importcom.datadog.api.client.v2.model.DORAIncidentRequestData;importcom.datadog.api.client.v2.model.DORAIncidentResponse;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createDORAIncident",true);DoraMetricsApiapiInstance=newDoraMetricsApi(defaultClient);DORAIncidentRequestbody=newDORAIncidentRequest().data(newDORAIncidentRequestData().attributes(newDORAIncidentRequestAttributes().finishedAt(1707842944600000000L).git(newDORAGitInfo().commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588").repositoryUrl("https://github.com/organization/example-repository")).name("Webserver is down failing all requests").services(Collections.singletonList("shopist")).severity("High").startedAt(1707842944500000000L).team("backend").version("v1.12.07")));try{DORAIncidentResponseresult=apiInstance.createDORAIncident(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DoraMetricsApi#createDORAIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Send an incident event for DORA Metrics returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.dora_metrics_apiimportDORAMetricsApifromdatadog_api_client.v2.model.dora_git_infoimportDORAGitInfofromdatadog_api_client.v2.model.dora_incident_requestimportDORAIncidentRequestfromdatadog_api_client.v2.model.dora_incident_request_attributesimportDORAIncidentRequestAttributesfromdatadog_api_client.v2.model.dora_incident_request_dataimportDORAIncidentRequestDatabody=DORAIncidentRequest(data=DORAIncidentRequestData(attributes=DORAIncidentRequestAttributes(finished_at=1707842944600000000,git=DORAGitInfo(commit_sha="66adc9350f2cc9b250b69abddab733dd55e1a588",repository_url="https://github.com/organization/example-repository",),name="Webserver is down failing all requests",services=["shopist",],severity="High",started_at=1707842944500000000,team="backend",version="v1.12.07",),),)configuration=Configuration()configuration.unstable_operations["create_dora_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=DORAMetricsApi(api_client)response=api_instance.create_dora_incident(body=body)print(response)
# Send an incident event for DORA Metrics returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_dora_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DORAMetricsAPI.newbody=DatadogAPIClient::V2::DORAIncidentRequest.new({data:DatadogAPIClient::V2::DORAIncidentRequestData.new({attributes:DatadogAPIClient::V2::DORAIncidentRequestAttributes.new({finished_at:1707842944600000000,git:DatadogAPIClient::V2::DORAGitInfo.new({commit_sha:"66adc9350f2cc9b250b69abddab733dd55e1a588",repository_url:"https://github.com/organization/example-repository",}),name:"Webserver is down failing all requests",services:["shopist",],severity:"High",started_at:1707842944500000000,team:"backend",version:"v1.12.07",}),}),})papi_instance.create_dora_incident(body)
// Send an incident event for DORA Metrics returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI;usedatadog_api_client::datadogV2::model::DORAGitInfo;usedatadog_api_client::datadogV2::model::DORAIncidentRequest;usedatadog_api_client::datadogV2::model::DORAIncidentRequestAttributes;usedatadog_api_client::datadogV2::model::DORAIncidentRequestData;#[tokio::main]asyncfnmain(){letbody=DORAIncidentRequest::new(DORAIncidentRequestData::new(DORAIncidentRequestAttributes::new(1707842944500000000).finished_at(1707842944600000000).git(DORAGitInfo::new("66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),"https://github.com/organization/example-repository".to_string(),)).name("Webserver is down failing all requests".to_string()).services(vec!["shopist".to_string()]).severity("High".to_string()).team("backend".to_string()).version("v1.12.07".to_string()),));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateDORAIncident",true);letapi=DORAMetricsAPI::with_config(configuration);letresp=api.create_dora_incident(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"cargo run
/**
* Send an incident event for DORA Metrics returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createDORAIncident"]=true;constapiInstance=newv2.DORAMetricsApi(configuration);constparams: v2.DORAMetricsApiCreateDORAIncidentRequest={body:{data:{attributes:{finishedAt: 1707842944600000000,git:{commitSha:"66adc9350f2cc9b250b69abddab733dd55e1a588",repositoryUrl:"https://github.com/organization/example-repository",},name:"Webserver is down failing all requests",services:["shopist"],severity:"High",startedAt: 1707842944500000000,team:"backend",version:"v1.12.07",},},},};apiInstance.createDORAIncident(params).then((data: v2.DORAIncidentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));