Sha256: 9aba855d0a0768d03ea4fd0f686088223e5d7743ada6783d6836f03788e3f169

Contents?: true

Size: 1.99 KB

Versions: 13

Compression:

Stored size: 1.99 KB

Contents

# Create a new dashboard with logs query table widget and storage parameter

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 query table widget and storage parameter",
  widgets: [
    DatadogAPIClient::V1::Widget.new({
      definition: DatadogAPIClient::V1::TableWidgetDefinition.new({
        type: DatadogAPIClient::V1::TableWidgetDefinitionType::QUERY_TABLE,
        requests: [
          DatadogAPIClient::V1::TableWidgetRequest.new({
            queries: [
              DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({
                data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::LOGS,
                name: "query1",
                search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({
                  query: "",
                }),
                indexes: [
                  "*",
                ],
                compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({
                  aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT,
                }),
                group_by: [],
                storage: "online_archives",
              }),
            ],
            formulas: [
              DatadogAPIClient::V1::WidgetFormula.new({
                conditional_formats: [],
                cell_display_mode: DatadogAPIClient::V1::TableWidgetCellDisplayMode::BAR,
                formula: "query1",
                limit: DatadogAPIClient::V1::WidgetFormulaLimit.new({
                  count: 50,
                  order: DatadogAPIClient::V1::QuerySortOrder::DESC,
                }),
              }),
            ],
            response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
          }),
        ],
      }),
    }),
  ],
})
p api_instance.create_dashboard(body)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
datadog_api_client-2.22.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.21.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.20.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.19.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.18.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.17.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.16.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.15.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.14.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.13.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.12.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.11.0 examples/v1/dashboards/CreateDashboard_3669695268.rb
datadog_api_client-2.10.0 examples/v1/dashboards/CreateDashboard_3669695268.rb