@Generated(value="https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class MonitorsApi extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MonitorsApi.DeleteMonitorOptionalParameters
Manage optional parameters to deleteMonitor.
|
static class |
MonitorsApi.GetMonitorOptionalParameters
Manage optional parameters to getMonitor.
|
static class |
MonitorsApi.ListMonitorsOptionalParameters
Manage optional parameters to listMonitors.
|
static class |
MonitorsApi.SearchMonitorGroupsOptionalParameters
Manage optional parameters to searchMonitorGroups.
|
static class |
MonitorsApi.SearchMonitorsOptionalParameters
Manage optional parameters to searchMonitors.
|
| Constructor and Description |
|---|
MonitorsApi() |
MonitorsApi(ApiClient apiClient) |
public MonitorsApi()
public MonitorsApi(ApiClient apiClient)
public ApiClient getApiClient()
public void setApiClient(ApiClient apiClient)
apiClient - an instance of API clientpublic CheckCanDeleteMonitorResponse checkCanDeleteMonitor(List<Long> monitorIds) throws ApiException
See checkCanDeleteMonitorWithHttpInfo(java.util.List<java.lang.Long>).
monitorIds - The IDs of the monitor to check. (required)ApiException - if fails to make API callpublic CompletableFuture<CheckCanDeleteMonitorResponse> checkCanDeleteMonitorAsync(List<Long> monitorIds)
See checkCanDeleteMonitorWithHttpInfoAsync(java.util.List<java.lang.Long>).
monitorIds - The IDs of the monitor to check. (required)public ApiResponse<CheckCanDeleteMonitorResponse> checkCanDeleteMonitorWithHttpInfo(List<Long> monitorIds) throws ApiException
monitorIds - The IDs of the monitor to check. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 409 | Deletion conflict error | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<CheckCanDeleteMonitorResponse>> checkCanDeleteMonitorWithHttpInfoAsync(List<Long> monitorIds)
See checkCanDeleteMonitorWithHttpInfo(java.util.List<java.lang.Long>).
monitorIds - The IDs of the monitor to check. (required)public Monitor createMonitor(Monitor body) throws ApiException
See createMonitorWithHttpInfo(com.datadog.api.client.v1.model.Monitor).
body - Create a monitor request body. (required)ApiException - if fails to make API callpublic CompletableFuture<Monitor> createMonitorAsync(Monitor body)
See createMonitorWithHttpInfoAsync(com.datadog.api.client.v1.model.Monitor).
body - Create a monitor request body. (required)public ApiResponse<Monitor> createMonitorWithHttpInfo(Monitor body) throws ApiException
The type of monitor chosen from:
query alert
query alert or trace-analytics alert
composite
service check
query alert
service check
query alert or service check
process alert
log alert
query alert
service check
query alert
service check
rum alert
slo alert
event-v2 alert
event-v2 alert
audit alert
error-tracking alert
database-monitoring alert
network-performance alert
Notes: - Synthetic monitors are created through the Synthetics API. See the Synthetics API documentation for more information. - Log monitors require an unscoped App Key.
Example: time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator #
time_aggr: avg, sum, max, min, change, or pct_change
time_window: last_#m (with # between 1 and 10080
depending on the monitor type) or last_#h(with # between 1 and
168 depending on the monitor type) or last_1d, or last_1w
space_aggr: avg, sum, min, or max
tags: one or more tags (comma-separated), or *
key: a 'key' in key:value tag syntax; defines a separate alert for each tag
in the group (multi-alert)
operator: <, <=, >, >=, ==, or !=
#: an integer or decimal number used to set the threshold
If you are using the _change_ or _pct_change_ time aggregator,
instead use change_aggr(time_aggr(time_window),
timeshift):space_aggr:metric{tags} [by {key}] operator # with:
change_aggr change, pct_change
time_aggr avg, sum, max, min Learn
more
time_window last_#m (between 1 and 2880 depending on the monitor type),
last_#h (between 1 and 48 depending on the monitor type), or last_#d (1 or 2)
timeshift #m_ago (5, 10, 15, or 30), #h_ago (1, 2, or 4), or 1d_ago
Use this to create an outlier monitor using the following query:
avg(last_30m):outliers(avg:system.cpu.user{role:es-events-data} by {host}, 'dbscan', 7) > 0
Example: "check".over(tags).last(count).by(group).count_by_status()
check name of the check, for example datadog.agent.up
tags one or more quoted tags (comma-separated), or "*". for example:
.over("env:prod", "role:db"); over cannot be blank.
count must be at greater than or equal to your max threshold (defined in the
options). It is limited to 100. For example, if you've specified to notify
on 1 critical, 3 ok, and 2 warn statuses, count should be at least 3.
group must be specified for check monitors. Per-check grouping is already
explicitly known for some service checks. For example, Postgres integration monitors are
tagged by db, host, and port, and Network monitors
by host, instance, and url. See Service Checks
documentation for more information.
Note: The Event Alert Query has been replaced by the Event V2 Alert Query. For more information, see the Event Migration guide.
Example: events(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Example: processes(search).over(tags).rollup('count').last(timeframe) operator #
search free text search string for querying processes. Matching processes
match results on the Live
Processes page.
tags one or more tags (comma-separated)
timeframe the timeframe to roll up the counts. Examples: 10m, 4h. Supported
timeframes: s, m, h and d
operator <, <=, >, >=, ==, or !=
# an integer or decimal number used to set the threshold
Example:
logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
index_name For multi-index organizations, the log index in which the request
is performed.
rollup_method The stats roll-up method - supports count,
avg and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Example: 12345 && 67890, where 12345 and 67890
are the IDs of non-composite monitors
name [required, default = dynamic, based on
query]: The name of the alert.
message [required, default = dynamic, based on
query]: A message to include with notifications for this monitor. Email
notifications can be sent to specific users by using the same '@username' notation as
events.
tags [optional, default = empty list]: A
list of tags to associate with your monitor. When getting all monitor details via the
API, use the monitor_tags argument to filter results by these tags. It is
only available via the API and isn't visible or editable in the Datadog UI.
Example: error_budget("slo_id").over("time_window") operator #
slo_id: The alphanumeric SLO ID of the SLO you are configuring the alert
for.
time_window: The time window of the SLO target you wish to alert on. Valid
options: 7d, 30d, 90d.
operator: >= or >
Example: audits(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Example:
ci-pipelines(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg, and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Example: ci-tests(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg, and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Example(RUM):
error-tracking-rum(query).rollup(rollup_method[, measure]).last(time_window) operator #
Example(APM Traces):
error-tracking-traces(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg, and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Database Monitoring Alert Query
Example:
database-monitoring(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg, and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
Network Performance Alert Query
Example:
network-performance(query).rollup(rollup_method[, measure]).last(time_window) operator #
query The search query - following the Log search syntax.
rollup_method The stats roll-up method - supports count,
avg, and cardinality.
measure For avg and cardinality rollup_method -
specify the measure or the facet name you want to use.
time_window #m (between 1 and 2880), #h (between 1 and 48).
operator <, <=, >,
>=, ==, or !=.
# an integer or decimal number used to set the threshold.
body - Create a monitor request body. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<Monitor>> createMonitorWithHttpInfoAsync(Monitor body)
See createMonitorWithHttpInfo(com.datadog.api.client.v1.model.Monitor).
body - Create a monitor request body. (required)public DeletedMonitor deleteMonitor(Long monitorId) throws ApiException
monitorId - The ID of the monitor. (required)ApiException - if fails to make API callpublic CompletableFuture<DeletedMonitor> deleteMonitorAsync(Long monitorId)
monitorId - The ID of the monitor. (required)public DeletedMonitor deleteMonitor(Long monitorId, MonitorsApi.DeleteMonitorOptionalParameters parameters) throws ApiException
monitorId - The ID of the monitor. (required)parameters - Optional parameters for the request.ApiException - if fails to make API callpublic CompletableFuture<DeletedMonitor> deleteMonitorAsync(Long monitorId, MonitorsApi.DeleteMonitorOptionalParameters parameters)
monitorId - The ID of the monitor. (required)parameters - Optional parameters for the request.public ApiResponse<DeletedMonitor> deleteMonitorWithHttpInfo(Long monitorId, MonitorsApi.DeleteMonitorOptionalParameters parameters) throws ApiException
monitorId - The ID of the monitor. (required)parameters - Optional parameters for the request.ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 401 | Authentication error | - |
| 403 | Forbidden | - |
| 404 | Item not found error | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<DeletedMonitor>> deleteMonitorWithHttpInfoAsync(Long monitorId, MonitorsApi.DeleteMonitorOptionalParameters parameters)
monitorId - The ID of the monitor. (required)parameters - Optional parameters for the request.public Monitor getMonitor(Long monitorId) throws ApiException
monitorId - The ID of the monitor (required)ApiException - if fails to make API callpublic CompletableFuture<Monitor> getMonitorAsync(Long monitorId)
monitorId - The ID of the monitor (required)public Monitor getMonitor(Long monitorId, MonitorsApi.GetMonitorOptionalParameters parameters) throws ApiException
monitorId - The ID of the monitor (required)parameters - Optional parameters for the request.ApiException - if fails to make API callpublic CompletableFuture<Monitor> getMonitorAsync(Long monitorId, MonitorsApi.GetMonitorOptionalParameters parameters)
monitorId - The ID of the monitor (required)parameters - Optional parameters for the request.public ApiResponse<Monitor> getMonitorWithHttpInfo(Long monitorId, MonitorsApi.GetMonitorOptionalParameters parameters) throws ApiException
monitorId - The ID of the monitor (required)parameters - Optional parameters for the request.ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Authentication error | - |
| 404 | Monitor Not Found error | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<Monitor>> getMonitorWithHttpInfoAsync(Long monitorId, MonitorsApi.GetMonitorOptionalParameters parameters)
monitorId - The ID of the monitor (required)parameters - Optional parameters for the request.public List<Monitor> listMonitors() throws ApiException
See listMonitorsWithHttpInfo(com.datadog.api.client.v1.api.MonitorsApi.ListMonitorsOptionalParameters).
ApiException - if fails to make API callpublic CompletableFuture<List<Monitor>> listMonitorsAsync()
public List<Monitor> listMonitors(MonitorsApi.ListMonitorsOptionalParameters parameters) throws ApiException
See listMonitorsWithHttpInfo(com.datadog.api.client.v1.api.MonitorsApi.ListMonitorsOptionalParameters).
parameters - Optional parameters for the request.ApiException - if fails to make API callpublic CompletableFuture<List<Monitor>> listMonitorsAsync(MonitorsApi.ListMonitorsOptionalParameters parameters)
parameters - Optional parameters for the request.public PaginationIterable<Monitor> listMonitorsWithPagination()
See listMonitorsWithHttpInfo(com.datadog.api.client.v1.api.MonitorsApi.ListMonitorsOptionalParameters).
public PaginationIterable<Monitor> listMonitorsWithPagination(MonitorsApi.ListMonitorsOptionalParameters parameters)
See listMonitorsWithHttpInfo(com.datadog.api.client.v1.api.MonitorsApi.ListMonitorsOptionalParameters).
public ApiResponse<List<Monitor>> listMonitorsWithHttpInfo(MonitorsApi.ListMonitorsOptionalParameters parameters) throws ApiException
parameters - Optional parameters for the request.ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<List<Monitor>>> listMonitorsWithHttpInfoAsync(MonitorsApi.ListMonitorsOptionalParameters parameters)
See listMonitorsWithHttpInfo(com.datadog.api.client.v1.api.MonitorsApi.ListMonitorsOptionalParameters).
parameters - Optional parameters for the request.public MonitorGroupSearchResponse searchMonitorGroups() throws ApiException
ApiException - if fails to make API callpublic CompletableFuture<MonitorGroupSearchResponse> searchMonitorGroupsAsync()
public MonitorGroupSearchResponse searchMonitorGroups(MonitorsApi.SearchMonitorGroupsOptionalParameters parameters) throws ApiException
parameters - Optional parameters for the request.ApiException - if fails to make API callpublic CompletableFuture<MonitorGroupSearchResponse> searchMonitorGroupsAsync(MonitorsApi.SearchMonitorGroupsOptionalParameters parameters)
parameters - Optional parameters for the request.public ApiResponse<MonitorGroupSearchResponse> searchMonitorGroupsWithHttpInfo(MonitorsApi.SearchMonitorGroupsOptionalParameters parameters) throws ApiException
parameters - Optional parameters for the request.ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<MonitorGroupSearchResponse>> searchMonitorGroupsWithHttpInfoAsync(MonitorsApi.SearchMonitorGroupsOptionalParameters parameters)
parameters - Optional parameters for the request.public MonitorSearchResponse searchMonitors() throws ApiException
ApiException - if fails to make API callpublic CompletableFuture<MonitorSearchResponse> searchMonitorsAsync()
public MonitorSearchResponse searchMonitors(MonitorsApi.SearchMonitorsOptionalParameters parameters) throws ApiException
parameters - Optional parameters for the request.ApiException - if fails to make API callpublic CompletableFuture<MonitorSearchResponse> searchMonitorsAsync(MonitorsApi.SearchMonitorsOptionalParameters parameters)
parameters - Optional parameters for the request.public ApiResponse<MonitorSearchResponse> searchMonitorsWithHttpInfo(MonitorsApi.SearchMonitorsOptionalParameters parameters) throws ApiException
parameters - Optional parameters for the request.ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<MonitorSearchResponse>> searchMonitorsWithHttpInfoAsync(MonitorsApi.SearchMonitorsOptionalParameters parameters)
parameters - Optional parameters for the request.public Monitor updateMonitor(Long monitorId, MonitorUpdateRequest body) throws ApiException
See updateMonitorWithHttpInfo(java.lang.Long, com.datadog.api.client.v1.model.MonitorUpdateRequest).
monitorId - The ID of the monitor. (required)body - Edit a monitor request body. (required)ApiException - if fails to make API callpublic CompletableFuture<Monitor> updateMonitorAsync(Long monitorId, MonitorUpdateRequest body)
See updateMonitorWithHttpInfoAsync(java.lang.Long, com.datadog.api.client.v1.model.MonitorUpdateRequest).
monitorId - The ID of the monitor. (required)body - Edit a monitor request body. (required)public ApiResponse<Monitor> updateMonitorWithHttpInfo(Long monitorId, MonitorUpdateRequest body) throws ApiException
monitorId - The ID of the monitor. (required)body - Edit a monitor request body. (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
| 401 | Authentication error | - |
| 403 | Forbidden | - |
| 404 | Monitor Not Found error | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<Monitor>> updateMonitorWithHttpInfoAsync(Long monitorId, MonitorUpdateRequest body)
See updateMonitorWithHttpInfo(java.lang.Long, com.datadog.api.client.v1.model.MonitorUpdateRequest).
monitorId - The ID of the monitor. (required)body - Edit a monitor request body. (required)public Object validateExistingMonitor(Long monitorId, Monitor body) throws ApiException
See validateExistingMonitorWithHttpInfo(java.lang.Long, com.datadog.api.client.v1.model.Monitor).
monitorId - The ID of the monitor (required)body - Monitor request object (required)ApiException - if fails to make API callpublic CompletableFuture<Object> validateExistingMonitorAsync(Long monitorId, Monitor body)
See validateExistingMonitorWithHttpInfoAsync(java.lang.Long, com.datadog.api.client.v1.model.Monitor).
monitorId - The ID of the monitor (required)body - Monitor request object (required)public ApiResponse<Object> validateExistingMonitorWithHttpInfo(Long monitorId, Monitor body) throws ApiException
monitorId - The ID of the monitor (required)body - Monitor request object (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Invalid JSON | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<Object>> validateExistingMonitorWithHttpInfoAsync(Long monitorId, Monitor body)
See validateExistingMonitorWithHttpInfo(java.lang.Long, com.datadog.api.client.v1.model.Monitor).
monitorId - The ID of the monitor (required)body - Monitor request object (required)public Object validateMonitor(Monitor body) throws ApiException
See validateMonitorWithHttpInfo(com.datadog.api.client.v1.model.Monitor).
body - Monitor request object (required)ApiException - if fails to make API callpublic CompletableFuture<Object> validateMonitorAsync(Monitor body)
See validateMonitorWithHttpInfoAsync(com.datadog.api.client.v1.model.Monitor).
body - Monitor request object (required)public ApiResponse<Object> validateMonitorWithHttpInfo(Monitor body) throws ApiException
Note: Log monitors require an unscoped App Key.
body - Monitor request object (required)ApiException - if fails to make API call| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Invalid JSON | - |
| 403 | Forbidden | - |
| 429 | Too many requests | - |
public CompletableFuture<ApiResponse<Object>> validateMonitorWithHttpInfoAsync(Monitor body)
See validateMonitorWithHttpInfo(com.datadog.api.client.v1.model.Monitor).
body - Monitor request object (required)Copyright © 2024. All rights reserved.