ダッシュボード

ダッシュボード

API を介してすべてのダッシュボードを簡単に整理、検索、およびチームや組織と共有できます。

POST https://api.datadoghq.eu/api/v1/dashboard/publichttps://api.ddog-gov.com/api/v1/dashboard/publichttps://api.datadoghq.com/api/v1/dashboard/publichttps://api.us3.datadoghq.com/api/v1/dashboard/public

概要

指定した非公開ダッシュボードを共有し、公開表示できる URL を生成します。

リクエスト

Body Data (required)

共有ダッシュボードのリクエスト本文を作成します。

Expand All

フィールド

種類

説明

author

object

User who shared the dashboard.

handle

string

Identifier of the user who shared the dashboard.

name

string

Name of the user who shared the dashboard.

created_at

date-time

Date the dashboard was shared.

dashboard_id [required]

string

ID of the dashboard to share.

dashboard_type [required]

enum

The type of the associated private dashboard. Allowed enum values: custom_timeboard,custom_screenboard

global_time

object

Object containing the live span selection for the dashboard.

live_span

enum

Dashboard global time live_span selection Allowed enum values: 15m,1h,4h,1d,2d,1w,1mo,3mo

global_time_selectable_enabled

boolean

Whether to allow viewers to select a different global time setting for the shared dashboard.

public_url

string

URL of the shared dashboard.

selectable_template_vars

[object]

List of objects representing template variables on the shared dashboard which can have selectable values.

default_value

string

The default value of the template variable.

name

string

Name of the template variable.

prefix

string

The tag/attribute key associated with the template variable.

visible_tags

[string]

List of visible tag values on the shared dashboard.

share_list

[string]

List of email addresses that can receive an invitation to access to the shared dashboard.

share_type

enum

Type of sharing access (either open to anyone who has the public URL or invite-only). Allowed enum values: open,invite

token

string

A unique token assigned to the shared dashboard.

{
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "selectable_template_vars": [
    {
      "default_value": "*",
      "name": "exampleVar",
      "prefix": "test",
      "visible_tags": [
        "selectableValue1",
        "selectableValue2"
      ]
    }
  ],
  "share_list": [
    "test@datadoghq.com",
    "test2@email.com"
  ],
  "share_type": "string"
}

応答

OK

The metadata object associated with how a dashboard has been/will be shared.

Expand All

フィールド

種類

説明

author

object

User who shared the dashboard.

handle

string

Identifier of the user who shared the dashboard.

name

string

Name of the user who shared the dashboard.

created_at

date-time

Date the dashboard was shared.

dashboard_id [required]

string

ID of the dashboard to share.

dashboard_type [required]

enum

The type of the associated private dashboard. Allowed enum values: custom_timeboard,custom_screenboard

global_time

object

Object containing the live span selection for the dashboard.

live_span

enum

Dashboard global time live_span selection Allowed enum values: 15m,1h,4h,1d,2d,1w,1mo,3mo

global_time_selectable_enabled

boolean

Whether to allow viewers to select a different global time setting for the shared dashboard.

public_url

string

URL of the shared dashboard.

selectable_template_vars

[object]

List of objects representing template variables on the shared dashboard which can have selectable values.

default_value

string

The default value of the template variable.

name

string

Name of the template variable.

prefix

string

The tag/attribute key associated with the template variable.

visible_tags

[string]

List of visible tag values on the shared dashboard.

share_list

[string]

List of email addresses that can receive an invitation to access to the shared dashboard.

share_type

enum

Type of sharing access (either open to anyone who has the public URL or invite-only). Allowed enum values: open,invite

token

string

A unique token assigned to the shared dashboard.

{
  "author": {
    "handle": "test@datadoghq.com",
    "name": "string"
  },
  "created_at": "2019-09-19T10:00:00.000Z",
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "public_url": "string",
  "selectable_template_vars": [
    {
      "default_value": "*",
      "name": "exampleVar",
      "prefix": "test",
      "visible_tags": [
        "selectableValue1",
        "selectableValue2"
      ]
    }
  ],
  "share_list": [
    "test@datadoghq.com",
    "test2@email.com"
  ],
  "share_type": "string",
  "token": "string"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Dashboard Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


## json-request-body
# 
# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "share_type": "open"
}
EOF

POST https://api.datadoghq.eu/api/v1/dashboardhttps://api.ddog-gov.com/api/v1/dashboardhttps://api.datadoghq.com/api/v1/dashboardhttps://api.us3.datadoghq.com/api/v1/dashboard

概要

指定されたオプションを使用してダッシュボードを作成します。ウィジェットでクエリを定義するときは、どのクエリに as_count() または as_rate() 修飾子を追加する必要があるかに注意してください。 これらの修飾子の詳細については、次のドキュメントを参照してください。

リクエスト

Body Data (required)

ダッシュボードのリクエスト本文を作成します。

Expand All

フィールド

種類

説明

author_handle

string

Identifier of the dashboard author.

created_at

date-time

Creation date of the dashboard.

description

string

Description of the dashboard.

id

string

ID of the dashboard.

is_read_only

boolean

Whether this dashboard is read-only. If True, only the author and admins can make changes to it.

layout_type [required]

enum

Layout type of the dashboard. Allowed enum values: ordered,free

modified_at

date-time

Modification date of the dashboard.

notify_list

[string]

List of handles of users to notify when changes are made to this dashboard.

reflow_type

enum

Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts. Allowed enum values: auto,fixed

restricted_roles

[string]

A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the is_read_only property if both are present. This feature is currently in beta.

template_variable_presets

[object]

Array of template variables saved views.

name

string

The name of the variable.

template_variables

[object]

List of variables.

name

string

The name of the variable.

value

string

The value of the template variable within the saved view.

template_variables

[object]

List of template variables for this dashboard.

available_values

[string]

The list of values that the template variable drop-down is limited to.

default

string

The default value for the template variable on dashboard load.

name [required]

string

The name of the variable.

prefix

string

The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.

title [required]

string

Title of the dashboard.

url

string

The URL of the dashboard.

widgets [required]

[object]

List of widgets to display on the dashboard.

definition [required]

object <oneOf>

id

int64

ID of the widget.

layout

object

The layout for a widget on a free or new dashboard layout dashboard.

height [required]

int64

The height of the widget. Should be a non-negative integer.

is_column_break

boolean

Whether the widget should be the first one on the second column in high density or not. Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.

width [required]

int64

The width of the widget. Should be a non-negative integer.

x [required]

int64

The position of the widget on the x (horizontal) axis. Should be a non-negative integer.

y [required]

int64

The position of the widget on the y (vertical) axis. Should be a non-negative integer.

{
  "description": "string",
  "is_read_only": false,
  "layout_type": "ordered",
  "notify_list": [],
  "reflow_type": "string",
  "restricted_roles": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "widgets": [
    {
      "definition": {},
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

応答

OK

A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying key performance metrics, which enable you to monitor the health of your infrastructure.

Expand All

フィールド

種類

説明

author_handle

string

Identifier of the dashboard author.

created_at

date-time

Creation date of the dashboard.

description

string

Description of the dashboard.

id

string

ID of the dashboard.

is_read_only

boolean

Whether this dashboard is read-only. If True, only the author and admins can make changes to it.

layout_type [required]

enum

Layout type of the dashboard. Allowed enum values: ordered,free

modified_at

date-time

Modification date of the dashboard.

notify_list

[string]

List of handles of users to notify when changes are made to this dashboard.

reflow_type

enum

Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts. Allowed enum values: auto,fixed

restricted_roles

[string]

A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the is_read_only property if both are present. This feature is currently in beta.

template_variable_presets

[object]

Array of template variables saved views.

name

string

The name of the variable.

template_variables

[object]

List of variables.

name

string

The name of the variable.

value

string

The value of the template variable within the saved view.

template_variables

[object]

List of template variables for this dashboard.

available_values

[string]

The list of values that the template variable drop-down is limited to.

default

string

The default value for the template variable on dashboard load.

name [required]

string

The name of the variable.

prefix

string

The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.

title [required]

string

Title of the dashboard.

url

string

The URL of the dashboard.

widgets [required]

[object]

List of widgets to display on the dashboard.

definition [required]

object <oneOf>

id

int64

ID of the widget.

layout

object

The layout for a widget on a free or new dashboard layout dashboard.

height [required]

int64

The height of the widget. Should be a non-negative integer.

is_column_break

boolean

Whether the widget should be the first one on the second column in high density or not. Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.

width [required]

int64

The width of the widget. Should be a non-negative integer.

x [required]

int64

The position of the widget on the x (horizontal) axis. Should be a non-negative integer.

y [required]

int64

The position of the widget on the y (vertical) axis. Should be a non-negative integer.

{
  "author_handle": "test@datadoghq.com",
  "created_at": "2019-09-19T10:00:00.000Z",
  "description": "string",
  "id": "123-abc-456",
  "is_read_only": false,
  "layout_type": "ordered",
  "modified_at": "2019-09-19T10:00:00.000Z",
  "notify_list": [],
  "reflow_type": "string",
  "restricted_roles": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "url": "/dashboard/123-abc-456/example-dashboard-title",
  "widgets": [
    {
      "definition": {},
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "layout_type": "ordered",
  "template_variables": [
    {
      "name": "host1"
    }
  ],
  "title": "",
  "widgets": [
    {
      "definition": null,
      "layout": {
        "height": 0,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}
EOF
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewDashboard(datadog.DashboardLayoutType("ordered"), "Title_example", []datadog.Widget{*datadog.NewWidget(datadog.WidgetDefinition{AlertGraphWidgetDefinition: datadog.NewAlertGraphWidgetDefinition("AlertId_example", datadog.AlertGraphWidgetDefinitionType("alert_graph"), datadog.WidgetVizType("timeseries"))})}) // Dashboard | Create a dashboard request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.DashboardsApi.CreateDashboard(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateDashboard`: Dashboard
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardsApi.CreateDashboard:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    body = Dashboard(
        description="description_example",
        is_read_only=False,
        layout_type=DashboardLayoutType("ordered"),
        notify_list=[
            "notify_list_example",
        ],
        reflow_type=DashboardReflowType("auto"),
        restricted_roles=[
            "restricted_roles_example",
        ],
        template_variable_presets=[
            DashboardTemplateVariablePreset(
                name="name_example",
                template_variables=[
                    DashboardTemplateVariablePresetValue(
                        name="name_example",
                        value="value_example",
                    ),
                ],
            ),
        ],
        template_variables=[
            DashboardTemplateVariable(
                available_values=["my-host","host1","host2"],
                default="my-host",
                name="host1",
                prefix="host",
            ),
        ],
        title="",
        widgets=[
            Widget(
                definition=WidgetDefinition(),
                id=1,
                layout=WidgetLayout(
                    height=0,
                    is_column_break=True,
                    width=0,
                    x=0,
                    y=0,
                ),
            ),
        ],
    )  # Dashboard | Create a dashboard request body.

    # example passing only required values which don't have defaults set
    try:
        # Create a new dashboard
        api_response = api_instance.create_dashboard(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DashboardsApi->create_dashboard: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
body = DatadogAPIClient::V1::Dashboard.new({layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, title: 'title_example', widgets: [DatadogAPIClient::V1::Widget.new({definition: DatadogAPIClient::V1::AlertGraphWidgetDefinition.new({alert_id: 'alert_id_example', type: DatadogAPIClient::V1::AlertGraphWidgetDefinitionType::ALERT_GRAPH, viz_type: DatadogAPIClient::V1::WidgetVizType::TIMESERIES})})]}) # Dashboard | Create a dashboard request body.

begin
  # Create a new dashboard
  result = api_instance.create_dashboard(body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->create_dashboard: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiCreateDashboardRequest = {
  // Dashboard | Create a dashboard request body.
  body: {
    description: "description_example",
    isReadOnly: false,
    layoutType: "ordered",
    notifyList: ["notifyList_example"],
    reflowType: "auto",
    restrictedRoles: ["restrictedRoles_example"],
    templateVariablePresets: [
      {
        name: "name_example",
        templateVariables: [
          {
            name: "name_example",
            value: "value_example",
          },
        ],
      },
    ],
    templateVariables: [
      {
        availableValues: ["my-host", "host1", "host2"],
        _default: "my-host",
        name: "host1",
        prefix: "host",
      },
    ],
    title: "",
    widgets: [
      {
        definition: {
          alertId: "",
          time: {
            liveSpan: "5m",
          },
          title: "title_example",
          titleAlign: "center",
          titleSize: "titleSize_example",
          type: "alert_graph",
          vizType: "timeseries",
        },
        id: 1,
        layout: {
          height: 0,
          isColumnBreak: true,
          width: 0,
          x: 0,
          y: 0,
        },
      },
    ],
  },
};

apiInstance
  .createDashboard(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        Dashboard body = new Dashboard(); // Dashboard | Create a dashboard request body.
        try {
            Dashboard result = apiInstance.createDashboard(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#createDashboard");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
from datadog import initialize, api

options = {
    'api_key': '<DATADOG_API_KEY>',
    'app_key': '<DATADOG_APPLICATION_KEY>'
}

initialize(**options)

title = 'Average Memory Free Shell'
widgets = [{
    'definition': {
        'type': 'timeseries',
        'requests': [
            {'q': 'avg:system.mem.free{*}'}
        ],
        'title': 'Average Memory Free'
    }
}]
layout_type = 'ordered'
description = 'A dashboard with memory info.'
is_read_only = True
notify_list = ['user@domain.com']
template_variables = [{
    'name': 'host1',
    'prefix': 'host',
    'default': 'my-host'
}]

saved_views = [{
    'name': 'Saved views for hostname 2',
    'template_variables': [{'name': 'host', 'value': '<HOSTNAME_2>'}]}
]

api.Dashboard.create(title=title,
                     widgets=widgets,
                     layout_type=layout_type,
                     description=description,
                     is_read_only=is_read_only,
                     notify_list=notify_list,
                     template_variables=template_variables,
                     template_variable_presets=saved_view)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python "example.py"
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

# Create a dashboard.
title = 'Average Memory Free Shell'
widgets = [{
    'definition': {
        'type' => 'timeseries',
        'requests' => [
            {'q' => 'avg:system.mem.free{*}'}
        ],
        'title' => 'Average Memory Free'
    }
}]
layout_type = 'ordered'
description = 'A dashboard with memory info.'
is_read_only = true
notify_list = ['user@domain.com']
template_variables = [{
    'name' => 'host',
    'prefix' => 'host',
    'default' => '<HOSTNAME_1>'
}]

saved_view = [{
  'name': 'Saved views for hostname 2',
  'template_variables': [{'name': 'host', 'value': '<HOSTNAME_2>'}]}
  ]

dog.create_board(title, widgets, layout_type, {
    :description => description,
    :is_read_only => is_read_only,
    :notify_list => notify_list,
    :template_variables => template_variables,
    :template_variable_presets => saved_view
    })

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"

GET https://api.datadoghq.eu/api/v1/dashboard/public/{token}https://api.ddog-gov.com/api/v1/dashboard/public/{token}https://api.datadoghq.com/api/v1/dashboard/public/{token}https://api.us3.datadoghq.com/api/v1/dashboard/public/{token}

概要

指定されたトークンに関連付けられている既存の共有ダッシュボードの共有メタデータをフェッチします。

引数

パスパラメーター

名前

種類

説明

token [required]

string

The token of the shared dashboard. Generated when a dashboard is shared.

応答

OK

The metadata object associated with how a dashboard has been/will be shared.

Expand All

フィールド

種類

説明

author

object

User who shared the dashboard.

handle

string

Identifier of the user who shared the dashboard.

name

string

Name of the user who shared the dashboard.

created_at

date-time

Date the dashboard was shared.

dashboard_id [required]

string

ID of the dashboard to share.

dashboard_type [required]

enum

The type of the associated private dashboard. Allowed enum values: custom_timeboard,custom_screenboard

global_time

object

Object containing the live span selection for the dashboard.

live_span

enum

Dashboard global time live_span selection Allowed enum values: 15m,1h,4h,1d,2d,1w,1mo,3mo

global_time_selectable_enabled

boolean

Whether to allow viewers to select a different global time setting for the shared dashboard.

public_url

string

URL of the shared dashboard.

selectable_template_vars

[object]

List of objects representing template variables on the shared dashboard which can have selectable values.

default_value

string

The default value of the template variable.

name

string

Name of the template variable.

prefix

string

The tag/attribute key associated with the template variable.

visible_tags

[string]

List of visible tag values on the shared dashboard.

share_list

[string]

List of email addresses that can receive an invitation to access to the shared dashboard.

share_type

enum

Type of sharing access (either open to anyone who has the public URL or invite-only). Allowed enum values: open,invite

token

string

A unique token assigned to the shared dashboard.

{
  "author": {
    "handle": "test@datadoghq.com",
    "name": "string"
  },
  "created_at": "2019-09-19T10:00:00.000Z",
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "public_url": "string",
  "selectable_template_vars": [
    {
      "default_value": "*",
      "name": "exampleVar",
      "prefix": "test",
      "visible_tags": [
        "selectableValue1",
        "selectableValue2"
      ]
    }
  ],
  "share_list": [
    "test@datadoghq.com",
    "test2@email.com"
  ],
  "share_type": "string",
  "token": "string"
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Shared Dashboard Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Path parameters
export token="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public/${token}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.datadoghq.eu/api/v1/dashboardhttps://api.ddog-gov.com/api/v1/dashboardhttps://api.datadoghq.com/api/v1/dashboardhttps://api.us3.datadoghq.com/api/v1/dashboard

概要

すべてのダッシュボードを取得します。

: このクエリはカスタマイズして作成された、または複製されたダッシュボードのみを返します。 このクエリではプリセットされたダッシュボードは取得できません。

引数

クエリ文字列

名前

種類

説明

filter[shared]

boolean

When true, this query only returns shared custom created or cloned dashboards.

応答

OK

Dashboard summary response.

Expand All

フィールド

種類

説明

dashboards

[object]

List of dashboard definitions.

author_handle

string

Identifier of the dashboard author.

created_at

date-time

Creation date of the dashboard.

description

string

Description of the dashboard.

id

string

Dashboard identifier.

is_read_only

boolean

Whether this dashboard is read-only. If True, only the author and admins can make changes to it.

layout_type

enum

Layout type of the dashboard. Allowed enum values: ordered,free

modified_at

date-time

Modification date of the dashboard.

title

string

Title of the dashboard.

url

string

URL of the dashboard.

{
  "dashboards": [
    {
      "author_handle": "string",
      "created_at": "2019-09-19T10:00:00.000Z",
      "description": "string",
      "id": "string",
      "is_read_only": false,
      "layout_type": "ordered",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "title": "string",
      "url": "string"
    }
  ]
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    filterShared := true // bool | When `true`, this query only returns shared custom created or cloned dashboards. (optional)
    optionalParams := datadog.ListDashboardsOptionalParameters{
        FilterShared: &filterShared,
    }

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.DashboardsApi.ListDashboards(ctx, optionalParams)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.ListDashboards`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListDashboards`: DashboardSummary
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardsApi.ListDashboards:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    filter_shared = True  # bool | When `true`, this query only returns shared custom created or cloned dashboards. (optional)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all dashboards
        api_response = api_instance.list_dashboards(filter_shared=filter_shared)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DashboardsApi->list_dashboards: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
opts = {
  filter_shared: true # Boolean | When `true`, this query only returns shared custom created or cloned dashboards.
}

begin
  # Get all dashboards
  result = api_instance.list_dashboards(opts)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->list_dashboards: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiListDashboardsRequest = {
  // boolean | When `true`, this query only returns shared custom created or cloned dashboards. (optional)
  filterShared: true,
};

apiInstance
  .listDashboards(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        Boolean filterShared = true; // Boolean | When `true`, this query only returns shared custom created or cloned dashboards.
        try {
            DashboardSummary result = apiInstance.listDashboards(new DashboardsApi.ListDashboardsOptionalParameters()
                .filterShared(filterShared));
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#listDashboards");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
from datadog import initialize, api

options = {
    'api_key': '<DATADOG_API_KEY>',
    'app_key': '<DATADOG_APPLICATION_KEY>'
}

initialize(**options)

api.Dashboard.get_all()

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python "example.py"
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dog.get_all_boards()

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"

DELETE https://api.datadoghq.eu/api/v1/dashboard/{dashboard_id}https://api.ddog-gov.com/api/v1/dashboard/{dashboard_id}https://api.datadoghq.com/api/v1/dashboard/{dashboard_id}https://api.us3.datadoghq.com/api/v1/dashboard/{dashboard_id}

概要

指定の ID を使用してダッシュボードを削除します。

引数

パスパラメーター

名前

種類

説明

dashboard_id [required]

string

The ID of the dashboard.

応答

OK

Response from the delete dashboard call.

Expand All

フィールド

種類

説明

deleted_dashboard_id

string

ID of the deleted dashboard.

{
  "deleted_dashboard_id": "string"
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Dashboards Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Path parameters
export dashboard_id="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/${dashboard_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    dashboardId := "dashboardId_example" // string | The ID of the dashboard.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.DashboardsApi.DeleteDashboard(ctx, dashboardId)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.DeleteDashboard`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteDashboard`: DashboardDeleteResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardsApi.DeleteDashboard:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    dashboard_id = "dashboard_id_example"  # str | The ID of the dashboard.

    # example passing only required values which don't have defaults set
    try:
        # Delete a dashboard
        api_response = api_instance.delete_dashboard(dashboard_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DashboardsApi->delete_dashboard: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
dashboard_id = 'dashboard_id_example' # String | The ID of the dashboard.

begin
  # Delete a dashboard
  result = api_instance.delete_dashboard(dashboard_id)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->delete_dashboard: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiDeleteDashboardRequest = {
  // string | The ID of the dashboard.
  dashboardId: "dashboard_id_example",
};

apiInstance
  .deleteDashboard(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        String dashboardId = "dashboardId_example"; // String | The ID of the dashboard.
        try {
            DashboardDeleteResponse result = apiInstance.deleteDashboard(dashboardId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#deleteDashboard");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
from datadog import initialize, api

options = {
    'api_key': '<DATADOG_API_KEY>',
    'app_key': '<DATADOG_APPLICATION_KEY>'
}

initialize(**options)

dashboard_id = '<DASHBOARD_ID>'

api.Dashboard.delete(dashboard_id)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python "example.py"
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dashboard_id = '<DASHBOARD_ID>'
dog.delete_board(dashboard_id)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"

PUT https://api.datadoghq.eu/api/v1/dashboard/public/{token}https://api.ddog-gov.com/api/v1/dashboard/public/{token}https://api.datadoghq.com/api/v1/dashboard/public/{token}https://api.us3.datadoghq.com/api/v1/dashboard/public/{token}

概要

指定されたトークンに関連付けられている共有ダッシュボードを更新します。

引数

パスパラメーター

名前

種類

説明

token [required]

string

The token of the shared dashboard.

リクエスト

Body Data (required)

ダッシュボードのリクエスト本文を更新します。

Expand All

フィールド

種類

説明

global_time [required]

object

Timeframe setting for the shared dashboard.

live_span

enum

Dashboard global time live_span selection Allowed enum values: 15m,1h,4h,1d,2d,1w,1mo,3mo

global_time_selectable_enabled

boolean

Whether to allow viewers to select a different global time setting for the shared dashboard.

selectable_template_vars

[object]

List of objects representing template variables on the shared dashboard which can have selectable values.

default_value

string

The default value of the template variable.

name

string

Name of the template variable.

prefix

string

The tag/attribute key associated with the template variable.

visible_tags

[string]

List of visible tag values on the shared dashboard.

share_list

[string]

List of email addresses that can be given access to the shared dashboard.

share_type

enum

Type of sharing access (either open to anyone who has the public URL or invite-only). Allowed enum values: open,invite

{
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "selectable_template_vars": [
    {
      "default_value": "*",
      "name": "exampleVar",
      "prefix": "test",
      "visible_tags": [
        "selectableValue1",
        "selectableValue2"
      ]
    }
  ],
  "share_list": [
    "test@datadoghq.com",
    "test2@email.com"
  ],
  "share_type": "string"
}

応答

OK

The metadata object associated with how a dashboard has been/will be shared.

Expand All

フィールド

種類

説明

author

object

User who shared the dashboard.

handle

string

Identifier of the user who shared the dashboard.

name

string

Name of the user who shared the dashboard.

created_at

date-time

Date the dashboard was shared.

dashboard_id [required]

string

ID of the dashboard to share.

dashboard_type [required]

enum

The type of the associated private dashboard. Allowed enum values: custom_timeboard,custom_screenboard

global_time

object

Object containing the live span selection for the dashboard.

live_span

enum

Dashboard global time live_span selection Allowed enum values: 15m,1h,4h,1d,2d,1w,1mo,3mo

global_time_selectable_enabled

boolean

Whether to allow viewers to select a different global time setting for the shared dashboard.

public_url

string

URL of the shared dashboard.

selectable_template_vars

[object]

List of objects representing template variables on the shared dashboard which can have selectable values.

default_value

string

The default value of the template variable.

name

string

Name of the template variable.

prefix

string

The tag/attribute key associated with the template variable.

visible_tags

[string]

List of visible tag values on the shared dashboard.

share_list

[string]

List of email addresses that can receive an invitation to access to the shared dashboard.

share_type

enum

Type of sharing access (either open to anyone who has the public URL or invite-only). Allowed enum values: open,invite

token

string

A unique token assigned to the shared dashboard.

{
  "author": {
    "handle": "test@datadoghq.com",
    "name": "string"
  },
  "created_at": "2019-09-19T10:00:00.000Z",
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "public_url": "string",
  "selectable_template_vars": [
    {
      "default_value": "*",
      "name": "exampleVar",
      "prefix": "test",
      "visible_tags": [
        "selectableValue1",
        "selectableValue2"
      ]
    }
  ],
  "share_list": [
    "test@datadoghq.com",
    "test2@email.com"
  ],
  "share_type": "string",
  "token": "string"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


## json-request-body
# 
# Path parameters
export token="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public/${token}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "global_time": { "live_span": "1h" }, "selectable_template_vars": [ { "default_value": "*", "name": "exampleVar", "prefix": "test", "visible_tags": [ "selectableValue1", "selectableValue2" ] } ], "share_list": [ "test@datadoghq.com", "test2@datadoghq.com" ], "share_type": "invite" } EOF

DELETE https://api.datadoghq.eu/api/v1/dashboardhttps://api.ddog-gov.com/api/v1/dashboardhttps://api.datadoghq.com/api/v1/dashboardhttps://api.us3.datadoghq.com/api/v1/dashboard

概要

指定された ID を使用するダッシュボードを削除します。エラーがあった場合、ダッシュボードは削除されません (部分的に成功した場合も完了とはみなされません)。

リクエスト

Body Data (required)

ダッシュボードのリクエスト本文を削除します。

Expand All

フィールド

種類

説明

data [required]

[object]

List of dashboard bulk action request data objects.

id [required]

string

Dashboard resource ID.

type [required]

enum

Dashboard resource type. Allowed enum values: dashboard

{
  "data": [
    {
      "id": "123-abc-456",
      "type": "dashboard"
    }
  ]
}

応答

No Content

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Dashboards Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


## json-request-body
# 
# Curl command
curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": [
    {
      "id": "123-abc-456",
      "type": "dashboard"
    },
    {
      "id": "789-def-101",
      "type": "dashboard"
    }
  ]
}
EOF
package main

import (
    "context"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewDashboardBulkDeleteRequest([]datadog.DashboardBulkActionData{*datadog.NewDashboardBulkActionData("123-abc-456", datadog.DashboardResourceType("dashboard"))}) // DashboardBulkDeleteRequest | Delete dashboards request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    r, err := apiClient.DashboardsApi.DeleteDashboards(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.DeleteDashboards`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    body = DashboardBulkDeleteRequest(
        data=DashboardBulkActionDataList([
            DashboardBulkActionData(
                id="123-abc-456",
                type=DashboardResourceType("dashboard"),
            ),
        ]),
    )  # DashboardBulkDeleteRequest | Delete dashboards request body.

    # example passing only required values which don't have defaults set
    try:
        # Delete dashboards
        api_instance.delete_dashboards(body)
    except ApiException as e:
        print("Exception when calling DashboardsApi->delete_dashboards: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
body = DatadogAPIClient::V1::DashboardBulkDeleteRequest.new({data: [DatadogAPIClient::V1::DashboardBulkActionData.new({id: '123-abc-456', type: DatadogAPIClient::V1::DashboardResourceType::DASHBOARD})]}) # DashboardBulkDeleteRequest | Delete dashboards request body.

begin
  # Delete dashboards
  api_instance.delete_dashboards(body)
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->delete_dashboards: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiDeleteDashboardsRequest = {
  // DashboardBulkDeleteRequest | Delete dashboards request body.
  body: {
    data: [
      {
        id: "123-abc-456",
        type: "dashboard",
      },
    ],
  },
};

apiInstance
  .deleteDashboards(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        DashboardBulkDeleteRequest body = new DashboardBulkDeleteRequest(); // DashboardBulkDeleteRequest | Delete dashboards request body.
        try {
            apiInstance.deleteDashboards(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#deleteDashboards");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

DELETE https://api.datadoghq.eu/api/v1/dashboard/public/{token}https://api.ddog-gov.com/api/v1/dashboard/public/{token}https://api.datadoghq.com/api/v1/dashboard/public/{token}https://api.us3.datadoghq.com/api/v1/dashboard/public/{token}

概要

指定されたトークンに関連付けられているダッシュボードのパブリック URL を取り消します (プライベートにレンダリングします)。

引数

パスパラメーター

名前

種類

説明

token [required]

string

The token of the shared dashboard.

応答

OK

Response containing token of deleted shared dashboard.

Expand All

フィールド

種類

説明

deleted_public_dashboard_token

string

Token associated with the shared dashboard that was revoked.

{
  "deleted_public_dashboard_token": "string"
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Shared Dashboard Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Path parameters
export token="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public/${token}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PATCH https://api.datadoghq.eu/api/v1/dashboardhttps://api.ddog-gov.com/api/v1/dashboardhttps://api.datadoghq.com/api/v1/dashboardhttps://api.us3.datadoghq.com/api/v1/dashboard

概要

指定された ID を使用するダッシュボードを復元します。エラーがあった場合、ダッシュボードは復元されません (部分的に成功した場合も完了とはみなされません)。

リクエスト

Body Data (required)

ダッシュボードのリクエスト本文を復元します。

Expand All

フィールド

種類

説明

data [required]

[object]

List of dashboard bulk action request data objects.

id [required]

string

Dashboard resource ID.

type [required]

enum

Dashboard resource type. Allowed enum values: dashboard

{
  "data": [
    {
      "id": "123-abc-456",
      "type": "dashboard"
    }
  ]
}

応答

No Content

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Dashboards Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


## json-request-body
# 
# Curl command
curl -X PATCH "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": [
    {
      "id": "123-abc-456",
      "type": "dashboard"
    },
    {
      "id": "789-def-101",
      "type": "dashboard"
    }
  ]
}
EOF
package main

import (
    "context"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewDashboardRestoreRequest([]datadog.DashboardBulkActionData{*datadog.NewDashboardBulkActionData("123-abc-456", datadog.DashboardResourceType("dashboard"))}) // DashboardRestoreRequest | Restore dashboards request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    r, err := apiClient.DashboardsApi.RestoreDashboards(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.RestoreDashboards`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    body = DashboardRestoreRequest(
        data=DashboardBulkActionDataList([
            DashboardBulkActionData(
                id="123-abc-456",
                type=DashboardResourceType("dashboard"),
            ),
        ]),
    )  # DashboardRestoreRequest | Restore dashboards request body.

    # example passing only required values which don't have defaults set
    try:
        # Restore deleted dashboards
        api_instance.restore_dashboards(body)
    except ApiException as e:
        print("Exception when calling DashboardsApi->restore_dashboards: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
body = DatadogAPIClient::V1::DashboardRestoreRequest.new({data: [DatadogAPIClient::V1::DashboardBulkActionData.new({id: '123-abc-456', type: DatadogAPIClient::V1::DashboardResourceType::DASHBOARD})]}) # DashboardRestoreRequest | Restore dashboards request body.

begin
  # Restore deleted dashboards
  api_instance.restore_dashboards(body)
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->restore_dashboards: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiRestoreDashboardsRequest = {
  // DashboardRestoreRequest | Restore dashboards request body.
  body: {
    data: [
      {
        id: "123-abc-456",
        type: "dashboard",
      },
    ],
  },
};

apiInstance
  .restoreDashboards(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        DashboardRestoreRequest body = new DashboardRestoreRequest(); // DashboardRestoreRequest | Restore dashboards request body.
        try {
            apiInstance.restoreDashboards(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#restoreDashboards");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

GET https://api.datadoghq.eu/api/v1/dashboard/public/{token}/invitationhttps://api.ddog-gov.com/api/v1/dashboard/public/{token}/invitationhttps://api.datadoghq.com/api/v1/dashboard/public/{token}/invitationhttps://api.us3.datadoghq.com/api/v1/dashboard/public/{token}/invitation

概要

特定の共有ダッシュボードに存在する招待について記述します (ページ区切り)。

引数

パスパラメーター

名前

種類

説明

token [required]

string

Token of the shared dashboard for which to fetch invitations.

クエリ文字列

名前

種類

説明

page_size

integer

The number of records to return in a single request.

page_number

integer

The page to access (base 0).

応答

OK

Invitations data and metadata that exists for a shared dashboard returned by the API.

Expand All

フィールド

種類

説明

data [required]

 <oneOf>

An object or list of objects containing the information for an invitation to a shared dashboard.

Option 1

object

Object containing the information for an invitation to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

Option 2

[object]

A list of objects containing the information for an invitation(s) to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

meta

object

Pagination metadata returned by the API.

page

object

Object containing the total count of invitations across all pages

total_count

int64

The total number of invitations on this shared board, across all pages.

{
  "data": [
    "undefined"
  ],
  "meta": {
    "page": {
      "total_count": "integer"
    }
  }
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Path parameters
export token="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public/${token}/invitation" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.datadoghq.eu/api/v1/dashboard/{dashboard_id}https://api.ddog-gov.com/api/v1/dashboard/{dashboard_id}https://api.datadoghq.com/api/v1/dashboard/{dashboard_id}https://api.us3.datadoghq.com/api/v1/dashboard/{dashboard_id}

概要

指定の ID を使用してダッシュボードを更新します。

引数

パスパラメーター

名前

種類

説明

dashboard_id [required]

string

The ID of the dashboard.

リクエスト

Body Data (required)

ダッシュボードのリクエスト本文を更新します。

Expand All

フィールド

種類

説明

author_handle

string

Identifier of the dashboard author.

created_at

date-time

Creation date of the dashboard.

description

string

Description of the dashboard.

id

string

ID of the dashboard.

is_read_only

boolean

Whether this dashboard is read-only. If True, only the author and admins can make changes to it.

layout_type [required]

enum

Layout type of the dashboard. Allowed enum values: ordered,free

modified_at

date-time

Modification date of the dashboard.

notify_list

[string]

List of handles of users to notify when changes are made to this dashboard.

reflow_type

enum

Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts. Allowed enum values: auto,fixed

restricted_roles

[string]

A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the is_read_only property if both are present. This feature is currently in beta.

template_variable_presets

[object]

Array of template variables saved views.

name

string

The name of the variable.

template_variables

[object]

List of variables.

name

string

The name of the variable.

value

string

The value of the template variable within the saved view.

template_variables

[object]

List of template variables for this dashboard.

available_values

[string]

The list of values that the template variable drop-down is limited to.

default

string

The default value for the template variable on dashboard load.

name [required]

string

The name of the variable.

prefix

string

The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.

title [required]

string

Title of the dashboard.

url

string

The URL of the dashboard.

widgets [required]

[object]

List of widgets to display on the dashboard.

definition [required]

object <oneOf>

id

int64

ID of the widget.

layout

object

The layout for a widget on a free or new dashboard layout dashboard.

height [required]

int64

The height of the widget. Should be a non-negative integer.

is_column_break

boolean

Whether the widget should be the first one on the second column in high density or not. Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.

width [required]

int64

The width of the widget. Should be a non-negative integer.

x [required]

int64

The position of the widget on the x (horizontal) axis. Should be a non-negative integer.

y [required]

int64

The position of the widget on the y (vertical) axis. Should be a non-negative integer.

{
  "description": "string",
  "is_read_only": false,
  "layout_type": "ordered",
  "notify_list": [],
  "reflow_type": "string",
  "restricted_roles": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "widgets": [
    {
      "definition": {},
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

応答

OK

A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying key performance metrics, which enable you to monitor the health of your infrastructure.

Expand All

フィールド

種類

説明

author_handle

string

Identifier of the dashboard author.

created_at

date-time

Creation date of the dashboard.

description

string

Description of the dashboard.

id

string

ID of the dashboard.

is_read_only

boolean

Whether this dashboard is read-only. If True, only the author and admins can make changes to it.

layout_type [required]

enum

Layout type of the dashboard. Allowed enum values: ordered,free

modified_at

date-time

Modification date of the dashboard.

notify_list

[string]

List of handles of users to notify when changes are made to this dashboard.

reflow_type

enum

Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts. Allowed enum values: auto,fixed

restricted_roles

[string]

A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the is_read_only property if both are present. This feature is currently in beta.

template_variable_presets

[object]

Array of template variables saved views.

name

string

The name of the variable.

template_variables

[object]

List of variables.

name

string

The name of the variable.

value

string

The value of the template variable within the saved view.

template_variables

[object]

List of template variables for this dashboard.

available_values

[string]

The list of values that the template variable drop-down is limited to.

default

string

The default value for the template variable on dashboard load.

name [required]

string

The name of the variable.

prefix

string

The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.

title [required]

string

Title of the dashboard.

url

string

The URL of the dashboard.

widgets [required]

[object]

List of widgets to display on the dashboard.

definition [required]

object <oneOf>

id

int64

ID of the widget.

layout

object

The layout for a widget on a free or new dashboard layout dashboard.

height [required]

int64

The height of the widget. Should be a non-negative integer.

is_column_break

boolean

Whether the widget should be the first one on the second column in high density or not. Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.

width [required]

int64

The width of the widget. Should be a non-negative integer.

x [required]

int64

The position of the widget on the x (horizontal) axis. Should be a non-negative integer.

y [required]

int64

The position of the widget on the y (vertical) axis. Should be a non-negative integer.

{
  "author_handle": "test@datadoghq.com",
  "created_at": "2019-09-19T10:00:00.000Z",
  "description": "string",
  "id": "123-abc-456",
  "is_read_only": false,
  "layout_type": "ordered",
  "modified_at": "2019-09-19T10:00:00.000Z",
  "notify_list": [],
  "reflow_type": "string",
  "restricted_roles": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "url": "/dashboard/123-abc-456/example-dashboard-title",
  "widgets": [
    {
      "definition": {},
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Path parameters
export dashboard_id="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/${dashboard_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "layout_type": "ordered", "template_variables": [ { "name": "host1" } ], "title": "", "widgets": [ { "definition": null, "layout": { "height": 0, "width": 0, "x": 0, "y": 0 } } ] } EOF
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    dashboardId := "dashboardId_example" // string | The ID of the dashboard.
    body := *datadog.NewDashboard(datadog.DashboardLayoutType("ordered"), "Title_example", []datadog.Widget{*datadog.NewWidget(datadog.WidgetDefinition{AlertGraphWidgetDefinition: datadog.NewAlertGraphWidgetDefinition("AlertId_example", datadog.AlertGraphWidgetDefinitionType("alert_graph"), datadog.WidgetVizType("timeseries"))})}) // Dashboard | Update Dashboard request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.DashboardsApi.UpdateDashboard(ctx, dashboardId, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.UpdateDashboard`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateDashboard`: Dashboard
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardsApi.UpdateDashboard:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    dashboard_id = "dashboard_id_example"  # str | The ID of the dashboard.
    body = Dashboard(
        description="description_example",
        is_read_only=False,
        layout_type=DashboardLayoutType("ordered"),
        notify_list=[
            "notify_list_example",
        ],
        reflow_type=DashboardReflowType("auto"),
        restricted_roles=[
            "restricted_roles_example",
        ],
        template_variable_presets=[
            DashboardTemplateVariablePreset(
                name="name_example",
                template_variables=[
                    DashboardTemplateVariablePresetValue(
                        name="name_example",
                        value="value_example",
                    ),
                ],
            ),
        ],
        template_variables=[
            DashboardTemplateVariable(
                available_values=["my-host","host1","host2"],
                default="my-host",
                name="host1",
                prefix="host",
            ),
        ],
        title="",
        widgets=[
            Widget(
                definition=WidgetDefinition(),
                id=1,
                layout=WidgetLayout(
                    height=0,
                    is_column_break=True,
                    width=0,
                    x=0,
                    y=0,
                ),
            ),
        ],
    )  # Dashboard | Update Dashboard request body.

    # example passing only required values which don't have defaults set
    try:
        # Update a dashboard
        api_response = api_instance.update_dashboard(dashboard_id, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DashboardsApi->update_dashboard: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
dashboard_id = 'dashboard_id_example' # String | The ID of the dashboard.
body = DatadogAPIClient::V1::Dashboard.new({layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, title: 'title_example', widgets: [DatadogAPIClient::V1::Widget.new({definition: DatadogAPIClient::V1::AlertGraphWidgetDefinition.new({alert_id: 'alert_id_example', type: DatadogAPIClient::V1::AlertGraphWidgetDefinitionType::ALERT_GRAPH, viz_type: DatadogAPIClient::V1::WidgetVizType::TIMESERIES})})]}) # Dashboard | Update Dashboard request body.

begin
  # Update a dashboard
  result = api_instance.update_dashboard(dashboard_id, body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->update_dashboard: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiUpdateDashboardRequest = {
  // string | The ID of the dashboard.
  dashboardId: "dashboard_id_example",
  // Dashboard | Update Dashboard request body.
  body: {
    description: "description_example",
    isReadOnly: false,
    layoutType: "ordered",
    notifyList: ["notifyList_example"],
    reflowType: "auto",
    restrictedRoles: ["restrictedRoles_example"],
    templateVariablePresets: [
      {
        name: "name_example",
        templateVariables: [
          {
            name: "name_example",
            value: "value_example",
          },
        ],
      },
    ],
    templateVariables: [
      {
        availableValues: ["my-host", "host1", "host2"],
        _default: "my-host",
        name: "host1",
        prefix: "host",
      },
    ],
    title: "",
    widgets: [
      {
        definition: {
          alertId: "",
          time: {
            liveSpan: "5m",
          },
          title: "title_example",
          titleAlign: "center",
          titleSize: "titleSize_example",
          type: "alert_graph",
          vizType: "timeseries",
        },
        id: 1,
        layout: {
          height: 0,
          isColumnBreak: true,
          width: 0,
          x: 0,
          y: 0,
        },
      },
    ],
  },
};

apiInstance
  .updateDashboard(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        String dashboardId = "dashboardId_example"; // String | The ID of the dashboard.
        Dashboard body = new Dashboard(); // Dashboard | Update Dashboard request body.
        try {
            Dashboard result = apiInstance.updateDashboard(dashboardId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#updateDashboard");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

POST https://api.datadoghq.eu/api/v1/dashboard/public/{token}/invitationhttps://api.ddog-gov.com/api/v1/dashboard/public/{token}/invitationhttps://api.datadoghq.com/api/v1/dashboard/public/{token}/invitationhttps://api.us3.datadoghq.com/api/v1/dashboard/public/{token}/invitation

概要

特定の認証済み共有ダッシュボードにアクセスするためのリンクを含む指定されたメールアドレスにメールを送信します。メールアドレスは、認証された共有ダッシュボードの share_list にすでに属している必要があります。

引数

パスパラメーター

名前

種類

説明

token [required]

string

The token of the shared dashboard.

リクエスト

Body Data (required)

共有ダッシュボードの招待リクエスト本文。

Expand All

フィールド

種類

説明

data [required]

 <oneOf>

An object or list of objects containing the information for an invitation to a shared dashboard.

Option 1

object

Object containing the information for an invitation to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

Option 2

[object]

A list of objects containing the information for an invitation(s) to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

meta

object

Pagination metadata returned by the API.

page

object

Object containing the total count of invitations across all pages

total_count

int64

The total number of invitations on this shared board, across all pages.

{
  "data": [
    "undefined"
  ]
}

応答

OK

Invitations data and metadata that exists for a shared dashboard returned by the API.

Expand All

フィールド

種類

説明

data [required]

 <oneOf>

An object or list of objects containing the information for an invitation to a shared dashboard.

Option 1

object

Object containing the information for an invitation to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

Option 2

[object]

A list of objects containing the information for an invitation(s) to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

meta

object

Pagination metadata returned by the API.

page

object

Object containing the total count of invitations across all pages

total_count

int64

The total number of invitations on this shared board, across all pages.

{
  "data": [
    "undefined"
  ],
  "meta": {
    "page": {
      "total_count": "integer"
    }
  }
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


## json-request-body
# 
# Path parameters
export token="CHANGE_ME"
# Curl command curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public/${token}/invitation" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": [ { "attributes": { "email": "test@datadoghq.com" }, "type": "public_dashboard_invitation" } ] } EOF

DELETE https://api.datadoghq.eu/api/v1/dashboard/public/{token}/invitationhttps://api.ddog-gov.com/api/v1/dashboard/public/{token}/invitationhttps://api.datadoghq.com/api/v1/dashboard/public/{token}/invitationhttps://api.us3.datadoghq.com/api/v1/dashboard/public/{token}/invitation

概要

特定のメールアドレスの指定された共有ダッシュボードにアクセスするために使用された、以前に送信された招待メールとアクティブなセッションを取り消します。

引数

パスパラメーター

名前

種類

説明

token [required]

string

The token of the shared dashboard.

リクエスト

Body Data (required)

共有ダッシュボードの招待削除のリクエスト本文。

Expand All

フィールド

種類

説明

data [required]

 <oneOf>

An object or list of objects containing the information for an invitation to a shared dashboard.

Option 1

object

Object containing the information for an invitation to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

Option 2

[object]

A list of objects containing the information for an invitation(s) to a shared dashboard.

attributes [required]

object

Attributes of the shared dashboard invitation

created_at

date-time

When the invitation was sent.

email

string

An email address that an invitation has been (or if used in invitation request, will be) sent to.

has_session

boolean

Indicates whether an active session exists for the invitation (produced when a user clicks the link in the email).

invitation_expiry

date-time

When the invitation expires.

session_expiry

date-time

When the invited user's session expires. null if the invitation has no associated session.

share_token

string

The unique token of the shared dashboard that was (or is to be) shared.

type [required]

enum

Type for shared dashboard invitation request body. Allowed enum values: public_dashboard_invitation

meta

object

Pagination metadata returned by the API.

page

object

Object containing the total count of invitations across all pages

total_count

int64

The total number of invitations on this shared board, across all pages.

{
  "data": [
    "undefined"
  ]
}

応答

OK

Forbidden

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


## json-request-body
# 
# Path parameters
export token="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/public/${token}/invitation" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": [ { "attributes": { "email": "test@datadoghq.com" }, "type": "public_dashboard_invitation" } ] } EOF

GET https://api.datadoghq.eu/api/v1/dashboard/{dashboard_id}https://api.ddog-gov.com/api/v1/dashboard/{dashboard_id}https://api.datadoghq.com/api/v1/dashboard/{dashboard_id}https://api.us3.datadoghq.com/api/v1/dashboard/{dashboard_id}

概要

指定の ID を使用してダッシュボードを取得します。

引数

パスパラメーター

名前

種類

説明

dashboard_id [required]

string

The ID of the dashboard.

応答

OK

A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying key performance metrics, which enable you to monitor the health of your infrastructure.

Expand All

フィールド

種類

説明

author_handle

string

Identifier of the dashboard author.

created_at

date-time

Creation date of the dashboard.

description

string

Description of the dashboard.

id

string

ID of the dashboard.

is_read_only

boolean

Whether this dashboard is read-only. If True, only the author and admins can make changes to it.

layout_type [required]

enum

Layout type of the dashboard. Allowed enum values: ordered,free

modified_at

date-time

Modification date of the dashboard.

notify_list

[string]

List of handles of users to notify when changes are made to this dashboard.

reflow_type

enum

Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts. Allowed enum values: auto,fixed

restricted_roles

[string]

A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the is_read_only property if both are present. This feature is currently in beta.

template_variable_presets

[object]

Array of template variables saved views.

name

string

The name of the variable.

template_variables

[object]

List of variables.

name

string

The name of the variable.

value

string

The value of the template variable within the saved view.

template_variables

[object]

List of template variables for this dashboard.

available_values

[string]

The list of values that the template variable drop-down is limited to.

default

string

The default value for the template variable on dashboard load.

name [required]

string

The name of the variable.

prefix

string

The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.

title [required]

string

Title of the dashboard.

url

string

The URL of the dashboard.

widgets [required]

[object]

List of widgets to display on the dashboard.

definition [required]

object <oneOf>

id

int64

ID of the widget.

layout

object

The layout for a widget on a free or new dashboard layout dashboard.

height [required]

int64

The height of the widget. Should be a non-negative integer.

is_column_break

boolean

Whether the widget should be the first one on the second column in high density or not. Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.

width [required]

int64

The width of the widget. Should be a non-negative integer.

x [required]

int64

The position of the widget on the x (horizontal) axis. Should be a non-negative integer.

y [required]

int64

The position of the widget on the y (vertical) axis. Should be a non-negative integer.

{
  "author_handle": "test@datadoghq.com",
  "created_at": "2019-09-19T10:00:00.000Z",
  "description": "string",
  "id": "123-abc-456",
  "is_read_only": false,
  "layout_type": "ordered",
  "modified_at": "2019-09-19T10:00:00.000Z",
  "notify_list": [],
  "reflow_type": "string",
  "restricted_roles": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "url": "/dashboard/123-abc-456/example-dashboard-title",
  "widgets": [
    {
      "definition": {},
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

Authentication Error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


# Path parameters
export dashboard_id="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/dashboard/${dashboard_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    dashboardId := "dashboardId_example" // string | The ID of the dashboard.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.DashboardsApi.GetDashboard(ctx, dashboardId)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.GetDashboard`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetDashboard`: Dashboard
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardsApi.GetDashboard:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import dashboards_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboards_api.DashboardsApi(api_client)
    dashboard_id = "dashboard_id_example"  # str | The ID of the dashboard.

    # example passing only required values which don't have defaults set
    try:
        # Get a dashboard
        api_response = api_instance.get_dashboard(dashboard_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DashboardsApi->get_dashboard: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
dashboard_id = 'dashboard_id_example' # String | The ID of the dashboard.

begin
  # Get a dashboard
  result = api_instance.get_dashboard(dashboard_id)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling DashboardsAPI->get_dashboard: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

let params: v1.DashboardsApiGetDashboardRequest = {
  // string | The ID of the dashboard.
  dashboardId: "dashboard_id_example",
};

apiInstance
  .getDashboard(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.DashboardsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        DashboardsApi apiInstance = new DashboardsApi(defaultClient);
        String dashboardId = "dashboardId_example"; // String | The ID of the dashboard.
        try {
            Dashboard result = apiInstance.getDashboard(dashboardId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardsApi#getDashboard");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
from datadog import initialize, api

options = {
    'api_key': '<DATADOG_API_KEY>',
    'app_key': '<DATADOG_APPLICATION_KEY>'
}

initialize(**options)

dashboard_id = '<DASHBOARD_ID>'

api.Dashboard.get(dashboard_id)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python "example.py"
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dashboard_id = '<DASHBOARD_ID>'
dog.get_board(dashboard_id)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"