대시보드 목록에서 항목 삭제
https://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}/dashboardshttps://api.datadoghq.eu/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ap1.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ap2.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.uk1.datadoghq.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.ddog-gov.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboardshttps://api.us2.ddog-gov.com/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards개요
기존 대시보드 목록에서 대시보드 삭제
인수
경로 파라미터
dashboard_list_id [required]ID of the dashboard list to delete items from.
요청
Body Data (required)
대시보드 목록에서 삭제할 대시보드.
dashboards삭제할 대시보드 목록을 포함한 요청.
id [required]ID of the dashboard.
type [required]The type of the dashboard.
custom_timeboard, custom_screenboard, integration_screenboard, integration_timeboard, host_timeboardDelete custom screenboard dashboard from an existing dashboard list returns "OK" response
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}응답
OK
Response containing a list of deleted dashboards.
deleted_dashboards_from_listList of dashboards deleted from the dashboard list.
id [required]ID of the dashboard.
type [required]The type of the dashboard.
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.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}코드 예시
Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_screenboard"
}
]
}
EOFDelete custom timeboard dashboard from an existing dashboard list returns "OK" response
# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOF# Path parameters
export dashboard_list_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/dashboard/lists/manual/${dashboard_list_id}/dashboards" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"dashboards": [
{
"id": "123-abc-456",
"type": "custom_timeboard"
}
]
}
EOFDelete custom screenboard dashboard from an existing dashboard list returns "OK" response
// 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())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
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
// 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())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
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.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
// Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DashboardListsApi;
import com.datadog.api.client.v2.model.DashboardListDeleteItemsRequest;
import com.datadog.api.client.v2.model.DashboardListDeleteItemsResponse;
import com.datadog.api.client.v2.model.DashboardListItemRequest;
import com.datadog.api.client.v2.model.DashboardType;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
DashboardListsApi apiInstance = new DashboardListsApi(defaultClient);
// there is a valid "dashboard_list" in the system
Long DASHBOARD_LIST_ID = Long.parseLong(System.getenv("DASHBOARD_LIST_ID"));
// there is a valid "screenboard_dashboard" in the system
String SCREENBOARD_DASHBOARD_ID = System.getenv("SCREENBOARD_DASHBOARD_ID");
DashboardListDeleteItemsRequest body =
new DashboardListDeleteItemsRequest()
.dashboards(
Collections.singletonList(
new DashboardListItemRequest()
.id(SCREENBOARD_DASHBOARD_ID)
.type(DashboardType.CUSTOM_SCREENBOARD)));
try {
DashboardListDeleteItemsResponse result =
apiInstance.deleteDashboardListItems(DASHBOARD_LIST_ID, body);
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();
}
}
}
Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
// Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DashboardListsApi;
import com.datadog.api.client.v2.model.DashboardListDeleteItemsRequest;
import com.datadog.api.client.v2.model.DashboardListDeleteItemsResponse;
import com.datadog.api.client.v2.model.DashboardListItemRequest;
import com.datadog.api.client.v2.model.DashboardType;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
DashboardListsApi apiInstance = new DashboardListsApi(defaultClient);
// there is a valid "dashboard_list" in the system
Long DASHBOARD_LIST_ID = Long.parseLong(System.getenv("DASHBOARD_LIST_ID"));
// there is a valid "dashboard" in the system
String DASHBOARD_ID = System.getenv("DASHBOARD_ID");
DashboardListDeleteItemsRequest body =
new DashboardListDeleteItemsRequest()
.dashboards(
Collections.singletonList(
new DashboardListItemRequest()
.id(DASHBOARD_ID)
.type(DashboardType.CUSTOM_TIMEBOARD)));
try {
DashboardListDeleteItemsResponse result =
apiInstance.deleteDashboardListItems(DASHBOARD_LIST_ID, body);
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();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
"""
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_delete_items_request import DashboardListDeleteItemsRequest
from datadog_api_client.v2.model.dashboard_list_item_request import DashboardListItemRequest
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 = DashboardListDeleteItemsRequest(
dashboards=[
DashboardListItemRequest(
id=SCREENBOARD_DASHBOARD_ID,
type=DashboardType.CUSTOM_SCREENBOARD,
),
],
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
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)
Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
"""
Delete custom timeboard 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_delete_items_request import DashboardListDeleteItemsRequest
from datadog_api_client.v2.model.dashboard_list_item_request import DashboardListItemRequest
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 "dashboard" in the system
DASHBOARD_ID = environ["DASHBOARD_ID"]
body = DashboardListDeleteItemsRequest(
dashboards=[
DashboardListItemRequest(
id=DASHBOARD_ID,
type=DashboardType.CUSTOM_TIMEBOARD,
),
],
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
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)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
# Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::DashboardListsAPI.new
# there is a valid "dashboard_list" in the system
DASHBOARD_LIST_ID = ENV["DASHBOARD_LIST_ID"]
# there is a valid "screenboard_dashboard" in the system
SCREENBOARD_DASHBOARD_ID = ENV["SCREENBOARD_DASHBOARD_ID"]
body = DatadogAPIClient::V2::DashboardListDeleteItemsRequest.new({
dashboards: [
DatadogAPIClient::V2::DashboardListItemRequest.new({
id: SCREENBOARD_DASHBOARD_ID,
type: DatadogAPIClient::V2::DashboardType::CUSTOM_SCREENBOARD,
}),
],
})
p api_instance.delete_dashboard_list_items(DASHBOARD_LIST_ID.to_i, body)
Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
# Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::DashboardListsAPI.new
# there is a valid "dashboard_list" in the system
DASHBOARD_LIST_ID = ENV["DASHBOARD_LIST_ID"]
# there is a valid "dashboard" in the system
DASHBOARD_ID = ENV["DASHBOARD_ID"]
body = DatadogAPIClient::V2::DashboardListDeleteItemsRequest.new({
dashboards: [
DatadogAPIClient::V2::DashboardListItemRequest.new({
id: DASHBOARD_ID,
type: DatadogAPIClient::V2::DashboardType::CUSTOM_TIMEBOARD,
}),
],
})
p api_instance.delete_dashboard_list_items(DASHBOARD_LIST_ID.to_i, body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
// Delete custom screenboard dashboard from an existing dashboard list returns
// "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI;
use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest;
use datadog_api_client::datadogV2::model::DashboardListItemRequest;
use datadog_api_client::datadogV2::model::DashboardType;
#[tokio::main]
async fn main() {
// there is a valid "dashboard_list" in the system
let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
// there is a valid "screenboard_dashboard" in the system
let screenboard_dashboard_id = std::env::var("SCREENBOARD_DASHBOARD_ID").unwrap();
let body =
DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
screenboard_dashboard_id.clone(),
DashboardType::CUSTOM_SCREENBOARD,
)]);
let configuration = datadog::Configuration::new();
let api = DashboardListsAPI::with_config(configuration);
let resp = api
.delete_dashboard_list_items(dashboard_list_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
// Delete custom timeboard dashboard from an existing dashboard list returns "OK"
// response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI;
use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest;
use datadog_api_client::datadogV2::model::DashboardListItemRequest;
use datadog_api_client::datadogV2::model::DashboardType;
#[tokio::main]
async fn main() {
// there is a valid "dashboard_list" in the system
let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
// there is a valid "dashboard" in the system
let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
let body =
DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
dashboard_id.clone(),
DashboardType::CUSTOM_TIMEBOARD,
)]);
let configuration = datadog::Configuration::new();
let api = DashboardListsAPI::with_config(configuration);
let resp = api
.delete_dashboard_list_items(dashboard_list_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDelete custom screenboard dashboard from an existing dashboard list returns "OK" response
/**
* Delete custom screenboard dashboard from an existing dashboard list returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.DashboardListsApi(configuration);
// there is a valid "dashboard_list" in the system
const DASHBOARD_LIST_ID = parseInt(process.env.DASHBOARD_LIST_ID as string);
// there is a valid "screenboard_dashboard" in the system
const SCREENBOARD_DASHBOARD_ID = process.env.SCREENBOARD_DASHBOARD_ID as string;
const params: v2.DashboardListsApiDeleteDashboardListItemsRequest = {
body: {
dashboards: [
{
id: SCREENBOARD_DASHBOARD_ID,
type: "custom_screenboard",
},
],
},
dashboardListId: DASHBOARD_LIST_ID,
};
apiInstance
.deleteDashboardListItems(params)
.then((data: v2.DashboardListDeleteItemsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
/**
* Delete custom timeboard dashboard from an existing dashboard list returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.DashboardListsApi(configuration);
// there is a valid "dashboard_list" in the system
const DASHBOARD_LIST_ID = parseInt(process.env.DASHBOARD_LIST_ID as string);
// there is a valid "dashboard" in the system
const DASHBOARD_ID = process.env.DASHBOARD_ID as string;
const params: v2.DashboardListsApiDeleteDashboardListItemsRequest = {
body: {
dashboards: [
{
id: DASHBOARD_ID,
type: "custom_timeboard",
},
],
},
dashboardListId: DASHBOARD_LIST_ID,
};
apiInstance
.deleteDashboardListItems(params)
.then((data: v2.DashboardListDeleteItemsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"