Sha256: 661e49fe626c3baeae9f518dd052ea0efffef7fc32af78d68b81e76b62b8aa59

Contents?: true

Size: 1.21 KB

Versions: 20

Compression:

Stored size: 1.21 KB

Contents

# Create a new dashboard with distribution widget and apm stats data

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

body = DatadogAPIClient::V1::Dashboard.new({
  title: "Example-Dashboard",
  widgets: [
    DatadogAPIClient::V1::Widget.new({
      definition: DatadogAPIClient::V1::DistributionWidgetDefinition.new({
        title: "",
        title_size: "16",
        title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
        type: DatadogAPIClient::V1::DistributionWidgetDefinitionType::DISTRIBUTION,
        requests: [
          DatadogAPIClient::V1::DistributionWidgetRequest.new({
            apm_stats_query: DatadogAPIClient::V1::ApmStatsQueryDefinition.new({
              env: "prod",
              service: "cassandra",
              name: "cassandra.query",
              primary_tag: "datacenter:dc1",
              row_type: DatadogAPIClient::V1::ApmStatsQueryRowType::SERVICE,
            }),
          }),
        ],
      }),
      layout: DatadogAPIClient::V1::WidgetLayout.new({
        x: 0,
        y: 0,
        width: 4,
        height: 4,
      }),
    }),
  ],
  layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
})
p api_instance.create_dashboard(body)

Version data entries

20 entries across 20 versions & 1 rubygems

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