Dashboards

Gestiona todos tus dashboards, así como el acceso a tus dashboards compartidos, a través de la API. Para obtener más información, consulta la página Dashboards.

POST https://api.ap1.datadoghq.com/api/v1/dashboardhttps://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/dashboardhttps://api.us5.datadoghq.com/api/v1/dashboard

Información general

Crea un dashboard utilizando las opciones especificadas. Cuando definas consultas en tus widgets, ten en cuenta qué consultas deben tener los modificadores as_count() or as_rate() añadidos. Para obtener más información sobre estos modificadores, consulta la siguiente documentación. This endpoint requires the dashboards_write permission.

OAuth apps require the dashboards_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Crea el cuerpo de una solicitud de dashboards.

Expand All

Campo

Tipo

Descripción

author_handle

string

Identifier of the dashboard author.

author_name

string

Name 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

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

This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.

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.

tags

[string]

List of team names representing ownership of a dashboard.

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

DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.

values

[string]

One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.

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

DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.

defaults

[string]

One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.

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]

 <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.

{
  "title": "Example-Dashboard",
  "widgets": [
    {
      "definition": {
        "title": "Example Cloud Cost Query",
        "title_size": "16",
        "title_align": "left",
        "type": "timeseries",
        "requests": [
          {
            "formulas": [
              {
                "formula": "query1"
              }
            ],
            "queries": [
              {
                "data_source": "cloud_cost",
                "name": "query1",
                "query": "sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)"
              }
            ],
            "response_format": "timeseries",
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "display_type": "bars"
          }
        ],
        "time": {}
      }
    }
  ],
  "layout_type": "ordered"
}
{
  "title": "Example-Dashboard",
  "description": "",
  "widgets": [
    {
      "definition": {
        "title": "APM Stats - Request latency HOP",
        "title_size": "16",
        "title_align": "left",
        "show_legend": false,
        "type": "distribution",
        "xaxis": {
          "max": "auto",
          "include_zero": true,
          "scale": "linear",
          "min": "auto"
        },
        "yaxis": {
          "max": "auto",
          "include_zero": true,
          "scale": "linear",
          "min": "auto"
        },
        "requests": [
          {
            "query": {
              "primary_tag_value": "*",
              "stat": "latency_distribution",
              "data_source": "apm_resource_stats",
              "name": "query1",
              "service": "azure-bill-import",
              "group_by": [
                "resource_name"
              ],
              "env": "staging",
              "primary_tag_name": "datacenter",
              "operation_name": "universal.http.client"
            },
            "request_type": "histogram",
            "style": {
              "palette": "dog_classic"
            }
          }
        ]
      },
      "layout": {
        "x": 8,
        "y": 0,
        "width": 4,
        "height": 2
      }
    }
  ],
  "layout_type": "ordered"
}
{
  "title": "Example-Dashboard",
  "description": "Example-Dashboard",
  "widgets": [
    {
      "definition": {
        "title": "Events Platform - Request latency HOP",
        "title_size": "16",
        "title_align": "left",
        "show_legend": false,
        "type": "distribution",
        "xaxis": {
          "max": "auto",
          "include_zero": true,
          "scale": "linear",
          "min": "auto"
        },
        "yaxis": {
          "max": "auto",
          "include_zero": true,
          "scale": "linear",
          "min": "auto"
        },
        "requests": [
          {
            "query": {
              "search": {
                "query": ""
              },
              "data_source": "events",
              "compute": {
                "metric": "@duration",
                "aggregation": "min"
              },
              "name": "query1",
              "indexes": [
                "*"
              ],
              "group_by": []
            },
            "request_type": "histogram"
          }
        ]
      },
      "layout": {
        "x": 0,
        "y": 0,
        "width": 4,
        "height": 2
      }
    }
  ],
  "layout_type": "ordered"
}

Respuesta

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

Campo

Tipo

Descripción

author_handle

string

Identifier of the dashboard author.

author_name

string

Name 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

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

This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.

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.

tags

[string]

List of team names representing ownership of a dashboard.

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

DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.

values

[string]

One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.

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

DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.

defaults

[string]

One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.

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]

 <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",
  "author_name": "John Doe",
  "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": [],
  "tags": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string",
          "values": []
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "defaults": [
        "my-host-1",
        "my-host-2"
      ],
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "url": "/dashboard/123-abc-456/example-dashboard-title",
  "widgets": [
    {
      "definition": {
        "requests": {
          "fill": {
            "q": "avg:system.cpu.user{*}"
          }
        },
        "type": "hostmap"
      },
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Clients deserialize a dashboard with a empty time object
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard import Dashboard
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
from datadog_api_client.v1.model.formula_and_function_cloud_cost_data_source import (
    FormulaAndFunctionCloudCostDataSource,
)
from datadog_api_client.v1.model.formula_and_function_cloud_cost_query_definition import (
    FormulaAndFunctionCloudCostQueryDefinition,
)
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat
from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition
from datadog_api_client.v1.model.timeseries_widget_definition_type import TimeseriesWidgetDefinitionType
from datadog_api_client.v1.model.timeseries_widget_request import TimeseriesWidgetRequest
from datadog_api_client.v1.model.widget import Widget
from datadog_api_client.v1.model.widget_display_type import WidgetDisplayType
from datadog_api_client.v1.model.widget_formula import WidgetFormula
from datadog_api_client.v1.model.widget_legacy_live_span import WidgetLegacyLiveSpan
from datadog_api_client.v1.model.widget_line_type import WidgetLineType
from datadog_api_client.v1.model.widget_line_width import WidgetLineWidth
from datadog_api_client.v1.model.widget_request_style import WidgetRequestStyle
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign

body = Dashboard(
    title="Example-Dashboard",
    widgets=[
        Widget(
            definition=TimeseriesWidgetDefinition(
                title="Example Cloud Cost Query",
                title_size="16",
                title_align=WidgetTextAlign.LEFT,
                type=TimeseriesWidgetDefinitionType.TIMESERIES,
                requests=[
                    TimeseriesWidgetRequest(
                        formulas=[
                            WidgetFormula(
                                formula="query1",
                            ),
                        ],
                        queries=[
                            FormulaAndFunctionCloudCostQueryDefinition(
                                data_source=FormulaAndFunctionCloudCostDataSource.CLOUD_COST,
                                name="query1",
                                query="sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)",
                            ),
                        ],
                        response_format=FormulaAndFunctionResponseFormat.TIMESERIES,
                        style=WidgetRequestStyle(
                            palette="dog_classic",
                            line_type=WidgetLineType.SOLID,
                            line_width=WidgetLineWidth.NORMAL,
                        ),
                        display_type=WidgetDisplayType.BARS,
                    ),
                ],
                time=WidgetLegacyLiveSpan(),
            ),
        ),
    ],
    layout_type=DashboardLayoutType.ORDERED,
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.create_dashboard(body=body)

    print(response)
"""
Create a distribution widget using a histogram request containing a formulas and functions APM Stats query
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard import Dashboard
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
from datadog_api_client.v1.model.distribution_widget_definition import DistributionWidgetDefinition
from datadog_api_client.v1.model.distribution_widget_definition_type import DistributionWidgetDefinitionType
from datadog_api_client.v1.model.distribution_widget_histogram_request_type import (
    DistributionWidgetHistogramRequestType,
)
from datadog_api_client.v1.model.distribution_widget_request import DistributionWidgetRequest
from datadog_api_client.v1.model.distribution_widget_x_axis import DistributionWidgetXAxis
from datadog_api_client.v1.model.distribution_widget_y_axis import DistributionWidgetYAxis
from datadog_api_client.v1.model.formula_and_function_apm_resource_stat_name import (
    FormulaAndFunctionApmResourceStatName,
)
from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_data_source import (
    FormulaAndFunctionApmResourceStatsDataSource,
)
from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import (
    FormulaAndFunctionApmResourceStatsQueryDefinition,
)
from datadog_api_client.v1.model.widget import Widget
from datadog_api_client.v1.model.widget_layout import WidgetLayout
from datadog_api_client.v1.model.widget_style import WidgetStyle
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign

body = Dashboard(
    title="Example-Dashboard",
    description="",
    widgets=[
        Widget(
            definition=DistributionWidgetDefinition(
                title="APM Stats - Request latency HOP",
                title_size="16",
                title_align=WidgetTextAlign.LEFT,
                show_legend=False,
                type=DistributionWidgetDefinitionType.DISTRIBUTION,
                xaxis=DistributionWidgetXAxis(
                    max="auto",
                    include_zero=True,
                    scale="linear",
                    min="auto",
                ),
                yaxis=DistributionWidgetYAxis(
                    max="auto",
                    include_zero=True,
                    scale="linear",
                    min="auto",
                ),
                requests=[
                    DistributionWidgetRequest(
                        query=FormulaAndFunctionApmResourceStatsQueryDefinition(
                            primary_tag_value="*",
                            stat=FormulaAndFunctionApmResourceStatName.LATENCY_DISTRIBUTION,
                            data_source=FormulaAndFunctionApmResourceStatsDataSource.APM_RESOURCE_STATS,
                            name="query1",
                            service="azure-bill-import",
                            group_by=[
                                "resource_name",
                            ],
                            env="staging",
                            primary_tag_name="datacenter",
                            operation_name="universal.http.client",
                        ),
                        request_type=DistributionWidgetHistogramRequestType.HISTOGRAM,
                        style=WidgetStyle(
                            palette="dog_classic",
                        ),
                    ),
                ],
            ),
            layout=WidgetLayout(
                x=8,
                y=0,
                width=4,
                height=2,
            ),
        ),
    ],
    layout_type=DashboardLayoutType.ORDERED,
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.create_dashboard(body=body)

    print(response)
"""
Create a distribution widget using a histogram request containing a formulas and functions events query
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard import Dashboard
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
from datadog_api_client.v1.model.distribution_widget_definition import DistributionWidgetDefinition
from datadog_api_client.v1.model.distribution_widget_definition_type import DistributionWidgetDefinitionType
from datadog_api_client.v1.model.distribution_widget_histogram_request_type import (
    DistributionWidgetHistogramRequestType,
)
from datadog_api_client.v1.model.distribution_widget_request import DistributionWidgetRequest
from datadog_api_client.v1.model.distribution_widget_x_axis import DistributionWidgetXAxis
from datadog_api_client.v1.model.distribution_widget_y_axis import DistributionWidgetYAxis
from datadog_api_client.v1.model.formula_and_function_event_aggregation import FormulaAndFunctionEventAggregation
from datadog_api_client.v1.model.formula_and_function_event_query_definition import (
    FormulaAndFunctionEventQueryDefinition,
)
from datadog_api_client.v1.model.formula_and_function_event_query_definition_compute import (
    FormulaAndFunctionEventQueryDefinitionCompute,
)
from datadog_api_client.v1.model.formula_and_function_event_query_definition_search import (
    FormulaAndFunctionEventQueryDefinitionSearch,
)
from datadog_api_client.v1.model.formula_and_function_events_data_source import FormulaAndFunctionEventsDataSource
from datadog_api_client.v1.model.widget import Widget
from datadog_api_client.v1.model.widget_layout import WidgetLayout
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign

body = Dashboard(
    title="Example-Dashboard",
    description="Example-Dashboard",
    widgets=[
        Widget(
            definition=DistributionWidgetDefinition(
                title="Events Platform - Request latency HOP",
                title_size="16",
                title_align=WidgetTextAlign.LEFT,
                show_legend=False,
                type=DistributionWidgetDefinitionType.DISTRIBUTION,
                xaxis=DistributionWidgetXAxis(
                    max="auto",
                    include_zero=True,
                    scale="linear",
                    min="auto",
                ),
                yaxis=DistributionWidgetYAxis(
                    max="auto",
                    include_zero=True,
                    scale="linear",
                    min="auto",
                ),
                requests=[
                    DistributionWidgetRequest(
                        query=FormulaAndFunctionEventQueryDefinition(
                            search=FormulaAndFunctionEventQueryDefinitionSearch(
                                query="",
                            ),
                            data_source=FormulaAndFunctionEventsDataSource.EVENTS,
                            compute=FormulaAndFunctionEventQueryDefinitionCompute(
                                metric="@duration",
                                aggregation=FormulaAndFunctionEventAggregation.MIN,
                            ),
                            name="query1",
                            indexes=[
                                "*",
                            ],
                            group_by=[],
                        ),
                        request_type=DistributionWidgetHistogramRequestType.HISTOGRAM,
                    ),
                ],
            ),
            layout=WidgetLayout(
                x=0,
                y=0,
                width=4,
                height=2,
            ),
        ),
    ],
    layout_type=DashboardLayoutType.ORDERED,
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.create_dashboard(body=body)

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

GET https://api.ap1.datadoghq.com/api/v1/dashboard/{dashboard_id}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}https://api.us5.datadoghq.com/api/v1/dashboard/{dashboard_id}

Información general

Obtén un dashboard utilizando el ID especificado. This endpoint requires the dashboards_read permission.

OAuth apps require the dashboards_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

dashboard_id [required]

string

The ID of the dashboard.

Respuesta

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

Campo

Tipo

Descripción

author_handle

string

Identifier of the dashboard author.

author_name

string

Name 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

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

This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.

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.

tags

[string]

List of team names representing ownership of a dashboard.

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

DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.

values

[string]

One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.

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

DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.

defaults

[string]

One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.

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]

 <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",
  "author_name": "John Doe",
  "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": [],
  "tags": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string",
          "values": []
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "defaults": [
        "my-host-1",
        "my-host-2"
      ],
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "url": "/dashboard/123-abc-456/example-dashboard-title",
  "widgets": [
    {
      "definition": {
        "requests": {
          "fill": {
            "q": "avg:system.cpu.user{*}"
          }
        },
        "type": "hostmap"
      },
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

Authentication Error

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Get a dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.get_dashboard(
        dashboard_id=DASHBOARD_ID,
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

GET https://api.ap1.datadoghq.com/api/v1/dashboardhttps://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/dashboardhttps://api.us5.datadoghq.com/api/v1/dashboard

Información general

Obtén todos los dashboards.

Nota: Esta consulta sólo devolverá dashboards personalizados o clonados. Esta consulta no devolverá dashboards preconfigurados.

This endpoint requires the dashboards_read permission.

OAuth apps require the dashboards_read authorization scope to access this endpoint.

Argumentos

Cadenas de consulta

Nombre

Tipo

Descripción

filter[shared]

boolean

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

filter[deleted]

boolean

When true, this query returns only deleted custom-created or cloned dashboards. This parameter is incompatible with filter[shared].

count

integer

The maximum number of dashboards returned in the list.

start

integer

The specific offset to use as the beginning of the returned response.

Respuesta

OK

Dashboard summary response.

Expand All

Campo

Tipo

Descripción

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

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

This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.

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

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Get all dashboards returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.list_dashboards(
        filter_shared=False,
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

PUT https://api.ap1.datadoghq.com/api/v1/dashboard/{dashboard_id}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}https://api.us5.datadoghq.com/api/v1/dashboard/{dashboard_id}

Información general

Actualiza un dashboard utilizando el ID especificado. This endpoint requires the dashboards_write permission.

OAuth apps require the dashboards_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

dashboard_id [required]

string

The ID of the dashboard.

Solicitud

Body Data (required)

Actualiza el cuerpo de una solicitud de dashboard.

Expand All

Campo

Tipo

Descripción

author_handle

string

Identifier of the dashboard author.

author_name

string

Name 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

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

This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.

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.

tags

[string]

List of team names representing ownership of a dashboard.

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

DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.

values

[string]

One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.

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

DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.

defaults

[string]

One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.

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]

 <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.

{
  "layout_type": "ordered",
  "title": "Example-Dashboard with list_stream widget",
  "description": "Updated description",
  "widgets": [
    {
      "definition": {
        "type": "list_stream",
        "requests": [
          {
            "columns": [
              {
                "width": "auto",
                "field": "timestamp"
              }
            ],
            "query": {
              "data_source": "apm_issue_stream",
              "query_string": ""
            },
            "response_format": "event_list"
          }
        ]
      }
    }
  ]
}
{
  "layout_type": "ordered",
  "title": "Example-Dashboard with list_stream widget",
  "description": "Updated description",
  "tags": [
    "team:foo",
    "team:bar"
  ],
  "widgets": [
    {
      "definition": {
        "type": "list_stream",
        "requests": [
          {
            "columns": [
              {
                "width": "auto",
                "field": "timestamp"
              }
            ],
            "query": {
              "data_source": "apm_issue_stream",
              "query_string": ""
            },
            "response_format": "event_list"
          }
        ]
      }
    }
  ]
}

Respuesta

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

Campo

Tipo

Descripción

author_handle

string

Identifier of the dashboard author.

author_name

string

Name 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

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

This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.

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.

tags

[string]

List of team names representing ownership of a dashboard.

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

DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.

values

[string]

One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.

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

DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.

defaults

[string]

One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.

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]

 <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",
  "author_name": "John Doe",
  "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": [],
  "tags": [],
  "template_variable_presets": [
    {
      "name": "string",
      "template_variables": [
        {
          "name": "string",
          "value": "string",
          "values": []
        }
      ]
    }
  ],
  "template_variables": [
    {
      "available_values": [
        "my-host",
        "host1",
        "host2"
      ],
      "default": "my-host",
      "defaults": [
        "my-host-1",
        "my-host-2"
      ],
      "name": "host1",
      "prefix": "host"
    }
  ],
  "title": "",
  "url": "/dashboard/123-abc-456/example-dashboard-title",
  "widgets": [
    {
      "definition": {
        "requests": {
          "fill": {
            "q": "avg:system.cpu.user{*}"
          }
        },
        "type": "hostmap"
      },
      "id": "integer",
      "layout": {
        "height": 0,
        "is_column_break": false,
        "width": 0,
        "x": 0,
        "y": 0
      }
    }
  ]
}

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Update a dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard import Dashboard
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
from datadog_api_client.v1.model.list_stream_column import ListStreamColumn
from datadog_api_client.v1.model.list_stream_column_width import ListStreamColumnWidth
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery
from datadog_api_client.v1.model.list_stream_response_format import ListStreamResponseFormat
from datadog_api_client.v1.model.list_stream_source import ListStreamSource
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition
from datadog_api_client.v1.model.list_stream_widget_definition_type import ListStreamWidgetDefinitionType
from datadog_api_client.v1.model.list_stream_widget_request import ListStreamWidgetRequest
from datadog_api_client.v1.model.widget import Widget

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

body = Dashboard(
    layout_type=DashboardLayoutType.ORDERED,
    title="Example-Dashboard with list_stream widget",
    description="Updated description",
    widgets=[
        Widget(
            definition=ListStreamWidgetDefinition(
                type=ListStreamWidgetDefinitionType.LIST_STREAM,
                requests=[
                    ListStreamWidgetRequest(
                        columns=[
                            ListStreamColumn(
                                width=ListStreamColumnWidth.AUTO,
                                field="timestamp",
                            ),
                        ],
                        query=ListStreamQuery(
                            data_source=ListStreamSource.APM_ISSUE_STREAM,
                            query_string="",
                        ),
                        response_format=ListStreamResponseFormat.EVENT_LIST,
                    ),
                ],
            ),
        ),
    ],
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.update_dashboard(dashboard_id=DASHBOARD_ID, body=body)

    print(response)
"""
Update a dashboard with tags returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard import Dashboard
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
from datadog_api_client.v1.model.list_stream_column import ListStreamColumn
from datadog_api_client.v1.model.list_stream_column_width import ListStreamColumnWidth
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery
from datadog_api_client.v1.model.list_stream_response_format import ListStreamResponseFormat
from datadog_api_client.v1.model.list_stream_source import ListStreamSource
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition
from datadog_api_client.v1.model.list_stream_widget_definition_type import ListStreamWidgetDefinitionType
from datadog_api_client.v1.model.list_stream_widget_request import ListStreamWidgetRequest
from datadog_api_client.v1.model.widget import Widget

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

body = Dashboard(
    layout_type=DashboardLayoutType.ORDERED,
    title="Example-Dashboard with list_stream widget",
    description="Updated description",
    tags=[
        "team:foo",
        "team:bar",
    ],
    widgets=[
        Widget(
            definition=ListStreamWidgetDefinition(
                type=ListStreamWidgetDefinitionType.LIST_STREAM,
                requests=[
                    ListStreamWidgetRequest(
                        columns=[
                            ListStreamColumn(
                                width=ListStreamColumnWidth.AUTO,
                                field="timestamp",
                            ),
                        ],
                        query=ListStreamQuery(
                            data_source=ListStreamSource.APM_ISSUE_STREAM,
                            query_string="",
                        ),
                        response_format=ListStreamResponseFormat.EVENT_LIST,
                    ),
                ],
            ),
        ),
    ],
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.update_dashboard(dashboard_id=DASHBOARD_ID, body=body)

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

DELETE https://api.ap1.datadoghq.com/api/v1/dashboard/{dashboard_id}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}https://api.us5.datadoghq.com/api/v1/dashboard/{dashboard_id}

Información general

Elimina un dashboard utilizando el ID especificado. This endpoint requires the dashboards_write permission.

OAuth apps require the dashboards_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

dashboard_id [required]

string

The ID of the dashboard.

Respuesta

OK

Response from the delete dashboard call.

Expand All

Campo

Tipo

Descripción

deleted_dashboard_id

string

ID of the deleted dashboard.

{
  "deleted_dashboard_id": "string"
}

Authentication Error

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Dashboards Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Delete a dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.delete_dashboard(
        dashboard_id=DASHBOARD_ID,
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

DELETE https://api.ap1.datadoghq.com/api/v1/dashboardhttps://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/dashboardhttps://api.us5.datadoghq.com/api/v1/dashboard

Información general

Elimina dashboards utilizando los ID especificados. Si se produce algún fallo, no se eliminará ningún dashboard (no se permite el éxito parcial). This endpoint requires the dashboards_write permission.

OAuth apps require the dashboards_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Elimina el cuerpo de una solicitud de dashboards.

Expand All

Campo

Tipo

Descripción

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

default: dashboard

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

Respuesta

No Content

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Dashboards Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Delete dashboards returns "No Content" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_bulk_action_data import DashboardBulkActionData
from datadog_api_client.v1.model.dashboard_bulk_action_data_list import DashboardBulkActionDataList
from datadog_api_client.v1.model.dashboard_bulk_delete_request import DashboardBulkDeleteRequest
from datadog_api_client.v1.model.dashboard_resource_type import DashboardResourceType

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

body = DashboardBulkDeleteRequest(
    data=DashboardBulkActionDataList(
        [
            DashboardBulkActionData(
                id=DASHBOARD_ID,
                type=DashboardResourceType.DASHBOARD,
            ),
        ]
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    api_instance.delete_dashboards(body=body)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

PATCH https://api.ap1.datadoghq.com/api/v1/dashboardhttps://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/dashboardhttps://api.us5.datadoghq.com/api/v1/dashboard

Información general

Restaura dashboards utilizando los ID especificados. Si se produce algún fallo, no se restaurará ningún dashboard (no se permite el éxito parcial). This endpoint requires the dashboards_write permission.

OAuth apps require the dashboards_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Restaura el cuerpo de una solicitud de dashboards.

Expand All

Campo

Tipo

Descripción

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

default: dashboard

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

Respuesta

No Content

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Dashboards Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Restore deleted dashboards returns "No Content" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_bulk_action_data import DashboardBulkActionData
from datadog_api_client.v1.model.dashboard_bulk_action_data_list import DashboardBulkActionDataList
from datadog_api_client.v1.model.dashboard_resource_type import DashboardResourceType
from datadog_api_client.v1.model.dashboard_restore_request import DashboardRestoreRequest

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

body = DashboardRestoreRequest(
    data=DashboardBulkActionDataList(
        [
            DashboardBulkActionData(
                id=DASHBOARD_ID,
                type=DashboardResourceType.DASHBOARD,
            ),
        ]
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    api_instance.restore_dashboards(body=body)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

POST https://api.ap1.datadoghq.com/api/v1/dashboard/publichttps://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/publichttps://api.us5.datadoghq.com/api/v1/dashboard/public

Información general

Comparte un dashboard privado específico generando una URL en la que pueda verse públicamente. This endpoint requires the dashboards_public_share permission.

OAuth apps require the dashboards_public_share authorization scope to access this endpoint.

Solicitud

Body Data (required)

Crea el cuerpo de una solicitud de dashboards compartidos.

Expand All

Campo

Tipo

Descripción

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

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

embeddable_domains

[string]

The SharedDashboard embeddable_domains.

expiration

date-time

The time when an OPEN shared dashboard becomes publicly unavailable.

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.

invitees

[object]

The SharedDashboard invitees.

access_expiration

date-time

Time of the invitee expiration. Null means the invite will not expire.

created_at

date-time

Time that the invitee was created.

email [required]

string

Email of the invitee.

last_accessed

date-time

The last time the shared dashboard was accessed. Null if never accessed.

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]

DEPRECATED: 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,embed

status

enum

Active means the dashboard is publicly available. Paused means the dashboard is not publicly available. Allowed enum values: active,paused

title

string

Title of the shared dashboard.

token

string

A unique token assigned to the shared dashboard.

viewing_preferences

object

The viewing preferences for a shared dashboard.

high_density

boolean

Whether the widgets on the shared dashboard should be displayed with high density.

theme

enum

The theme of the shared dashboard view. "system" follows your system's default viewing theme. Allowed enum values: system,light,dark

{
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "share_type": "open",
  "global_time": {
    "live_span": "1h"
  }
}

Respuesta

OK

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

Expand All

Campo

Tipo

Descripción

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

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

embeddable_domains

[string]

The SharedDashboard embeddable_domains.

expiration

date-time

The time when an OPEN shared dashboard becomes publicly unavailable.

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.

invitees

[object]

The SharedDashboard invitees.

access_expiration

date-time

Time of the invitee expiration. Null means the invite will not expire.

created_at

date-time

Time that the invitee was created.

email [required]

string

Email of the invitee.

last_accessed

date-time

The last time the shared dashboard was accessed. Null if never accessed.

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]

DEPRECATED: 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,embed

status

enum

Active means the dashboard is publicly available. Paused means the dashboard is not publicly available. Allowed enum values: active,paused

title

string

Title of the shared dashboard.

token

string

A unique token assigned to the shared dashboard.

viewing_preferences

object

The viewing preferences for a shared dashboard.

high_density

boolean

Whether the widgets on the shared dashboard should be displayed with high density.

theme

enum

The theme of the shared dashboard view. "system" follows your system's default viewing theme. Allowed enum values: system,light,dark

{
  "author": {
    "handle": "test@datadoghq.com",
    "name": "string"
  },
  "created": "2019-09-19T10:00:00.000Z",
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "embeddable_domains": [
    "https://domain.atlassian.net/",
    "http://myserver.com/"
  ],
  "expiration": "2019-09-19T10:00:00.000Z",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "invitees": [
    {
      "access_expiration": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "email": "test@datadoghq.com"
    }
  ],
  "last_accessed": "2019-09-19T10:00:00.000Z",
  "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",
  "status": "active",
  "title": "string",
  "token": "string",
  "viewing_preferences": {
    "high_density": false,
    "theme": "string"
  }
}

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Dashboard Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Create a shared dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_global_time import DashboardGlobalTime
from datadog_api_client.v1.model.dashboard_global_time_live_span import DashboardGlobalTimeLiveSpan
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
from datadog_api_client.v1.model.dashboard_type import DashboardType
from datadog_api_client.v1.model.shared_dashboard import SharedDashboard

# there is a valid "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]

body = SharedDashboard(
    dashboard_id=DASHBOARD_ID,
    dashboard_type=DashboardType.CUSTOM_TIMEBOARD,
    share_type=DashboardShareType.OPEN,
    global_time=DashboardGlobalTime(
        live_span=DashboardGlobalTimeLiveSpan.PAST_ONE_HOUR,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.create_public_dashboard(body=body)

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

GET https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}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}https://api.us5.datadoghq.com/api/v1/dashboard/public/{token}

Información general

Obtén los metadatos de un dashboard compartido, asociados al token especificado. This endpoint requires the dashboards_read permission.

OAuth apps require the dashboards_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

token [required]

string

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

Respuesta

OK

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

Expand All

Campo

Tipo

Descripción

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

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

embeddable_domains

[string]

The SharedDashboard embeddable_domains.

expiration

date-time

The time when an OPEN shared dashboard becomes publicly unavailable.

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.

invitees

[object]

The SharedDashboard invitees.

access_expiration

date-time

Time of the invitee expiration. Null means the invite will not expire.

created_at

date-time

Time that the invitee was created.

email [required]

string

Email of the invitee.

last_accessed

date-time

The last time the shared dashboard was accessed. Null if never accessed.

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]

DEPRECATED: 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,embed

status

enum

Active means the dashboard is publicly available. Paused means the dashboard is not publicly available. Allowed enum values: active,paused

title

string

Title of the shared dashboard.

token

string

A unique token assigned to the shared dashboard.

viewing_preferences

object

The viewing preferences for a shared dashboard.

high_density

boolean

Whether the widgets on the shared dashboard should be displayed with high density.

theme

enum

The theme of the shared dashboard view. "system" follows your system's default viewing theme. Allowed enum values: system,light,dark

{
  "author": {
    "handle": "test@datadoghq.com",
    "name": "string"
  },
  "created": "2019-09-19T10:00:00.000Z",
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "embeddable_domains": [
    "https://domain.atlassian.net/",
    "http://myserver.com/"
  ],
  "expiration": "2019-09-19T10:00:00.000Z",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "invitees": [
    {
      "access_expiration": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "email": "test@datadoghq.com"
    }
  ],
  "last_accessed": "2019-09-19T10:00:00.000Z",
  "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",
  "status": "active",
  "title": "string",
  "token": "string",
  "viewing_preferences": {
    "high_density": false,
    "theme": "string"
  }
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Shared Dashboard Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Get a shared dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi

# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.get_public_dashboard(
        token=SHARED_DASHBOARD_TOKEN,
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

PUT https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}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}https://api.us5.datadoghq.com/api/v1/dashboard/public/{token}

Información general

Actualiza un dashboard compartido asociado al token especificado. This endpoint requires the dashboards_public_share permission.

OAuth apps require the dashboards_public_share authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

token [required]

string

The token of the shared dashboard.

Solicitud

Body Data (required)

Actualiza el cuerpo de una solicitud de dashboards.

Expand All

Campo

Tipo

Descripción

embeddable_domains

[string]

The SharedDashboard embeddable_domains.

expiration

date-time

The time when an OPEN shared dashboard becomes publicly unavailable.

global_time

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.

invitees

[object]

The SharedDashboard invitees.

access_expiration

date-time

Time of the invitee expiration. Null means the invite will not expire.

created_at

date-time

Time that the invitee was created.

email [required]

string

Email of the invitee.

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]

DEPRECATED: 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,embed

status

enum

Active means the dashboard is publicly available. Paused means the dashboard is not publicly available. Allowed enum values: active,paused

title

string

Title of the shared dashboard.

viewing_preferences

object

The viewing preferences for a shared dashboard.

high_density

boolean

Whether the widgets on the shared dashboard should be displayed with high density.

theme

enum

The theme of the shared dashboard view. "system" follows your system's default viewing theme. Allowed enum values: system,light,dark

{
  "global_time": {
    "live_span": "15m"
  },
  "share_list": [],
  "share_type": "open"
}

Respuesta

OK

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

Expand All

Campo

Tipo

Descripción

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

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

embeddable_domains

[string]

The SharedDashboard embeddable_domains.

expiration

date-time

The time when an OPEN shared dashboard becomes publicly unavailable.

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.

invitees

[object]

The SharedDashboard invitees.

access_expiration

date-time

Time of the invitee expiration. Null means the invite will not expire.

created_at

date-time

Time that the invitee was created.

email [required]

string

Email of the invitee.

last_accessed

date-time

The last time the shared dashboard was accessed. Null if never accessed.

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]

DEPRECATED: 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,embed

status

enum

Active means the dashboard is publicly available. Paused means the dashboard is not publicly available. Allowed enum values: active,paused

title

string

Title of the shared dashboard.

token

string

A unique token assigned to the shared dashboard.

viewing_preferences

object

The viewing preferences for a shared dashboard.

high_density

boolean

Whether the widgets on the shared dashboard should be displayed with high density.

theme

enum

The theme of the shared dashboard view. "system" follows your system's default viewing theme. Allowed enum values: system,light,dark

{
  "author": {
    "handle": "test@datadoghq.com",
    "name": "string"
  },
  "created": "2019-09-19T10:00:00.000Z",
  "dashboard_id": "123-abc-456",
  "dashboard_type": "custom_timeboard",
  "embeddable_domains": [
    "https://domain.atlassian.net/",
    "http://myserver.com/"
  ],
  "expiration": "2019-09-19T10:00:00.000Z",
  "global_time": {
    "live_span": "1h"
  },
  "global_time_selectable_enabled": false,
  "invitees": [
    {
      "access_expiration": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "email": "test@datadoghq.com"
    }
  ],
  "last_accessed": "2019-09-19T10:00:00.000Z",
  "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",
  "status": "active",
  "title": "string",
  "token": "string",
  "viewing_preferences": {
    "high_density": false,
    "theme": "string"
  }
}

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Update a shared dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_global_time_live_span import DashboardGlobalTimeLiveSpan
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
from datadog_api_client.v1.model.shared_dashboard_update_request import SharedDashboardUpdateRequest
from datadog_api_client.v1.model.shared_dashboard_update_request_global_time import (
    SharedDashboardUpdateRequestGlobalTime,
)

# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]

body = SharedDashboardUpdateRequest(
    global_time=SharedDashboardUpdateRequestGlobalTime(
        live_span=DashboardGlobalTimeLiveSpan.PAST_FIFTEEN_MINUTES,
    ),
    share_list=[],
    share_type=DashboardShareType.OPEN,
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.update_public_dashboard(token=SHARED_DASHBOARD_TOKEN, body=body)

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

POST https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}/invitationhttps://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}/invitationhttps://api.us5.datadoghq.com/api/v1/dashboard/public/{token}/invitation

Información general

Envía correos electrónicos a direcciones especificadas que contengan enlaces para acceder a un determinado dashboard compartido. Las direcciones de correo electrónico ya deben pertenecer a la lista de compartidos autenticada del dashboard compartido. This endpoint requires the dashboards_public_share permission.

OAuth apps require the dashboards_public_share authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

token [required]

string

The token of the shared dashboard.

Solicitud

Body Data (required)

Cuerpo de una solicitud de invitación al dashboard compartido.

Expand All

Campo

Tipo

Descripción

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": {
    "attributes": {
      "email": "exampledashboard@datadoghq.com"
    },
    "type": "public_dashboard_invitation"
  }
}

Respuesta

OK

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

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Send shared dashboard invitation email returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_invite_type import DashboardInviteType
from datadog_api_client.v1.model.shared_dashboard_invites import SharedDashboardInvites
from datadog_api_client.v1.model.shared_dashboard_invites_data_object import SharedDashboardInvitesDataObject
from datadog_api_client.v1.model.shared_dashboard_invites_data_object_attributes import (
    SharedDashboardInvitesDataObjectAttributes,
)

# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]

body = SharedDashboardInvites(
    data=SharedDashboardInvitesDataObject(
        attributes=SharedDashboardInvitesDataObjectAttributes(
            email="exampledashboard@datadoghq.com",
        ),
        type=DashboardInviteType.PUBLIC_DASHBOARD_INVITATION,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.send_public_dashboard_invitation(token=SHARED_DASHBOARD_TOKEN, body=body)

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

GET https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}/invitationhttps://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}/invitationhttps://api.us5.datadoghq.com/api/v1/dashboard/public/{token}/invitation

Información general

Describe las invitaciones existentes para el dashboard compartido (paginado). This endpoint requires the dashboards_public_share permission.

OAuth apps require the dashboards_public_share authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

token [required]

string

Token of the shared dashboard for which to fetch invitations.

Cadenas de consulta

Nombre

Tipo

Descripción

page_size

integer

The number of records to return in a single request.

page_number

integer

The page to access (base 0).

Respuesta

OK

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

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Get all invitations for a shared dashboard returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi

# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.get_public_dashboard_invitations(
        token=SHARED_DASHBOARD_TOKEN,
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

DELETE https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}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}https://api.us5.datadoghq.com/api/v1/dashboard/public/{token}

Información general

Revoca la URL pública del dashboard (haciéndola privada), asociada al token especificado. This endpoint requires the dashboards_public_share permission.

OAuth apps require the dashboards_public_share authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

token [required]

string

The token of the shared dashboard.

Respuesta

OK

Response containing token of deleted shared dashboard.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Shared Dashboard Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Revoke a shared dashboard URL returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    response = api_instance.delete_public_dashboard(
        token="token",
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

DELETE https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}/invitationhttps://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}/invitationhttps://api.us5.datadoghq.com/api/v1/dashboard/public/{token}/invitation

Información general

Revoca los correos electrónicos de invitación enviados anteriormente y las sesiones activas utilizadas para acceder a un dashboard determinado para direcciones de correo electrónico específicas. This endpoint requires the dashboards_public_share permission.

OAuth apps require the dashboards_public_share authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

token [required]

string

The token of the shared dashboard.

Solicitud

Body Data (required)

Cuerpo de una solicitud de eliminación de una invitación de dashboard compartido.

Expand All

Campo

Tipo

Descripción

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"
  ]
}

Respuesta

OK

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Not Found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

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

Ejemplo de código

"""
Revoke shared dashboard invitations returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_invite_type import DashboardInviteType
from datadog_api_client.v1.model.shared_dashboard_invites import SharedDashboardInvites
from datadog_api_client.v1.model.shared_dashboard_invites_data_list import SharedDashboardInvitesDataList
from datadog_api_client.v1.model.shared_dashboard_invites_data_object import SharedDashboardInvitesDataObject
from datadog_api_client.v1.model.shared_dashboard_invites_data_object_attributes import (
    SharedDashboardInvitesDataObjectAttributes,
)

body = SharedDashboardInvites(
    data=SharedDashboardInvitesDataList(
        [
            SharedDashboardInvitesDataObject(
                attributes=SharedDashboardInvitesDataObjectAttributes(
                    email="test@datadoghq.com",
                ),
                type=DashboardInviteType.PUBLIC_DASHBOARD_INVITATION,
            ),
        ]
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DashboardsApi(api_client)
    api_instance.delete_public_dashboard_invitation(token="token", body=body)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

PREVIEWING: aliciascott/DOCS-10399-move-CCM
Your Privacy Choices