diff --git a/.apigentools-info b/.apigentools-info index 7acff425f696..1c8875470dd3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-10-01 10:29:42.539805", - "spec_repo_commit": "bc91052" + "regenerated": "2021-10-04 11:34:38.131215", + "spec_repo_commit": "f7cc278" }, "v2": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-10-01 10:30:34.501367", - "spec_repo_commit": "bc91052" + "regenerated": "2021-10-04 11:35:25.718491", + "spec_repo_commit": "f7cc278" } } } \ No newline at end of file diff --git a/data/v1/openapi.yaml b/data/v1/openapi.yaml index 3e78e4734c98..db71b636b525 100644 --- a/data/v1/openapi.yaml +++ b/data/v1/openapi.yaml @@ -5711,6 +5711,20 @@ components: format: int64 nullable: true type: integer + renotify_occurrences: + description: The number of times re-notification messages should be sent + on the current status at the provided re-notification interval. + format: int64 + nullable: true + type: integer + renotify_statuses: + description: The types of monitor statuses for which re-notification messages + are sent. + items: + description: Valid values are `alert`, `warning`, and `no data`. + type: string + nullable: true + type: array require_full_window: description: "A Boolean indicating whether this monitor needs a full window of data before it\u2019s evaluated.\nWe highly recommend you set this diff --git a/docs/v1/MonitorOptions.md b/docs/v1/MonitorOptions.md index 8d9e83aca1ff..a0ee3926e4b3 100644 --- a/docs/v1/MonitorOptions.md +++ b/docs/v1/MonitorOptions.md @@ -20,6 +20,8 @@ | **notify_audit** | **Boolean** | A Boolean indicating whether tagged users is notified on changes to this monitor. | [optional][default to false] | | **notify_no_data** | **Boolean** | A Boolean indicating whether this monitor notifies when data stops reporting. | [optional][default to false] | | **renotify_interval** | **Integer** | The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it’s not resolved. | [optional] | +| **renotify_occurrences** | **Integer** | The number of times re-notification messages should be sent on the current status at the provided re-notification interval. | [optional] | +| **renotify_statuses** | **Array<String>** | The types of monitor statuses for which re-notification messages are sent. | [optional] | | **require_full_window** | **Boolean** | A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false. | [optional] | | **silenced** | **Hash<String, Integer>** | Information about the downtime applied to the monitor. | [optional] | | **synthetics_check_id** | **String** | ID of the corresponding Synthetic check. | [optional] | @@ -49,6 +51,8 @@ instance = DatadogAPIClient::V1::MonitorOptions.new( notify_audit: null, notify_no_data: null, renotify_interval: null, + renotify_occurrences: null, + renotify_statuses: null, require_full_window: null, silenced: null, synthetics_check_id: null, diff --git a/features/v1/monitors.feature b/features/v1/monitors.feature index 9b9df7f1d11d..50e6436850ad 100644 --- a/features/v1/monitors.feature +++ b/features/v1/monitors.feature @@ -31,14 +31,14 @@ Feature: Monitors @generated @skip Scenario: Create a monitor returns "Bad Request" response Given new "CreateMonitor" request - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 400 Bad Request @generated @skip Scenario: Create a monitor returns "OK" response Given new "CreateMonitor" request - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 200 OK @@ -67,7 +67,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "" - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": null, "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": null, "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 400 Bad Request @@ -75,7 +75,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Monitor Not Found error" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "" - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": null, "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": null, "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 404 Monitor Not Found error @@ -83,7 +83,7 @@ Feature: Monitors Scenario: Edit a monitor returns "OK" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "" - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": null, "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": null, "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 200 OK @@ -144,13 +144,13 @@ Feature: Monitors @generated @skip Scenario: Validate a monitor returns "Invalid JSON" response Given new "ValidateMonitor" request - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 400 Invalid JSON @generated @skip Scenario: Validate a monitor returns "OK" response Given new "ValidateMonitor" request - And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} + And body with value {"message": null, "name": null, "options": {"enable_logs_sample": null, "escalation_message": "none", "evaluation_delay": null, "groupby_simple_monitor": null, "include_tags": true, "locked": null, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": "none", "renotify_occurrences": null, "renotify_statuses": [null], "require_full_window": null, "silenced": null, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical": null, "critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": "none"}, "priority": null, "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "restricted_roles": [null], "tags": [null], "type": "metric alert"} When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/v1/models/monitor_options.rb b/lib/datadog_api_client/v1/models/monitor_options.rb index 45ba6b3a4fd5..bf3d44188c92 100644 --- a/lib/datadog_api_client/v1/models/monitor_options.rb +++ b/lib/datadog_api_client/v1/models/monitor_options.rb @@ -69,6 +69,12 @@ class MonitorOptions # The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it’s not resolved. attr_accessor :renotify_interval + # The number of times re-notification messages should be sent on the current status at the provided re-notification interval. + attr_accessor :renotify_occurrences + + # The types of monitor statuses for which re-notification messages are sent. + attr_accessor :renotify_statuses + # A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false. attr_accessor :require_full_window @@ -104,6 +110,8 @@ def self.attribute_map :'notify_audit' => :'notify_audit', :'notify_no_data' => :'notify_no_data', :'renotify_interval' => :'renotify_interval', + :'renotify_occurrences' => :'renotify_occurrences', + :'renotify_statuses' => :'renotify_statuses', :'require_full_window' => :'require_full_window', :'silenced' => :'silenced', :'synthetics_check_id' => :'synthetics_check_id', @@ -137,6 +145,8 @@ def self.openapi_types :'notify_audit' => :'Boolean', :'notify_no_data' => :'Boolean', :'renotify_interval' => :'Integer', + :'renotify_occurrences' => :'Integer', + :'renotify_statuses' => :'Array', :'require_full_window' => :'Boolean', :'silenced' => :'Hash', :'synthetics_check_id' => :'String', @@ -156,6 +166,8 @@ def self.openapi_nullable :'new_host_delay', :'no_data_timeframe', :'renotify_interval', + :'renotify_occurrences', + :'renotify_statuses', :'synthetics_check_id', :'timeout_h' ]) @@ -256,6 +268,16 @@ def initialize(attributes = {}) self.renotify_interval = attributes[:'renotify_interval'] end + if attributes.key?(:'renotify_occurrences') + self.renotify_occurrences = attributes[:'renotify_occurrences'] + end + + if attributes.key?(:'renotify_statuses') + if (value = attributes[:'renotify_statuses']).is_a?(Array) + self.renotify_statuses = value + end + end + if attributes.key?(:'require_full_window') self.require_full_window = attributes[:'require_full_window'] end @@ -341,6 +363,8 @@ def ==(o) notify_audit == o.notify_audit && notify_no_data == o.notify_no_data && renotify_interval == o.renotify_interval && + renotify_occurrences == o.renotify_occurrences && + renotify_statuses == o.renotify_statuses && require_full_window == o.require_full_window && silenced == o.silenced && synthetics_check_id == o.synthetics_check_id && @@ -358,7 +382,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [aggregation, device_ids, enable_logs_sample, escalation_message, evaluation_delay, groupby_simple_monitor, include_tags, locked, min_failure_duration, min_location_failed, new_group_delay, new_host_delay, no_data_timeframe, notify_audit, notify_no_data, renotify_interval, require_full_window, silenced, synthetics_check_id, threshold_windows, thresholds, timeout_h].hash + [aggregation, device_ids, enable_logs_sample, escalation_message, evaluation_delay, groupby_simple_monitor, include_tags, locked, min_failure_duration, min_location_failed, new_group_delay, new_host_delay, no_data_timeframe, notify_audit, notify_no_data, renotify_interval, renotify_occurrences, renotify_statuses, require_full_window, silenced, synthetics_check_id, threshold_windows, thresholds, timeout_h].hash end # Builds the object from hash