- 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.
ListClustersV2Command
Returns a list of all the MSK clusters in the current Region.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { KafkaClient, ListClustersV2Command } from "@aws-sdk/client-kafka"; // ES Modules import
// const { KafkaClient, ListClustersV2Command } = require("@aws-sdk/client-kafka"); // CommonJS import
const client = new KafkaClient(config);
const input = { // ListClustersV2Request
ClusterNameFilter: "STRING_VALUE",
ClusterTypeFilter: "STRING_VALUE",
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new ListClustersV2Command(input);
const response = await client.send(command);
// { // ListClustersV2Response
// ClusterInfoList: [ // __listOfCluster
// { // Cluster
// ActiveOperationArn: "STRING_VALUE",
// ClusterType: "PROVISIONED" || "SERVERLESS",
// ClusterArn: "STRING_VALUE",
// ClusterName: "STRING_VALUE",
// CreationTime: new Date("TIMESTAMP"),
// CurrentVersion: "STRING_VALUE",
// State: "ACTIVE" || "CREATING" || "DELETING" || "FAILED" || "HEALING" || "MAINTENANCE" || "REBOOTING_BROKER" || "UPDATING",
// StateInfo: { // StateInfo
// Code: "STRING_VALUE",
// Message: "STRING_VALUE",
// },
// Tags: { // __mapOf__string
// "<keys>": "STRING_VALUE",
// },
// Provisioned: { // Provisioned
// BrokerNodeGroupInfo: { // BrokerNodeGroupInfo
// BrokerAZDistribution: "DEFAULT",
// ClientSubnets: [ // __listOf__string // required
// "STRING_VALUE",
// ],
// InstanceType: "STRING_VALUE", // required
// SecurityGroups: [
// "STRING_VALUE",
// ],
// StorageInfo: { // StorageInfo
// EbsStorageInfo: { // EBSStorageInfo
// ProvisionedThroughput: { // ProvisionedThroughput
// Enabled: true || false,
// VolumeThroughput: Number("int"),
// },
// VolumeSize: Number("int"),
// },
// },
// ConnectivityInfo: { // ConnectivityInfo
// PublicAccess: { // PublicAccess
// Type: "STRING_VALUE",
// },
// VpcConnectivity: { // VpcConnectivity
// ClientAuthentication: { // VpcConnectivityClientAuthentication
// Sasl: { // VpcConnectivitySasl
// Scram: { // VpcConnectivityScram
// Enabled: true || false,
// },
// Iam: { // VpcConnectivityIam
// Enabled: true || false,
// },
// },
// Tls: { // VpcConnectivityTls
// Enabled: true || false,
// },
// },
// },
// },
// ZoneIds: [
// "STRING_VALUE",
// ],
// },
// CurrentBrokerSoftwareInfo: { // BrokerSoftwareInfo
// ConfigurationArn: "STRING_VALUE",
// ConfigurationRevision: Number("long"),
// KafkaVersion: "STRING_VALUE",
// },
// ClientAuthentication: { // ClientAuthentication
// Sasl: { // Sasl
// Scram: { // Scram
// Enabled: true || false,
// },
// Iam: { // Iam
// Enabled: true || false,
// },
// },
// Tls: { // Tls
// CertificateAuthorityArnList: [
// "STRING_VALUE",
// ],
// Enabled: true || false,
// },
// Unauthenticated: { // Unauthenticated
// Enabled: true || false,
// },
// },
// EncryptionInfo: { // EncryptionInfo
// EncryptionAtRest: { // EncryptionAtRest
// DataVolumeKMSKeyId: "STRING_VALUE", // required
// },
// EncryptionInTransit: { // EncryptionInTransit
// ClientBroker: "TLS" || "TLS_PLAINTEXT" || "PLAINTEXT",
// InCluster: true || false,
// },
// },
// EnhancedMonitoring: "DEFAULT" || "PER_BROKER" || "PER_TOPIC_PER_BROKER" || "PER_TOPIC_PER_PARTITION",
// OpenMonitoring: { // OpenMonitoringInfo
// Prometheus: { // PrometheusInfo
// JmxExporter: { // JmxExporterInfo
// EnabledInBroker: true || false, // required
// },
// NodeExporter: { // NodeExporterInfo
// EnabledInBroker: true || false, // required
// },
// },
// },
// LoggingInfo: { // LoggingInfo
// BrokerLogs: { // BrokerLogs
// CloudWatchLogs: { // CloudWatchLogs
// Enabled: true || false, // required
// LogGroup: "STRING_VALUE",
// },
// Firehose: { // Firehose
// DeliveryStream: "STRING_VALUE",
// Enabled: true || false, // required
// },
// S3: { // S3
// Bucket: "STRING_VALUE",
// Enabled: true || false, // required
// Prefix: "STRING_VALUE",
// },
// },
// },
// NumberOfBrokerNodes: Number("int"), // required
// ZookeeperConnectString: "STRING_VALUE",
// ZookeeperConnectStringTls: "STRING_VALUE",
// StorageMode: "LOCAL" || "TIERED",
// CustomerActionStatus: "CRITICAL_ACTION_REQUIRED" || "ACTION_RECOMMENDED" || "NONE",
// },
// Serverless: { // Serverless
// VpcConfigs: [ // __listOfVpcConfig // required
// { // VpcConfig
// SubnetIds: [ // required
// "STRING_VALUE",
// ],
// SecurityGroupIds: "<__listOf__string>",
// },
// ],
// ClientAuthentication: { // ServerlessClientAuthentication
// Sasl: { // ServerlessSasl
// Iam: {
// Enabled: true || false,
// },
// },
// },
// },
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListClustersV2Command Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ClusterNameFilter | string | undefined | Specify a prefix of the names of the clusters that you want to list. The service lists all the clusters whose names start with this prefix. |
ClusterTypeFilter | string | undefined | Specify either PROVISIONED or SERVERLESS. |
MaxResults | number | undefined | The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter. |
NextToken | string | undefined | The paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request. |
ListClustersV2Command Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ClusterInfoList | Cluster[] | undefined | Information on each of the MSK clusters in the response. |
NextToken | string | undefined | The paginated results marker. When the result of a ListClusters operation is truncated, the call returns NextToken in the response. To get another batch of clusters, provide this token in your next request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | Returns information about an error. |
ForbiddenException | client | Returns information about an error. |
InternalServerErrorException | server | Returns information about an error. |
UnauthorizedException | client | Returns information about an error. |
KafkaServiceException | Base exception class for all service exceptions from Kafka service. |