Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/v1/monitors/CreateMonitor_1539578087.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.datadog.api.client.v1.model.MonitorOptionsSchedulingOptionsEvaluationWindow;
import com.datadog.api.client.v1.model.MonitorThresholds;
import com.datadog.api.client.v1.model.MonitorType;
import com.datadog.api.client.v1.model.OnMissingDataOption;
import java.util.Collections;

public class Example {
Expand All @@ -29,6 +30,7 @@ public static void main(String[] args) {
.thresholds(new MonitorThresholds().critical(0.5))
.notifyAudit(false)
.includeTags(false)
.onMissingData(OnMissingDataOption.DEFAULT)
.schedulingOptions(
new MonitorOptionsSchedulingOptions()
.evaluationWindow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"draft_status\": \"published\", \"message\": \"some message Notify: @hipchat-channel\", \"name\": \"Test-Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response-1747261709\", \"options\": {\"include_tags\": false, \"notify_audit\": false, \"scheduling_options\": {\"custom_schedule\": {\"recurrences\": [{\"rrule\": \"FREQ=DAILY;INTERVAL=1\", \"start\": \"2024-10-26T09:13:00\", \"timezone\": \"America/Los_Angeles\"}]}, \"evaluation_window\": {\"day_starts\": \"04:00\", \"month_starts\": 1}}, \"thresholds\": {\"critical\": 0.5}}, \"query\": \"avg(current_1mo):avg:system.load.5{*} > 0.5\", \"tags\": [], \"type\": \"query alert\"}"
"json": "{\"draft_status\": \"published\", \"message\": \"some message Notify: @hipchat-channel\", \"name\": \"Test-Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response-1747261709\", \"options\": {\"include_tags\": false, \"notify_audit\": false, \"on_missing_data\": \"default\", \"scheduling_options\": {\"custom_schedule\": {\"recurrences\": [{\"rrule\": \"FREQ=DAILY;INTERVAL=1\", \"start\": \"2024-10-26T09:13:00\", \"timezone\": \"America/Los_Angeles\"}]}, \"evaluation_window\": {\"day_starts\": \"04:00\", \"month_starts\": 1}}, \"thresholds\": {\"critical\": 0.5}}, \"query\": \"avg(current_1mo):avg:system.load.5{*} > 0.5\", \"tags\": [], \"type\": \"query alert\"}"
},
"headers": {},
"method": "POST",
Expand All @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "74a4aebf-899a-e69e-554a-79667da36952"
"id": "adae6914-57e7-fd43-a18c-9a696be62335"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Feature: Monitors
@team:DataDog/monitor-app
Scenario: Create a metric monitor with a custom schedule returns "OK" response
Given new "CreateMonitor" request
And body with value {"message":"some message Notify: @hipchat-channel","name":"{{ unique }}","query":"avg(current_1mo):avg:system.load.5{*} > 0.5","tags":[],"options":{"thresholds":{"critical":0.5},"notify_audit":false,"include_tags":false,"scheduling_options":{"evaluation_window":{"day_starts":"04:00", "month_starts":1},"custom_schedule":{"recurrences":[{"rrule":"FREQ=DAILY;INTERVAL=1","timezone":"America/Los_Angeles","start":"2024-10-26T09:13:00"}]}}},"type":"query alert", "draft_status": "published"}
And body with value {"message":"some message Notify: @hipchat-channel","name":"{{ unique }}","query":"avg(current_1mo):avg:system.load.5{*} > 0.5","tags":[],"options":{"thresholds":{"critical":0.5},"notify_audit":false,"include_tags":false,"on_missing_data":"default","scheduling_options":{"evaluation_window":{"day_starts":"04:00", "month_starts":1},"custom_schedule":{"recurrences":[{"rrule":"FREQ=DAILY;INTERVAL=1","timezone":"America/Los_Angeles","start":"2024-10-26T09:13:00"}]}}},"type":"query alert", "draft_status": "published"}
When the request is sent
Then the response status is 200 OK
And the response "name" is equal to "{{ unique }}"
Expand Down
Loading