Google Cloud Bigtable C++ Client  2.5.0
A C++ Client Library for Google Cloud Bigtable
bigtable_table_admin_client.h
Go to the documentation of this file.
1 // Copyright 2021 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 // https://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 
15 // Generated by the Codegen C++ plugin.
16 // If you make any local changes, they will be lost.
17 // source: google/bigtable/admin/v2/bigtable_table_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_TABLE_ADMIN_CLIENT_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_TABLE_ADMIN_CLIENT_H
21 
22 #include "google/cloud/bigtable/admin/bigtable_table_admin_connection.h"
23 #include "google/cloud/future.h"
24 #include "google/cloud/iam_updater.h"
25 #include "google/cloud/options.h"
26 #include "google/cloud/polling_policy.h"
27 #include "google/cloud/status_or.h"
28 #include "google/cloud/version.h"
29 #include <google/longrunning/operations.grpc.pb.h>
30 #include <map>
31 #include <memory>
32 
33 namespace google {
34 namespace cloud {
35 namespace bigtable_admin {
37 
38 ///
39 /// Service for creating, configuring, and deleting Cloud Bigtable tables.
40 ///
41 ///
42 /// Provides access to the table schemas only, not the data stored within
43 /// the tables.
44 ///
45 /// @par Equality
46 ///
47 /// Instances of this class created via copy-construction or copy-assignment
48 /// always compare equal. Instances created with equal
49 /// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
50 /// equal share the same underlying resources.
51 ///
52 /// @par Performance
53 ///
54 /// Creating a new instance of this class is a relatively expensive operation,
55 /// new objects establish new connections to the service. In contrast,
56 /// copy-construction, move-construction, and the corresponding assignment
57 /// operations are relatively efficient as the copies share all underlying
58 /// resources.
59 ///
60 /// @par Thread Safety
61 ///
62 /// Concurrent access to different instances of this class, even if they compare
63 /// equal, is guaranteed to work. Two or more threads operating on the same
64 /// instance of this class is not guaranteed to work. Since copy-construction
65 /// and move-construction is a relatively efficient operation, consider using
66 /// such a copy when using this class from multiple threads.
67 ///
69  public:
71  std::shared_ptr<BigtableTableAdminConnection> connection,
72  Options opts = {});
74 
75  ///@{
76  // @name Copy and move support
79  default;
82  ///@}
83 
84  ///@{
85  // @name Equality
86  friend bool operator==(BigtableTableAdminClient const& a,
87  BigtableTableAdminClient const& b) {
88  return a.connection_ == b.connection_;
89  }
90  friend bool operator!=(BigtableTableAdminClient const& a,
91  BigtableTableAdminClient const& b) {
92  return !(a == b);
93  }
94  ///@}
95 
96  ///
97  /// Creates a new table in the specified instance.
98  /// The table can be created with a full set of initial column families,
99  /// specified in the request.
100  ///
101  /// @param parent Required. The unique name of the instance in which to
102  /// create the table.
103  /// Values are of the form `projects/{project}/instances/{instance}`.
104  /// @param table_id Required. The name by which the new table should be
105  /// referred to within the parent
106  /// instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
107  /// Maximum 50 characters.
108  /// @param table Required. The Table to create.
109  /// @param opts Optional. Override the class-level options, such as retry and
110  /// backoff policies.
111  /// @return
112  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
113  ///
114  /// [google.bigtable.admin.v2.CreateTableRequest]:
115  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L434}
116  /// [google.bigtable.admin.v2.Table]:
117  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
118  ///
119  StatusOr<google::bigtable::admin::v2::Table> CreateTable(
120  std::string const& parent, std::string const& table_id,
121  google::bigtable::admin::v2::Table const& table, Options opts = {});
122 
123  ///
124  /// Creates a new table in the specified instance.
125  /// The table can be created with a full set of initial column families,
126  /// specified in the request.
127  ///
128  /// @param request
129  /// @googleapis_link{google::bigtable::admin::v2::CreateTableRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L434}
130  /// @param opts Optional. Override the class-level options, such as retry and
131  /// backoff policies.
132  /// @return
133  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
134  ///
135  /// [google.bigtable.admin.v2.CreateTableRequest]:
136  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L434}
137  /// [google.bigtable.admin.v2.Table]:
138  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
139  ///
140  StatusOr<google::bigtable::admin::v2::Table> CreateTable(
141  google::bigtable::admin::v2::CreateTableRequest const& request,
142  Options opts = {});
143 
144  ///
145  /// Lists all tables served from a specified instance.
146  ///
147  /// @param parent Required. The unique name of the instance for which tables
148  /// should be listed.
149  /// Values are of the form `projects/{project}/instances/{instance}`.
150  /// @param opts Optional. Override the class-level options, such as retry and
151  /// backoff policies.
152  /// @return
153  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
154  ///
155  /// [google.bigtable.admin.v2.ListTablesRequest]:
156  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L536}
157  /// [google.bigtable.admin.v2.Table]:
158  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
159  ///
160  StreamRange<google::bigtable::admin::v2::Table> ListTables(
161  std::string const& parent, Options opts = {});
162 
163  ///
164  /// Lists all tables served from a specified instance.
165  ///
166  /// @param request
167  /// @googleapis_link{google::bigtable::admin::v2::ListTablesRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L536}
168  /// @param opts Optional. Override the class-level options, such as retry and
169  /// backoff policies.
170  /// @return
171  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
172  ///
173  /// [google.bigtable.admin.v2.ListTablesRequest]:
174  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L536}
175  /// [google.bigtable.admin.v2.Table]:
176  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
177  ///
178  StreamRange<google::bigtable::admin::v2::Table> ListTables(
179  google::bigtable::admin::v2::ListTablesRequest request,
180  Options opts = {});
181 
182  ///
183  /// Gets metadata information about the specified table.
184  ///
185  /// @param name Required. The unique name of the requested table.
186  /// Values are of the form
187  /// `projects/{project}/instances/{instance}/tables/{table}`.
188  /// @param opts Optional. Override the class-level options, such as retry and
189  /// backoff policies.
190  /// @return
191  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
192  ///
193  /// [google.bigtable.admin.v2.GetTableRequest]:
194  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L579}
195  /// [google.bigtable.admin.v2.Table]:
196  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
197  ///
198  StatusOr<google::bigtable::admin::v2::Table> GetTable(std::string const& name,
199  Options opts = {});
200 
201  ///
202  /// Gets metadata information about the specified table.
203  ///
204  /// @param request
205  /// @googleapis_link{google::bigtable::admin::v2::GetTableRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L579}
206  /// @param opts Optional. Override the class-level options, such as retry and
207  /// backoff policies.
208  /// @return
209  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
210  ///
211  /// [google.bigtable.admin.v2.GetTableRequest]:
212  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L579}
213  /// [google.bigtable.admin.v2.Table]:
214  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
215  ///
216  StatusOr<google::bigtable::admin::v2::Table> GetTable(
217  google::bigtable::admin::v2::GetTableRequest const& request,
218  Options opts = {});
219 
220  ///
221  /// Updates a specified table.
222  ///
223  /// @param table Required. The table to update.
224  /// The table's `name` field is used to identify the table to update.
225  /// @param update_mask Required. The list of fields to update.
226  /// A mask specifying which fields (e.g. `deletion_protection`) in the
227  /// `table` field should be updated. This mask is relative to the `table`
228  /// field, not to the request message. The wildcard (*) path is currently not
229  /// supported. Currently UpdateTable is only supported for the following
230  /// field:
231  /// * `deletion_protection`
232  /// If `column_families` is set in `update_mask`, it will return an
233  /// UNIMPLEMENTED error.
234  /// @param opts Optional. Override the class-level options, such as retry and
235  /// backoff policies.
236  /// @return
237  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
238  ///
239  /// [google.bigtable.admin.v2.UpdateTableRequest]:
240  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L597}
241  /// [google.bigtable.admin.v2.Table]:
242  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
243  ///
244  future<StatusOr<google::bigtable::admin::v2::Table>> UpdateTable(
245  google::bigtable::admin::v2::Table const& table,
246  google::protobuf::FieldMask const& update_mask, Options opts = {});
247 
248  ///
249  /// Updates a specified table.
250  ///
251  /// @param request
252  /// @googleapis_link{google::bigtable::admin::v2::UpdateTableRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L597}
253  /// @param opts Optional. Override the class-level options, such as retry and
254  /// backoff policies.
255  /// @return
256  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
257  ///
258  /// [google.bigtable.admin.v2.UpdateTableRequest]:
259  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L597}
260  /// [google.bigtable.admin.v2.Table]:
261  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
262  ///
263  future<StatusOr<google::bigtable::admin::v2::Table>> UpdateTable(
264  google::bigtable::admin::v2::UpdateTableRequest const& request,
265  Options opts = {});
266 
267  ///
268  /// Permanently deletes a specified table and all of its data.
269  ///
270  /// @param name Required. The unique name of the table to be deleted.
271  /// Values are of the form
272  /// `projects/{project}/instances/{instance}/tables/{table}`.
273  /// @param opts Optional. Override the class-level options, such as retry and
274  /// backoff policies.
275  ///
276  /// [google.bigtable.admin.v2.DeleteTableRequest]:
277  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L629}
278  ///
279  Status DeleteTable(std::string const& name, Options opts = {});
280 
281  ///
282  /// Permanently deletes a specified table and all of its data.
283  ///
284  /// @param request
285  /// @googleapis_link{google::bigtable::admin::v2::DeleteTableRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L629}
286  /// @param opts Optional. Override the class-level options, such as retry and
287  /// backoff policies.
288  ///
289  /// [google.bigtable.admin.v2.DeleteTableRequest]:
290  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L629}
291  ///
293  google::bigtable::admin::v2::DeleteTableRequest const& request,
294  Options opts = {});
295 
296  ///
297  /// Restores a specified table which was accidentally deleted.
298  ///
299  /// @param name Required. The unique name of the table to be restored.
300  /// Values are of the form
301  /// `projects/{project}/instances/{instance}/tables/{table}`.
302  /// @param opts Optional. Override the class-level options, such as retry and
303  /// backoff policies.
304  /// @return
305  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
306  ///
307  /// [google.bigtable.admin.v2.UndeleteTableRequest]:
308  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L643}
309  /// [google.bigtable.admin.v2.Table]:
310  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
311  ///
312  future<StatusOr<google::bigtable::admin::v2::Table>> UndeleteTable(
313  std::string const& name, Options opts = {});
314 
315  ///
316  /// Restores a specified table which was accidentally deleted.
317  ///
318  /// @param request
319  /// @googleapis_link{google::bigtable::admin::v2::UndeleteTableRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L643}
320  /// @param opts Optional. Override the class-level options, such as retry and
321  /// backoff policies.
322  /// @return
323  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
324  ///
325  /// [google.bigtable.admin.v2.UndeleteTableRequest]:
326  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L643}
327  /// [google.bigtable.admin.v2.Table]:
328  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
329  ///
330  future<StatusOr<google::bigtable::admin::v2::Table>> UndeleteTable(
331  google::bigtable::admin::v2::UndeleteTableRequest const& request,
332  Options opts = {});
333 
334  ///
335  /// Performs a series of column family modifications on the specified table.
336  /// Either all or none of the modifications will occur before this method
337  /// returns, but data requests received prior to that point may see a table
338  /// where only some modifications have taken effect.
339  ///
340  /// @param name Required. The unique name of the table whose families should
341  /// be modified.
342  /// Values are of the form
343  /// `projects/{project}/instances/{instance}/tables/{table}`.
344  /// @param modifications Required. Modifications to be atomically applied to
345  /// the specified table's families.
346  /// Entries are applied in order, meaning that earlier modifications can be
347  /// masked by later ones (in the case of repeated updates to the same family,
348  /// for example).
349  /// @param opts Optional. Override the class-level options, such as retry and
350  /// backoff policies.
351  /// @return
352  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
353  ///
354  /// [google.bigtable.admin.v2.ModifyColumnFamiliesRequest]:
355  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L670}
356  /// [google.bigtable.admin.v2.Table]:
357  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
358  ///
359  StatusOr<google::bigtable::admin::v2::Table> ModifyColumnFamilies(
360  std::string const& name,
361  std::vector<google::bigtable::admin::v2::ModifyColumnFamiliesRequest::
362  Modification> const& modifications,
363  Options opts = {});
364 
365  ///
366  /// Performs a series of column family modifications on the specified table.
367  /// Either all or none of the modifications will occur before this method
368  /// returns, but data requests received prior to that point may see a table
369  /// where only some modifications have taken effect.
370  ///
371  /// @param request
372  /// @googleapis_link{google::bigtable::admin::v2::ModifyColumnFamiliesRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L670}
373  /// @param opts Optional. Override the class-level options, such as retry and
374  /// backoff policies.
375  /// @return
376  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
377  ///
378  /// [google.bigtable.admin.v2.ModifyColumnFamiliesRequest]:
379  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L670}
380  /// [google.bigtable.admin.v2.Table]:
381  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
382  ///
383  StatusOr<google::bigtable::admin::v2::Table> ModifyColumnFamilies(
384  google::bigtable::admin::v2::ModifyColumnFamiliesRequest const& request,
385  Options opts = {});
386 
387  ///
388  /// Permanently drop/delete a row range from a specified table. The request
389  /// can specify whether to delete all rows in a table, or only those that
390  /// match a particular prefix.
391  ///
392  /// @param request
393  /// @googleapis_link{google::bigtable::admin::v2::DropRowRangeRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L512}
394  /// @param opts Optional. Override the class-level options, such as retry and
395  /// backoff policies.
396  ///
397  /// [google.bigtable.admin.v2.DropRowRangeRequest]:
398  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L512}
399  ///
401  google::bigtable::admin::v2::DropRowRangeRequest const& request,
402  Options opts = {});
403 
404  ///
405  /// Generates a consistency token for a Table, which can be used in
406  /// CheckConsistency to check whether mutations to the table that finished
407  /// before this call started have been replicated. The tokens will be
408  /// available for 90 days.
409  ///
410  /// @param name Required. The unique name of the Table for which to create a
411  /// consistency token.
412  /// Values are of the form
413  /// `projects/{project}/instances/{instance}/tables/{table}`.
414  /// @param opts Optional. Override the class-level options, such as retry and
415  /// backoff policies.
416  /// @return
417  /// @googleapis_link{google::bigtable::admin::v2::GenerateConsistencyTokenResponse,google/bigtable/admin/v2/bigtable_table_admin.proto#L725}
418  ///
419  /// [google.bigtable.admin.v2.GenerateConsistencyTokenRequest]:
420  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L711}
421  /// [google.bigtable.admin.v2.GenerateConsistencyTokenResponse]:
422  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L725}
423  ///
424  StatusOr<google::bigtable::admin::v2::GenerateConsistencyTokenResponse>
425  GenerateConsistencyToken(std::string const& name, Options opts = {});
426 
427  ///
428  /// Generates a consistency token for a Table, which can be used in
429  /// CheckConsistency to check whether mutations to the table that finished
430  /// before this call started have been replicated. The tokens will be
431  /// available for 90 days.
432  ///
433  /// @param request
434  /// @googleapis_link{google::bigtable::admin::v2::GenerateConsistencyTokenRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L711}
435  /// @param opts Optional. Override the class-level options, such as retry and
436  /// backoff policies.
437  /// @return
438  /// @googleapis_link{google::bigtable::admin::v2::GenerateConsistencyTokenResponse,google/bigtable/admin/v2/bigtable_table_admin.proto#L725}
439  ///
440  /// [google.bigtable.admin.v2.GenerateConsistencyTokenRequest]:
441  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L711}
442  /// [google.bigtable.admin.v2.GenerateConsistencyTokenResponse]:
443  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L725}
444  ///
445  StatusOr<google::bigtable::admin::v2::GenerateConsistencyTokenResponse>
447  google::bigtable::admin::v2::GenerateConsistencyTokenRequest const&
448  request,
449  Options opts = {});
450 
451  ///
452  /// Checks replication consistency based on a consistency token, that is, if
453  /// replication has caught up based on the conditions specified in the token
454  /// and the check request.
455  ///
456  /// @param name Required. The unique name of the Table for which to check
457  /// replication consistency.
458  /// Values are of the form
459  /// `projects/{project}/instances/{instance}/tables/{table}`.
460  /// @param consistency_token Required. The token created using
461  /// GenerateConsistencyToken for the Table.
462  /// @param opts Optional. Override the class-level options, such as retry and
463  /// backoff policies.
464  /// @return
465  /// @googleapis_link{google::bigtable::admin::v2::CheckConsistencyResponse,google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
466  ///
467  /// [google.bigtable.admin.v2.CheckConsistencyRequest]:
468  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L732}
469  /// [google.bigtable.admin.v2.CheckConsistencyResponse]:
470  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
471  ///
472  StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>
473  CheckConsistency(std::string const& name,
474  std::string const& consistency_token, Options opts = {});
475 
476  ///
477  /// Checks replication consistency based on a consistency token, that is, if
478  /// replication has caught up based on the conditions specified in the token
479  /// and the check request.
480  ///
481  /// @param request
482  /// @googleapis_link{google::bigtable::admin::v2::CheckConsistencyRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L732}
483  /// @param opts Optional. Override the class-level options, such as retry and
484  /// backoff policies.
485  /// @return
486  /// @googleapis_link{google::bigtable::admin::v2::CheckConsistencyResponse,google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
487  ///
488  /// [google.bigtable.admin.v2.CheckConsistencyRequest]:
489  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L732}
490  /// [google.bigtable.admin.v2.CheckConsistencyResponse]:
491  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
492  ///
493  StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>
495  google::bigtable::admin::v2::CheckConsistencyRequest const& request,
496  Options opts = {});
497 
498  ///
499  /// Starts creating a new Cloud Bigtable Backup. The returned backup
500  /// [long-running operation][google.longrunning.Operation] can be used to
501  /// track creation of the backup. The
502  /// [metadata][google.longrunning.Operation.metadata] field type is
503  /// [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
504  /// [response][google.longrunning.Operation.response] field type is
505  /// [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
506  /// returned operation will stop the creation and delete the backup.
507  ///
508  /// @param parent Required. This must be one of the clusters in the instance
509  /// in which this
510  /// table is located. The backup will be stored in this cluster. Values are
511  /// of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
512  /// @param backup_id Required. The id of the backup to be created. The
513  /// `backup_id` along with
514  /// the parent `parent` are combined as {parent}/backups/{backup_id} to
515  /// create the full backup name, of the form:
516  /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
517  /// This string must be between 1 and 50 characters in length and match the
518  /// regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
519  /// @param backup Required. The backup to create.
520  /// @param opts Optional. Override the class-level options, such as retry and
521  /// backoff policies.
522  /// @return
523  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
524  ///
525  /// [google.bigtable.admin.v2.CreateBackupRequest]:
526  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L918}
527  /// [google.bigtable.admin.v2.Backup]:
528  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
529  ///
530  future<StatusOr<google::bigtable::admin::v2::Backup>> CreateBackup(
531  std::string const& parent, std::string const& backup_id,
532  google::bigtable::admin::v2::Backup const& backup, Options opts = {});
533 
534  ///
535  /// Starts creating a new Cloud Bigtable Backup. The returned backup
536  /// [long-running operation][google.longrunning.Operation] can be used to
537  /// track creation of the backup. The
538  /// [metadata][google.longrunning.Operation.metadata] field type is
539  /// [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
540  /// [response][google.longrunning.Operation.response] field type is
541  /// [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
542  /// returned operation will stop the creation and delete the backup.
543  ///
544  /// @param request
545  /// @googleapis_link{google::bigtable::admin::v2::CreateBackupRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L918}
546  /// @param opts Optional. Override the class-level options, such as retry and
547  /// backoff policies.
548  /// @return
549  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
550  ///
551  /// [google.bigtable.admin.v2.CreateBackupRequest]:
552  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L918}
553  /// [google.bigtable.admin.v2.Backup]:
554  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
555  ///
556  future<StatusOr<google::bigtable::admin::v2::Backup>> CreateBackup(
557  google::bigtable::admin::v2::CreateBackupRequest const& request,
558  Options opts = {});
559 
560  ///
561  /// Gets metadata on a pending or completed Cloud Bigtable Backup.
562  ///
563  /// @param name Required. Name of the backup.
564  /// Values are of the form
565  /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
566  /// @param opts Optional. Override the class-level options, such as retry and
567  /// backoff policies.
568  /// @return
569  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
570  ///
571  /// [google.bigtable.admin.v2.GetBackupRequest]:
572  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L974}
573  /// [google.bigtable.admin.v2.Backup]:
574  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
575  ///
576  StatusOr<google::bigtable::admin::v2::Backup> GetBackup(
577  std::string const& name, Options opts = {});
578 
579  ///
580  /// Gets metadata on a pending or completed Cloud Bigtable Backup.
581  ///
582  /// @param request
583  /// @googleapis_link{google::bigtable::admin::v2::GetBackupRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L974}
584  /// @param opts Optional. Override the class-level options, such as retry and
585  /// backoff policies.
586  /// @return
587  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
588  ///
589  /// [google.bigtable.admin.v2.GetBackupRequest]:
590  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L974}
591  /// [google.bigtable.admin.v2.Backup]:
592  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
593  ///
594  StatusOr<google::bigtable::admin::v2::Backup> GetBackup(
595  google::bigtable::admin::v2::GetBackupRequest const& request,
596  Options opts = {});
597 
598  ///
599  /// Updates a pending or completed Cloud Bigtable Backup.
600  ///
601  /// @param backup Required. The backup to update. `backup.name`, and the
602  /// fields to be updated
603  /// as specified by `update_mask` are required. Other fields are ignored.
604  /// Update is only supported for the following fields:
605  /// * `backup.expire_time`.
606  /// @param update_mask Required. A mask specifying which fields (e.g.
607  /// `expire_time`) in the
608  /// Backup resource should be updated. This mask is relative to the Backup
609  /// resource, not to the request message. The field mask must always be
610  /// specified; this prevents any future fields from being erased accidentally
611  /// by clients that do not know about them.
612  /// @param opts Optional. Override the class-level options, such as retry and
613  /// backoff policies.
614  /// @return
615  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
616  ///
617  /// [google.bigtable.admin.v2.UpdateBackupRequest]:
618  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L958}
619  /// [google.bigtable.admin.v2.Backup]:
620  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
621  ///
622  StatusOr<google::bigtable::admin::v2::Backup> UpdateBackup(
623  google::bigtable::admin::v2::Backup const& backup,
624  google::protobuf::FieldMask const& update_mask, Options opts = {});
625 
626  ///
627  /// Updates a pending or completed Cloud Bigtable Backup.
628  ///
629  /// @param request
630  /// @googleapis_link{google::bigtable::admin::v2::UpdateBackupRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L958}
631  /// @param opts Optional. Override the class-level options, such as retry and
632  /// backoff policies.
633  /// @return
634  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
635  ///
636  /// [google.bigtable.admin.v2.UpdateBackupRequest]:
637  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L958}
638  /// [google.bigtable.admin.v2.Backup]:
639  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
640  ///
641  StatusOr<google::bigtable::admin::v2::Backup> UpdateBackup(
642  google::bigtable::admin::v2::UpdateBackupRequest const& request,
643  Options opts = {});
644 
645  ///
646  /// Deletes a pending or completed Cloud Bigtable backup.
647  ///
648  /// @param name Required. Name of the backup to delete.
649  /// Values are of the form
650  /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
651  /// @param opts Optional. Override the class-level options, such as retry and
652  /// backoff policies.
653  ///
654  /// [google.bigtable.admin.v2.DeleteBackupRequest]:
655  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L987}
656  ///
657  Status DeleteBackup(std::string const& name, Options opts = {});
658 
659  ///
660  /// Deletes a pending or completed Cloud Bigtable backup.
661  ///
662  /// @param request
663  /// @googleapis_link{google::bigtable::admin::v2::DeleteBackupRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L987}
664  /// @param opts Optional. Override the class-level options, such as retry and
665  /// backoff policies.
666  ///
667  /// [google.bigtable.admin.v2.DeleteBackupRequest]:
668  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L987}
669  ///
671  google::bigtable::admin::v2::DeleteBackupRequest const& request,
672  Options opts = {});
673 
674  ///
675  /// Lists Cloud Bigtable backups. Returns both completed and pending
676  /// backups.
677  ///
678  /// @param parent Required. The cluster to list backups from. Values are of
679  /// the
680  /// form `projects/{project}/instances/{instance}/clusters/{cluster}`.
681  /// Use `{cluster} = '-'` to list backups for all clusters in an instance,
682  /// e.g., `projects/{project}/instances/{instance}/clusters/-`.
683  /// @param opts Optional. Override the class-level options, such as retry and
684  /// backoff policies.
685  /// @return
686  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
687  ///
688  /// [google.bigtable.admin.v2.ListBackupsRequest]:
689  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1000}
690  /// [google.bigtable.admin.v2.Backup]:
691  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
692  ///
693  StreamRange<google::bigtable::admin::v2::Backup> ListBackups(
694  std::string const& parent, Options opts = {});
695 
696  ///
697  /// Lists Cloud Bigtable backups. Returns both completed and pending
698  /// backups.
699  ///
700  /// @param request
701  /// @googleapis_link{google::bigtable::admin::v2::ListBackupsRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L1000}
702  /// @param opts Optional. Override the class-level options, such as retry and
703  /// backoff policies.
704  /// @return
705  /// @googleapis_link{google::bigtable::admin::v2::Backup,google/bigtable/admin/v2/table.proto#L311}
706  ///
707  /// [google.bigtable.admin.v2.ListBackupsRequest]:
708  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1000}
709  /// [google.bigtable.admin.v2.Backup]:
710  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L311}
711  ///
712  StreamRange<google::bigtable::admin::v2::Backup> ListBackups(
713  google::bigtable::admin::v2::ListBackupsRequest request,
714  Options opts = {});
715 
716  ///
717  /// Create a new table by restoring from a completed backup. The new table
718  /// must be in the same project as the instance containing the backup. The
719  /// returned table [long-running operation][google.longrunning.Operation] can
720  /// be used to track the progress of the operation, and to cancel it. The
721  /// [metadata][google.longrunning.Operation.metadata] field type is
722  /// [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The
723  /// [response][google.longrunning.Operation.response] type is
724  /// [Table][google.bigtable.admin.v2.Table], if successful.
725  ///
726  /// @param request
727  /// @googleapis_link{google::bigtable::admin::v2::RestoreTableRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L362}
728  /// @param opts Optional. Override the class-level options, such as retry and
729  /// backoff policies.
730  /// @return
731  /// @googleapis_link{google::bigtable::admin::v2::Table,google/bigtable/admin/v2/table.proto#L53}
732  ///
733  /// [google.bigtable.admin.v2.RestoreTableRequest]:
734  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L362}
735  /// [google.bigtable.admin.v2.Table]:
736  /// @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L53}
737  ///
738  future<StatusOr<google::bigtable::admin::v2::Table>> RestoreTable(
739  google::bigtable::admin::v2::RestoreTableRequest const& request,
740  Options opts = {});
741 
742  ///
743  /// Gets the access control policy for a Table or Backup resource.
744  /// Returns an empty policy if the resource exists but does not have a policy
745  /// set.
746  ///
747  /// @param resource REQUIRED: The resource for which the policy is being
748  /// requested.
749  /// See the operation documentation for the appropriate value for this field.
750  /// @param opts Optional. Override the class-level options, such as retry and
751  /// backoff policies.
752  /// @return
753  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
754  ///
755  /// [google.iam.v1.GetIamPolicyRequest]:
756  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
757  /// [google.iam.v1.Policy]:
758  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
759  ///
760  StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
761  Options opts = {});
762 
763  ///
764  /// Gets the access control policy for a Table or Backup resource.
765  /// Returns an empty policy if the resource exists but does not have a policy
766  /// set.
767  ///
768  /// @param request
769  /// @googleapis_link{google::iam::v1::GetIamPolicyRequest,google/iam/v1/iam_policy.proto#L123}
770  /// @param opts Optional. Override the class-level options, such as retry and
771  /// backoff policies.
772  /// @return
773  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
774  ///
775  /// [google.iam.v1.GetIamPolicyRequest]:
776  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
777  /// [google.iam.v1.Policy]:
778  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
779  ///
780  StatusOr<google::iam::v1::Policy> GetIamPolicy(
781  google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
782 
783  ///
784  /// Sets the access control policy on a Table or Backup resource.
785  /// Replaces any existing policy.
786  ///
787  /// @param resource REQUIRED: The resource for which the policy is being
788  /// specified.
789  /// See the operation documentation for the appropriate value for this field.
790  /// @param policy REQUIRED: The complete policy to be applied to the
791  /// `resource`. The size of
792  /// the policy is limited to a few 10s of KB. An empty policy is a
793  /// valid policy but certain Cloud Platform services (such as Projects)
794  /// might reject them.
795  /// @param opts Optional. Override the class-level options, such as retry and
796  /// backoff policies.
797  /// @return
798  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
799  ///
800  /// [google.iam.v1.SetIamPolicyRequest]:
801  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
802  /// [google.iam.v1.Policy]:
803  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
804  ///
805  StatusOr<google::iam::v1::Policy> SetIamPolicy(
806  std::string const& resource, google::iam::v1::Policy const& policy,
807  Options opts = {});
808 
809  /**
810  * Updates the IAM policy for @p resource using an optimistic concurrency
811  * control loop.
812  *
813  * The loop fetches the current policy for @p resource, and passes it to @p
814  * updater, which should return the new policy. This new policy should use the
815  * current etag so that the read-modify-write cycle can detect races and rerun
816  * the update when there is a mismatch. If the new policy does not have an
817  * etag, the existing policy will be blindly overwritten. If @p updater does
818  * not yield a policy, the control loop is terminated and kCancelled is
819  * returned.
820  *
821  * @param resource Required. The resource for which the policy is being
822  * specified. See the operation documentation for the appropriate value for
823  * this field.
824  * @param updater Required. Functor to map the current policy to a new one.
825  * @param opts Optional. Override the class-level options, such as retry and
826  * backoff policies.
827  * @return google::iam::v1::Policy
828  */
829  StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
830  IamUpdater const& updater,
831  Options opts = {});
832 
833  ///
834  /// Sets the access control policy on a Table or Backup resource.
835  /// Replaces any existing policy.
836  ///
837  /// @param request
838  /// @googleapis_link{google::iam::v1::SetIamPolicyRequest,google/iam/v1/iam_policy.proto#L101}
839  /// @param opts Optional. Override the class-level options, such as retry and
840  /// backoff policies.
841  /// @return
842  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
843  ///
844  /// [google.iam.v1.SetIamPolicyRequest]:
845  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
846  /// [google.iam.v1.Policy]:
847  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
848  ///
849  StatusOr<google::iam::v1::Policy> SetIamPolicy(
850  google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
851 
852  ///
853  /// Returns permissions that the caller has on the specified Table or Backup
854  /// resource.
855  ///
856  /// @param resource REQUIRED: The resource for which the policy detail is
857  /// being requested.
858  /// See the operation documentation for the appropriate value for this field.
859  /// @param permissions The set of permissions to check for the `resource`.
860  /// Permissions with
861  /// wildcards (such as '*' or 'storage.*') are not allowed. For more
862  /// information see
863  /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
864  /// @param opts Optional. Override the class-level options, such as retry and
865  /// backoff policies.
866  /// @return
867  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
868  ///
869  /// [google.iam.v1.TestIamPermissionsRequest]:
870  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
871  /// [google.iam.v1.TestIamPermissionsResponse]:
872  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
873  ///
874  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
875  std::string const& resource, std::vector<std::string> const& permissions,
876  Options opts = {});
877 
878  ///
879  /// Returns permissions that the caller has on the specified Table or Backup
880  /// resource.
881  ///
882  /// @param request
883  /// @googleapis_link{google::iam::v1::TestIamPermissionsRequest,google/iam/v1/iam_policy.proto#L136}
884  /// @param opts Optional. Override the class-level options, such as retry and
885  /// backoff policies.
886  /// @return
887  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
888  ///
889  /// [google.iam.v1.TestIamPermissionsRequest]:
890  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
891  /// [google.iam.v1.TestIamPermissionsResponse]:
892  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
893  ///
894  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
895  google::iam::v1::TestIamPermissionsRequest const& request,
896  Options opts = {});
897 
898  ///
899  /// Checks replication consistency based on a consistency token, that is, if
900  /// replication has caught up based on the conditions specified in the token
901  /// and the check request.
902  ///
903  /// @param name Required. The unique name of the Table for which to check
904  /// replication consistency.
905  /// Values are of the form
906  /// `projects/{project}/instances/{instance}/tables/{table}`.
907  /// @param consistency_token Required. The token created using
908  /// GenerateConsistencyToken for the Table.
909  /// @param opts Optional. Override the class-level options, such as retry and
910  /// backoff policies.
911  /// @return
912  /// @googleapis_link{google::bigtable::admin::v2::CheckConsistencyResponse,google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
913  ///
914  /// [google.bigtable.admin.v2.CheckConsistencyRequest]:
915  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L732}
916  /// [google.bigtable.admin.v2.CheckConsistencyResponse]:
917  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
918  ///
919  future<StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>>
920  AsyncCheckConsistency(std::string const& name,
921  std::string const& consistency_token,
922  Options opts = {});
923 
924  ///
925  /// Checks replication consistency based on a consistency token, that is, if
926  /// replication has caught up based on the conditions specified in the token
927  /// and the check request.
928  ///
929  /// @param request
930  /// @googleapis_link{google::bigtable::admin::v2::CheckConsistencyRequest,google/bigtable/admin/v2/bigtable_table_admin.proto#L732}
931  /// @param opts Optional. Override the class-level options, such as retry and
932  /// backoff policies.
933  /// @return
934  /// @googleapis_link{google::bigtable::admin::v2::CheckConsistencyResponse,google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
935  ///
936  /// [google.bigtable.admin.v2.CheckConsistencyRequest]:
937  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L732}
938  /// [google.bigtable.admin.v2.CheckConsistencyResponse]:
939  /// @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L749}
940  ///
941  future<StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>>
943  google::bigtable::admin::v2::CheckConsistencyRequest const& request,
944  Options opts = {});
945 
946  private:
947  std::shared_ptr<BigtableTableAdminConnection> connection_;
948  Options options_;
949 };
950 
952 } // namespace bigtable_admin
953 } // namespace cloud
954 } // namespace google
955 
956 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_TABLE_ADMIN_CLIENT_H