Sha256: 0165a3d19dbe435c9aca2559c2f24b65b0b205a7afe2e4645fa5312e303b1ea7

Contents?: true

Size: 1.32 KB

Versions: 13

Compression:

Stored size: 1.32 KB

Contents

# Create a new dashboard with powerpack widget

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

# there is a valid "powerpack" in the system
POWERPACK_DATA_ID = ENV["POWERPACK_DATA_ID"]

body = DatadogAPIClient::V1::Dashboard.new({
  title: "Example-Dashboard with powerpack widget",
  layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
  widgets: [
    DatadogAPIClient::V1::Widget.new({
      definition: DatadogAPIClient::V1::PowerpackWidgetDefinition.new({
        type: DatadogAPIClient::V1::PowerpackWidgetDefinitionType::POWERPACK,
        powerpack_id: POWERPACK_DATA_ID,
        template_variables: DatadogAPIClient::V1::PowerpackTemplateVariables.new({
          controlled_externally: [],
          controlled_by_powerpack: [
            DatadogAPIClient::V1::PowerpackTemplateVariableContents.new({
              name: "foo",
              prefix: "bar",
              values: [
                "baz",
                "qux",
                "quuz",
              ],
            }),
          ],
        }),
      }),
      layout: DatadogAPIClient::V1::WidgetLayout.new({
        x: 1,
        y: 1,
        width: 2,
        height: 2,
        is_column_break: false,
      }),
    }),
  ],
  description: "description",
  is_read_only: false,
})
p api_instance.create_dashboard(body)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.27.1 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.26.1 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.26.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.25.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.24.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.22.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.21.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.20.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.19.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.18.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.17.0 examples/v1/dashboards/CreateDashboard_1754992756.rb
datadog_api_client-2.16.0 examples/v1/dashboards/CreateDashboard_1754992756.rb