Sha256: 5e7ee6469693f79574feef0a857b459519bd471d2aa3baa694e392019425983a

Contents?: true

Size: 832 Bytes

Versions: 19

Compression:

Stored size: 832 Bytes

Contents

# Create a monitor configuration policy returns "OK" response

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

body = DatadogAPIClient::V2::MonitorConfigPolicyCreateRequest.new({
  data: DatadogAPIClient::V2::MonitorConfigPolicyCreateData.new({
    attributes: DatadogAPIClient::V2::MonitorConfigPolicyAttributeCreateRequest.new({
      policy_type: DatadogAPIClient::V2::MonitorConfigPolicyType::TAG,
      policy: DatadogAPIClient::V2::MonitorConfigPolicyTagPolicyCreateRequest.new({
        tag_key: "examplemonitor",
        tag_key_required: false,
        valid_tag_values: [
          "prod",
          "staging",
        ],
      }),
    }),
    type: DatadogAPIClient::V2::MonitorConfigPolicyResourceType::MONITOR_CONFIG_POLICY,
  }),
})
p api_instance.create_monitor_config_policy(body)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
datadog_api_client-2.29.1 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.28.1 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.27.1 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.26.1 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.26.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.25.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.24.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.22.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.21.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.20.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.19.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.18.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.17.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.16.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.15.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.14.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.13.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.12.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb
datadog_api_client-2.11.0 examples/v2/monitors/CreateMonitorConfigPolicy.rb