Sha256: ac5ec89a8a47bccb00eb17fe55c80ff468e9de135546923e67bfbccf22225460

Contents?: true

Size: 1.51 KB

Versions: 19

Compression:

Stored size: 1.51 KB

Contents

# Create a new dashboard returns "OK" response

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

body = DatadogAPIClient::V1::Dashboard.new({
  layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
  title: "Example-Dashboard with Profile Metrics Query",
  widgets: [
    DatadogAPIClient::V1::Widget.new({
      definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({
        type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES,
        requests: [
          DatadogAPIClient::V1::TimeseriesWidgetRequest.new({
            profile_metrics_query: DatadogAPIClient::V1::LogQueryDefinition.new({
              compute: DatadogAPIClient::V1::LogsQueryCompute.new({
                aggregation: "sum",
                facet: "@prof_core_cpu_cores",
              }),
              search: DatadogAPIClient::V1::LogQueryDefinitionSearch.new({
                query: "runtime:jvm",
              }),
              group_by: [
                DatadogAPIClient::V1::LogQueryDefinitionGroupBy.new({
                  facet: "service",
                  limit: 10,
                  sort: DatadogAPIClient::V1::LogQueryDefinitionGroupBySort.new({
                    aggregation: "sum",
                    order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
                    facet: "@prof_core_cpu_cores",
                  }),
                }),
              ],
            }),
          }),
        ],
      }),
    }),
  ],
})
p api_instance.create_dashboard(body)

Version data entries

19 entries across 19 versions & 1 rubygems

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