func main() {
	ctx, clientOption, err := getClientArgs(bigtable.ClusterAdminScope)
	if err != nil {
		log.Fatal(err)
		return
	}

	client, err := bigtable.NewClusterAdminClient(
		*ctx, ProjectID, *clientOption)

	// Delete a cluster.
	err = client.DeleteCluster(*ctx, Zone, ClusterID)
	if err != nil {
		log.Fatal(err)
		return
	}

	// Get the list of clusters.
	clusterInfo, err := client.Clusters(*ctx)
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println("Result of List Clusters:")
	for i := 0; i < len(clusterInfo); i++ {
		fmt.Printf("    %v\n", clusterInfo[i].Name)
	}
}
func main() {
	ctx, clientOption, err := getClientArgs(bigtable.ClusterAdminScope)
	if err != nil {
		log.Fatal(err)
		return
	}

	client, err := bigtable.NewClusterAdminClient(
		*ctx, ProjectID, *clientOption)
	if err != nil {
		log.Fatal(err)
		return
	}

	zones, err := client.ListZones(*ctx)
	if err != nil {
		log.Fatal(err)
		return
	}
	for i := 0; i < len(zones); i++ {
		fmt.Printf("Zone %d\n", i)
		fmt.Println("===========================================================")
		fmt.Printf("       Name: %v\n", zones[i].Name)
		fmt.Printf("DisplayName: %v\n", zones[i].DisplayName)
		fmt.Printf("     Status: %v\n", zones[i].Status)
	}
}
func main() {
	ctx, clientOption, err := getClientArgs(bigtable.ClusterAdminScope)
	if err != nil {
		log.Fatal(err)
		return
	}

	client, err := bigtable.NewClusterAdminClient(
		*ctx, ProjectID, *clientOption)

	// Update the cluster.
	cluster, err := client.UpdateCluster(
		*ctx, Zone, ClusterID, DisplayName+"Foo", ServeNodes)
	if err != nil {
		log.Fatal(err)
		return
	}
	clusterPretty, err := json.MarshalIndent(cluster, "", "  ")
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Printf("Cluster updated:\n%s\n\n", clusterPretty)

	// Get the list of clusters.
	clusterInfo, err := client.Clusters(*ctx)
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println("Result of List Clusters:")
	for i := 0; i < len(clusterInfo); i++ {
		fmt.Printf("    %v\n", clusterInfo[i].Name)
	}
}
func main() {
	ctx, clientOption, err := getClientArgs(bigtable.ClusterAdminScope)
	if err != nil {
		log.Fatal(err)
		return
	}

	client, err := bigtable.NewClusterAdminClient(
		*ctx, ProjectID, *clientOption)
	opsClient, err := bigtable.NewClusterAdminOperationsClient(
		*ctx, ProjectID, *clientOption)

	// Insert a new cluster.
	cluster, err := client.CreateCluster(*ctx, Zone, ClusterID, DisplayName, ServeNodes)
	if err != nil {
		log.Fatal(err)
		return
	}
	clusterPretty, err := json.MarshalIndent(cluster, "", "  ")
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Printf("Cluster created:\n%s\n\n", clusterPretty)

	// Get the progress of the long-running operation.
	opName := cluster.CurrentOperation.Name
	m := opNameRegexp.FindStringSubmatch(opName)
	opId := m[4]
	fmt.Printf("Op Name: %s, Op ID: %s\n\n", opName, opId)
	operation, err := opsClient.GetOperation(*ctx, Zone, ClusterID, opId)
	if err != nil {
		log.Fatal(err)
		return
	}
	opPretty, err := json.MarshalIndent(operation, "", "  ")
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Printf("Operation retrieved:\n%s\n\n", opPretty)

	createClusterMetadataBytes := operation.Metadata.Value
	metadata := &btcspb.CreateClusterMetadata{}
	err = proto.Unmarshal(createClusterMetadataBytes, metadata)
	if err != nil {
		log.Fatal(err)
		return
	}
	metadataPretty, err := json.MarshalIndent(metadata, "", "  ")
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Printf("Metadata:\n%s\n\n", metadataPretty)

	// Get the list of clusters.
	clusterInfo, err := client.Clusters(*ctx)
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println("Result of List Clusters:")
	for i := 0; i < len(clusterInfo); i++ {
		fmt.Printf("    %v\n", clusterInfo[i].Name)
	}
}