This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Recibir los elementos de una lista de dashboards

Interactúa con tus listas de dashboards a través de la API para organizar, buscar y compartir todos tus dashboards con tu equipo y tu organización.

GET https://api.ap1.datadoghq.com/api/v1/dashboard/lists/manualhttps://api.datadoghq.eu/api/v1/dashboard/lists/manualhttps://api.ddog-gov.com/api/v1/dashboard/lists/manualhttps://api.datadoghq.com/api/v1/dashboard/lists/manualhttps://api.us3.datadoghq.com/api/v1/dashboard/lists/manualhttps://api.us5.datadoghq.com/api/v1/dashboard/lists/manual

Información general

Obtén todas las definiciones existentes de listas de dashboards. This endpoint requires the dashboards_read permission.

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

Respuesta

OK

Information on your dashboard lists.

Expand All

Campo

Tipo

Descripción

dashboard_lists

[object]

List of all your dashboard lists.

author

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard list.

dashboard_count

int64

The number of dashboards in the list.

id

int64

The ID of the dashboard list.

is_favorite

boolean

Whether or not the list is in the favorites.

modified

date-time

Date of last edition of the dashboard list.

name [required]

string

The name of the dashboard list.

type

string

The type of dashboard list.

{
  "dashboard_lists": [
    {
      "author": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "created": "2019-09-19T10:00:00.000Z",
      "dashboard_count": "integer",
      "id": "integer",
      "is_favorite": false,
      "modified": "2019-09-19T10:00:00.000Z",
      "name": "My Dashboard",
      "type": "manual_dashboard_list"
    }
  ]
}

Forbidden

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 dashboard lists returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewDashboardListsApi(apiClient)
	resp, r, err := api.ListDashboardLists(ctx)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.ListDashboardLists`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.ListDashboardLists`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"

GET https://api.ap1.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ddog-gov.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us3.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us5.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

Información general

Fetch the dashboard list’s dashboard definitions. 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_list_id [required]

integer

ID of the dashboard list to get items from.

Respuesta

OK

Dashboards within a list.

Expand All

Campo

Tipo

Descripción

dashboards [required]

[object]

List of dashboards in the dashboard list.

author

object

Creator of the object.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard.

icon

string

URL to the icon of the dashboard.

id [required]

string

ID of the dashboard.

integration_id

string

The short name of the integration.

is_favorite

boolean

Whether or not the dashboard is in the favorites.

is_read_only

boolean

Whether or not the dashboard is read only.

is_shared

boolean

Whether the dashboard is publicly shared or not.

modified

date-time

Date of last edition of the dashboard.

popularity

int32

Popularity of the dashboard.

tags

[string]

List of team names representing ownership of a dashboard.

title

string

Title of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

url

string

URL path to the dashboard.

total

int64

Number of dashboards in the dashboard list.

{
  "dashboards": [
    {
      "author": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "created": "2019-09-19T10:00:00.000Z",
      "icon": "string",
      "id": "q5j-nti-fv6",
      "integration_id": "string",
      "is_favorite": false,
      "is_read_only": false,
      "is_shared": false,
      "modified": "2019-09-19T10:00:00.000Z",
      "popularity": "integer",
      "tags": [],
      "title": "string",
      "type": "host_timeboard",
      "url": "string"
    }
  ],
  "total": "integer"
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

// Get items of a Dashboard List returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDashboardListsApi(apiClient)
	resp, r, err := api.GetDashboardListItems(ctx, DashboardListID)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.GetDashboardListItems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.GetDashboardListItems`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"

POST https://api.ap1.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ddog-gov.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us3.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us5.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

Información general

Add dashboards to an existing dashboard list.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

dashboard_list_id [required]

integer

ID of the dashboard list to add items to.

Solicitud

Body Data (required)

Dashboards to add to the dashboard list.

Expand All

Campo

Tipo

Descripción

dashboards

[object]

List of dashboards to add the dashboard list.

id [required]

string

ID of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

{
  "dashboards": [
    {
      "id": "123-abc-456",
      "type": "custom_screenboard"
    }
  ]
}
{
  "dashboards": [
    {
      "id": "123-abc-456",
      "type": "custom_timeboard"
    }
  ]
}

Respuesta

OK

Response containing a list of added dashboards.

Expand All

Campo

Tipo

Descripción

added_dashboards_to_list

[object]

List of dashboards added to the dashboard list.

id [required]

string

ID of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

{
  "added_dashboards_to_list": [
    {
      "id": "q5j-nti-fv6",
      "type": "host_timeboard"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

// Add custom screenboard dashboard to an existing dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	// there is a valid "screenboard_dashboard" in the system
	ScreenboardDashboardID := os.Getenv("SCREENBOARD_DASHBOARD_ID")

	body := datadogV2.DashboardListAddItemsRequest{
		Dashboards: []datadogV2.DashboardListItemRequest{
			{
				Id:   ScreenboardDashboardID,
				Type: datadogV2.DASHBOARDTYPE_CUSTOM_SCREENBOARD,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDashboardListsApi(apiClient)
	resp, r, err := api.CreateDashboardListItems(ctx, DashboardListID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.CreateDashboardListItems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.CreateDashboardListItems`:\n%s\n", responseContent)
}
// Add custom timeboard dashboard to an existing dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	// there is a valid "dashboard" in the system
	DashboardID := os.Getenv("DASHBOARD_ID")

	body := datadogV2.DashboardListAddItemsRequest{
		Dashboards: []datadogV2.DashboardListItemRequest{
			{
				Id:   DashboardID,
				Type: datadogV2.DASHBOARDTYPE_CUSTOM_TIMEBOARD,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDashboardListsApi(apiClient)
	resp, r, err := api.CreateDashboardListItems(ctx, DashboardListID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.CreateDashboardListItems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.CreateDashboardListItems`:\n%s\n", responseContent)
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"

POST https://api.ap1.datadoghq.com/api/v1/dashboard/lists/manualhttps://api.datadoghq.eu/api/v1/dashboard/lists/manualhttps://api.ddog-gov.com/api/v1/dashboard/lists/manualhttps://api.datadoghq.com/api/v1/dashboard/lists/manualhttps://api.us3.datadoghq.com/api/v1/dashboard/lists/manualhttps://api.us5.datadoghq.com/api/v1/dashboard/lists/manual

Información general

Crea una lista de dashboards vacía. 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 lista de dashboards.

Expand All

Campo

Tipo

Descripción

author

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard list.

dashboard_count

int64

The number of dashboards in the list.

id

int64

The ID of the dashboard list.

is_favorite

boolean

Whether or not the list is in the favorites.

modified

date-time

Date of last edition of the dashboard list.

name [required]

string

The name of the dashboard list.

type

string

The type of dashboard list.

{
  "name": "Example-Dashboard-List"
}

Respuesta

OK

Your Datadog Dashboards.

Expand All

Campo

Tipo

Descripción

author

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard list.

dashboard_count

int64

The number of dashboards in the list.

id

int64

The ID of the dashboard list.

is_favorite

boolean

Whether or not the list is in the favorites.

modified

date-time

Date of last edition of the dashboard list.

name [required]

string

The name of the dashboard list.

type

string

The type of dashboard list.

{
  "author": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "created": "2019-09-19T10:00:00.000Z",
  "dashboard_count": "integer",
  "id": "integer",
  "is_favorite": false,
  "modified": "2019-09-19T10:00:00.000Z",
  "name": "My Dashboard",
  "type": "manual_dashboard_list"
}

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

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 dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	body := datadogV1.DashboardList{
		Name: "Example-Dashboard-List",
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewDashboardListsApi(apiClient)
	resp, r, err := api.CreateDashboardList(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.CreateDashboardList`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.CreateDashboardList`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"

GET https://api.ap1.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.datadoghq.eu/api/v1/dashboard/lists/manual/{list_id}https://api.ddog-gov.com/api/v1/dashboard/lists/manual/{list_id}https://api.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.us3.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.us5.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}

Información general

Recupera una definición de lista de dashboards existentes. 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

list_id [required]

integer

ID of the dashboard list to fetch.

Respuesta

OK

Your Datadog Dashboards.

Expand All

Campo

Tipo

Descripción

author

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard list.

dashboard_count

int64

The number of dashboards in the list.

id

int64

The ID of the dashboard list.

is_favorite

boolean

Whether or not the list is in the favorites.

modified

date-time

Date of last edition of the dashboard list.

name [required]

string

The name of the dashboard list.

type

string

The type of dashboard list.

{
  "author": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "created": "2019-09-19T10:00:00.000Z",
  "dashboard_count": "integer",
  "id": "integer",
  "is_favorite": false,
  "modified": "2019-09-19T10:00:00.000Z",
  "name": "My Dashboard",
  "type": "manual_dashboard_list"
}

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 a dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewDashboardListsApi(apiClient)
	resp, r, err := api.GetDashboardList(ctx, DashboardListID)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.GetDashboardList`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.GetDashboardList`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"

PUT https://api.ap1.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ddog-gov.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us3.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us5.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

Información general

Update dashboards of an existing dashboard list.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

dashboard_list_id [required]

integer

ID of the dashboard list to update items from.

Solicitud

Body Data (required)

New dashboards of the dashboard list.

Expand All

Campo

Tipo

Descripción

dashboards

[object]

List of dashboards to update the dashboard list to.

id [required]

string

ID of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

{
  "dashboards": [
    {
      "id": "123-abc-456",
      "type": "custom_screenboard"
    }
  ]
}

Respuesta

OK

Response containing a list of updated dashboards.

Expand All

Campo

Tipo

Descripción

dashboards

[object]

List of dashboards in the dashboard list.

id [required]

string

ID of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

{
  "dashboards": [
    {
      "id": "q5j-nti-fv6",
      "type": "host_timeboard"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

// Update items of a dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	// there is a valid "screenboard_dashboard" in the system
	ScreenboardDashboardID := os.Getenv("SCREENBOARD_DASHBOARD_ID")

	body := datadogV2.DashboardListUpdateItemsRequest{
		Dashboards: []datadogV2.DashboardListItemRequest{
			{
				Id:   ScreenboardDashboardID,
				Type: datadogV2.DASHBOARDTYPE_CUSTOM_SCREENBOARD,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDashboardListsApi(apiClient)
	resp, r, err := api.UpdateDashboardListItems(ctx, DashboardListID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.UpdateDashboardListItems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.UpdateDashboardListItems`:\n%s\n", responseContent)
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"

DELETE https://api.ap1.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ddog-gov.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us3.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us5.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

Información general

Delete dashboards from an existing dashboard list.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

dashboard_list_id [required]

integer

ID of the dashboard list to delete items from.

Solicitud

Body Data (required)

Dashboards to delete from the dashboard list.

Expand All

Campo

Tipo

Descripción

dashboards

[object]

List of dashboards to delete from the dashboard list.

id [required]

string

ID of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

{
  "dashboards": [
    {
      "id": "123-abc-456",
      "type": "custom_screenboard"
    }
  ]
}
{
  "dashboards": [
    {
      "id": "123-abc-456",
      "type": "custom_timeboard"
    }
  ]
}

Respuesta

OK

Response containing a list of deleted dashboards.

Expand All

Campo

Tipo

Descripción

deleted_dashboards_from_list

[object]

List of dashboards deleted from the dashboard list.

id [required]

string

ID of the dashboard.

type [required]

enum

The type of the dashboard. Allowed enum values: custom_timeboard,custom_screenboard,integration_screenboard,integration_timeboard,host_timeboard

{
  "deleted_dashboards_from_list": [
    {
      "id": "q5j-nti-fv6",
      "type": "host_timeboard"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

// Delete custom screenboard dashboard from an existing dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	// there is a valid "screenboard_dashboard" in the system
	ScreenboardDashboardID := os.Getenv("SCREENBOARD_DASHBOARD_ID")

	body := datadogV2.DashboardListDeleteItemsRequest{
		Dashboards: []datadogV2.DashboardListItemRequest{
			{
				Id:   ScreenboardDashboardID,
				Type: datadogV2.DASHBOARDTYPE_CUSTOM_SCREENBOARD,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDashboardListsApi(apiClient)
	resp, r, err := api.DeleteDashboardListItems(ctx, DashboardListID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.DeleteDashboardListItems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.DeleteDashboardListItems`:\n%s\n", responseContent)
}
// Delete custom timeboard dashboard from an existing dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	// there is a valid "dashboard" in the system
	DashboardID := os.Getenv("DASHBOARD_ID")

	body := datadogV2.DashboardListDeleteItemsRequest{
		Dashboards: []datadogV2.DashboardListItemRequest{
			{
				Id:   DashboardID,
				Type: datadogV2.DASHBOARDTYPE_CUSTOM_TIMEBOARD,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDashboardListsApi(apiClient)
	resp, r, err := api.DeleteDashboardListItems(ctx, DashboardListID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.DeleteDashboardListItems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.DeleteDashboardListItems`:\n%s\n", responseContent)
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"

PUT https://api.ap1.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.datadoghq.eu/api/v1/dashboard/lists/manual/{list_id}https://api.ddog-gov.com/api/v1/dashboard/lists/manual/{list_id}https://api.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.us3.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.us5.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}

Información general

Actualiza el nombre de una lista de dashboards. 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

list_id [required]

integer

ID of the dashboard list to update.

Solicitud

Body Data (required)

Actualiza el cuerpo de una solicitud de lista de dashboards.

Expand All

Campo

Tipo

Descripción

author

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard list.

dashboard_count

int64

The number of dashboards in the list.

id

int64

The ID of the dashboard list.

is_favorite

boolean

Whether or not the list is in the favorites.

modified

date-time

Date of last edition of the dashboard list.

name [required]

string

The name of the dashboard list.

type

string

The type of dashboard list.

{
  "name": "updated Example-Dashboard-List"
}

Respuesta

OK

Your Datadog Dashboards.

Expand All

Campo

Tipo

Descripción

author

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

created

date-time

Date of creation of the dashboard list.

dashboard_count

int64

The number of dashboards in the list.

id

int64

The ID of the dashboard list.

is_favorite

boolean

Whether or not the list is in the favorites.

modified

date-time

Date of last edition of the dashboard list.

name [required]

string

The name of the dashboard list.

type

string

The type of dashboard list.

{
  "author": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "created": "2019-09-19T10:00:00.000Z",
  "dashboard_count": "integer",
  "id": "integer",
  "is_favorite": false,
  "modified": "2019-09-19T10:00:00.000Z",
  "name": "My Dashboard",
  "type": "manual_dashboard_list"
}

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

// Update a dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	body := datadogV1.DashboardList{
		Name: "updated Example-Dashboard-List",
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewDashboardListsApi(apiClient)
	resp, r, err := api.UpdateDashboardList(ctx, DashboardListID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.UpdateDashboardList`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.UpdateDashboardList`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"

DELETE https://api.ap1.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.datadoghq.eu/api/v1/dashboard/lists/manual/{list_id}https://api.ddog-gov.com/api/v1/dashboard/lists/manual/{list_id}https://api.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.us3.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}https://api.us5.datadoghq.com/api/v1/dashboard/lists/manual/{list_id}

Información general

Elimina una lista de dashboards. 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

list_id [required]

integer

ID of the dashboard list to delete.

Respuesta

OK

Deleted dashboard details.

Expand All

Campo

Tipo

Descripción

deleted_dashboard_list_id

int64

ID of the deleted dashboard list.

{
  "deleted_dashboard_list_id": "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

// Delete a dashboard list returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	// there is a valid "dashboard_list" in the system
	DashboardListID, _ := strconv.ParseInt(os.Getenv("DASHBOARD_LIST_ID"), 10, 64)

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewDashboardListsApi(apiClient)
	resp, r, err := api.DeleteDashboardList(ctx, DashboardListID)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DashboardListsApi.DeleteDashboardList`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DashboardListsApi.DeleteDashboardList`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"