All URIs are relative to https://api.datadoghq.com
Method | HTTP request | Description |
---|---|---|
createDashboard | POST /api/v1/dashboard | Create a new dashboard |
deleteDashboard | DELETE /api/v1/dashboard/{dashboard_id} | Delete a dashboard |
deleteDashboards | DELETE /api/v1/dashboard | Delete dashboards |
getDashboard | GET /api/v1/dashboard/{dashboard_id} | Get a dashboard |
listDashboards | GET /api/v1/dashboard | Get all dashboards |
restoreDashboards | PATCH /api/v1/dashboard | Restore deleted dashboards |
updateDashboard | PUT /api/v1/dashboard/{dashboard_id} | Update a dashboard |
Dashboard createDashboard(body)
Create a dashboard using the specified options. When defining queries in your widgets, take note of which queries should have the as_count()
or as_rate()
modifiers appended.
Refer to the following documentation for more information on these modifiers.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiCreateDashboardRequest = {
// Dashboard | Create a dashboard request body.
body: {
description: "description_example",
isReadOnly: false,
layoutType: "ordered",
notifyList: ["notifyList_example"],
reflowType: "auto",
restrictedRoles: ["restrictedRoles_example"],
templateVariablePresets: [
{
name: "name_example",
templateVariables: [
{
name: "name_example",
value: "value_example",
},
],
},
],
templateVariables: [
{
availableValues: ["my-host", "host1", "host2"],
_default: "my-host",
name: "host1",
prefix: "host",
},
],
title: "",
widgets: [
{
definition: {
alertId: "",
time: {
liveSpan: "5m",
},
title: "title_example",
titleAlign: "center",
titleSize: "titleSize_example",
type: "alert_graph",
vizType: "timeseries",
},
id: 1,
layout: {
height: 0,
isColumnBreak: true,
width: 0,
x: 0,
y: 0,
},
},
],
},
};
apiInstance
.createDashboard(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
body | Dashboard | Create a dashboard request body. |
Dashboard
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DashboardDeleteResponse deleteDashboard()
Delete a dashboard using the specified ID.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiDeleteDashboardRequest = {
// string | The ID of the dashboard.
dashboardId: "dashboard_id_example",
};
apiInstance
.deleteDashboard(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
dashboardId | [string] | The ID of the dashboard. | defaults to undefined |
DashboardDeleteResponse
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
403 | Authentication Error | - |
404 | Dashboards Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void deleteDashboards(body)
Delete dashboards using the specified IDs. If there are any failures, no dashboards will be deleted (partial success is not allowed).
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiDeleteDashboardsRequest = {
// DashboardBulkDeleteRequest | Delete dashboards request body.
body: {
data: [
{
id: "123-abc-456",
type: "dashboard",
},
],
},
};
apiInstance
.deleteDashboards(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
body | DashboardBulkDeleteRequest | Delete dashboards request body. |
void
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad Request | - |
403 | Forbidden | - |
404 | Dashboards Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dashboard getDashboard()
Get a dashboard using the specified ID.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiGetDashboardRequest = {
// string | The ID of the dashboard.
dashboardId: "dashboard_id_example",
};
apiInstance
.getDashboard(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
dashboardId | [string] | The ID of the dashboard. | defaults to undefined |
Dashboard
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
403 | Authentication Error | - |
404 | Item Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DashboardSummary listDashboards()
Get all dashboards.
Note: This query will only return custom created or cloned dashboards. This query will not return preset dashboards.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiListDashboardsRequest = {
// boolean | When `true`, this query only returns shared custom created or cloned dashboards. (optional)
filterShared: true,
};
apiInstance
.listDashboards(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
filterShared | [boolean] | When `true`, this query only returns shared custom created or cloned dashboards. | (optional) defaults to undefined |
DashboardSummary
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
403 | Authentication Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void restoreDashboards(body)
Restore dashboards using the specified IDs. If there are any failures, no dashboards will be restored (partial success is not allowed).
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiRestoreDashboardsRequest = {
// DashboardRestoreRequest | Restore dashboards request body.
body: {
data: [
{
id: "123-abc-456",
type: "dashboard",
},
],
},
};
apiInstance
.restoreDashboards(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
body | DashboardRestoreRequest | Restore dashboards request body. |
void
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad Request | - |
403 | Forbidden | - |
404 | Dashboards Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dashboard updateDashboard(body)
Update a dashboard using the specified ID.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);
let params: v1.DashboardsApiUpdateDashboardRequest = {
// string | The ID of the dashboard.
dashboardId: "dashboard_id_example",
// Dashboard | Update Dashboard request body.
body: {
description: "description_example",
isReadOnly: false,
layoutType: "ordered",
notifyList: ["notifyList_example"],
reflowType: "auto",
restrictedRoles: ["restrictedRoles_example"],
templateVariablePresets: [
{
name: "name_example",
templateVariables: [
{
name: "name_example",
value: "value_example",
},
],
},
],
templateVariables: [
{
availableValues: ["my-host", "host1", "host2"],
_default: "my-host",
name: "host1",
prefix: "host",
},
],
title: "",
widgets: [
{
definition: {
alertId: "",
time: {
liveSpan: "5m",
},
title: "title_example",
titleAlign: "center",
titleSize: "titleSize_example",
type: "alert_graph",
vizType: "timeseries",
},
id: 1,
layout: {
height: 0,
isColumnBreak: true,
width: 0,
x: 0,
y: 0,
},
},
],
},
};
apiInstance
.updateDashboard(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
body | Dashboard | Update Dashboard request body. | |
dashboardId | [string] | The ID of the dashboard. | defaults to undefined |
Dashboard
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
404 | Item Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]