You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

426 lines
9.7 KiB

  1. // Copyright 2016 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // DO NOT EDIT. THIS IS AUTOMATICALLY GENERATED.
  15. // Run "go generate" to regenerate.
  16. //go:generate go run cbt.go gcpolicy.go -o cbtdoc.go doc
  17. /*
  18. Cbt is a tool for doing basic interactions with Cloud Bigtable. To learn how to
  19. install the cbt tool, see the
  20. [cbt overview](https://cloud.google.com/bigtable/docs/cbt-overview).
  21. Usage:
  22. cbt [options] command [arguments]
  23. The commands are:
  24. count Count rows in a table
  25. createinstance Create an instance with an initial cluster
  26. createcluster Create a cluster in the configured instance
  27. createfamily Create a column family
  28. createtable Create a table
  29. updatecluster Update a cluster in the configured instance
  30. deleteinstance Delete an instance
  31. deletecluster Delete a cluster from the configured instance
  32. deletecolumn Delete all cells in a column
  33. deletefamily Delete a column family
  34. deleterow Delete a row
  35. deletetable Delete a table
  36. doc Print godoc-suitable documentation for cbt
  37. help Print help text
  38. listinstances List instances in a project
  39. listclusters List clusters in an instance
  40. lookup Read from a single row
  41. ls List tables and column families
  42. mddoc Print documentation for cbt in Markdown format
  43. read Read rows
  44. set Set value of a cell
  45. setgcpolicy Set the GC policy for a column family
  46. waitforreplication Block until all the completed writes have been replicated to all the clusters
  47. createtablefromsnapshot Create a table from a snapshot (snapshots alpha)
  48. createsnapshot Create a snapshot from a source table (snapshots alpha)
  49. listsnapshots List snapshots in a cluster (snapshots alpha)
  50. getsnapshot Get snapshot info (snapshots alpha)
  51. deletesnapshot Delete snapshot in a cluster (snapshots alpha)
  52. version Print the current cbt version
  53. createappprofile Creates app profile for an instance
  54. getappprofile Reads app profile for an instance
  55. listappprofile Lists app profile for an instance
  56. updateappprofile Updates app profile for an instance
  57. deleteappprofile Deletes app profile for an instance
  58. Use "cbt help <command>" for more information about a command.
  59. The options are:
  60. -project string
  61. project ID, if unset uses gcloud configured project
  62. -instance string
  63. Cloud Bigtable instance
  64. -creds string
  65. if set, use application credentials in this file
  66. Alpha features are not currently available to most Cloud Bigtable customers. The
  67. features might be changed in backward-incompatible ways and are not recommended
  68. for production use. They are not subject to any SLA or deprecation policy.
  69. Note: cbt does not support specifying arbitrary bytes on the command line for
  70. any value that Bigtable otherwise supports (e.g., row key, column qualifier,
  71. etc.).
  72. For convenience, values of the -project, -instance, -creds,
  73. -admin-endpoint and -data-endpoint flags may be specified in
  74. ~/.cbtrc in this format:
  75. project = my-project-123
  76. instance = my-instance
  77. creds = path-to-account-key.json
  78. admin-endpoint = hostname:port
  79. data-endpoint = hostname:port
  80. All values are optional, and all will be overridden by flags.
  81. Count rows in a table
  82. Usage:
  83. cbt count <table>
  84. Create an instance with an initial cluster
  85. Usage:
  86. cbt createinstance <instance-id> <display-name> <cluster-id> <zone> <num-nodes> <storage type>
  87. instance-id Permanent, unique id for the instance
  88. display-name Description of the instance
  89. cluster-id Permanent, unique id for the cluster in the instance
  90. zone The zone in which to create the cluster
  91. num-nodes The number of nodes to create
  92. storage-type SSD or HDD
  93. Create a cluster in the configured instance
  94. Usage:
  95. cbt createcluster <cluster-id> <zone> <num-nodes> <storage type>
  96. cluster-id Permanent, unique id for the cluster in the instance
  97. zone The zone in which to create the cluster
  98. num-nodes The number of nodes to create
  99. storage-type SSD or HDD
  100. Create a column family
  101. Usage:
  102. cbt createfamily <table> <family>
  103. Create a table
  104. Usage:
  105. cbt createtable <table> [families=family[:gcpolicy],...] [splits=split,...]
  106. families: Column families and their associated GC policies. For gcpolicy,
  107. see "setgcpolicy".
  108. Example: families=family1:maxage=1w,family2:maxversions=1
  109. splits: Row key to be used to initially split the table
  110. Update a cluster in the configured instance
  111. Usage:
  112. cbt updatecluster <cluster-id> [num-nodes=num-nodes]
  113. cluster-id Permanent, unique id for the cluster in the instance
  114. num-nodes The number of nodes to update to
  115. Delete an instance
  116. Usage:
  117. cbt deleteinstance <instance>
  118. Delete a cluster from the configured instance
  119. Usage:
  120. cbt deletecluster <cluster>
  121. Delete all cells in a column
  122. Usage:
  123. cbt deletecolumn <table> <row> <family> <column> [app-profile=<app profile id>]
  124. app-profile=<app profile id> The app profile id to use for the request
  125. Delete a column family
  126. Usage:
  127. cbt deletefamily <table> <family>
  128. Delete a row
  129. Usage:
  130. cbt deleterow <table> <row> [app-profile=<app profile id>]
  131. app-profile=<app profile id> The app profile id to use for the request
  132. Delete a table
  133. Usage:
  134. cbt deletetable <table>
  135. Print godoc-suitable documentation for cbt
  136. Usage:
  137. cbt doc
  138. Print help text
  139. Usage:
  140. cbt help [command]
  141. List instances in a project
  142. Usage:
  143. cbt listinstances
  144. List clusters in an instance
  145. Usage:
  146. cbt listclusters
  147. Read from a single row
  148. Usage:
  149. cbt lookup <table> <row> [columns=[family]:[qualifier],...] [cells-per-column=<n>] [app-profile=<app profile id>]
  150. columns=[family]:[qualifier],... Read only these columns, comma-separated
  151. cells-per-column=<n> Read only this many cells per column
  152. app-profile=<app profile id> The app profile id to use for the request
  153. List tables and column families
  154. Usage:
  155. cbt ls List tables
  156. cbt ls <table> List column families in <table>
  157. Print documentation for cbt in Markdown format
  158. Usage:
  159. cbt mddoc
  160. Read rows
  161. Usage:
  162. cbt read <table> [start=<row>] [end=<row>] [prefix=<prefix>] [regex=<regex>] [columns=[family]:[qualifier],...] [count=<n>] [cells-per-column=<n>] [app-profile=<app profile id>]
  163. start=<row> Start reading at this row
  164. end=<row> Stop reading before this row
  165. prefix=<prefix> Read rows with this prefix
  166. regex=<regex> Read rows with keys matching this regex
  167. columns=[family]:[qualifier],... Read only these columns, comma-separated
  168. count=<n> Read only this many rows
  169. cells-per-column=<n> Read only this many cells per column
  170. app-profile=<app profile id> The app profile id to use for the request
  171. Set value of a cell
  172. Usage:
  173. cbt set <table> <row> [app-profile=<app profile id>] family:column=val[@ts] ...
  174. app-profile=<app profile id> The app profile id to use for the request
  175. family:column=val[@ts] may be repeated to set multiple cells.
  176. ts is an optional integer timestamp.
  177. If it cannot be parsed, the `@ts` part will be
  178. interpreted as part of the value.
  179. Set the GC policy for a column family
  180. Usage:
  181. cbt setgcpolicy <table> <family> ((maxage=<d> | maxversions=<n>) [(and|or) (maxage=<d> | maxversions=<n>),...] | never)
  182. maxage=<d> Maximum timestamp age to preserve (e.g. "1h", "4d")
  183. maxversions=<n> Maximum number of versions to preserve
  184. Block until all the completed writes have been replicated to all the clusters
  185. Usage:
  186. cbt waitforreplication <table>
  187. Create a table from a snapshot (snapshots alpha)
  188. Usage:
  189. cbt createtablefromsnapshot <table> <cluster> <snapshot>
  190. table The name of the table to create
  191. cluster The cluster where the snapshot is located
  192. snapshot The snapshot to restore
  193. Create a snapshot from a source table (snapshots alpha)
  194. Usage:
  195. cbt createsnapshot <cluster> <snapshot> <table> [ttl=<d>]
  196. [ttl=<d>] Lifespan of the snapshot (e.g. "1h", "4d")
  197. List snapshots in a cluster (snapshots alpha)
  198. Usage:
  199. cbt listsnapshots [<cluster>]
  200. Get snapshot info (snapshots alpha)
  201. Usage:
  202. cbt getsnapshot <cluster> <snapshot>
  203. Delete snapshot in a cluster (snapshots alpha)
  204. Usage:
  205. cbt deletesnapshot <cluster> <snapshot>
  206. Print the current cbt version
  207. Usage:
  208. cbt version
  209. Creates app profile for an instance
  210. Usage:
  211. usage: cbt createappprofile <instance-id> <profile-id> <description> (route-any | [ route-to=<cluster-id> : transactional-writes]) [optional flag]
  212. optional flags may be `force`
  213. Reads app profile for an instance
  214. Usage:
  215. cbt getappprofile <instance-id> <profile-id>
  216. Lists app profile for an instance
  217. Usage:
  218. cbt listappprofile <instance-id>
  219. Updates app profile for an instance
  220. Usage:
  221. usage: cbt updateappprofile <instance-id> <profile-id> <description>(route-any | [ route-to=<cluster-id> : transactional-writes]) [optional flag]
  222. optional flags may be `force`
  223. Deletes app profile for an instance
  224. Usage:
  225. cbt deleteappprofile <instance-id> <profile-id>
  226. */
  227. package main