user_templates
Creates, updates, deletes, gets or lists a user_templates resource.
Overview
| Name | user_templates |
| Type | Resource |
| Id | datadog.monitoring.user_templates |
Fields
The following fields are returned by SELECT queries:
- get_monitor_user_template
- list_monitor_user_templates
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier. (example: 00000000-0000-1234-0000-000000000000) |
attributes | object | A monitor user template object. |
type | string | Monitor user template resource type. (monitor-user-template) (default: monitor-user-template, example: monitor-user-template) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier. (example: 00000000-0000-1234-0000-000000000000) |
attributes | object | Attributes for a monitor user template. |
type | string | Monitor user template resource type. (monitor-user-template) (default: monitor-user-template, example: monitor-user-template) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_monitor_user_template | select | template_id | with_all_versions | Retrieve a monitor user template by its ID. |
list_monitor_user_templates | select | Retrieve all monitor user templates. | ||
create_monitor_user_template | insert | data | Create a new monitor user template. | |
update_monitor_user_template | replace | template_id, data | Creates a new version of an existing monitor user template. | |
delete_monitor_user_template | delete | template_id | Delete an existing monitor user template by its ID. | |
validate_monitor_user_template | exec | data | Validate the structure and content of a monitor user template. | |
validate_existing_monitor_user_template | exec | template_id, data | Validate the structure and content of an existing monitor user template being updated to a new version. |
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 |
|---|---|---|
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. |
template_id | string | ID of the monitor user template. |
with_all_versions | boolean | Whether to include all versions of the template in the response in the versions field. (example: false) |
SELECT examples
- get_monitor_user_template
- list_monitor_user_templates
Retrieve a monitor user template by its ID.
SELECT
id,
attributes,
type
FROM datadog.monitoring.user_templates
WHERE template_id = '{{ template_id }}' -- required
AND with_all_versions = '{{ with_all_versions }}'
;
Retrieve all monitor user templates.
SELECT
id,
attributes,
type
FROM datadog.monitoring.user_templates
;
INSERT examples
- create_monitor_user_template
- Manifest
Create a new monitor user template.
INSERT INTO datadog.monitoring.user_templates (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: user_templates
props:
- name: data
description: |
Monitor user template data.
value:
attributes:
description: "{{ description }}"
monitor_definition: "{{ monitor_definition }}"
tags:
- "{{ tags }}"
template_variables:
- available_values: "{{ available_values }}"
defaults: "{{ defaults }}"
name: "{{ name }}"
tag_key: "{{ tag_key }}"
title: "{{ title }}"
type: "{{ type }}"
REPLACE examples
- update_monitor_user_template
Creates a new version of an existing monitor user template.
REPLACE datadog.monitoring.user_templates
SET
data = '{{ data }}'
WHERE
template_id = '{{ template_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_monitor_user_template
Delete an existing monitor user template by its ID.
DELETE FROM datadog.monitoring.user_templates
WHERE template_id = '{{ template_id }}' --required
;
Lifecycle Methods
EXEC variables use wire (API) names.
- validate_monitor_user_template
- validate_existing_monitor_user_template
Validate the structure and content of a monitor user template.
EXEC datadog.monitoring.user_templates.validate_monitor_user_template
@@json=
'{
"data": "{{ data }}"
}'
;
Validate the structure and content of an existing monitor user template being updated to a new version.
EXEC datadog.monitoring.user_templates.validate_existing_monitor_user_template
@template_id='{{ template_id }}' --required,
@@json=
'{
"data": "{{ data }}"
}'
;