ダッシュボードリスト
Incident Management が一般に使用できるようになりました。 Incident Management が広範に使用できるようになりました。

ダッシュボードリスト

API を介してすべてのダッシュボードを簡単に整理、検索、およびチームや組織と共有できます。なお、API v2 で作成したダッシュボードリストに API v1 ダッシュボードを追加することが可能です。

ダッシュボードリストへの項目の追加

POST https://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

概要

既存のダッシュボードリストにダッシュボードを追加します。

引数

パスパラメーター

名前

種類

説明

dashboard_list_id [required]

integer

ID of the dashboard list to add items to.

リクエスト

Body Data (required)

ダッシュボードリストに追加するダッシュボード。

Expand All

フィールド

種類

説明

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": "q5j-nti-fv6",
      "type": "string"
    }
  ]
}

応答

OK

Response containing a list of added dashboards.

Expand All

フィールド

種類

説明

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

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例


                                        # Path parameters
export dashboard_list_id="CHANGE_ME"
# Curl command curl -X POST "https://api.datadoghq.eu"https://api.datadoghq.com/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF { "dashboards": [ { "id": "q5j-nti-fv6", "type": null } ] } EOF
package main

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

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    dashboardListId := int64(789) // int64 | ID of the dashboard list to add items to.
    body := *datadog.NewDashboardListAddItemsRequest() // DashboardListAddItemsRequest | Dashboards to add to the dashboard list.

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.DashboardListsApi.CreateDashboardListItems(ctx, dashboardListId).Body(body).Execute()
    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)
    }
    // response from `CreateDashboardListItems`: DashboardListAddItemsResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardListsApi.CreateDashboardListItems:\n%s\n", response_content)
}
// Import classes:
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.auth.*;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.DashboardListsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        DashboardListsApi apiInstance = new DashboardListsApi(defaultClient);
        Long dashboardListId = 56L; // Long | ID of the dashboard list to add items to.
        DashboardListAddItemsRequest body = new DashboardListAddItemsRequest(); // DashboardListAddItemsRequest | Dashboards to add to the dashboard list.
        try {
            DashboardListAddItemsResponse result = apiInstance.createDashboardListItems(dashboardListId)
                .body(body)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardListsApi#createDashboardListItems");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}
from datadog import initialize, api

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

initialize(**options)

list_id = 4741
dashboards = [
    {
        'type': 'custom_screenboard',
        'id': 'rys-xwq-geh'
    },
    {
        'type': 'custom_timeboard',
        'id': 'qts-q2k-yq6'
    },
    {
        'type': 'integration_screenboard',
        'id': '87'
    },
    {
        'type': 'integration_timeboard',
        'id': '23'
    },
    {
        'type': 'host_timeboard',
        'id': '3245468'
    }
]

api.DashboardList.v2.add_items(list_id, dashboards=dashboards)
import os
from dateutil.parser import parse as dateutil_parser
import datadog_api_client.v2
from datadog_api_client.v2.api import dashboard_lists_api
from datadog_api_client.v2.models import *
from pprint import pprint
# Defining the host is optional and defaults to https://api.datadoghq.com
# See configuration.py for a list of all supported configuration parameters.
configuration = datadog_api_client.v2.Configuration(
    host = "https://api.datadoghq.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer'

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['appKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with datadog_api_client.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboard_lists_api.DashboardListsApi(api_client)
    dashboard_list_id = 1 # int | ID of the dashboard list to add items to.
    body = DashboardListAddItemsRequest(
        dashboards=[
            DashboardListItemRequest(
                id="q5j-nti-fv6",
                type=DashboardType("custom_timeboard"),
            ),
        ],
    ) # DashboardListAddItemsRequest | Dashboards to add to the dashboard list.

    # example passing only required values which don't have defaults set
    try:
        # Add Items to a Dashboard List
        api_response = api_instance.create_dashboard_list_items(dashboard_list_id, body)
        pprint(api_response)
    except datadog_api_client.v2.ApiException as e:
        print("Exception when calling DashboardListsApi->create_dashboard_list_items: %s\n" % e)
require 'rubygems'
require 'dogapi'

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

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

list_id = 4741
dashboards = [
    {
        "type" => "custom_screenboard",
        "id" => "rys-xwq-geh"
    },
    {
        "type" => "custom_timeboard",
        "id" => "qts-q2k-yq6"
    },
    {
        "type" => "integration_screenboard",
        "id" => "87"
    },
    {
        "type" => "integration_timeboard",
        "id" => "23"
    },
    {
        "type" => "host_timeboard",
        "id" => "3245468"
    }
]

result = dog.v2.add_items_to_dashboard_list(list_id, dashboards)
require 'time'
require 'datadog_api_client/v2'
# setup authorization
DatadogAPIClient::V2.configure do |config|
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKeyAuth'] = 'Bearer'

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['appKeyAuth'] = 'Bearer'
end

api_instance = DatadogAPIClient::V2::DashboardListsApi.new
dashboard_list_id = 789 # Integer | ID of the dashboard list to add items to.
body = DatadogAPIClient::V2::DashboardListAddItemsRequest.new # DashboardListAddItemsRequest | Dashboards to add to the dashboard list.

begin
  # Add Items to a Dashboard List
  result = api_instance.create_dashboard_list_items(dashboard_list_id, body)
  p result
rescue DatadogAPIClient::V2::ApiError => e
  puts "Error when calling DashboardListsApi->create_dashboard_list_items: #{e}"
end

ダッシュボードリストからアイテムを削除する

DELETE https://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

概要

既存のダッシュボードリストからダッシュボードを削除します。

引数

パスパラメーター

名前

種類

説明

dashboard_list_id [required]

integer

ID of the dashboard list to delete items from.

リクエスト

Body Data (required)

ダッシュボードリストから削除するダッシュボード。

Expand All

フィールド

種類

説明

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": "q5j-nti-fv6",
      "type": "string"
    }
  ]
}

応答

OK

Response containing a list of deleted dashboards.

Expand All

フィールド

種類

説明

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

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例


                                        # Path parameters
export dashboard_list_id="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.datadoghq.com/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF { "dashboards": [ { "id": "q5j-nti-fv6", "type": null } ] } EOF
package main

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

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    dashboardListId := int64(789) // int64 | ID of the dashboard list to delete items from.
    body := *datadog.NewDashboardListDeleteItemsRequest() // DashboardListDeleteItemsRequest | Dashboards to delete from the dashboard list.

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.DashboardListsApi.DeleteDashboardListItems(ctx, dashboardListId).Body(body).Execute()
    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)
    }
    // response from `DeleteDashboardListItems`: DashboardListDeleteItemsResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardListsApi.DeleteDashboardListItems:\n%s\n", response_content)
}
// Import classes:
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.auth.*;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.DashboardListsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        DashboardListsApi apiInstance = new DashboardListsApi(defaultClient);
        Long dashboardListId = 56L; // Long | ID of the dashboard list to delete items from.
        DashboardListDeleteItemsRequest body = new DashboardListDeleteItemsRequest(); // DashboardListDeleteItemsRequest | Dashboards to delete from the dashboard list.
        try {
            DashboardListDeleteItemsResponse result = apiInstance.deleteDashboardListItems(dashboardListId)
                .body(body)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardListsApi#deleteDashboardListItems");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}
from datadog import initialize, api

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

initialize(**options)

list_id = 4741
dashboards = [
    {
        'type': 'custom_screenboard',
        'id': 'rys-xwq-geh'
    },
    {
        'type': 'custom_timeboard',
        'id': 'qts-q2k-yq6'
    },
    {
        'type': 'integration_screenboard',
        'id': '87'
    },
    {
        'type': 'integration_timeboard',
        'id': '23'
    },
    {
        'type': 'host_timeboard',
        'id': '3245468'
    }
]

api.DashboardList.v2.delete_items(list_id, dashboards=dashboards)
import os
from dateutil.parser import parse as dateutil_parser
import datadog_api_client.v2
from datadog_api_client.v2.api import dashboard_lists_api
from datadog_api_client.v2.models import *
from pprint import pprint
# Defining the host is optional and defaults to https://api.datadoghq.com
# See configuration.py for a list of all supported configuration parameters.
configuration = datadog_api_client.v2.Configuration(
    host = "https://api.datadoghq.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer'

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['appKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with datadog_api_client.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboard_lists_api.DashboardListsApi(api_client)
    dashboard_list_id = 1 # int | ID of the dashboard list to delete items from.
    body = DashboardListDeleteItemsRequest(
        dashboards=[
            DashboardListItemRequest(
                id="q5j-nti-fv6",
                type=DashboardType("custom_timeboard"),
            ),
        ],
    ) # DashboardListDeleteItemsRequest | Dashboards to delete from the dashboard list.

    # example passing only required values which don't have defaults set
    try:
        # Delete items from a dashboard list
        api_response = api_instance.delete_dashboard_list_items(dashboard_list_id, body)
        pprint(api_response)
    except datadog_api_client.v2.ApiException as e:
        print("Exception when calling DashboardListsApi->delete_dashboard_list_items: %s\n" % e)
require 'rubygems'
require 'dogapi'

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

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

list_id = 4741
dashboards = [
    {
        "type" => "custom_screenboard",
        "id" => "rys-xwq-geh"
    },
    {
        "type" => "custom_timeboard",
        "id" => "qts-q2k-yq6"
    },
    {
        "type" => "integration_screenboard",
        "id" => "87"
    },
    {
        "type" => "integration_timeboard",
        "id" => "23"
    },
    {
        "type" => "host_timeboard",
        "id" => "3245468"
    }
]

result = dog.v2.delete_items_from_dashboard_list(list_id, dashboards)
require 'time'
require 'datadog_api_client/v2'
# setup authorization
DatadogAPIClient::V2.configure do |config|
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKeyAuth'] = 'Bearer'

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['appKeyAuth'] = 'Bearer'
end

api_instance = DatadogAPIClient::V2::DashboardListsApi.new
dashboard_list_id = 789 # Integer | ID of the dashboard list to delete items from.
body = DatadogAPIClient::V2::DashboardListDeleteItemsRequest.new # DashboardListDeleteItemsRequest | Dashboards to delete from the dashboard list.

begin
  # Delete items from a dashboard list
  result = api_instance.delete_dashboard_list_items(dashboard_list_id, body)
  p result
rescue DatadogAPIClient::V2::ApiError => e
  puts "Error when calling DashboardListsApi->delete_dashboard_list_items: #{e}"
end

ダッシュボードリストの取得

GET https://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

概要

ダッシュボードリストのダッシュボード定義を取得します。

引数

パスパラメーター

名前

種類

説明

dashboard_list_id [required]

integer

ID of the dashboard list to get items from.

応答

OK

Dashboards within a list.

Expand All

フィールド

種類

説明

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.

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.

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",
      "is_favorite": false,
      "is_read_only": false,
      "is_shared": false,
      "modified": "2019-09-19T10:00:00.000Z",
      "popularity": "integer",
      "title": "string",
      "type": "string",
      "url": "string"
    }
  ],
  "total": "integer"
}

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例


                                        # Path parameters
export dashboard_list_id="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
package main

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

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    dashboardListId := int64(789) // int64 | ID of the dashboard list to get items from.

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.DashboardListsApi.GetDashboardListItems(ctx, dashboardListId).Execute()
    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)
    }
    // response from `GetDashboardListItems`: DashboardListItems
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardListsApi.GetDashboardListItems:\n%s\n", response_content)
}
// Import classes:
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.auth.*;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.DashboardListsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        DashboardListsApi apiInstance = new DashboardListsApi(defaultClient);
        Long dashboardListId = 56L; // Long | ID of the dashboard list to get items from.
        try {
            DashboardListItems result = apiInstance.getDashboardListItems(dashboardListId)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardListsApi#getDashboardListItems");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}
from datadog import initialize, api

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

initialize(**options)

api.DashboardList.v2.get_items(4741)
import os
from dateutil.parser import parse as dateutil_parser
import datadog_api_client.v2
from datadog_api_client.v2.api import dashboard_lists_api
from datadog_api_client.v2.models import *
from pprint import pprint
# Defining the host is optional and defaults to https://api.datadoghq.com
# See configuration.py for a list of all supported configuration parameters.
configuration = datadog_api_client.v2.Configuration(
    host = "https://api.datadoghq.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer'

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['appKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with datadog_api_client.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboard_lists_api.DashboardListsApi(api_client)
    dashboard_list_id = 1 # int | ID of the dashboard list to get items from.

    # example passing only required values which don't have defaults set
    try:
        # Get a Dashboard List
        api_response = api_instance.get_dashboard_list_items(dashboard_list_id)
        pprint(api_response)
    except datadog_api_client.v2.ApiException as e:
        print("Exception when calling DashboardListsApi->get_dashboard_list_items: %s\n" % e)
require 'rubygems'
require 'dogapi'

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

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

result = dog.v2.get_items_of_dashboard_list(4741)
require 'time'
require 'datadog_api_client/v2'
# setup authorization
DatadogAPIClient::V2.configure do |config|
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKeyAuth'] = 'Bearer'

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['appKeyAuth'] = 'Bearer'
end

api_instance = DatadogAPIClient::V2::DashboardListsApi.new
dashboard_list_id = 789 # Integer | ID of the dashboard list to get items from.

begin
  # Get a Dashboard List
  result = api_instance.get_dashboard_list_items(dashboard_list_id)
  p result
rescue DatadogAPIClient::V2::ApiError => e
  puts "Error when calling DashboardListsApi->get_dashboard_list_items: #{e}"
end

ダッシュボードリストのアイテムを更新する

PUT https://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards

概要

既存のダッシュボードリストのダッシュボードを更新します。

引数

パスパラメーター

名前

種類

説明

dashboard_list_id [required]

integer

ID of the dashboard list to update items from.

リクエスト

Body Data (required)

ダッシュボードリストの新しいダッシュボード。

Expand All

フィールド

種類

説明

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": "q5j-nti-fv6",
      "type": "string"
    }
  ]
}

応答

OK

Response containing a list of updated dashboards.

Expand All

フィールド

種類

説明

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

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例


                                        # Path parameters
export dashboard_list_id="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.eu"https://api.datadoghq.com/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF { "dashboards": [ { "id": "q5j-nti-fv6", "type": null } ] } EOF
package main

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

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    dashboardListId := int64(789) // int64 | ID of the dashboard list to update items from.
    body := *datadog.NewDashboardListUpdateItemsRequest() // DashboardListUpdateItemsRequest | New dashboards of the dashboard list.

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.DashboardListsApi.UpdateDashboardListItems(ctx, dashboardListId).Body(body).Execute()
    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)
    }
    // response from `UpdateDashboardListItems`: DashboardListUpdateItemsResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from DashboardListsApi.UpdateDashboardListItems:\n%s\n", response_content)
}
// Import classes:
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.auth.*;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.DashboardListsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        DashboardListsApi apiInstance = new DashboardListsApi(defaultClient);
        Long dashboardListId = 56L; // Long | ID of the dashboard list to update items from.
        DashboardListUpdateItemsRequest body = new DashboardListUpdateItemsRequest(); // DashboardListUpdateItemsRequest | New dashboards of the dashboard list.
        try {
            DashboardListUpdateItemsResponse result = apiInstance.updateDashboardListItems(dashboardListId)
                .body(body)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DashboardListsApi#updateDashboardListItems");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}
import os
from dateutil.parser import parse as dateutil_parser
import datadog_api_client.v2
from datadog_api_client.v2.api import dashboard_lists_api
from datadog_api_client.v2.models import *
from pprint import pprint
# Defining the host is optional and defaults to https://api.datadoghq.com
# See configuration.py for a list of all supported configuration parameters.
configuration = datadog_api_client.v2.Configuration(
    host = "https://api.datadoghq.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer'

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['appKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with datadog_api_client.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dashboard_lists_api.DashboardListsApi(api_client)
    dashboard_list_id = 1 # int | ID of the dashboard list to update items from.
    body = DashboardListUpdateItemsRequest(
        dashboards=[
            DashboardListItemRequest(
                id="q5j-nti-fv6",
                type=DashboardType("custom_timeboard"),
            ),
        ],
    ) # DashboardListUpdateItemsRequest | New dashboards of the dashboard list.

    # example passing only required values which don't have defaults set
    try:
        # Update items of a dashboard list
        api_response = api_instance.update_dashboard_list_items(dashboard_list_id, body)
        pprint(api_response)
    except datadog_api_client.v2.ApiException as e:
        print("Exception when calling DashboardListsApi->update_dashboard_list_items: %s\n" % e)
require 'time'
require 'datadog_api_client/v2'
# setup authorization
DatadogAPIClient::V2.configure do |config|
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKeyAuth'] = 'Bearer'

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['appKeyAuth'] = 'Bearer'
end

api_instance = DatadogAPIClient::V2::DashboardListsApi.new
dashboard_list_id = 789 # Integer | ID of the dashboard list to update items from.
body = DatadogAPIClient::V2::DashboardListUpdateItemsRequest.new # DashboardListUpdateItemsRequest | New dashboards of the dashboard list.

begin
  # Update items of a dashboard list
  result = api_instance.update_dashboard_list_items(dashboard_list_id, body)
  p result
rescue DatadogAPIClient::V2::ApiError => e
  puts "Error when calling DashboardListsApi->update_dashboard_list_items: #{e}"
end