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. (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. (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,region | with_all_versions | Retrieve a monitor user template by its ID. | 
| list_monitor_user_templates | select | region | Retrieve all monitor user templates. | |
| create_monitor_user_template | insert | region,data__data | Create a new monitor user template. | |
| update_monitor_user_template | replace | template_id,region,data__data | Creates a new version of an existing monitor user template. | |
| delete_monitor_user_template | delete | template_id,region | Delete an existing monitor user template by its ID. | |
| validate_monitor_user_template | exec | region,data | Validate the structure and content of a monitor user template. | |
| validate_existing_monitor_user_template | exec | template_id,region,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 | 
|---|---|---|
| region | string | (default: datadoghq.com) | 
| 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 region = '{{ region }}' -- required
AND with_all_versions = '{{ with_all_versions }}'
;
Retrieve all monitor user templates.
SELECT
id,
attributes,
type
FROM datadog.monitoring.user_templates
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_monitor_user_template
- Manifest
Create a new monitor user template.
INSERT INTO datadog.monitoring.user_templates (
data__data,
region
)
SELECT 
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: user_templates
  props:
    - name: region
      value: string
      description: Required parameter for the user_templates resource.
    - name: data
      value: object
      description: |
        Monitor user template data.
REPLACE examples
- update_monitor_user_template
Creates a new version of an existing monitor user template.
REPLACE datadog.monitoring.user_templates
SET 
data__data = '{{ data }}'
WHERE 
template_id = '{{ template_id }}' --required
AND region = '{{ region }}' --required
AND data__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
AND region = '{{ region }}' --required
;
Lifecycle Methods
- 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 
@region='{{ region }}' --required 
@@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, 
@region='{{ region }}' --required 
@@json=
'{
"data": "{{ data }}"
}'
;