- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
IncludeLinkedAccounts | boolean | undefined | A boolean option that you can set to |
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 |
---|
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 |
---|
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. |