列出集群

列出实例中的集群。

代码示例

C#

如需了解如何安装和使用 Bigtable 的客户端库,请参阅 Bigtable 客户端库

// 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);
}

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器