-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathDeleteDashboardListItems_3851624753.py
More file actions
32 lines (26 loc) · 1.18 KB
/
DeleteDashboardListItems_3851624753.py
File metadata and controls
32 lines (26 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi
from datadog_api_client.v2.model.dashboard_list_item_request import DashboardListItemRequest
from datadog_api_client.v2.model.dashboard_list_remove_items_request import DashboardListRemoveItemsRequest
from datadog_api_client.v2.model.dashboard_type import DashboardType
# there is a valid "dashboard_list" in the system
DASHBOARD_LIST_ID = environ["DASHBOARD_LIST_ID"]
# there is a valid "screenboard_dashboard" in the system
SCREENBOARD_DASHBOARD_ID = environ["SCREENBOARD_DASHBOARD_ID"]
body = DashboardListRemoveItemsRequest(
dashboards=[
DashboardListItemRequest(
id=SCREENBOARD_DASHBOARD_ID,
type=DashboardType.CUSTOM_SCREENBOARD,
),
],
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = DashboardListsApi(api_client)
response = api_instance.delete_dashboard_list_items(dashboard_list_id=int(DASHBOARD_LIST_ID), body=body)
print(response)