Response for retrieving all monitor user templates.
Expand All
Field
Type
Description
data
[object]
An array of monitor user templates.
attributes
object
Attributes for a monitor user template.
created
date-time
The created timestamp of the template.
description
string
A brief description of the monitor user template.
modified
date-time
The last modified timestamp. When the template version was created.
monitor_definition
object
A valid monitor definition in the same format as the V1 Monitor API.
tags
[string]
The definition of MonitorUserTemplateTags object.
template_variables
[object]
The definition of MonitorUserTemplateTemplateVariables object.
available_values
[string]
Available values for the variable.
defaults
[string]
Default values of the template variable.
name [required]
string
The name of the template variable.
tag_key
string
The tag key associated with the variable. This works the same as dashboard template variables.
title
string
The title of the monitor user template.
version
int64
The version of the monitor user template.
id
string
The unique identifier.
type
enum
Monitor user template resource type.
Allowed enum values: monitor-user-template
default: monitor-user-template
{"data":[{"attributes":{"created":"2024-01-02T03:04:23.274966+00:00","description":"This is a template for monitoring user activity.","modified":"2024-02-02T03:04:23.274966+00:00","monitor_definition":{"message":"You may need to add web hosts if this is consistently high.","name":"Bytes received on host0","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100","type":"query alert"},"tags":["product:Our Custom App","integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres CPU Monitor","version":0},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}]}
"""
Get all monitor user templates returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.monitors_apiimportMonitorsApiconfiguration=Configuration()configuration.unstable_operations["list_monitor_user_templates"]=TruewithApiClient(configuration)asapi_client:api_instance=MonitorsApi(api_client)response=api_instance.list_monitor_user_templates()print(response)
# Get all monitor user templates returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_monitor_user_templates".to_sym]=trueendapi_instance=DatadogAPIClient::V2::MonitorsAPI.newpapi_instance.list_monitor_user_templates()
// Get all monitor user templates returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListMonitorUserTemplates",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewMonitorsApi(apiClient)resp,r,err:=api.ListMonitorUserTemplates(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `MonitorsApi.ListMonitorUserTemplates`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `MonitorsApi.ListMonitorUserTemplates`:\n%s\n",responseContent)}
// Get all monitor user templates returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.MonitorsApi;importcom.datadog.api.client.v2.model.MonitorUserTemplateListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listMonitorUserTemplates",true);MonitorsApiapiInstance=newMonitorsApi(defaultClient);try{MonitorUserTemplateListResponseresult=apiInstance.listMonitorUserTemplates();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling MonitorsApi#listMonitorUserTemplates");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all monitor user templates returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_monitors::MonitorsAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListMonitorUserTemplates",true);letapi=MonitorsAPI::with_config(configuration);letresp=api.list_monitor_user_templates().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get all monitor user templates returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listMonitorUserTemplates"]=true;constapiInstance=newv2.MonitorsApi(configuration);apiInstance.listMonitorUserTemplates().then((data: v2.MonitorUserTemplateListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));