Get instance information
This page explains how to list all instances in a project and get instance detailsprogrammatically usingBigtable client libraries ormanually using theGoogle Cloud console, Google Cloud CLI, or cbt CLI:
List instances
To get a list of instances, do the following:
Console
Open the list of Bigtable instances in the Google Cloud console.
TheInstances page displays a list of instances.
gcloud
Use thebigtable instances list command to view a list of instances:
gcloud bigtable instances listcbt
Use thelistinstances command to view a list of instances:
cbt listinstancesC++
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
namespacecbta=::google::cloud::bigtable_admin;using::google::cloud::Project;using::google::cloud::StatusOr;[](cbta::BigtableInstanceAdminClientinstance_admin,std::stringconst&project_id){std::stringproject_name=Project(project_id).FullName();StatusOr<google::bigtable::admin::v2::ListInstancesResponse>instances=instance_admin.ListInstances(project_name);if(!instances)throwstd::move(instances).status();for(autoconst&instance:instances->instances()){std::cout <<instance.name() <<"\n";}if(!instances->failed_locations().empty()){std::cout <<"The Cloud Bigtable service reports that the following ""locations are temporarily unavailable and no information ""about instances in these locations can be obtained:\n";for(autoconst&failed_location:instances->failed_locations()){std::cout <<failed_location <<"\n";}}}C#
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
// Lists instances in the project.// Initialize request argument(s).ListInstancesRequestlistInstancesRequest=newListInstancesRequest{ParentAsProjectName=newProjectName(projectId)};try{// Make a request.Console.WriteLine("Waiting for operation to complete...");ListInstancesResponseinstances=bigtableInstanceAdminClient.ListInstances(listInstancesRequest);}catch(Exceptionex){Console.WriteLine($"Exception while requesting information about instances in {projectId} project");Console.WriteLine(ex.Message);return-1;}Console.WriteLine(newstring('-',50));Java
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
try{List<Instance>instances=adminClient.listInstances();for(Instanceinstance:instances){System.out.println(instance.getId());}}catch(PartialListInstancesExceptione){System.err.println("Failed to list instances: "+e.getMessage());System.err.println("The following zones are unavailable: "+e.getUnavailableZones());System.err.println("But the following instances are reachable: "+e.getInstances());}Node.js
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
const{BigtableInstanceAdminClient}=require('@google-cloud/bigtable').v2;constinstanceAdminClient=newBigtableInstanceAdminClient();constprojectId=awaitinstanceAdminClient.getProjectId();const[instances]=awaitinstanceAdminClient.listInstances({parent:`projects/${projectId}`,});instances.instances.forEach(instance=>{console.log(instance.name);});PHP
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
use Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient;use Google\Cloud\Bigtable\Admin\V2\ListInstancesRequest;/** * List Bigtable instances in a project * * @param string $projectId The Google Cloud project ID */function list_instance(string $projectId): void{ $instanceAdminClient = new BigtableInstanceAdminClient(); $projectName = $instanceAdminClient->projectName($projectId); printf('Listing Instances:' . PHP_EOL); $listInstancesRequest = (new ListInstancesRequest()) ->setParent($projectName); $getInstances = $instanceAdminClient->listInstances($listInstancesRequest)->getInstances(); $instances = $getInstances->getIterator(); foreach ($instances as $instance) { print($instance->getName() . PHP_EOL); }}Python
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
print("\nListing instances:")forinstance_localinclient.list_instances()[0]:print(instance_local.instance_id)Ruby
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
bigtable.instances.alldo|instance|puts"Instance:#{instance.instance_id}"endGet instance details
To get details about an instance, do the following:
Console
Open the list of Bigtable instances in the Google Cloud console.
Click the instance whose details you want to view.
TheInstance Overview page displays detailed information about the instance.
gcloud
Use thebigtable instances describe command to view details of an instance:
gcloud bigtable instances describeINSTANCE_IDReplace the following:
INSTANCE_ID: The permanent identifier for the instance.
cbt
Use thelistclusters command to view a view details of an instance:
cbt listclustersINSTANCE_IDReplace the following:
INSTANCE_ID: The permanent identifier for the instance.
C++
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
namespacecbt=::google::cloud::bigtable;namespacecbta=::google::cloud::bigtable_admin;using::google::cloud::StatusOr;[](cbta::BigtableInstanceAdminClientinstance_admin,std::stringconst&project_id,std::stringconst&instance_id){std::stringinstance_name=cbt::InstanceName(project_id,instance_id);StatusOr<google::bigtable::admin::v2::Instance>instance=instance_admin.GetInstance(instance_name);if(!instance)throwstd::move(instance).status();std::cout <<"GetInstance details : " <<instance->DebugString() <<"\n";}C#
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
// Initialize request argument(s).GetInstanceRequestrequest=newGetInstanceRequest{InstanceName=newInstanceName(projectId,instanceId)};try{// Make Request.Console.WriteLine("Waiting for operation to complete...");Instancerespond=bigtableInstanceAdminClient.GetInstance(request);}catch(Exceptionex){Console.WriteLine($"Exception retreiving {instanceId} instance");Console.WriteLine(ex.Message);}Java
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
Instanceinstance=null;try{instance=adminClient.getInstance(instanceId);System.out.println("Instance ID: "+instance.getId());System.out.println("Display Name: "+instance.getDisplayName());System.out.print("Labels: ");Map<String,String>labels=instance.getLabels();for(Stringkey:labels.keySet()){System.out.printf("%s - %s",key,labels.get(key));}System.out.println("\nState: "+instance.getState());System.out.println("Type: "+instance.getType());}catch(NotFoundExceptione){System.err.println("Failed to get non-existent instance: "+e.getMessage());}Node.js
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
const{BigtableInstanceAdminClient}=require('@google-cloud/bigtable').v2;constinstanceAdminClient=newBigtableInstanceAdminClient();constprojectId=awaitinstanceAdminClient.getProjectId();const[instance2]=awaitinstanceAdminClient.getInstance({name:`projects/${projectId}/instances/${instanceID}`,});console.log(`Instance ID:${instance2.name}`);console.log(`Instance Meta:${JSON.stringify(instance2.labels)}`);PHP
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
use Google\ApiCore\ApiException;use Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient;use Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest;use Google\Cloud\Bigtable\Admin\V2\Instance\State;use Google\Cloud\Bigtable\Admin\V2\Instance\Type;/** * Get a Bigtable instance * * @param string $projectId The Google Cloud project ID * @param string $instanceId The ID of the Bigtable instance */function get_instance( string $projectId, string $instanceId): void { $instanceAdminClient = new BigtableInstanceAdminClient(); $instanceName = $instanceAdminClient->instanceName($projectId, $instanceId); printf('Fetching the Instance %s' . PHP_EOL, $instanceId); try { $getInstanceRequest = (new GetInstanceRequest()) ->setName($instanceName); $instance = $instanceAdminClient->getInstance($getInstanceRequest); } catch (ApiException $e) { if ($e->getStatus() === 'NOT_FOUND') { printf('Instance %s does not exists.' . PHP_EOL, $instanceId); return; } throw $e; } printf('Printing Details:' . PHP_EOL); // Fetch some commonly used metadata printf('Name: ' . $instance->getName() . PHP_EOL); printf('Display Name: ' . $instance->getDisplayName() . PHP_EOL); printf('State: ' . State::name($instance->getState()) . PHP_EOL); printf('Type: ' . Type::name($instance->getType()) . PHP_EOL); printf('Labels: ' . PHP_EOL); $labels = $instance->getLabels(); // Labels are an object of the MapField class which implement the IteratorAggregate, Countable // and ArrayAccess interfaces so you can do the following: printf("\tNum of Labels: " . $labels->count() . PHP_EOL); printf("\tLabel with a key(dev-label): " . ($labels['dev-label'] ?? 'N/A') . PHP_EOL); // we can even loop over all the labels foreach ($labels as $key => $val) { printf("\t$key: $val" . PHP_EOL); }}Python
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
print("\nName of instance:{}\nLabels:{}".format(instance.display_name,instance.labels))Ruby
To learn how to install and use the client library for Bigtable, seeBigtable client libraries.
To authenticate to Bigtable, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
# instance_id = "my-instance"instance=bigtable.instanceinstance_idputs"Get Instance id:#{instance.instance_id}"What's next
- Find out how tomodify an instance.
- Learn how todelete an instance.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.