ListMonitorsCommand

Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.

Example Syntax

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

import { InternetMonitorClient, ListMonitorsCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import
// const { InternetMonitorClient, ListMonitorsCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import
const client = new InternetMonitorClient(config);
const input = { // ListMonitorsInput
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
  MonitorStatus: "STRING_VALUE",
  IncludeLinkedAccounts: true || false,
};
const command = new ListMonitorsCommand(input);
const response = await client.send(command);
// { // ListMonitorsOutput
//   Monitors: [ // MonitorList // required
//     { // Monitor
//       MonitorName: "STRING_VALUE", // required
//       MonitorArn: "STRING_VALUE", // required
//       Status: "STRING_VALUE", // required
//       ProcessingStatus: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListMonitorsCommand Input

See ListMonitorsCommandInput for more details

Parameter
Type
Description
IncludeLinkedAccounts
boolean | undefined

A boolean option that you can set to TRUE to include monitors for linked accounts in a list of monitors, when you've set up cross-account sharing in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see Internet Monitor cross-account observability  in the Amazon CloudWatch Internet Monitor User Guide.

MaxResults
number | undefined

The number of monitor objects that you want to return with this call.

MonitorStatus
string | undefined

The status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself.

For information about the statuses for a monitor, see Monitor .

NextToken
string | undefined

The token for the next set of results. You receive this token from a previous call.

ListMonitorsCommand Output

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

A list of monitors.

NextToken
string | undefined

The token for the next set of results. You receive this token from a previous call.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have sufficient permission to perform this action.

InternalServerException
server

An internal error occurred.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

Invalid request.

InternetMonitorServiceException
Base exception class for all service exceptions from InternetMonitor service.