Sha256: c8f02de282774e2acb4f342c793892660b3e44dc1c14b1165a0f8c2a9b169711

Contents?: true

Size: 687 Bytes

Versions: 6

Compression:

Stored size: 687 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",
  priority: nil,
  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

6 entries across 6 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.27.1 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.26.1 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.26.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.25.0 examples/v1/monitors/UpdateMonitor.rb
datadog_api_client-2.24.0 examples/v1/monitors/UpdateMonitor.rb