cbt Reference

Cbt is a tool for doing basic interactions with Cloud Bigtable.

Usage:

cbt [options] command [arguments]

The commands are:

count                     Count rows in a table
createinstance            Create an instance with an initial cluster
createcluster             Create a cluster in the configured instance
createfamily              Create a column family
createtable               Create a table
updatecluster             Update a cluster in the configured instance
deleteinstance            Delete an instance
deletecluster             Delete a cluster from the configured instance
deletecolumn              Delete all cells in a column
deletefamily              Delete a column family
deleterow                 Delete a row
deletetable               Delete a table
doc                       Print godoc-suitable documentation for cbt
help                      Print help text
listinstances             List instances in a project
listclusters              List clusters in an instance
lookup                    Read from a single row
ls                        List tables and column families
mddoc                     Print documentation for cbt in Markdown format
read                      Read rows
set                       Set value of a cell
setgcpolicy               Set the GC policy for a column family
waitforreplication        Block until all the completed writes have been replicated to all the clusters
version                   Print the current cbt version

Use "cbt help " for more information about a command.

The options are:

-project string
    project ID, if unset uses gcloud configured project
-instance string
    Cloud Bigtable instance
-creds string
    if set, use application credentials in this file

For convenience, values of the -project, -instance, -creds, -admin-endpoint and -data-endpoint flags may be specified in ~/.cbtrc in this format: project = my-project-123 instance = my-instance creds = path-to-account-key.json admin-endpoint = hostname:port data-endpoint = hostname:port All values are optional, and all will be overridden by flags.

Count rows in a table

cbt count <table>

Create an instance with an initial cluster

cbt createinstance <instance-id> <display-name> <cluster-id> <zone> <num-nodes> <storage type>
  instance-id                   Permanent, unique id for the instance
  display-name              Description of the instance
  cluster-id                        Permanent, unique id for the cluster in the instance
  zone                              The zone in which to create the cluster
  num-nodes                 The number of nodes to create
  storage-type                  SSD or HDD

Create a cluster in the configured instance

cbt createcluster <cluster-id> <zone> <num-nodes> <storage type>
  cluster-id        Permanent, unique id for the cluster in the instance
  zone                The zone in which to create the cluster
  num-nodes   The number of nodes to create
  storage-type  SSD or HDD

Create a column family

cbt createfamily <table> <family>

Create a table

cbt createtable <table>
  families: Column families and their associated GC policies. See "setgcpolicy".
                     Example: families=family1:maxage=1w,family2:maxversions=1
  splits:   Row key to be used to initially split the table

Update a cluster in the configured instance

cbt updatecluster <cluster-id> [num-nodes=num-nodes]
  cluster-id        Permanent, unique id for the cluster in the instance
  num-nodes     The number of nodes to update to

Deletes an instance

cbt deleteinstance <instance>

Deletes a cluster from the configured instance

cbt deletecluster <cluster>

Delete all cells in a column

cbt deletecolumn <table> <row> <family> <column> [app-profile=<app profile id>]
  app-profile=<app profile id>      The app profile id to use for the request

Delete a column family

cbt deletefamily <table> <family>

Delete a row

cbt deleterow <table> <row> [app-profile=<app profile id>]
  app-profile=<app profile id>      The app profile id to use for the request

Delete a table

cbt deletetable <table>
cbt doc
cbt help [command]

List instances in a project

cbt listinstances

List clusters in an instance

cbt listclusters

Read from a single row

cbt lookup <table> <row> [app-profile=<app profile id>]
  app-profile=<app profile id>      The app profile id to use for the request

List tables and column families

cbt ls          List tables
cbt ls <table>      List column families in <table>
cbt mddoc

Read rows

cbt read <table> [start=<row>] [end=<row>] [prefix=<prefix>] [regex=<regex>] [count=<n>] [app-profile=<app profile id>]
  start=<row>       Start reading at this row
  end=<row>     Stop reading before this row
  prefix=<prefix>   Read rows with this prefix
  regex=<regex>     Read rows with keys matching this regex
  count=<n>     Read only this many rows
  app-profile=<app profile id>      The app profile id to use for the request

Set value of a cell

cbt set <table> <row> [app-profile=<app profile id>] family:column=val[@ts] ...
  app-profile=<app profile id>      The app profile id to use for the request
  family:column=val[@ts] may be repeated to set multiple cells.

  ts is an optional integer timestamp.
  If it cannot be parsed, the `@ts` part will be
  interpreted as part of the value.

Set the GC policy for a column family

cbt setgcpolicy <table> <family> ( maxage=<d> | maxversions=<n> )

  maxage=<d>        Maximum timestamp age to preserve (e.g. "1h", "4d")
  maxversions=<n>   Maximum number of versions to preserve

Blocks until all the completed writes have been replicated to all the clusters

cbt waitforreplication <table>

  table The name of the table to create
cbt version

Send feedback about...

Cloud Bigtable Documentation