Get table metadata and apply the name view to table fields.

## Code sample

### C++


To learn how to install and use the client library for Bigtable, see
[Bigtable client libraries](https://docs.cloud.google.com/bigtable/docs/reference/libraries).


To authenticate to Bigtable, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment).

    namespace cbt = ::google::cloud::bigtable;
    namespace cbta = ::google::cloud::bigtable_admin;
    using ::google::cloud::StatusOr;
    [](cbta::BigtableTableAdminClient admin, std::string const& project_id,
       std::string const& instance_id, std::string const& table_id) {
      std::string table_name = cbt::TableName(project_id, instance_id, table_id);

      google::bigtable::admin::v2::GetTableRequest r;
      r.set_name(table_name);
      r.set_view(google::bigtable::admin::v2::Table::FULL);

      StatusOr<google::bigtable::admin::v2::Table> table =
          admin.GetTable(std::move(r));
      if (!table) throw std::move(table).status();
      std::cout << table->name() << " details=\n" << table->DebugString() << "\n";
    }

### Java


To learn how to install and use the client library for Bigtable, see
[Bigtable client libraries](https://docs.cloud.google.com/bigtable/docs/reference/libraries).


To authenticate to Bigtable, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment).

    // Gets table metadata, and applies a view to the table fields.
    try {
      String tableName =
          "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId;
      Table table = adminClient.getTable(tableName);
      System.out.println("Table: " + table.getName());
      for (Map.Entry<String, ColumnFamily> entry : table.getColumnFamiliesMap().entrySet()) {
        System.out.printf(
            "Column family: %s%nGC Rule: %s%n", entry.getKey(), entry.getValue().getGcRule());
      }
    } catch (NotFoundException e) {
      System.err.println(
          "Failed to retrieve table metadata for a non-existent table: " + e.getMessage());
    }

### Ruby


To learn how to install and use the client library for Bigtable, see
[Bigtable client libraries](https://docs.cloud.google.com/bigtable/docs/reference/libraries).


To authenticate to Bigtable, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment).

    # instance_id = "my-instance"
    # table_id    = "my-table"
    table = bigtable.table(
      instance_id,
      table_id,
      view:           :FULL,
      perform_lookup: true
    )
    puts "Cluster states:"
    table.cluster_states.each do |stats|
      p stats
    end

## What's next


To search and filter code samples for other Google Cloud products, see the
[Google Cloud sample browser](https://docs.cloud.google.com/docs/samples?product=bigtable).