1 // Copyright 2018 Google LLC.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 package google.bigtable.admin.v2;
20 import "google/api/annotations.proto";
21 import "google/bigtable/admin/v2/table.proto";
22 import "google/longrunning/operations.proto";
23 import "google/protobuf/duration.proto";
24 import "google/protobuf/empty.proto";
25 import "google/protobuf/timestamp.proto";
27 option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
28 option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
29 option java_multiple_files = true;
30 option java_outer_classname = "BigtableTableAdminProto";
31 option java_package = "com.google.bigtable.admin.v2";
32 option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
34 // Service for creating, configuring, and deleting Cloud Bigtable tables.
37 // Provides access to the table schemas only, not the data stored within
39 service BigtableTableAdmin {
40 // Creates a new table in the specified instance.
41 // The table can be created with a full set of initial column families,
42 // specified in the request.
43 rpc CreateTable(CreateTableRequest) returns (Table) {
44 option (google.api.http) = {
45 post: "/v2/{parent=projects/*/instances/*}/tables"
50 // Creates a new table from the specified snapshot. The target table must
51 // not exist. The snapshot and the table must be in the same instance.
53 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
54 // feature is not currently available to most Cloud Bigtable customers. This
55 // feature might be changed in backward-incompatible ways and is not
56 // recommended for production use. It is not subject to any SLA or deprecation
58 rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest)
59 returns (google.longrunning.Operation) {
60 option (google.api.http) = {
61 post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot"
66 // Lists all tables served from a specified instance.
67 rpc ListTables(ListTablesRequest) returns (ListTablesResponse) {
68 option (google.api.http) = {
69 get: "/v2/{parent=projects/*/instances/*}/tables"
73 // Gets metadata information about the specified table.
74 rpc GetTable(GetTableRequest) returns (Table) {
75 option (google.api.http) = {
76 get: "/v2/{name=projects/*/instances/*/tables/*}"
80 // Permanently deletes a specified table and all of its data.
81 rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) {
82 option (google.api.http) = {
83 delete: "/v2/{name=projects/*/instances/*/tables/*}"
87 // Performs a series of column family modifications on the specified table.
88 // Either all or none of the modifications will occur before this method
89 // returns, but data requests received prior to that point may see a table
90 // where only some modifications have taken effect.
91 rpc ModifyColumnFamilies(ModifyColumnFamiliesRequest) returns (Table) {
92 option (google.api.http) = {
93 post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies"
98 // Permanently drop/delete a row range from a specified table. The request can
99 // specify whether to delete all rows in a table, or only those that match a
100 // particular prefix.
101 rpc DropRowRange(DropRowRangeRequest) returns (google.protobuf.Empty) {
102 option (google.api.http) = {
103 post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange"
108 // Generates a consistency token for a Table, which can be used in
109 // CheckConsistency to check whether mutations to the table that finished
110 // before this call started have been replicated. The tokens will be available
112 rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest)
113 returns (GenerateConsistencyTokenResponse) {
114 option (google.api.http) = {
115 post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken"
120 // Checks replication consistency based on a consistency token, that is, if
121 // replication has caught up based on the conditions specified in the token
122 // and the check request.
123 rpc CheckConsistency(CheckConsistencyRequest)
124 returns (CheckConsistencyResponse) {
125 option (google.api.http) = {
126 post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency"
131 // Creates a new snapshot in the specified cluster from the specified
132 // source table. The cluster and the table must be in the same instance.
134 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
135 // feature is not currently available to most Cloud Bigtable customers. This
136 // feature might be changed in backward-incompatible ways and is not
137 // recommended for production use. It is not subject to any SLA or deprecation
139 rpc SnapshotTable(SnapshotTableRequest)
140 returns (google.longrunning.Operation) {
141 option (google.api.http) = {
142 post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot"
147 // Gets metadata information about the specified snapshot.
149 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
150 // feature is not currently available to most Cloud Bigtable customers. This
151 // feature might be changed in backward-incompatible ways and is not
152 // recommended for production use. It is not subject to any SLA or deprecation
154 rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
155 option (google.api.http) = {
156 get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}"
160 // Lists all snapshots associated with the specified cluster.
162 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
163 // feature is not currently available to most Cloud Bigtable customers. This
164 // feature might be changed in backward-incompatible ways and is not
165 // recommended for production use. It is not subject to any SLA or deprecation
167 rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
168 option (google.api.http) = {
169 get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots"
173 // Permanently deletes the specified snapshot.
175 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
176 // feature is not currently available to most Cloud Bigtable customers. This
177 // feature might be changed in backward-incompatible ways and is not
178 // recommended for production use. It is not subject to any SLA or deprecation
180 rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) {
181 option (google.api.http) = {
182 delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}"
187 // Request message for
188 // [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
189 message CreateTableRequest {
190 // An initial split point for a newly created table.
192 // Row key to use as an initial tablet boundary.
196 // The unique name of the instance in which to create the table.
197 // Values are of the form `projects/<project>/instances/<instance>`.
200 // The name by which the new table should be referred to within the parent
201 // instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
204 // The Table to create.
207 // The optional list of row keys that will be used to initially split the
208 // table into several tablets (tablets are similar to HBase regions).
209 // Given two split keys, `s1` and `s2`, three tablets will be created,
210 // spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
214 // * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
216 // * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
218 // - Tablet 1 `[, apple) => {"a"}.`
219 // - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.`
220 // - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
221 // - Tablet 4 `[customer_2, other) => {"customer_2"}.`
222 // - Tablet 5 `[other, ) => {"other", "zz"}.`
223 repeated Split initial_splits = 4;
226 // Request message for
227 // [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
229 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
230 // feature is not currently available to most Cloud Bigtable customers. This
231 // feature might be changed in backward-incompatible ways and is not recommended
232 // for production use. It is not subject to any SLA or deprecation policy.
233 message CreateTableFromSnapshotRequest {
234 // The unique name of the instance in which to create the table.
235 // Values are of the form `projects/<project>/instances/<instance>`.
238 // The name by which the new table should be referred to within the parent
239 // instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
242 // The unique name of the snapshot from which to restore the table. The
243 // snapshot and the table must be in the same instance.
244 // Values are of the form
245 // `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
246 string source_snapshot = 3;
249 // Request message for
250 // [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
251 message DropRowRangeRequest {
252 // The unique name of the table on which to drop a range of rows.
253 // Values are of the form
254 // `projects/<project>/instances/<instance>/tables/<table>`.
257 // Delete all rows or by prefix.
259 // Delete all rows that start with this row key prefix. Prefix cannot be
261 bytes row_key_prefix = 2;
263 // Delete all rows in the table. Setting this to false is a no-op.
264 bool delete_all_data_from_table = 3;
268 // Request message for
269 // [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
270 message ListTablesRequest {
271 // The unique name of the instance for which tables should be listed.
272 // Values are of the form `projects/<project>/instances/<instance>`.
275 // The view to be applied to the returned tables' fields.
276 // Defaults to `NAME_ONLY` if unspecified; no others are currently supported.
279 // Maximum number of results per page.
280 // CURRENTLY UNIMPLEMENTED AND IGNORED.
283 // The value of `next_page_token` returned by a previous call.
284 string page_token = 3;
287 // Response message for
288 // [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
289 message ListTablesResponse {
290 // The tables present in the requested instance.
291 repeated Table tables = 1;
293 // Set if not all tables could be returned in a single response.
294 // Pass this value to `page_token` in another request to get the next
296 string next_page_token = 2;
299 // Request message for
300 // [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
301 message GetTableRequest {
302 // The unique name of the requested table.
303 // Values are of the form
304 // `projects/<project>/instances/<instance>/tables/<table>`.
307 // The view to be applied to the returned table's fields.
308 // Defaults to `SCHEMA_VIEW` if unspecified.
312 // Request message for
313 // [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
314 message DeleteTableRequest {
315 // The unique name of the table to be deleted.
316 // Values are of the form
317 // `projects/<project>/instances/<instance>/tables/<table>`.
321 // Request message for
322 // [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
323 message ModifyColumnFamiliesRequest {
324 // A create, update, or delete of a particular column family.
325 message Modification {
326 // The ID of the column family to be modified.
329 // Column familiy modifications.
331 // Create a new column family with the specified schema, or fail if
332 // one already exists with the given ID.
333 ColumnFamily create = 2;
335 // Update an existing column family to the specified schema, or fail
336 // if no column family exists with the given ID.
337 ColumnFamily update = 3;
339 // Drop (delete) the column family with the given ID, or fail if no such
345 // The unique name of the table whose families should be modified.
346 // Values are of the form
347 // `projects/<project>/instances/<instance>/tables/<table>`.
350 // Modifications to be atomically applied to the specified table's families.
351 // Entries are applied in order, meaning that earlier modifications can be
352 // masked by later ones (in the case of repeated updates to the same family,
354 repeated Modification modifications = 2;
357 // Request message for
358 // [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
359 message GenerateConsistencyTokenRequest {
360 // The unique name of the Table for which to create a consistency token.
361 // Values are of the form
362 // `projects/<project>/instances/<instance>/tables/<table>`.
366 // Response message for
367 // [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
368 message GenerateConsistencyTokenResponse {
369 // The generated consistency token.
370 string consistency_token = 1;
373 // Request message for
374 // [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
375 message CheckConsistencyRequest {
376 // The unique name of the Table for which to check replication consistency.
377 // Values are of the form
378 // `projects/<project>/instances/<instance>/tables/<table>`.
381 // The token created using GenerateConsistencyToken for the Table.
382 string consistency_token = 2;
385 // Response message for
386 // [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
387 message CheckConsistencyResponse {
388 // True only if the token is consistent. A token is consistent if replication
389 // has caught up with the restrictions specified in the request.
393 // Request message for
394 // [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
396 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
397 // feature is not currently available to most Cloud Bigtable customers. This
398 // feature might be changed in backward-incompatible ways and is not recommended
399 // for production use. It is not subject to any SLA or deprecation policy.
400 message SnapshotTableRequest {
401 // The unique name of the table to have the snapshot taken.
402 // Values are of the form
403 // `projects/<project>/instances/<instance>/tables/<table>`.
406 // The name of the cluster where the snapshot will be created in.
407 // Values are of the form
408 // `projects/<project>/instances/<instance>/clusters/<cluster>`.
411 // The ID by which the new snapshot should be referred to within the parent
412 // cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
414 // `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/mysnapshot`.
415 string snapshot_id = 3;
417 // The amount of time that the new snapshot can stay active after it is
418 // created. Once 'ttl' expires, the snapshot will get deleted. The maximum
419 // amount of time a snapshot can stay active is 7 days. If 'ttl' is not
420 // specified, the default value of 24 hours will be used.
421 google.protobuf.Duration ttl = 4;
423 // Description of the snapshot.
424 string description = 5;
427 // Request message for
428 // [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
430 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
431 // feature is not currently available to most Cloud Bigtable customers. This
432 // feature might be changed in backward-incompatible ways and is not recommended
433 // for production use. It is not subject to any SLA or deprecation policy.
434 message GetSnapshotRequest {
435 // The unique name of the requested snapshot.
436 // Values are of the form
437 // `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
441 // Request message for
442 // [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
444 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
445 // feature is not currently available to most Cloud Bigtable customers. This
446 // feature might be changed in backward-incompatible ways and is not recommended
447 // for production use. It is not subject to any SLA or deprecation policy.
448 message ListSnapshotsRequest {
449 // The unique name of the cluster for which snapshots should be listed.
450 // Values are of the form
451 // `projects/<project>/instances/<instance>/clusters/<cluster>`.
452 // Use `<cluster> = '-'` to list snapshots for all clusters in an instance,
453 // e.g., `projects/<project>/instances/<instance>/clusters/-`.
456 // The maximum number of snapshots to return per page.
457 // CURRENTLY UNIMPLEMENTED AND IGNORED.
460 // The value of `next_page_token` returned by a previous call.
461 string page_token = 3;
464 // Response message for
465 // [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
467 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
468 // feature is not currently available to most Cloud Bigtable customers. This
469 // feature might be changed in backward-incompatible ways and is not recommended
470 // for production use. It is not subject to any SLA or deprecation policy.
471 message ListSnapshotsResponse {
472 // The snapshots present in the requested cluster.
473 repeated Snapshot snapshots = 1;
475 // Set if not all snapshots could be returned in a single response.
476 // Pass this value to `page_token` in another request to get the next
478 string next_page_token = 2;
481 // Request message for
482 // [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
484 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
485 // feature is not currently available to most Cloud Bigtable customers. This
486 // feature might be changed in backward-incompatible ways and is not recommended
487 // for production use. It is not subject to any SLA or deprecation policy.
488 message DeleteSnapshotRequest {
489 // The unique name of the snapshot to be deleted.
490 // Values are of the form
491 // `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
495 // The metadata for the Operation returned by SnapshotTable.
497 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
498 // feature is not currently available to most Cloud Bigtable customers. This
499 // feature might be changed in backward-incompatible ways and is not recommended
500 // for production use. It is not subject to any SLA or deprecation policy.
501 message SnapshotTableMetadata {
502 // The request that prompted the initiation of this SnapshotTable operation.
503 SnapshotTableRequest original_request = 1;
505 // The time at which the original request was received.
506 google.protobuf.Timestamp request_time = 2;
508 // The time at which the operation failed or was completed successfully.
509 google.protobuf.Timestamp finish_time = 3;
512 // The metadata for the Operation returned by CreateTableFromSnapshot.
514 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
515 // feature is not currently available to most Cloud Bigtable customers. This
516 // feature might be changed in backward-incompatible ways and is not recommended
517 // for production use. It is not subject to any SLA or deprecation policy.
518 message CreateTableFromSnapshotMetadata {
519 // The request that prompted the initiation of this CreateTableFromSnapshot
521 CreateTableFromSnapshotRequest original_request = 1;
523 // The time at which the original request was received.
524 google.protobuf.Timestamp request_time = 2;
526 // The time at which the operation failed or was completed successfully.
527 google.protobuf.Timestamp finish_time = 3;