Sha256: b5842997762d372361759d317894a19ce5dabb7f48211732602f29fb14127b01

Contents?: true

Size: 670 Bytes

Versions: 32

Compression:

Stored size: 670 Bytes

Contents

# Edit a monitor returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::MonitorsAPI.new

# there is a valid "monitor" in the system
MONITOR_ID = ENV["MONITOR_ID"]
MONITOR_NAME = ENV["MONITOR_NAME"]

body = DatadogAPIClient::V1::MonitorUpdateRequest.new({
  name: "My monitor-updated",
  options: DatadogAPIClient::V1::MonitorOptions.new({
    evaluation_delay: nil,
    new_group_delay: 600,
    new_host_delay: nil,
    renotify_interval: nil,
    thresholds: DatadogAPIClient::V1::MonitorThresholds.new({
      critical: 2,
      warning: nil,
    }),
    timeout_h: nil,
  }),
})
p api_instance.update_monitor(MONITOR_ID.to_i, body)

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
datadog_api_client-2.22.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.21.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.20.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.19.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.18.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.17.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.16.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.15.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.14.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.13.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.12.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.11.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.10.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.9.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.8.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.7.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.6.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.5.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.4.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.3.0 examples/v1/monitors/UpdateMonitor.rb