Search in sources :

Example 1 with ListShardsRequest

use of software.amazon.awssdk.services.kinesis.model.ListShardsRequest in project aws-doc-sdk-examples by awsdocs.

the class ListShards method listKinShards.

// snippet-start:[kinesis.java2.ListShards.main]
public static void listKinShards(KinesisClient kinesisClient, String name) {
    try {
        ListShardsRequest request = ListShardsRequest.builder().streamName(name).build();
        ListShardsResponse response = kinesisClient.listShards(request);
        System.out.println(request.streamName() + " has " + response.shards());
    } catch (KinesisException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
    System.out.println("Done");
}
Also used : ListShardsRequest(software.amazon.awssdk.services.kinesis.model.ListShardsRequest) ListShardsResponse(software.amazon.awssdk.services.kinesis.model.ListShardsResponse) KinesisException(software.amazon.awssdk.services.kinesis.model.KinesisException)

Aggregations

KinesisException (software.amazon.awssdk.services.kinesis.model.KinesisException)1 ListShardsRequest (software.amazon.awssdk.services.kinesis.model.ListShardsRequest)1 ListShardsResponse (software.amazon.awssdk.services.kinesis.model.ListShardsResponse)1