Google Cloud Spanner C++ Client  2.2.1
A C++ Client Library for Google Cloud Spanner
instance_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/spanner/admin/instance/v1/spanner_instance_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H
21 
22 #include "google/cloud/spanner/admin/instance_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 spanner_admin {
37 
38 ///
39 /// Cloud Spanner Instance Admin API
40 ///
41 /// The Cloud Spanner Instance Admin API can be used to create, delete,
42 /// modify and list instances. Instances are dedicated Cloud Spanner serving
43 /// and storage resources to be used by Cloud Spanner databases.
44 ///
45 /// Each instance has a "configuration", which dictates where the
46 /// serving resources for the Cloud Spanner instance are located (e.g.,
47 /// US-central, Europe). Configurations are created by Google based on
48 /// resource availability.
49 ///
50 /// Cloud Spanner billing is based on the instances that exist and their
51 /// sizes. After an instance exists, there are no additional
52 /// per-database or per-operation charges for use of the instance
53 /// (though there may be additional network bandwidth charges).
54 /// Instances offer isolation: problems with databases in one instance
55 /// will not affect other instances. However, within an instance
56 /// databases can affect each other. For example, if one database in an
57 /// instance receives a lot of requests and consumes most of the
58 /// instance resources, fewer resources are available for other
59 /// databases in that instance, and their performance may suffer.
60 ///
61 /// @par Equality
62 ///
63 /// Instances of this class created via copy-construction or copy-assignment
64 /// always compare equal. Instances created with equal
65 /// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
66 /// equal share the same underlying resources.
67 ///
68 /// @par Performance
69 ///
70 /// Creating a new instance of this class is a relatively expensive operation,
71 /// new objects establish new connections to the service. In contrast,
72 /// copy-construction, move-construction, and the corresponding assignment
73 /// operations are relatively efficient as the copies share all underlying
74 /// resources.
75 ///
76 /// @par Thread Safety
77 ///
78 /// Concurrent access to different instances of this class, even if they compare
79 /// equal, is guaranteed to work. Two or more threads operating on the same
80 /// instance of this class is not guaranteed to work. Since copy-construction
81 /// and move-construction is a relatively efficient operation, consider using
82 /// such a copy when using this class from multiple threads.
83 ///
85  public:
87  std::shared_ptr<InstanceAdminConnection> connection, Options opts = {});
89 
90  //@{
91  // @name Copy and move support
96  //@}
97 
98  //@{
99  // @name Equality
100  friend bool operator==(InstanceAdminClient const& a,
101  InstanceAdminClient const& b) {
102  return a.connection_ == b.connection_;
103  }
104  friend bool operator!=(InstanceAdminClient const& a,
105  InstanceAdminClient const& b) {
106  return !(a == b);
107  }
108  //@}
109 
110  ///
111  /// Lists the supported instance configurations for a given project.
112  ///
113  /// @param parent Required. The name of the project for which a list of
114  /// supported instance
115  /// configurations is requested. Values are of the form
116  /// `projects/<project>`.
117  /// @param opts Optional. Override the class-level options, such as retry and
118  /// backoff policies.
119  /// @return
120  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
121  ///
122  /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest]:
123  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L430}
124  /// [google.spanner.admin.instance.v1.InstanceConfig]:
125  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
126  ///
127  StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
128  ListInstanceConfigs(std::string const& parent, Options opts = {});
129 
130  ///
131  /// Lists the supported instance configurations for a given project.
132  ///
133  /// @param request
134  /// @googleapis_link{google::spanner::admin::instance::v1::ListInstanceConfigsRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L430}
135  /// @param opts Optional. Override the class-level options, such as retry and
136  /// backoff policies.
137  /// @return
138  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
139  ///
140  /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest]:
141  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L430}
142  /// [google.spanner.admin.instance.v1.InstanceConfig]:
143  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
144  ///
145  StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
147  google::spanner::admin::instance::v1::ListInstanceConfigsRequest request,
148  Options opts = {});
149 
150  ///
151  /// Gets information about a particular instance configuration.
152  ///
153  /// @param name Required. The name of the requested instance configuration.
154  /// Values are of
155  /// the form `projects/<project>/instanceConfigs/<config>`.
156  /// @param opts Optional. Override the class-level options, such as retry and
157  /// backoff policies.
158  /// @return
159  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
160  ///
161  /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest]:
162  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L464}
163  /// [google.spanner.admin.instance.v1.InstanceConfig]:
164  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
165  ///
166  StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
167  GetInstanceConfig(std::string const& name, Options opts = {});
168 
169  ///
170  /// Gets information about a particular instance configuration.
171  ///
172  /// @param request
173  /// @googleapis_link{google::spanner::admin::instance::v1::GetInstanceConfigRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L464}
174  /// @param opts Optional. Override the class-level options, such as retry and
175  /// backoff policies.
176  /// @return
177  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
178  ///
179  /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest]:
180  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L464}
181  /// [google.spanner.admin.instance.v1.InstanceConfig]:
182  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L304}
183  ///
184  StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
186  google::spanner::admin::instance::v1::GetInstanceConfigRequest const&
187  request,
188  Options opts = {});
189 
190  ///
191  /// Lists all instances in the given project.
192  ///
193  /// @param parent Required. The name of the project for which a list of
194  /// instances is
195  /// requested. Values are of the form `projects/<project>`.
196  /// @param opts Optional. Override the class-level options, such as retry and
197  /// backoff policies.
198  /// @return
199  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
200  ///
201  /// [google.spanner.admin.instance.v1.ListInstancesRequest]:
202  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L514}
203  /// [google.spanner.admin.instance.v1.Instance]:
204  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
205  ///
206  StreamRange<google::spanner::admin::instance::v1::Instance> ListInstances(
207  std::string const& parent, Options opts = {});
208 
209  ///
210  /// Lists all instances in the given project.
211  ///
212  /// @param request
213  /// @googleapis_link{google::spanner::admin::instance::v1::ListInstancesRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L514}
214  /// @param opts Optional. Override the class-level options, such as retry and
215  /// backoff policies.
216  /// @return
217  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
218  ///
219  /// [google.spanner.admin.instance.v1.ListInstancesRequest]:
220  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L514}
221  /// [google.spanner.admin.instance.v1.Instance]:
222  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
223  ///
224  StreamRange<google::spanner::admin::instance::v1::Instance> ListInstances(
225  google::spanner::admin::instance::v1::ListInstancesRequest request,
226  Options opts = {});
227 
228  ///
229  /// Gets information about a particular instance.
230  ///
231  /// @param name Required. The name of the requested instance. Values are of
232  /// the form
233  /// `projects/<project>/instances/<instance>`.
234  /// @param opts Optional. Override the class-level options, such as retry and
235  /// backoff policies.
236  /// @return
237  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
238  ///
239  /// [google.spanner.admin.instance.v1.GetInstanceRequest]:
240  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L476}
241  /// [google.spanner.admin.instance.v1.Instance]:
242  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
243  ///
244  StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
245  std::string const& name, Options opts = {});
246 
247  ///
248  /// Gets information about a particular instance.
249  ///
250  /// @param request
251  /// @googleapis_link{google::spanner::admin::instance::v1::GetInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L476}
252  /// @param opts Optional. Override the class-level options, such as retry and
253  /// backoff policies.
254  /// @return
255  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
256  ///
257  /// [google.spanner.admin.instance.v1.GetInstanceRequest]:
258  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L476}
259  /// [google.spanner.admin.instance.v1.Instance]:
260  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
261  ///
262  StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
263  google::spanner::admin::instance::v1::GetInstanceRequest const& request,
264  Options opts = {});
265 
266  ///
267  /// Creates an instance and begins preparing it to begin serving. The
268  /// returned [long-running operation][google.longrunning.Operation]
269  /// can be used to track the progress of preparing the new
270  /// instance. The instance name is assigned by the caller. If the
271  /// named instance already exists, `CreateInstance` returns
272  /// `ALREADY_EXISTS`.
273  ///
274  /// Immediately upon completion of this request:
275  ///
276  /// * The instance is readable via the API, with all requested attributes
277  /// but no allocated resources. Its state is `CREATING`.
278  ///
279  /// Until completion of the returned operation:
280  ///
281  /// * Cancelling the operation renders the instance immediately unreadable
282  /// via the API.
283  /// * The instance can be deleted.
284  /// * All other attempts to modify the instance are rejected.
285  ///
286  /// Upon completion of the returned operation:
287  ///
288  /// * Billing for all successfully-allocated resources begins (some types
289  /// may have lower than the requested levels).
290  /// * Databases can be created in the instance.
291  /// * The instance's allocated resource levels are readable via the API.
292  /// * The instance's state becomes `READY`.
293  ///
294  /// The returned [long-running operation][google.longrunning.Operation] will
295  /// have a name of the format `<instance_name>/operations/<operation_id>` and
296  /// can be used to track creation of the instance. The
297  /// [metadata][google.longrunning.Operation.metadata] field type is
298  /// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
299  /// The [response][google.longrunning.Operation.response] field type is
300  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
301  ///
302  /// @param parent Required. The name of the project in which to create the
303  /// instance. Values
304  /// are of the form `projects/<project>`.
305  /// @param instance_id Required. The ID of the instance to create. Valid
306  /// identifiers are of the
307  /// form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in
308  /// length.
309  /// @param instance Required. The instance to create. The name may be
310  /// omitted, but if
311  /// specified must be `<parent>/instances/<instance_id>`.
312  /// @param opts Optional. Override the class-level options, such as retry and
313  /// backoff policies.
314  /// @return
315  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
316  ///
317  /// [google.spanner.admin.instance.v1.CreateInstanceRequest]:
318  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L493}
319  /// [google.spanner.admin.instance.v1.Instance]:
320  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
321  ///
322  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
323  CreateInstance(std::string const& parent, std::string const& instance_id,
324  google::spanner::admin::instance::v1::Instance const& instance,
325  Options opts = {});
326 
327  ///
328  /// Creates an instance and begins preparing it to begin serving. The
329  /// returned [long-running operation][google.longrunning.Operation]
330  /// can be used to track the progress of preparing the new
331  /// instance. The instance name is assigned by the caller. If the
332  /// named instance already exists, `CreateInstance` returns
333  /// `ALREADY_EXISTS`.
334  ///
335  /// Immediately upon completion of this request:
336  ///
337  /// * The instance is readable via the API, with all requested attributes
338  /// but no allocated resources. Its state is `CREATING`.
339  ///
340  /// Until completion of the returned operation:
341  ///
342  /// * Cancelling the operation renders the instance immediately unreadable
343  /// via the API.
344  /// * The instance can be deleted.
345  /// * All other attempts to modify the instance are rejected.
346  ///
347  /// Upon completion of the returned operation:
348  ///
349  /// * Billing for all successfully-allocated resources begins (some types
350  /// may have lower than the requested levels).
351  /// * Databases can be created in the instance.
352  /// * The instance's allocated resource levels are readable via the API.
353  /// * The instance's state becomes `READY`.
354  ///
355  /// The returned [long-running operation][google.longrunning.Operation] will
356  /// have a name of the format `<instance_name>/operations/<operation_id>` and
357  /// can be used to track creation of the instance. The
358  /// [metadata][google.longrunning.Operation.metadata] field type is
359  /// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
360  /// The [response][google.longrunning.Operation.response] field type is
361  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
362  ///
363  /// @param request
364  /// @googleapis_link{google::spanner::admin::instance::v1::CreateInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L493}
365  /// @param opts Optional. Override the class-level options, such as retry and
366  /// backoff policies.
367  /// @return
368  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
369  ///
370  /// [google.spanner.admin.instance.v1.CreateInstanceRequest]:
371  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L493}
372  /// [google.spanner.admin.instance.v1.Instance]:
373  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
374  ///
375  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
377  google::spanner::admin::instance::v1::CreateInstanceRequest const&
378  request,
379  Options opts = {});
380 
381  ///
382  /// Updates an instance, and begins allocating or releasing resources
383  /// as requested. The returned [long-running
384  /// operation][google.longrunning.Operation] can be used to track the
385  /// progress of updating the instance. If the named instance does not
386  /// exist, returns `NOT_FOUND`.
387  ///
388  /// Immediately upon completion of this request:
389  ///
390  /// * For resource types for which a decrease in the instance's allocation
391  /// has been requested, billing is based on the newly-requested level.
392  ///
393  /// Until completion of the returned operation:
394  ///
395  /// * Cancelling the operation sets its metadata's
396  /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time],
397  /// and begins restoring resources to their pre-request values. The
398  /// operation is guaranteed to succeed at undoing all resource changes,
399  /// after which point it terminates with a `CANCELLED` status.
400  /// * All other attempts to modify the instance are rejected.
401  /// * Reading the instance via the API continues to give the pre-request
402  /// resource levels.
403  ///
404  /// Upon completion of the returned operation:
405  ///
406  /// * Billing begins for all successfully-allocated resources (some types
407  /// may have lower than the requested levels).
408  /// * All newly-reserved resources are available for serving the instance's
409  /// tables.
410  /// * The instance's new resource levels are readable via the API.
411  ///
412  /// The returned [long-running operation][google.longrunning.Operation] will
413  /// have a name of the format `<instance_name>/operations/<operation_id>` and
414  /// can be used to track the instance modification. The
415  /// [metadata][google.longrunning.Operation.metadata] field type is
416  /// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
417  /// The [response][google.longrunning.Operation.response] field type is
418  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
419  ///
420  /// Authorization requires `spanner.instances.update` permission on
421  /// the resource [name][google.spanner.admin.instance.v1.Instance.name].
422  ///
423  /// @param instance Required. The instance to update, which must always
424  /// include the instance
425  /// name. Otherwise, only fields mentioned in
426  /// [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask]
427  /// need be included.
428  /// @param field_mask Required. A mask specifying which fields in
429  /// [Instance][google.spanner.admin.instance.v1.Instance] should be updated.
430  /// The field mask must always be specified; this prevents any future fields
431  /// in [Instance][google.spanner.admin.instance.v1.Instance] from being
432  /// erased accidentally by clients that do not know about them.
433  /// @param opts Optional. Override the class-level options, such as retry and
434  /// backoff policies.
435  /// @return
436  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
437  ///
438  /// [google.spanner.admin.instance.v1.UpdateInstanceRequest]:
439  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L567}
440  /// [google.spanner.admin.instance.v1.Instance]:
441  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
442  ///
443  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
444  UpdateInstance(google::spanner::admin::instance::v1::Instance const& instance,
445  google::protobuf::FieldMask const& field_mask,
446  Options opts = {});
447 
448  ///
449  /// Updates an instance, and begins allocating or releasing resources
450  /// as requested. The returned [long-running
451  /// operation][google.longrunning.Operation] can be used to track the
452  /// progress of updating the instance. If the named instance does not
453  /// exist, returns `NOT_FOUND`.
454  ///
455  /// Immediately upon completion of this request:
456  ///
457  /// * For resource types for which a decrease in the instance's allocation
458  /// has been requested, billing is based on the newly-requested level.
459  ///
460  /// Until completion of the returned operation:
461  ///
462  /// * Cancelling the operation sets its metadata's
463  /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time],
464  /// and begins restoring resources to their pre-request values. The
465  /// operation is guaranteed to succeed at undoing all resource changes,
466  /// after which point it terminates with a `CANCELLED` status.
467  /// * All other attempts to modify the instance are rejected.
468  /// * Reading the instance via the API continues to give the pre-request
469  /// resource levels.
470  ///
471  /// Upon completion of the returned operation:
472  ///
473  /// * Billing begins for all successfully-allocated resources (some types
474  /// may have lower than the requested levels).
475  /// * All newly-reserved resources are available for serving the instance's
476  /// tables.
477  /// * The instance's new resource levels are readable via the API.
478  ///
479  /// The returned [long-running operation][google.longrunning.Operation] will
480  /// have a name of the format `<instance_name>/operations/<operation_id>` and
481  /// can be used to track the instance modification. The
482  /// [metadata][google.longrunning.Operation.metadata] field type is
483  /// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
484  /// The [response][google.longrunning.Operation.response] field type is
485  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
486  ///
487  /// Authorization requires `spanner.instances.update` permission on
488  /// the resource [name][google.spanner.admin.instance.v1.Instance.name].
489  ///
490  /// @param request
491  /// @googleapis_link{google::spanner::admin::instance::v1::UpdateInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L567}
492  /// @param opts Optional. Override the class-level options, such as retry and
493  /// backoff policies.
494  /// @return
495  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
496  ///
497  /// [google.spanner.admin.instance.v1.UpdateInstanceRequest]:
498  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L567}
499  /// [google.spanner.admin.instance.v1.Instance]:
500  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L328}
501  ///
502  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
504  google::spanner::admin::instance::v1::UpdateInstanceRequest const&
505  request,
506  Options opts = {});
507 
508  ///
509  /// Deletes an instance.
510  ///
511  /// Immediately upon completion of the request:
512  ///
513  /// * Billing ceases for all of the instance's reserved resources.
514  ///
515  /// Soon afterward:
516  ///
517  /// * The instance and *all of its databases* immediately and
518  /// irrevocably disappear from the API. All data in the databases
519  /// is permanently deleted.
520  ///
521  /// @param name Required. The name of the instance to be deleted. Values are
522  /// of the form
523  /// `projects/<project>/instances/<instance>`
524  /// @param opts Optional. Override the class-level options, such as retry and
525  /// backoff policies.
526  ///
527  /// [google.spanner.admin.instance.v1.DeleteInstanceRequest]:
528  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L580}
529  ///
530  Status DeleteInstance(std::string const& name, Options opts = {});
531 
532  ///
533  /// Deletes an instance.
534  ///
535  /// Immediately upon completion of the request:
536  ///
537  /// * Billing ceases for all of the instance's reserved resources.
538  ///
539  /// Soon afterward:
540  ///
541  /// * The instance and *all of its databases* immediately and
542  /// irrevocably disappear from the API. All data in the databases
543  /// is permanently deleted.
544  ///
545  /// @param request
546  /// @googleapis_link{google::spanner::admin::instance::v1::DeleteInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L580}
547  /// @param opts Optional. Override the class-level options, such as retry and
548  /// backoff policies.
549  ///
550  /// [google.spanner.admin.instance.v1.DeleteInstanceRequest]:
551  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L580}
552  ///
554  google::spanner::admin::instance::v1::DeleteInstanceRequest const&
555  request,
556  Options opts = {});
557 
558  ///
559  /// Sets the access control policy on an instance resource. Replaces any
560  /// existing policy.
561  ///
562  /// Authorization requires `spanner.instances.setIamPolicy` on
563  /// [resource][google.iam.v1.SetIamPolicyRequest.resource].
564  ///
565  /// @param resource REQUIRED: The resource for which the policy is being
566  /// specified.
567  /// See the operation documentation for the appropriate value for this field.
568  /// @param policy REQUIRED: The complete policy to be applied to the
569  /// `resource`. The size of
570  /// the policy is limited to a few 10s of KB. An empty policy is a
571  /// valid policy but certain Cloud Platform services (such as Projects)
572  /// might reject them.
573  /// @param opts Optional. Override the class-level options, such as retry and
574  /// backoff policies.
575  /// @return
576  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
577  ///
578  /// [google.iam.v1.SetIamPolicyRequest]:
579  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
580  /// [google.iam.v1.Policy]:
581  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
582  ///
583  StatusOr<google::iam::v1::Policy> SetIamPolicy(
584  std::string const& resource, google::iam::v1::Policy const& policy,
585  Options opts = {});
586 
587  /**
588  * Updates the IAM policy for @p resource using an optimistic concurrency
589  * control loop.
590  *
591  * The loop fetches the current policy for @p resource, and passes it to @p
592  * updater, which should return the new policy. This new policy should use the
593  * current etag so that the read-modify-write cycle can detect races and rerun
594  * the update when there is a mismatch. If the new policy does not have an
595  * etag, the existing policy will be blindly overwritten. If @p updater does
596  * not yield a policy, the control loop is terminated and kCancelled is
597  * returned.
598  *
599  * @param resource Required. The resource for which the policy is being
600  * specified. See the operation documentation for the appropriate value for
601  * this field.
602  * @param updater Required. Functor to map the current policy to a new one.
603  * @param opts Optional. Override the class-level options, such as retry and
604  * backoff policies.
605  * @return google::iam::v1::Policy
606  */
607  StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
608  IamUpdater const& updater,
609  Options opts = {});
610 
611  ///
612  /// Sets the access control policy on an instance resource. Replaces any
613  /// existing policy.
614  ///
615  /// Authorization requires `spanner.instances.setIamPolicy` on
616  /// [resource][google.iam.v1.SetIamPolicyRequest.resource].
617  ///
618  /// @param request
619  /// @googleapis_link{google::iam::v1::SetIamPolicyRequest,google/iam/v1/iam_policy.proto#L101}
620  /// @param opts Optional. Override the class-level options, such as retry and
621  /// backoff policies.
622  /// @return
623  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
624  ///
625  /// [google.iam.v1.SetIamPolicyRequest]:
626  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
627  /// [google.iam.v1.Policy]:
628  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
629  ///
630  StatusOr<google::iam::v1::Policy> SetIamPolicy(
631  google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
632 
633  ///
634  /// Gets the access control policy for an instance resource. Returns an empty
635  /// policy if an instance exists but does not have a policy set.
636  ///
637  /// Authorization requires `spanner.instances.getIamPolicy` on
638  /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
639  ///
640  /// @param resource REQUIRED: The resource for which the policy is being
641  /// requested.
642  /// See the operation documentation for the appropriate value for this field.
643  /// @param opts Optional. Override the class-level options, such as retry and
644  /// backoff policies.
645  /// @return
646  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
647  ///
648  /// [google.iam.v1.GetIamPolicyRequest]:
649  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
650  /// [google.iam.v1.Policy]:
651  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
652  ///
653  StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
654  Options opts = {});
655 
656  ///
657  /// Gets the access control policy for an instance resource. Returns an empty
658  /// policy if an instance exists but does not have a policy set.
659  ///
660  /// Authorization requires `spanner.instances.getIamPolicy` on
661  /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
662  ///
663  /// @param request
664  /// @googleapis_link{google::iam::v1::GetIamPolicyRequest,google/iam/v1/iam_policy.proto#L123}
665  /// @param opts Optional. Override the class-level options, such as retry and
666  /// backoff policies.
667  /// @return
668  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
669  ///
670  /// [google.iam.v1.GetIamPolicyRequest]:
671  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
672  /// [google.iam.v1.Policy]:
673  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
674  ///
675  StatusOr<google::iam::v1::Policy> GetIamPolicy(
676  google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
677 
678  ///
679  /// Returns permissions that the caller has on the specified instance
680  /// resource.
681  ///
682  /// Attempting this RPC on a non-existent Cloud Spanner instance resource will
683  /// result in a NOT_FOUND error if the user has `spanner.instances.list`
684  /// permission on the containing Google Cloud Project. Otherwise returns an
685  /// empty set of permissions.
686  ///
687  /// @param resource REQUIRED: The resource for which the policy detail is
688  /// being requested.
689  /// See the operation documentation for the appropriate value for this field.
690  /// @param permissions The set of permissions to check for the `resource`.
691  /// Permissions with
692  /// wildcards (such as '*' or 'storage.*') are not allowed. For more
693  /// information see
694  /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
695  /// @param opts Optional. Override the class-level options, such as retry and
696  /// backoff policies.
697  /// @return
698  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
699  ///
700  /// [google.iam.v1.TestIamPermissionsRequest]:
701  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
702  /// [google.iam.v1.TestIamPermissionsResponse]:
703  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
704  ///
705  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
706  std::string const& resource, std::vector<std::string> const& permissions,
707  Options opts = {});
708 
709  ///
710  /// Returns permissions that the caller has on the specified instance
711  /// resource.
712  ///
713  /// Attempting this RPC on a non-existent Cloud Spanner instance resource will
714  /// result in a NOT_FOUND error if the user has `spanner.instances.list`
715  /// permission on the containing Google Cloud Project. Otherwise returns an
716  /// empty set of permissions.
717  ///
718  /// @param request
719  /// @googleapis_link{google::iam::v1::TestIamPermissionsRequest,google/iam/v1/iam_policy.proto#L136}
720  /// @param opts Optional. Override the class-level options, such as retry and
721  /// backoff policies.
722  /// @return
723  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
724  ///
725  /// [google.iam.v1.TestIamPermissionsRequest]:
726  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
727  /// [google.iam.v1.TestIamPermissionsResponse]:
728  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
729  ///
730  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
731  google::iam::v1::TestIamPermissionsRequest const& request,
732  Options opts = {});
733 
734  private:
735  std::shared_ptr<InstanceAdminConnection> connection_;
736  Options options_;
737 };
738 
740 namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
741 } // namespace spanner_admin
742 } // namespace cloud
743 } // namespace google
744 
745 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H