Sha256: ddf97aada80de641750680e4012d56337d326dd2f3ceded3347a79eed495f119

Contents?: true

Size: 1.15 KB

Versions: 27

Compression:

Stored size: 1.15 KB

Contents

# Create a new dashboard with template variable defaults returns "OK" response

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

body = DatadogAPIClient::V1::Dashboard.new({
  description: nil,
  is_read_only: false,
  layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
  notify_list: [],
  reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
  restricted_roles: [],
  template_variables: [
    DatadogAPIClient::V1::DashboardTemplateVariable.new({
      available_values: [
        "my-host",
        "host1",
        "host2",
      ],
      defaults: [
        "my-host",
      ],
      name: "host1",
      prefix: "host",
    }),
  ],
  title: "",
  widgets: [
    DatadogAPIClient::V1::Widget.new({
      definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({
        requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({
          fill: DatadogAPIClient::V1::HostMapRequest.new({
            q: "avg:system.cpu.user{*}",
          }),
        }),
        type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP,
      }),
    }),
  ],
})
p api_instance.create_dashboard(body)

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.27.1 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.26.1 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.26.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.25.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.24.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.22.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.21.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.20.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.19.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.18.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.17.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.16.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.15.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.14.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.13.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.12.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.11.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.10.0 examples/v1/dashboards/CreateDashboard_858397694.rb
datadog_api_client-2.9.0 examples/v1/dashboards/CreateDashboard_858397694.rb