The query can contain any number of space-separated monitor attributes, for instance: query="type:metric group_status:alert".
page
integer
Page to start paginating from.
per_page
integer
Number of monitors to return per page.
sort
string
String for sort order, composed of field and sort order separate by a comma, for example name,asc. Supported sort directions: asc, desc. Supported fields:
The counts of monitor groups per different criteria.
status
[object]
Search facets.
count
int64
The number of found monitors with the listed value.
name
The facet value.
type
[object]
Search facets.
count
int64
The number of found monitors with the listed value.
name
The facet value.
groups
[object]
The list of found monitor groups.
group
string
The name of the group.
group_tags
[string]
The list of tags of the monitor group.
last_nodata_ts
int64
Latest timestamp the monitor group was in NO_DATA state.
last_triggered_ts
int64
Latest timestamp the monitor group triggered.
monitor_id
int64
The ID of the monitor.
monitor_name
string
The name of the monitor.
status
enum
The different states your monitor can be in.
Allowed enum values: Alert,Ignored,No Data,OK,Skipped,Unknown,Warn
metadata
object
Metadata about the response.
page
int64
The page to start paginating from.
page_count
int64
The number of pages.
per_page
int64
The number of monitors to return per page.
total_count
int64
The total number of monitors.
{"counts":{"status":[{"count":2,"name":"OK"}],"type":[{"count":2,"name":"metric"}]},"groups":[{"group":"*","group_tags":["*"],"last_nodata_ts":0,"last_triggered_ts":1525702966,"monitor_id":2738266,"monitor_name":"[demo] Cassandra disk usage is high on {{host.name}}","status":"OK"},{"group":"*","group_tags":["*"],"last_nodata_ts":0,"last_triggered_ts":1525703008,"monitor_id":1576648,"monitor_name":"[demo] Disk usage is high on {{host.name}}","status":"OK"}],"metadata":{"page":0,"page_count":2,"per_page":30,"total_count":2}}
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
/**
* Monitors group search returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.MonitorsApi(configuration);apiInstance.searchMonitorGroups().then((data: v1.MonitorGroupSearchResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));