service_definitions
Creates, updates, deletes, gets or lists a service_definitions resource.
Overview
| Name | service_definitions |
| Type | Resource |
| Id | datadog.service_management.service_definitions |
Fields
The following fields are returned by SELECT queries:
- get_service_definition
- list_service_definitions
| Name | Datatype | Description |
|---|---|---|
id | string | Service definition id. |
attributes | object | Service definition attributes. |
type | string | Service definition type. |
| Name | Datatype | Description |
|---|---|---|
id | string | Service definition id. |
attributes | object | Service definition attributes. |
type | string | Service definition type. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_service_definition | select | service_name | schema_version | Get a single service definition from the Datadog Service Catalog. |
list_service_definitions | select | page[size], page[number], schema_version | Get a list of all service definitions from the Datadog Service Catalog. | |
create_or_update_service_definitions | insert | schema-version, dd-service | Create or update service definition in the Datadog Service Catalog. | |
delete_service_definition | delete | service_name | Delete 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.
| Name | Datatype | Description |
|---|---|---|
service_name | string | The name of the service. |
site | string | The 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_version | string | The schema version desired in the response. |
SELECT examples
- get_service_definition
- list_service_definitions
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 }}'
;
Get a list of all service definitions from the Datadog Service Catalog.
SELECT
id,
attributes,
type
FROM datadog.service_management.service_definitions
WHERE page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
AND schema_version = '{{ schema_version }}'
;
INSERT examples
- create_or_update_service_definitions
- Manifest
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
;
# Description fields are for documentation purposes
- name: service_definitions
props:
- name: application
value: "{{ application }}"
description: |
Identifier for a group of related services serving a product feature, which the service is a part of.
- name: ci-pipeline-fingerprints
value:
- "{{ ci-pipeline-fingerprints }}"
description: |
A set of CI fingerprints.
- name: contacts
description: |
A list of contacts related to the services.
value:
- contact: "{{ contact }}"
name: "{{ name }}"
type: "{{ type }}"
- name: dd-service
value: "{{ dd-service }}"
description: |
Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.
- name: description
value: "{{ description }}"
description: |
A short description of the service.
- name: extensions
value: "{{ extensions }}"
description: |
Extensions to v2.2 schema.
- name: integrations
description: |
Third party integrations that Datadog supports.
value:
opsgenie:
region: "{{ region }}"
service-url: "{{ service-url }}"
pagerduty:
service-url: "{{ service-url }}"
- name: languages
value:
- "{{ languages }}"
description: |
The service's programming language. Datadog recognizes the following languages: `dotnet`, `go`, `java`, `js`, `php`, `python`, `ruby`, and `c++`.
- name: lifecycle
value: "{{ lifecycle }}"
description: |
The current life cycle phase of the service.
- name: links
description: |
A list of links related to the services.
value:
- name: "{{ name }}"
provider: "{{ provider }}"
type: "{{ type }}"
url: "{{ url }}"
- name: schema-version
value: "{{ schema-version }}"
description: |
Schema version being used.
valid_values: ['v2.2']
default: v2.2
- name: tags
value:
- "{{ tags }}"
description: |
A set of custom tags.
- name: team
value: "{{ team }}"
description: |
Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.
- name: tier
value: "{{ tier }}"
description: |
Importance of the service.
- name: type
value: "{{ type }}"
description: |
The type of service.
- name: dd-team
value: "{{ dd-team }}"
description: |
Experimental feature. A Team handle that matches a Team in the Datadog Teams product.
- name: docs
description: |
A list of documentation related to the services.
value:
- name: "{{ name }}"
provider: "{{ provider }}"
url: "{{ url }}"
- name: repos
description: |
A list of code repositories related to the services.
value:
- name: "{{ name }}"
provider: "{{ provider }}"
url: "{{ url }}"
DELETE examples
- delete_service_definition
Delete a single service definition in the Datadog Service Catalog.
DELETE FROM datadog.service_management.service_definitions
WHERE service_name = '{{ service_name }}' --required
;