public void listClusters ( ) { System . out . println ( "\nListing Clusters" ) ; // [START bigtable_get_clusters] try { List < Cluster > clusters = adminClient . listClusters ( instanceId ) ; for ( Cluster cluster : clusters ) { System . out . println ( cluster . getId ( ) ) ; } } catch ( NotFoundException e ) { System . err . println ( "Failed to list clusters from a non-existent instance: " + e . getMessage ( ) ) ; } // [END bigtable_get_clusters] }
Demonstrates how to list clusters within an instance .