Envoyer un événement de déploiement
https://api.datadoghq.com/api/v2/dora/deploymenthttps://api.us3.datadoghq.com/api/v2/dora/deploymenthttps://api.us5.datadoghq.com/api/v2/dora/deploymenthttps://api.datadoghq.eu/api/v2/dora/deploymenthttps://api.ap1.datadoghq.com/api/v2/dora/deploymenthttps://api.ap2.datadoghq.com/api/v2/dora/deploymenthttps://api.uk1.datadoghq.com/api/v2/dora/deploymenthttps://api.ddog-gov.com/api/v2/dora/deploymenthttps://api.us2.ddog-gov.com/api/v2/dora/deploymentPrésentation
Utilisez cet endpoint d'API pour fournir des données de déploiement.
Cela est nécessaire pour :
- La fréquence de déploiement
- Le délai d'exécution des modifications
- Le taux d'échec des modifications
- Le temps de récupération après un déploiement en échec
Requête
Body Data (required)
data [required]La requête de création d'un événement de déploiement DORA.
attributes [required]Attributes to create a DORA deployment event.
custom_tagsA list of user-defined tags. The tags must follow the key:value pattern. Up to 100 may be added per event.
envEnvironment name to where the service was deployed.
finished_at [required]Unix timestamp when the deployment finished. It must be in nanoseconds, milliseconds, or seconds.
gitGit info for DORA Metrics events.
commit_sha [required]Git Commit SHA.
repository_url [required]Git Repository URL
idDeployment ID. Must be 16-128 characters and contain only alphanumeric characters, hyphens, underscores, periods, and colons (a-z, A-Z, 0-9, -, _, ., :).
service [required]Service name.
started_at [required]Unix timestamp when the deployment started. It must be in nanoseconds, milliseconds, or seconds.
teamName 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.
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}Réponse
OK
Response after receiving a DORA deployment event.
data [required]The JSON:API data.
id [required]The ID of the received DORA deployment event.
typeJSON:API type for DORA deployment events.
dora_deploymentdora_deployment{
"data": {
"id": "4242fcdd31586083",
"type": "dora_deployment"
}
}OK - but delayed due to incident
Response after receiving a DORA deployment event.
data [required]The JSON:API data.
id [required]The ID of the received DORA deployment event.
typeJSON:API type for DORA deployment events.
dora_deploymentdora_deployment{
"data": {
"id": "4242fcdd31586083",
"type": "dora_deployment"
}
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Authorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Exemple de code
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/api/v2/dora/deployment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"finished_at": 1693491984000000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"service": "shopist",
"started_at": 1693491974000000000,
"version": "v1.12.07"
}
}
}
EOF