ListDashboardsCommand

Returns a list of the dashboards for your account. If you include DashboardNamePrefix, only those dashboards with names starting with the prefix are listed. Otherwise, all dashboards in your account are listed.

ListDashboards returns up to 1000 results on one page. If there are more than 1000 dashboards, you can call ListDashboards again and include the value you received for NextToken in the first call, to receive the next 1000 results.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CloudWatchClient, ListDashboardsCommand } from "@aws-sdk/client-cloudwatch"; // ES Modules import
// const { CloudWatchClient, ListDashboardsCommand } = require("@aws-sdk/client-cloudwatch"); // CommonJS import
const client = new CloudWatchClient(config);
const input = { // ListDashboardsInput
  DashboardNamePrefix: "STRING_VALUE",
  NextToken: "STRING_VALUE",
};
const command = new ListDashboardsCommand(input);
const response = await client.send(command);
// { // ListDashboardsOutput
//   DashboardEntries: [ // DashboardEntries
//     { // DashboardEntry
//       DashboardName: "STRING_VALUE",
//       DashboardArn: "STRING_VALUE",
//       LastModified: new Date("TIMESTAMP"),
//       Size: Number("long"),
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListDashboardsCommand Input

See ListDashboardsCommandInput for more details

Parameter
Type
Description
DashboardNamePrefix
string | undefined

If you specify this parameter, only the dashboards with names starting with the specified string are listed. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, ".", "-", and "_".

NextToken
string | undefined

The token returned by a previous call to indicate that there is more data available.

ListDashboardsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DashboardEntries
DashboardEntry[] | undefined

The list of matching dashboards.

NextToken
string | undefined

The token that marks the start of the next batch of returned results.

Throws

Name
Fault
Details
InternalServiceFault
server

Request processing has failed due to some unknown error, exception, or failure.

InvalidParameterValueException
client

The value of an input parameter is bad or out-of-range.

CloudWatchServiceException
Base exception class for all service exceptions from CloudWatch service.