Get service repository information
https://api.datadoghq.com/api/v2/sourcemaps/service_repository_infohttps://api.us3.datadoghq.com/api/v2/sourcemaps/service_repository_infohttps://api.us5.datadoghq.com/api/v2/sourcemaps/service_repository_infohttps://api.datadoghq.eu/api/v2/sourcemaps/service_repository_infohttps://api.ap1.datadoghq.com/api/v2/sourcemaps/service_repository_infohttps://api.ap2.datadoghq.com/api/v2/sourcemaps/service_repository_infohttps://api.uk1.datadoghq.com/api/v2/sourcemaps/service_repository_infohttps://api.ddog-gov.com/api/v2/sourcemaps/service_repository_infohttps://api.us2.ddog-gov.com/api/v2/sourcemaps/service_repository_infoPrésentation
Returns the repository URL and commit SHA associated with a given service and version.
Requête
Body Data (required)
data [required]Data object for the service repository info request.
attributes [required]Attributes for the service repository info request.
service [required]The name of the service.
version [required]The version of the service.
type [required]The resource type for service repository info objects.
service_repository_info{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}Réponse
OK
Response containing service repository information.
data [required]Data object for the service repository info response.
attributes [required]Attributes of the service repository information.
commit_shaThe SHA of the commit associated with the service version.
repository_urlThe URL of the source code repository.
status [required]The status of the service repository info lookup.
success, not_found, no_repository, internal_error, unknownid [required]The identifier composed of the service name and version.
type [required]The resource type for service repository info objects.
service_repository_info{
"data": {
"attributes": {
"commit_sha": "abc123def456789",
"repository_url": "https://github.com/my-org/my-repo",
"status": "success"
},
"id": "my-web-service:1.0.0",
"type": "service_repository_info"
}
}Unauthorized
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"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Internal Server Error
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"
}
]
}Exemple de code
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"service": "my-web-service",
"version": "1.0.0"
},
"type": "service_repository_info"
}
}
EOF