Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class ListClustersCommandProtected

Provides the status of all clusters visible to this Amazon Web Services account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters in unsorted order per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.

Example

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

import { EMRClient, ListClustersCommand } from "@aws-sdk/client-emr"; // ES Modules import
// const { EMRClient, ListClustersCommand } = require("@aws-sdk/client-emr"); // CommonJS import
const client = new EMRClient(config);
const input = { // ListClustersInput
CreatedAfter: new Date("TIMESTAMP"),
CreatedBefore: new Date("TIMESTAMP"),
ClusterStates: [ // ClusterStateList
"STARTING" || "BOOTSTRAPPING" || "RUNNING" || "WAITING" || "TERMINATING" || "TERMINATED" || "TERMINATED_WITH_ERRORS",
],
Marker: "STRING_VALUE",
};
const command = new ListClustersCommand(input);
const response = await client.send(command);
// { // ListClustersOutput
// Clusters: [ // ClusterSummaryList
// { // ClusterSummary
// Id: "STRING_VALUE",
// Name: "STRING_VALUE",
// Status: { // ClusterStatus
// State: "STARTING" || "BOOTSTRAPPING" || "RUNNING" || "WAITING" || "TERMINATING" || "TERMINATED" || "TERMINATED_WITH_ERRORS",
// StateChangeReason: { // ClusterStateChangeReason
// Code: "INTERNAL_ERROR" || "VALIDATION_ERROR" || "INSTANCE_FAILURE" || "INSTANCE_FLEET_TIMEOUT" || "BOOTSTRAP_FAILURE" || "USER_REQUEST" || "STEP_FAILURE" || "ALL_STEPS_COMPLETED",
// Message: "STRING_VALUE",
// },
// Timeline: { // ClusterTimeline
// CreationDateTime: new Date("TIMESTAMP"),
// ReadyDateTime: new Date("TIMESTAMP"),
// EndDateTime: new Date("TIMESTAMP"),
// },
// ErrorDetails: [ // ErrorDetailList
// { // ErrorDetail
// ErrorCode: "STRING_VALUE",
// ErrorData: [ // ErrorData
// { // StringMap
// "<keys>": "STRING_VALUE",
// },
// ],
// ErrorMessage: "STRING_VALUE",
// },
// ],
// },
// NormalizedInstanceHours: Number("int"),
// ClusterArn: "STRING_VALUE",
// OutpostArn: "STRING_VALUE",
// },
// ],
// Marker: "STRING_VALUE",
// };

Param

ListClustersCommandInput

Returns

ListClustersCommandOutput

See

Throws

InternalServerException (server fault)

This exception occurs when there is an internal failure in the Amazon EMR service.

Throws

InvalidRequestException (client fault)

This exception occurs when there is something wrong with user input.

Throws

EMRServiceException

Base exception class for all service exceptions from EMR service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods