List clusters

Lists the clusters in the instance.

Code sample

C#

To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

To authenticate to Bigtable, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

// Lists clusters in the instance.
// Initialize request argument(s)
ListClustersRequest listClustersRequest = new ListClustersRequest
{
    ParentAsInstanceName = new InstanceName(projectId, instanceId)
};

try
{
    // Make a request.
    Console.WriteLine("Waiting for operation to complete...");
    ListClustersResponse response = bigtableInstanceAdminClient.ListClusters(listClustersRequest);
}
catch (Exception ex)
{
    Console.WriteLine($"Exception while requesting information about clusters in {instanceId} instance");
    Console.WriteLine(ex.Message);
}

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.