Skip to main content

service_definitions

Creates, updates, deletes, gets or lists a service_definitions resource.

Overview

Nameservice_definitions
TypeResource
Iddatadog.service_management.service_definitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringService definition id.
attributesobjectService definition attributes.
typestringService definition type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_service_definitionselectservice_nameschema_versionGet a single service definition from the Datadog Service Catalog.
list_service_definitionsselectpage[size], page[number], schema_versionGet a list of all service definitions from the Datadog Service Catalog.
create_or_update_service_definitionsinsertschema-version, dd-serviceCreate or update service definition in the Datadog Service Catalog.
delete_service_definitiondeleteservice_nameDelete a single service definition in the Datadog Service Catalog.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
service_namestringThe name of the service.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
page[number]integer (int64)Specific page number to return.
page[size]integer (int64)Number of items to return per page. The maximum allowed value is 100.
schema_versionstringThe schema version desired in the response.

SELECT examples

Get a single service definition from the Datadog Service Catalog.

SELECT
id,
attributes,
type
FROM datadog.service_management.service_definitions
WHERE service_name = '{{ service_name }}' -- required
AND schema_version = '{{ schema_version }}'
;

INSERT examples

Create or update service definition in the Datadog Service Catalog.

INSERT INTO datadog.service_management.service_definitions (
application,
ci-pipeline-fingerprints,
contacts,
dd-service,
description,
extensions,
integrations,
languages,
lifecycle,
links,
schema-version,
tags,
team,
tier,
type,
dd-team,
docs,
repos
)
SELECT
'{{ application }}',
'{{ ci-pipeline-fingerprints }}',
'{{ contacts }}',
'{{ dd-service }}' /* required */,
'{{ description }}',
'{{ extensions }}',
'{{ integrations }}',
'{{ languages }}',
'{{ lifecycle }}',
'{{ links }}',
'{{ schema-version }}' /* required */,
'{{ tags }}',
'{{ team }}',
'{{ tier }}',
'{{ type }}',
'{{ dd-team }}',
'{{ docs }}',
'{{ repos }}'
RETURNING
data
;

DELETE examples

Delete a single service definition in the Datadog Service Catalog.

DELETE FROM datadog.service_management.service_definitions
WHERE service_name = '{{ service_name }}' --required
;