Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
instance_admin_client.h
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
33namespace google {
34namespace cloud {
35namespace spanner_admin {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
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:
86 explicit InstanceAdminClient(
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 // clang-format off
111 ///
112 /// Lists the supported instance configurations for a given project.
113 ///
114 /// @param parent Required. The name of the project for which a list of 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 a [StreamRange](@ref google::cloud::StreamRange)
120 /// to iterate of the results. See the documentation of this type for
121 /// details. In brief, this class has `begin()` and `end()` member
122 /// functions returning a iterator class meeting the
123 /// [input iterator requirements]. The value type for this iterator is a
124 /// [`StatusOr`] as the iteration may fail even after some values are
125 /// retrieved successfully, for example, if there is a network disconnect.
126 /// An empty set of results does not indicate an error, it indicates
127 /// that there are no resources meeting the request criteria.
128 /// On a successful iteration the `StatusOr<T>` contains elements of type
129 /// [google.spanner.admin.instance.v1.InstanceConfig], or rather,
130 /// the C++ class generated by Protobuf from that type. Please consult the
131 /// Protobuf documentation for details on the [Protobuf mapping rules].
132 ///
133 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
134 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
135 /// [Long Running Operation]: https://google.aip.dev/151
136 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
137 /// [`future`]: @ref google::cloud::future
138 /// [`StatusOr`]: @ref google::cloud::StatusOr
139 /// [`Status`]: @ref google::cloud::Status
140 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
141 /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L671}
142 ///
143 // clang-format on
144 StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
145 ListInstanceConfigs(std::string const& parent, Options opts = {});
146
147 // clang-format off
148 ///
149 /// Lists the supported instance configurations for a given project.
150 ///
151 /// @param request Unary RPCs, such as the one wrapped by this
152 /// function, receive a single `request` proto message which includes all
153 /// the inputs for the RPC. In this case, the proto message is a
154 /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest].
155 /// Proto messages are converted to C++ classes by Protobuf, using the
156 /// [Protobuf mapping rules].
157 /// @param opts Optional. Override the class-level options, such as retry and
158 /// backoff policies.
159 /// @return a [StreamRange](@ref google::cloud::StreamRange)
160 /// to iterate of the results. See the documentation of this type for
161 /// details. In brief, this class has `begin()` and `end()` member
162 /// functions returning a iterator class meeting the
163 /// [input iterator requirements]. The value type for this iterator is a
164 /// [`StatusOr`] as the iteration may fail even after some values are
165 /// retrieved successfully, for example, if there is a network disconnect.
166 /// An empty set of results does not indicate an error, it indicates
167 /// that there are no resources meeting the request criteria.
168 /// On a successful iteration the `StatusOr<T>` contains elements of type
169 /// [google.spanner.admin.instance.v1.InstanceConfig], or rather,
170 /// the C++ class generated by Protobuf from that type. Please consult the
171 /// Protobuf documentation for details on the [Protobuf mapping rules].
172 ///
173 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
174 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
175 /// [Long Running Operation]: https://google.aip.dev/151
176 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
177 /// [`future`]: @ref google::cloud::future
178 /// [`StatusOr`]: @ref google::cloud::StatusOr
179 /// [`Status`]: @ref google::cloud::Status
180 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
181 /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L671}
182 ///
183 // clang-format on
184 StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
186 google::spanner::admin::instance::v1::ListInstanceConfigsRequest request,
187 Options opts = {});
188
189 // clang-format off
190 ///
191 /// Gets information about a particular instance configuration.
192 ///
193 /// @param name Required. The name of the requested instance configuration. Values are of
194 /// the form `projects/<project>/instanceConfigs/<config>`.
195 /// @param opts Optional. Override the class-level options, such as retry and
196 /// backoff policies.
197 /// @return the result of the RPC. The response message type
198 /// ([google.spanner.admin.instance.v1.InstanceConfig])
199 /// is mapped to a C++ class using the [Protobuf mapping rules].
200 /// If the request fails, the [`StatusOr`] contains the error details.
201 ///
202 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
203 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
204 /// [Long Running Operation]: https://google.aip.dev/151
205 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
206 /// [`future`]: @ref google::cloud::future
207 /// [`StatusOr`]: @ref google::cloud::StatusOr
208 /// [`Status`]: @ref google::cloud::Status
209 /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L707}
210 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
211 ///
212 // clang-format on
213 StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
214 GetInstanceConfig(std::string const& name, Options opts = {});
215
216 // clang-format off
217 ///
218 /// Gets information about a particular instance configuration.
219 ///
220 /// @param request Unary RPCs, such as the one wrapped by this
221 /// function, receive a single `request` proto message which includes all
222 /// the inputs for the RPC. In this case, the proto message is a
223 /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest].
224 /// Proto messages are converted to C++ classes by Protobuf, using the
225 /// [Protobuf mapping rules].
226 /// @param opts Optional. Override the class-level options, such as retry and
227 /// backoff policies.
228 /// @return the result of the RPC. The response message type
229 /// ([google.spanner.admin.instance.v1.InstanceConfig])
230 /// is mapped to a C++ class using the [Protobuf mapping rules].
231 /// If the request fails, the [`StatusOr`] contains the error details.
232 ///
233 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
234 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
235 /// [Long Running Operation]: https://google.aip.dev/151
236 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
237 /// [`future`]: @ref google::cloud::future
238 /// [`StatusOr`]: @ref google::cloud::StatusOr
239 /// [`Status`]: @ref google::cloud::Status
240 /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L707}
241 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
242 ///
243 // clang-format on
244 StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
246 google::spanner::admin::instance::v1::GetInstanceConfigRequest const&
247 request,
248 Options opts = {});
249
250 // clang-format off
251 ///
252 /// Creates an instance config and begins preparing it to be used. The
253 /// returned [long-running operation][google.longrunning.Operation]
254 /// can be used to track the progress of preparing the new
255 /// instance config. The instance config name is assigned by the caller. If the
256 /// named instance config already exists, `CreateInstanceConfig` returns
257 /// `ALREADY_EXISTS`.
258 ///
259 /// Immediately after the request returns:
260 ///
261 /// * The instance config is readable via the API, with all requested
262 /// attributes. The instance config's
263 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
264 /// field is set to true. Its state is `CREATING`.
265 ///
266 /// While the operation is pending:
267 ///
268 /// * Cancelling the operation renders the instance config immediately
269 /// unreadable via the API.
270 /// * Except for deleting the creating resource, all other attempts to modify
271 /// the instance config are rejected.
272 ///
273 /// Upon completion of the returned operation:
274 ///
275 /// * Instances can be created using the instance configuration.
276 /// * The instance config's
277 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
278 /// field becomes false. Its state becomes `READY`.
279 ///
280 /// The returned [long-running operation][google.longrunning.Operation] will
281 /// have a name of the format
282 /// `<instance_config_name>/operations/<operation_id>` and can be used to track
283 /// creation of the instance config. The
284 /// [metadata][google.longrunning.Operation.metadata] field type is
285 /// [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
286 /// The [response][google.longrunning.Operation.response] field type is
287 /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
288 /// successful.
289 ///
290 /// Authorization requires `spanner.instanceConfigs.create` permission on
291 /// the resource
292 /// [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent].
293 ///
294 /// @param parent Required. The name of the project in which to create the instance config.
295 /// Values are of the form `projects/<project>`.
296 /// @param instance_config Required. The InstanceConfig proto of the configuration to create.
297 /// instance_config.name must be
298 /// `<parent>/instanceConfigs/<instance_config_id>`.
299 /// instance_config.base_config must be a Google managed configuration name,
300 /// e.g. `<parent>/instanceConfigs/us-east1`, `<parent>/instanceConfigs/nam3`.
301 /// @param instance_config_id Required. The ID of the instance config to create. Valid identifiers are
302 /// of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
303 /// characters in length. The `custom-` prefix is required to avoid name
304 /// conflicts with Google managed configurations.
305 /// @param opts Optional. Override the class-level options, such as retry and
306 /// backoff policies.
307 /// @return A [`future`] that becomes satisfied when the LRO
308 /// ([Long Running Operation]) completes or the polling policy in effect
309 /// for this call is exhausted. The future is satisfied with an error if
310 /// the LRO completes with an error or the polling policy is exhausted.
311 /// In this case the [`StatusOr`] returned by the future contains the
312 /// error. If the LRO completes successfully the value of the future
313 /// contains the LRO's result. For this RPC the result is a
314 /// [google.spanner.admin.instance.v1.InstanceConfig] proto message.
315 /// The C++ class representing this message is created by Protobuf, using
316 /// the [Protobuf mapping rules].
317 ///
318 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
319 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
320 /// [Long Running Operation]: https://google.aip.dev/151
321 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
322 /// [`future`]: @ref google::cloud::future
323 /// [`StatusOr`]: @ref google::cloud::StatusOr
324 /// [`Status`]: @ref google::cloud::Status
325 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
326 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
327 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
328 /// [google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1055}
329 /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L720}
330 /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L723}
331 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
332 /// [google.spanner.admin.instance.v1.InstanceConfig.reconciling]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L559}
333 ///
334 // clang-format on
335 future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
337 std::string const& parent,
338 google::spanner::admin::instance::v1::InstanceConfig const&
339 instance_config,
340 std::string const& instance_config_id, Options opts = {});
341
342 // clang-format off
343 ///
344 /// Creates an instance config and begins preparing it to be used. The
345 /// returned [long-running operation][google.longrunning.Operation]
346 /// can be used to track the progress of preparing the new
347 /// instance config. The instance config name is assigned by the caller. If the
348 /// named instance config already exists, `CreateInstanceConfig` returns
349 /// `ALREADY_EXISTS`.
350 ///
351 /// Immediately after the request returns:
352 ///
353 /// * The instance config is readable via the API, with all requested
354 /// attributes. The instance config's
355 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
356 /// field is set to true. Its state is `CREATING`.
357 ///
358 /// While the operation is pending:
359 ///
360 /// * Cancelling the operation renders the instance config immediately
361 /// unreadable via the API.
362 /// * Except for deleting the creating resource, all other attempts to modify
363 /// the instance config are rejected.
364 ///
365 /// Upon completion of the returned operation:
366 ///
367 /// * Instances can be created using the instance configuration.
368 /// * The instance config's
369 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
370 /// field becomes false. Its state becomes `READY`.
371 ///
372 /// The returned [long-running operation][google.longrunning.Operation] will
373 /// have a name of the format
374 /// `<instance_config_name>/operations/<operation_id>` and can be used to track
375 /// creation of the instance config. The
376 /// [metadata][google.longrunning.Operation.metadata] field type is
377 /// [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
378 /// The [response][google.longrunning.Operation.response] field type is
379 /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
380 /// successful.
381 ///
382 /// Authorization requires `spanner.instanceConfigs.create` permission on
383 /// the resource
384 /// [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent].
385 ///
386 /// @param request Unary RPCs, such as the one wrapped by this
387 /// function, receive a single `request` proto message which includes all
388 /// the inputs for the RPC. In this case, the proto message is a
389 /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest].
390 /// Proto messages are converted to C++ classes by Protobuf, using the
391 /// [Protobuf mapping rules].
392 /// @param opts Optional. Override the class-level options, such as retry and
393 /// backoff policies.
394 /// @return A [`future`] that becomes satisfied when the LRO
395 /// ([Long Running Operation]) completes or the polling policy in effect
396 /// for this call is exhausted. The future is satisfied with an error if
397 /// the LRO completes with an error or the polling policy is exhausted.
398 /// In this case the [`StatusOr`] returned by the future contains the
399 /// error. If the LRO completes successfully the value of the future
400 /// contains the LRO's result. For this RPC the result is a
401 /// [google.spanner.admin.instance.v1.InstanceConfig] proto message.
402 /// The C++ class representing this message is created by Protobuf, using
403 /// the [Protobuf mapping rules].
404 ///
405 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
406 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
407 /// [Long Running Operation]: https://google.aip.dev/151
408 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
409 /// [`future`]: @ref google::cloud::future
410 /// [`StatusOr`]: @ref google::cloud::StatusOr
411 /// [`Status`]: @ref google::cloud::Status
412 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
413 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
414 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
415 /// [google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1055}
416 /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L720}
417 /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L723}
418 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
419 /// [google.spanner.admin.instance.v1.InstanceConfig.reconciling]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L559}
420 ///
421 // clang-format on
422 future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
424 google::spanner::admin::instance::v1::CreateInstanceConfigRequest const&
425 request,
426 Options opts = {});
427
428 // clang-format off
429 ///
430 /// Updates an instance config. The returned
431 /// [long-running operation][google.longrunning.Operation] can be used to track
432 /// the progress of updating the instance. If the named instance config does
433 /// not exist, returns `NOT_FOUND`.
434 ///
435 /// Only user managed configurations can be updated.
436 ///
437 /// Immediately after the request returns:
438 ///
439 /// * The instance config's
440 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
441 /// field is set to true.
442 ///
443 /// While the operation is pending:
444 ///
445 /// * Cancelling the operation sets its metadata's
446 /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time].
447 /// The operation is guaranteed to succeed at undoing all changes, after
448 /// which point it terminates with a `CANCELLED` status.
449 /// * All other attempts to modify the instance config are rejected.
450 /// * Reading the instance config via the API continues to give the
451 /// pre-request values.
452 ///
453 /// Upon completion of the returned operation:
454 ///
455 /// * Creating instances using the instance configuration uses the new
456 /// values.
457 /// * The instance config's new values are readable via the API.
458 /// * The instance config's
459 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
460 /// field becomes false.
461 ///
462 /// The returned [long-running operation][google.longrunning.Operation] will
463 /// have a name of the format
464 /// `<instance_config_name>/operations/<operation_id>` and can be used to track
465 /// the instance config modification. The
466 /// [metadata][google.longrunning.Operation.metadata] field type is
467 /// [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
468 /// The [response][google.longrunning.Operation.response] field type is
469 /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
470 /// successful.
471 ///
472 /// Authorization requires `spanner.instanceConfigs.update` permission on
473 /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
474 ///
475 /// @param instance_config Required. The user instance config to update, which must always include the
476 /// instance config name. Otherwise, only fields mentioned in
477 /// [update_mask][google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask]
478 /// need be included. To prevent conflicts of concurrent updates,
479 /// [etag][google.spanner.admin.instance.v1.InstanceConfig.reconciling] can
480 /// be used.
481 /// @param update_mask Required. A mask specifying which fields in
482 /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] should be
483 /// updated. The field mask must always be specified; this prevents any future
484 /// fields in [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig]
485 /// from being erased accidentally by clients that do not know about them. Only
486 /// display_name and labels can be updated.
487 /// @param opts Optional. Override the class-level options, such as retry and
488 /// backoff policies.
489 /// @return A [`future`] that becomes satisfied when the LRO
490 /// ([Long Running Operation]) completes or the polling policy in effect
491 /// for this call is exhausted. The future is satisfied with an error if
492 /// the LRO completes with an error or the polling policy is exhausted.
493 /// In this case the [`StatusOr`] returned by the future contains the
494 /// error. If the LRO completes successfully the value of the future
495 /// contains the LRO's result. For this RPC the result is a
496 /// [google.spanner.admin.instance.v1.InstanceConfig] proto message.
497 /// The C++ class representing this message is created by Protobuf, using
498 /// the [Protobuf mapping rules].
499 ///
500 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
501 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
502 /// [Long Running Operation]: https://google.aip.dev/151
503 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
504 /// [`future`]: @ref google::cloud::future
505 /// [`StatusOr`]: @ref google::cloud::StatusOr
506 /// [`Status`]: @ref google::cloud::Status
507 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
508 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
509 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
510 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
511 /// [google.spanner.admin.instance.v1.InstanceConfig.name]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L492}
512 /// [google.spanner.admin.instance.v1.InstanceConfig.reconciling]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L559}
513 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1070}
514 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1080}
515 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L750}
516 ///
517 // clang-format on
518 future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
520 google::spanner::admin::instance::v1::InstanceConfig const&
521 instance_config,
522 google::protobuf::FieldMask const& update_mask, Options opts = {});
523
524 // clang-format off
525 ///
526 /// Updates an instance config. The returned
527 /// [long-running operation][google.longrunning.Operation] can be used to track
528 /// the progress of updating the instance. If the named instance config does
529 /// not exist, returns `NOT_FOUND`.
530 ///
531 /// Only user managed configurations can be updated.
532 ///
533 /// Immediately after the request returns:
534 ///
535 /// * The instance config's
536 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
537 /// field is set to true.
538 ///
539 /// While the operation is pending:
540 ///
541 /// * Cancelling the operation sets its metadata's
542 /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time].
543 /// The operation is guaranteed to succeed at undoing all changes, after
544 /// which point it terminates with a `CANCELLED` status.
545 /// * All other attempts to modify the instance config are rejected.
546 /// * Reading the instance config via the API continues to give the
547 /// pre-request values.
548 ///
549 /// Upon completion of the returned operation:
550 ///
551 /// * Creating instances using the instance configuration uses the new
552 /// values.
553 /// * The instance config's new values are readable via the API.
554 /// * The instance config's
555 /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
556 /// field becomes false.
557 ///
558 /// The returned [long-running operation][google.longrunning.Operation] will
559 /// have a name of the format
560 /// `<instance_config_name>/operations/<operation_id>` and can be used to track
561 /// the instance config modification. The
562 /// [metadata][google.longrunning.Operation.metadata] field type is
563 /// [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
564 /// The [response][google.longrunning.Operation.response] field type is
565 /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
566 /// successful.
567 ///
568 /// Authorization requires `spanner.instanceConfigs.update` permission on
569 /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
570 ///
571 /// @param request Unary RPCs, such as the one wrapped by this
572 /// function, receive a single `request` proto message which includes all
573 /// the inputs for the RPC. In this case, the proto message is a
574 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigRequest].
575 /// Proto messages are converted to C++ classes by Protobuf, using the
576 /// [Protobuf mapping rules].
577 /// @param opts Optional. Override the class-level options, such as retry and
578 /// backoff policies.
579 /// @return A [`future`] that becomes satisfied when the LRO
580 /// ([Long Running Operation]) completes or the polling policy in effect
581 /// for this call is exhausted. The future is satisfied with an error if
582 /// the LRO completes with an error or the polling policy is exhausted.
583 /// In this case the [`StatusOr`] returned by the future contains the
584 /// error. If the LRO completes successfully the value of the future
585 /// contains the LRO's result. For this RPC the result is a
586 /// [google.spanner.admin.instance.v1.InstanceConfig] proto message.
587 /// The C++ class representing this message is created by Protobuf, using
588 /// the [Protobuf mapping rules].
589 ///
590 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
591 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
592 /// [Long Running Operation]: https://google.aip.dev/151
593 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
594 /// [`future`]: @ref google::cloud::future
595 /// [`StatusOr`]: @ref google::cloud::StatusOr
596 /// [`Status`]: @ref google::cloud::Status
597 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
598 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
599 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
600 /// [google.spanner.admin.instance.v1.InstanceConfig]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
601 /// [google.spanner.admin.instance.v1.InstanceConfig.name]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L492}
602 /// [google.spanner.admin.instance.v1.InstanceConfig.reconciling]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L559}
603 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1070}
604 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1080}
605 /// [google.spanner.admin.instance.v1.UpdateInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L750}
606 ///
607 // clang-format on
608 future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
610 google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const&
611 request,
612 Options opts = {});
613
614 // clang-format off
615 ///
616 /// Deletes the instance config. Deletion is only allowed when no
617 /// instances are using the configuration. If any instances are using
618 /// the config, returns `FAILED_PRECONDITION`.
619 ///
620 /// Only user managed configurations can be deleted.
621 ///
622 /// Authorization requires `spanner.instanceConfigs.delete` permission on
623 /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
624 ///
625 /// @param name Required. The name of the instance configuration to be deleted.
626 /// Values are of the form
627 /// `projects/<project>/instanceConfigs/<instance_config>`
628 /// @param opts Optional. Override the class-level options, such as retry and
629 /// backoff policies.
630 /// @return a [`Status`] object. If the request failed, the
631 /// status contains the details of the failure.
632 ///
633 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
634 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
635 /// [Long Running Operation]: https://google.aip.dev/151
636 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
637 /// [`future`]: @ref google::cloud::future
638 /// [`StatusOr`]: @ref google::cloud::StatusOr
639 /// [`Status`]: @ref google::cloud::Status
640 /// [google.spanner.admin.instance.v1.DeleteInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L775}
641 /// [google.spanner.admin.instance.v1.InstanceConfig.name]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L492}
642 ///
643 // clang-format on
644 Status DeleteInstanceConfig(std::string const& name, Options opts = {});
645
646 // clang-format off
647 ///
648 /// Deletes the instance config. Deletion is only allowed when no
649 /// instances are using the configuration. If any instances are using
650 /// the config, returns `FAILED_PRECONDITION`.
651 ///
652 /// Only user managed configurations can be deleted.
653 ///
654 /// Authorization requires `spanner.instanceConfigs.delete` permission on
655 /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
656 ///
657 /// @param request Unary RPCs, such as the one wrapped by this
658 /// function, receive a single `request` proto message which includes all
659 /// the inputs for the RPC. In this case, the proto message is a
660 /// [google.spanner.admin.instance.v1.DeleteInstanceConfigRequest].
661 /// Proto messages are converted to C++ classes by Protobuf, using the
662 /// [Protobuf mapping rules].
663 /// @param opts Optional. Override the class-level options, such as retry and
664 /// backoff policies.
665 /// @return a [`Status`] object. If the request failed, the
666 /// status contains the details of the failure.
667 ///
668 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
669 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
670 /// [Long Running Operation]: https://google.aip.dev/151
671 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
672 /// [`future`]: @ref google::cloud::future
673 /// [`StatusOr`]: @ref google::cloud::StatusOr
674 /// [`Status`]: @ref google::cloud::Status
675 /// [google.spanner.admin.instance.v1.DeleteInstanceConfigRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L775}
676 /// [google.spanner.admin.instance.v1.InstanceConfig.name]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L492}
677 ///
678 // clang-format on
680 google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const&
681 request,
682 Options opts = {});
683
684 // clang-format off
685 ///
686 /// Lists the user-managed instance config [long-running
687 /// operations][google.longrunning.Operation] in the given project. An instance
688 /// config operation has a name of the form
689 /// `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
690 /// The long-running operation
691 /// [metadata][google.longrunning.Operation.metadata] field type
692 /// `metadata.type_url` describes the type of the metadata. Operations returned
693 /// include those that have completed/failed/canceled within the last 7 days,
694 /// and pending operations. Operations returned are ordered by
695 /// `operation.metadata.value.start_time` in descending order starting
696 /// from the most recently started operation.
697 ///
698 /// @param parent Required. The project of the instance config operations.
699 /// Values are of the form `projects/<project>`.
700 /// @param opts Optional. Override the class-level options, such as retry and
701 /// backoff policies.
702 /// @return a [StreamRange](@ref google::cloud::StreamRange)
703 /// to iterate of the results. See the documentation of this type for
704 /// details. In brief, this class has `begin()` and `end()` member
705 /// functions returning a iterator class meeting the
706 /// [input iterator requirements]. The value type for this iterator is a
707 /// [`StatusOr`] as the iteration may fail even after some values are
708 /// retrieved successfully, for example, if there is a network disconnect.
709 /// An empty set of results does not indicate an error, it indicates
710 /// that there are no resources meeting the request criteria.
711 /// On a successful iteration the `StatusOr<T>` contains elements of type
712 /// [google.longrunning.Operation], or rather,
713 /// the C++ class generated by Protobuf from that type. Please consult the
714 /// Protobuf documentation for details on the [Protobuf mapping rules].
715 ///
716 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
717 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
718 /// [Long Running Operation]: https://google.aip.dev/151
719 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
720 /// [`future`]: @ref google::cloud::future
721 /// [`StatusOr`]: @ref google::cloud::StatusOr
722 /// [`Status`]: @ref google::cloud::Status
723 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
724 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
725 /// [google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L802}
726 ///
727 // clang-format on
728 StreamRange<google::longrunning::Operation> ListInstanceConfigOperations(
729 std::string const& parent, Options opts = {});
730
731 // clang-format off
732 ///
733 /// Lists the user-managed instance config [long-running
734 /// operations][google.longrunning.Operation] in the given project. An instance
735 /// config operation has a name of the form
736 /// `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
737 /// The long-running operation
738 /// [metadata][google.longrunning.Operation.metadata] field type
739 /// `metadata.type_url` describes the type of the metadata. Operations returned
740 /// include those that have completed/failed/canceled within the last 7 days,
741 /// and pending operations. Operations returned are ordered by
742 /// `operation.metadata.value.start_time` in descending order starting
743 /// from the most recently started operation.
744 ///
745 /// @param request Unary RPCs, such as the one wrapped by this
746 /// function, receive a single `request` proto message which includes all
747 /// the inputs for the RPC. In this case, the proto message is a
748 /// [google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest].
749 /// Proto messages are converted to C++ classes by Protobuf, using the
750 /// [Protobuf mapping rules].
751 /// @param opts Optional. Override the class-level options, such as retry and
752 /// backoff policies.
753 /// @return a [StreamRange](@ref google::cloud::StreamRange)
754 /// to iterate of the results. See the documentation of this type for
755 /// details. In brief, this class has `begin()` and `end()` member
756 /// functions returning a iterator class meeting the
757 /// [input iterator requirements]. The value type for this iterator is a
758 /// [`StatusOr`] as the iteration may fail even after some values are
759 /// retrieved successfully, for example, if there is a network disconnect.
760 /// An empty set of results does not indicate an error, it indicates
761 /// that there are no resources meeting the request criteria.
762 /// On a successful iteration the `StatusOr<T>` contains elements of type
763 /// [google.longrunning.Operation], or rather,
764 /// the C++ class generated by Protobuf from that type. Please consult the
765 /// Protobuf documentation for details on the [Protobuf mapping rules].
766 ///
767 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
768 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
769 /// [Long Running Operation]: https://google.aip.dev/151
770 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
771 /// [`future`]: @ref google::cloud::future
772 /// [`StatusOr`]: @ref google::cloud::StatusOr
773 /// [`Status`]: @ref google::cloud::Status
774 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
775 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
776 /// [google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L802}
777 ///
778 // clang-format on
779 StreamRange<google::longrunning::Operation> ListInstanceConfigOperations(
780 google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest
781 request,
782 Options opts = {});
783
784 // clang-format off
785 ///
786 /// Lists all instances in the given project.
787 ///
788 /// @param parent Required. The name of the project for which a list of instances is
789 /// requested. Values are of the form `projects/<project>`.
790 /// @param opts Optional. Override the class-level options, such as retry and
791 /// backoff policies.
792 /// @return a [StreamRange](@ref google::cloud::StreamRange)
793 /// to iterate of the results. See the documentation of this type for
794 /// details. In brief, this class has `begin()` and `end()` member
795 /// functions returning a iterator class meeting the
796 /// [input iterator requirements]. The value type for this iterator is a
797 /// [`StatusOr`] as the iteration may fail even after some values are
798 /// retrieved successfully, for example, if there is a network disconnect.
799 /// An empty set of results does not indicate an error, it indicates
800 /// that there are no resources meeting the request criteria.
801 /// On a successful iteration the `StatusOr<T>` contains elements of type
802 /// [google.spanner.admin.instance.v1.Instance], or rather,
803 /// the C++ class generated by Protobuf from that type. Please consult the
804 /// Protobuf documentation for details on the [Protobuf mapping rules].
805 ///
806 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
807 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
808 /// [Long Running Operation]: https://google.aip.dev/151
809 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
810 /// [`future`]: @ref google::cloud::future
811 /// [`StatusOr`]: @ref google::cloud::StatusOr
812 /// [`Status`]: @ref google::cloud::Status
813 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
814 /// [google.spanner.admin.instance.v1.ListInstancesRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L928}
815 ///
816 // clang-format on
817 StreamRange<google::spanner::admin::instance::v1::Instance> ListInstances(
818 std::string const& parent, Options opts = {});
819
820 // clang-format off
821 ///
822 /// Lists all instances in the given project.
823 ///
824 /// @param request Unary RPCs, such as the one wrapped by this
825 /// function, receive a single `request` proto message which includes all
826 /// the inputs for the RPC. In this case, the proto message is a
827 /// [google.spanner.admin.instance.v1.ListInstancesRequest].
828 /// Proto messages are converted to C++ classes by Protobuf, using the
829 /// [Protobuf mapping rules].
830 /// @param opts Optional. Override the class-level options, such as retry and
831 /// backoff policies.
832 /// @return a [StreamRange](@ref google::cloud::StreamRange)
833 /// to iterate of the results. See the documentation of this type for
834 /// details. In brief, this class has `begin()` and `end()` member
835 /// functions returning a iterator class meeting the
836 /// [input iterator requirements]. The value type for this iterator is a
837 /// [`StatusOr`] as the iteration may fail even after some values are
838 /// retrieved successfully, for example, if there is a network disconnect.
839 /// An empty set of results does not indicate an error, it indicates
840 /// that there are no resources meeting the request criteria.
841 /// On a successful iteration the `StatusOr<T>` contains elements of type
842 /// [google.spanner.admin.instance.v1.Instance], or rather,
843 /// the C++ class generated by Protobuf from that type. Please consult the
844 /// Protobuf documentation for details on the [Protobuf mapping rules].
845 ///
846 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
847 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
848 /// [Long Running Operation]: https://google.aip.dev/151
849 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
850 /// [`future`]: @ref google::cloud::future
851 /// [`StatusOr`]: @ref google::cloud::StatusOr
852 /// [`Status`]: @ref google::cloud::Status
853 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
854 /// [google.spanner.admin.instance.v1.ListInstancesRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L928}
855 ///
856 // clang-format on
857 StreamRange<google::spanner::admin::instance::v1::Instance> ListInstances(
858 google::spanner::admin::instance::v1::ListInstancesRequest request,
859 Options opts = {});
860
861 // clang-format off
862 ///
863 /// Gets information about a particular instance.
864 ///
865 /// @param name Required. The name of the requested instance. Values are of the form
866 /// `projects/<project>/instances/<instance>`.
867 /// @param opts Optional. Override the class-level options, such as retry and
868 /// backoff policies.
869 /// @return the result of the RPC. The response message type
870 /// ([google.spanner.admin.instance.v1.Instance])
871 /// is mapped to a C++ class using the [Protobuf mapping rules].
872 /// If the request fails, the [`StatusOr`] contains the error details.
873 ///
874 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
875 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
876 /// [Long Running Operation]: https://google.aip.dev/151
877 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
878 /// [`future`]: @ref google::cloud::future
879 /// [`StatusOr`]: @ref google::cloud::StatusOr
880 /// [`Status`]: @ref google::cloud::Status
881 /// [google.spanner.admin.instance.v1.GetInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L887}
882 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
883 ///
884 // clang-format on
885 StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
886 std::string const& name, Options opts = {});
887
888 // clang-format off
889 ///
890 /// Gets information about a particular instance.
891 ///
892 /// @param request Unary RPCs, such as the one wrapped by this
893 /// function, receive a single `request` proto message which includes all
894 /// the inputs for the RPC. In this case, the proto message is a
895 /// [google.spanner.admin.instance.v1.GetInstanceRequest].
896 /// Proto messages are converted to C++ classes by Protobuf, using the
897 /// [Protobuf mapping rules].
898 /// @param opts Optional. Override the class-level options, such as retry and
899 /// backoff policies.
900 /// @return the result of the RPC. The response message type
901 /// ([google.spanner.admin.instance.v1.Instance])
902 /// is mapped to a C++ class using the [Protobuf mapping rules].
903 /// If the request fails, the [`StatusOr`] contains the error details.
904 ///
905 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
906 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
907 /// [Long Running Operation]: https://google.aip.dev/151
908 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
909 /// [`future`]: @ref google::cloud::future
910 /// [`StatusOr`]: @ref google::cloud::StatusOr
911 /// [`Status`]: @ref google::cloud::Status
912 /// [google.spanner.admin.instance.v1.GetInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L887}
913 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
914 ///
915 // clang-format on
916 StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
917 google::spanner::admin::instance::v1::GetInstanceRequest const& request,
918 Options opts = {});
919
920 // clang-format off
921 ///
922 /// Creates an instance and begins preparing it to begin serving. The
923 /// returned [long-running operation][google.longrunning.Operation]
924 /// can be used to track the progress of preparing the new
925 /// instance. The instance name is assigned by the caller. If the
926 /// named instance already exists, `CreateInstance` returns
927 /// `ALREADY_EXISTS`.
928 ///
929 /// Immediately upon completion of this request:
930 ///
931 /// * The instance is readable via the API, with all requested attributes
932 /// but no allocated resources. Its state is `CREATING`.
933 ///
934 /// Until completion of the returned operation:
935 ///
936 /// * Cancelling the operation renders the instance immediately unreadable
937 /// via the API.
938 /// * The instance can be deleted.
939 /// * All other attempts to modify the instance are rejected.
940 ///
941 /// Upon completion of the returned operation:
942 ///
943 /// * Billing for all successfully-allocated resources begins (some types
944 /// may have lower than the requested levels).
945 /// * Databases can be created in the instance.
946 /// * The instance's allocated resource levels are readable via the API.
947 /// * The instance's state becomes `READY`.
948 ///
949 /// The returned [long-running operation][google.longrunning.Operation] will
950 /// have a name of the format `<instance_name>/operations/<operation_id>` and
951 /// can be used to track creation of the instance. The
952 /// [metadata][google.longrunning.Operation.metadata] field type is
953 /// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
954 /// The [response][google.longrunning.Operation.response] field type is
955 /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
956 ///
957 /// @param parent Required. The name of the project in which to create the instance. Values
958 /// are of the form `projects/<project>`.
959 /// @param instance_id Required. The ID of the instance to create. Valid identifiers are of the
960 /// form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in
961 /// length.
962 /// @param instance Required. The instance to create. The name may be omitted, but if
963 /// specified must be `<parent>/instances/<instance_id>`.
964 /// @param opts Optional. Override the class-level options, such as retry and
965 /// backoff policies.
966 /// @return A [`future`] that becomes satisfied when the LRO
967 /// ([Long Running Operation]) completes or the polling policy in effect
968 /// for this call is exhausted. The future is satisfied with an error if
969 /// the LRO completes with an error or the polling policy is exhausted.
970 /// In this case the [`StatusOr`] returned by the future contains the
971 /// error. If the LRO completes successfully the value of the future
972 /// contains the LRO's result. For this RPC the result is a
973 /// [google.spanner.admin.instance.v1.Instance] proto message.
974 /// The C++ class representing this message is created by Protobuf, using
975 /// the [Protobuf mapping rules].
976 ///
977 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
978 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
979 /// [Long Running Operation]: https://google.aip.dev/151
980 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
981 /// [`future`]: @ref google::cloud::future
982 /// [`StatusOr`]: @ref google::cloud::StatusOr
983 /// [`Status`]: @ref google::cloud::Status
984 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
985 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
986 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
987 /// [google.spanner.admin.instance.v1.CreateInstanceMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1015}
988 /// [google.spanner.admin.instance.v1.CreateInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L906}
989 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
990 ///
991 // clang-format on
992 future<StatusOr<google::spanner::admin::instance::v1::Instance>>
993 CreateInstance(std::string const& parent, std::string const& instance_id,
994 google::spanner::admin::instance::v1::Instance const& instance,
995 Options opts = {});
996
997 // clang-format off
998 ///
999 /// Creates an instance and begins preparing it to begin serving. The
1000 /// returned [long-running operation][google.longrunning.Operation]
1001 /// can be used to track the progress of preparing the new
1002 /// instance. The instance name is assigned by the caller. If the
1003 /// named instance already exists, `CreateInstance` returns
1004 /// `ALREADY_EXISTS`.
1005 ///
1006 /// Immediately upon completion of this request:
1007 ///
1008 /// * The instance is readable via the API, with all requested attributes
1009 /// but no allocated resources. Its state is `CREATING`.
1010 ///
1011 /// Until completion of the returned operation:
1012 ///
1013 /// * Cancelling the operation renders the instance immediately unreadable
1014 /// via the API.
1015 /// * The instance can be deleted.
1016 /// * All other attempts to modify the instance are rejected.
1017 ///
1018 /// Upon completion of the returned operation:
1019 ///
1020 /// * Billing for all successfully-allocated resources begins (some types
1021 /// may have lower than the requested levels).
1022 /// * Databases can be created in the instance.
1023 /// * The instance's allocated resource levels are readable via the API.
1024 /// * The instance's state becomes `READY`.
1025 ///
1026 /// The returned [long-running operation][google.longrunning.Operation] will
1027 /// have a name of the format `<instance_name>/operations/<operation_id>` and
1028 /// can be used to track creation of the instance. The
1029 /// [metadata][google.longrunning.Operation.metadata] field type is
1030 /// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
1031 /// The [response][google.longrunning.Operation.response] field type is
1032 /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
1033 ///
1034 /// @param request Unary RPCs, such as the one wrapped by this
1035 /// function, receive a single `request` proto message which includes all
1036 /// the inputs for the RPC. In this case, the proto message is a
1037 /// [google.spanner.admin.instance.v1.CreateInstanceRequest].
1038 /// Proto messages are converted to C++ classes by Protobuf, using the
1039 /// [Protobuf mapping rules].
1040 /// @param opts Optional. Override the class-level options, such as retry and
1041 /// backoff policies.
1042 /// @return A [`future`] that becomes satisfied when the LRO
1043 /// ([Long Running Operation]) completes or the polling policy in effect
1044 /// for this call is exhausted. The future is satisfied with an error if
1045 /// the LRO completes with an error or the polling policy is exhausted.
1046 /// In this case the [`StatusOr`] returned by the future contains the
1047 /// error. If the LRO completes successfully the value of the future
1048 /// contains the LRO's result. For this RPC the result is a
1049 /// [google.spanner.admin.instance.v1.Instance] proto message.
1050 /// The C++ class representing this message is created by Protobuf, using
1051 /// the [Protobuf mapping rules].
1052 ///
1053 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1054 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1055 /// [Long Running Operation]: https://google.aip.dev/151
1056 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1057 /// [`future`]: @ref google::cloud::future
1058 /// [`StatusOr`]: @ref google::cloud::StatusOr
1059 /// [`Status`]: @ref google::cloud::Status
1060 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1061 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1062 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1063 /// [google.spanner.admin.instance.v1.CreateInstanceMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1015}
1064 /// [google.spanner.admin.instance.v1.CreateInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L906}
1065 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
1066 ///
1067 // clang-format on
1068 future<StatusOr<google::spanner::admin::instance::v1::Instance>>
1070 google::spanner::admin::instance::v1::CreateInstanceRequest const&
1071 request,
1072 Options opts = {});
1073
1074 // clang-format off
1075 ///
1076 /// Updates an instance, and begins allocating or releasing resources
1077 /// as requested. The returned [long-running
1078 /// operation][google.longrunning.Operation] can be used to track the
1079 /// progress of updating the instance. If the named instance does not
1080 /// exist, returns `NOT_FOUND`.
1081 ///
1082 /// Immediately upon completion of this request:
1083 ///
1084 /// * For resource types for which a decrease in the instance's allocation
1085 /// has been requested, billing is based on the newly-requested level.
1086 ///
1087 /// Until completion of the returned operation:
1088 ///
1089 /// * Cancelling the operation sets its metadata's
1090 /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time],
1091 /// and begins restoring resources to their pre-request values. The
1092 /// operation is guaranteed to succeed at undoing all resource changes,
1093 /// after which point it terminates with a `CANCELLED` status.
1094 /// * All other attempts to modify the instance are rejected.
1095 /// * Reading the instance via the API continues to give the pre-request
1096 /// resource levels.
1097 ///
1098 /// Upon completion of the returned operation:
1099 ///
1100 /// * Billing begins for all successfully-allocated resources (some types
1101 /// may have lower than the requested levels).
1102 /// * All newly-reserved resources are available for serving the instance's
1103 /// tables.
1104 /// * The instance's new resource levels are readable via the API.
1105 ///
1106 /// The returned [long-running operation][google.longrunning.Operation] will
1107 /// have a name of the format `<instance_name>/operations/<operation_id>` and
1108 /// can be used to track the instance modification. The
1109 /// [metadata][google.longrunning.Operation.metadata] field type is
1110 /// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
1111 /// The [response][google.longrunning.Operation.response] field type is
1112 /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
1113 ///
1114 /// Authorization requires `spanner.instances.update` permission on
1115 /// the resource [name][google.spanner.admin.instance.v1.Instance.name].
1116 ///
1117 /// @param instance Required. The instance to update, which must always include the instance
1118 /// name. Otherwise, only fields mentioned in
1119 /// [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask]
1120 /// need be included.
1121 /// @param field_mask Required. A mask specifying which fields in
1122 /// [Instance][google.spanner.admin.instance.v1.Instance] should be updated.
1123 /// The field mask must always be specified; this prevents any future fields in
1124 /// [Instance][google.spanner.admin.instance.v1.Instance] from being erased
1125 /// accidentally by clients that do not know about them.
1126 /// @param opts Optional. Override the class-level options, such as retry and
1127 /// backoff policies.
1128 /// @return A [`future`] that becomes satisfied when the LRO
1129 /// ([Long Running Operation]) completes or the polling policy in effect
1130 /// for this call is exhausted. The future is satisfied with an error if
1131 /// the LRO completes with an error or the polling policy is exhausted.
1132 /// In this case the [`StatusOr`] returned by the future contains the
1133 /// error. If the LRO completes successfully the value of the future
1134 /// contains the LRO's result. For this RPC the result is a
1135 /// [google.spanner.admin.instance.v1.Instance] proto message.
1136 /// The C++ class representing this message is created by Protobuf, using
1137 /// the [Protobuf mapping rules].
1138 ///
1139 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1140 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1141 /// [Long Running Operation]: https://google.aip.dev/151
1142 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1143 /// [`future`]: @ref google::cloud::future
1144 /// [`StatusOr`]: @ref google::cloud::StatusOr
1145 /// [`Status`]: @ref google::cloud::Status
1146 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1147 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1148 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1149 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
1150 /// [google.spanner.admin.instance.v1.Instance.name]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L591}
1151 /// [google.spanner.admin.instance.v1.UpdateInstanceMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1035}
1152 /// [google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1047}
1153 /// [google.spanner.admin.instance.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L984}
1154 ///
1155 // clang-format on
1156 future<StatusOr<google::spanner::admin::instance::v1::Instance>>
1157 UpdateInstance(google::spanner::admin::instance::v1::Instance const& instance,
1158 google::protobuf::FieldMask const& field_mask,
1159 Options opts = {});
1160
1161 // clang-format off
1162 ///
1163 /// Updates an instance, and begins allocating or releasing resources
1164 /// as requested. The returned [long-running
1165 /// operation][google.longrunning.Operation] can be used to track the
1166 /// progress of updating the instance. If the named instance does not
1167 /// exist, returns `NOT_FOUND`.
1168 ///
1169 /// Immediately upon completion of this request:
1170 ///
1171 /// * For resource types for which a decrease in the instance's allocation
1172 /// has been requested, billing is based on the newly-requested level.
1173 ///
1174 /// Until completion of the returned operation:
1175 ///
1176 /// * Cancelling the operation sets its metadata's
1177 /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time],
1178 /// and begins restoring resources to their pre-request values. The
1179 /// operation is guaranteed to succeed at undoing all resource changes,
1180 /// after which point it terminates with a `CANCELLED` status.
1181 /// * All other attempts to modify the instance are rejected.
1182 /// * Reading the instance via the API continues to give the pre-request
1183 /// resource levels.
1184 ///
1185 /// Upon completion of the returned operation:
1186 ///
1187 /// * Billing begins for all successfully-allocated resources (some types
1188 /// may have lower than the requested levels).
1189 /// * All newly-reserved resources are available for serving the instance's
1190 /// tables.
1191 /// * The instance's new resource levels are readable via the API.
1192 ///
1193 /// The returned [long-running operation][google.longrunning.Operation] will
1194 /// have a name of the format `<instance_name>/operations/<operation_id>` and
1195 /// can be used to track the instance modification. The
1196 /// [metadata][google.longrunning.Operation.metadata] field type is
1197 /// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
1198 /// The [response][google.longrunning.Operation.response] field type is
1199 /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
1200 ///
1201 /// Authorization requires `spanner.instances.update` permission on
1202 /// the resource [name][google.spanner.admin.instance.v1.Instance.name].
1203 ///
1204 /// @param request Unary RPCs, such as the one wrapped by this
1205 /// function, receive a single `request` proto message which includes all
1206 /// the inputs for the RPC. In this case, the proto message is a
1207 /// [google.spanner.admin.instance.v1.UpdateInstanceRequest].
1208 /// Proto messages are converted to C++ classes by Protobuf, using the
1209 /// [Protobuf mapping rules].
1210 /// @param opts Optional. Override the class-level options, such as retry and
1211 /// backoff policies.
1212 /// @return A [`future`] that becomes satisfied when the LRO
1213 /// ([Long Running Operation]) completes or the polling policy in effect
1214 /// for this call is exhausted. The future is satisfied with an error if
1215 /// the LRO completes with an error or the polling policy is exhausted.
1216 /// In this case the [`StatusOr`] returned by the future contains the
1217 /// error. If the LRO completes successfully the value of the future
1218 /// contains the LRO's result. For this RPC the result is a
1219 /// [google.spanner.admin.instance.v1.Instance] proto message.
1220 /// The C++ class representing this message is created by Protobuf, using
1221 /// the [Protobuf mapping rules].
1222 ///
1223 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1224 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1225 /// [Long Running Operation]: https://google.aip.dev/151
1226 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1227 /// [`future`]: @ref google::cloud::future
1228 /// [`StatusOr`]: @ref google::cloud::StatusOr
1229 /// [`Status`]: @ref google::cloud::Status
1230 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1231 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1232 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1233 /// [google.spanner.admin.instance.v1.Instance]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
1234 /// [google.spanner.admin.instance.v1.Instance.name]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L591}
1235 /// [google.spanner.admin.instance.v1.UpdateInstanceMetadata]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1035}
1236 /// [google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1047}
1237 /// [google.spanner.admin.instance.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L984}
1238 ///
1239 // clang-format on
1240 future<StatusOr<google::spanner::admin::instance::v1::Instance>>
1242 google::spanner::admin::instance::v1::UpdateInstanceRequest const&
1243 request,
1244 Options opts = {});
1245
1246 // clang-format off
1247 ///
1248 /// Deletes an instance.
1249 ///
1250 /// Immediately upon completion of the request:
1251 ///
1252 /// * Billing ceases for all of the instance's reserved resources.
1253 ///
1254 /// Soon afterward:
1255 ///
1256 /// * The instance and *all of its databases* immediately and
1257 /// irrevocably disappear from the API. All data in the databases
1258 /// is permanently deleted.
1259 ///
1260 /// @param name Required. The name of the instance to be deleted. Values are of the form
1261 /// `projects/<project>/instances/<instance>`
1262 /// @param opts Optional. Override the class-level options, such as retry and
1263 /// backoff policies.
1264 /// @return a [`Status`] object. If the request failed, the
1265 /// status contains the details of the failure.
1266 ///
1267 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1268 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1269 /// [Long Running Operation]: https://google.aip.dev/151
1270 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1271 /// [`future`]: @ref google::cloud::future
1272 /// [`StatusOr`]: @ref google::cloud::StatusOr
1273 /// [`Status`]: @ref google::cloud::Status
1274 /// [google.spanner.admin.instance.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1002}
1275 ///
1276 // clang-format on
1277 Status DeleteInstance(std::string const& name, Options opts = {});
1278
1279 // clang-format off
1280 ///
1281 /// Deletes an instance.
1282 ///
1283 /// Immediately upon completion of the request:
1284 ///
1285 /// * Billing ceases for all of the instance's reserved resources.
1286 ///
1287 /// Soon afterward:
1288 ///
1289 /// * The instance and *all of its databases* immediately and
1290 /// irrevocably disappear from the API. All data in the databases
1291 /// is permanently deleted.
1292 ///
1293 /// @param request Unary RPCs, such as the one wrapped by this
1294 /// function, receive a single `request` proto message which includes all
1295 /// the inputs for the RPC. In this case, the proto message is a
1296 /// [google.spanner.admin.instance.v1.DeleteInstanceRequest].
1297 /// Proto messages are converted to C++ classes by Protobuf, using the
1298 /// [Protobuf mapping rules].
1299 /// @param opts Optional. Override the class-level options, such as retry and
1300 /// backoff policies.
1301 /// @return a [`Status`] object. If the request failed, the
1302 /// status contains the details of the failure.
1303 ///
1304 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1305 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1306 /// [Long Running Operation]: https://google.aip.dev/151
1307 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1308 /// [`future`]: @ref google::cloud::future
1309 /// [`StatusOr`]: @ref google::cloud::StatusOr
1310 /// [`Status`]: @ref google::cloud::Status
1311 /// [google.spanner.admin.instance.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1002}
1312 ///
1313 // clang-format on
1315 google::spanner::admin::instance::v1::DeleteInstanceRequest const&
1316 request,
1317 Options opts = {});
1318
1319 // clang-format off
1320 ///
1321 /// Sets the access control policy on an instance resource. Replaces any
1322 /// existing policy.
1323 ///
1324 /// Authorization requires `spanner.instances.setIamPolicy` on
1325 /// [resource][google.iam.v1.SetIamPolicyRequest.resource].
1326 ///
1327 /// @param resource REQUIRED: The resource for which the policy is being specified.
1328 /// See the operation documentation for the appropriate value for this field.
1329 /// @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of
1330 /// the policy is limited to a few 10s of KB. An empty policy is a
1331 /// valid policy but certain Cloud Platform services (such as Projects)
1332 /// might reject them.
1333 /// @param opts Optional. Override the class-level options, such as retry and
1334 /// backoff policies.
1335 /// @return the result of the RPC. The response message type
1336 /// ([google.iam.v1.Policy])
1337 /// is mapped to a C++ class using the [Protobuf mapping rules].
1338 /// If the request fails, the [`StatusOr`] contains the error details.
1339 ///
1340 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1341 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1342 /// [Long Running Operation]: https://google.aip.dev/151
1343 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1344 /// [`future`]: @ref google::cloud::future
1345 /// [`StatusOr`]: @ref google::cloud::StatusOr
1346 /// [`Status`]: @ref google::cloud::Status
1347 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1348 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
1349 /// [google.iam.v1.SetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L104}
1350 ///
1351 // clang-format on
1352 StatusOr<google::iam::v1::Policy> SetIamPolicy(
1353 std::string const& resource, google::iam::v1::Policy const& policy,
1354 Options opts = {});
1355
1356 /**
1357 * Updates the IAM policy for @p resource using an optimistic concurrency
1358 * control loop.
1359 *
1360 * The loop fetches the current policy for @p resource, and passes it to @p
1361 * updater, which should return the new policy. This new policy should use the
1362 * current etag so that the read-modify-write cycle can detect races and rerun
1363 * the update when there is a mismatch. If the new policy does not have an
1364 * etag, the existing policy will be blindly overwritten. If @p updater does
1365 * not yield a policy, the control loop is terminated and kCancelled is
1366 * returned.
1367 *
1368 * @param resource Required. The resource for which the policy is being
1369 * specified. See the operation documentation for the appropriate value for
1370 * this field.
1371 * @param updater Required. Functor to map the current policy to a new one.
1372 * @param opts Optional. Override the class-level options, such as retry and
1373 * backoff policies.
1374 * @return google::iam::v1::Policy
1375 */
1376 StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
1377 IamUpdater const& updater,
1378 Options opts = {});
1379
1380 // clang-format off
1381 ///
1382 /// Sets the access control policy on an instance resource. Replaces any
1383 /// existing policy.
1384 ///
1385 /// Authorization requires `spanner.instances.setIamPolicy` on
1386 /// [resource][google.iam.v1.SetIamPolicyRequest.resource].
1387 ///
1388 /// @param request Unary RPCs, such as the one wrapped by this
1389 /// function, receive a single `request` proto message which includes all
1390 /// the inputs for the RPC. In this case, the proto message is a
1391 /// [google.iam.v1.SetIamPolicyRequest].
1392 /// Proto messages are converted to C++ classes by Protobuf, using the
1393 /// [Protobuf mapping rules].
1394 /// @param opts Optional. Override the class-level options, such as retry and
1395 /// backoff policies.
1396 /// @return the result of the RPC. The response message type
1397 /// ([google.iam.v1.Policy])
1398 /// is mapped to a C++ class using the [Protobuf mapping rules].
1399 /// If the request fails, the [`StatusOr`] contains the error details.
1400 ///
1401 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1402 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1403 /// [Long Running Operation]: https://google.aip.dev/151
1404 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1405 /// [`future`]: @ref google::cloud::future
1406 /// [`StatusOr`]: @ref google::cloud::StatusOr
1407 /// [`Status`]: @ref google::cloud::Status
1408 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1409 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
1410 /// [google.iam.v1.SetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L104}
1411 ///
1412 // clang-format on
1413 StatusOr<google::iam::v1::Policy> SetIamPolicy(
1414 google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
1415
1416 // clang-format off
1417 ///
1418 /// Gets the access control policy for an instance resource. Returns an empty
1419 /// policy if an instance exists but does not have a policy set.
1420 ///
1421 /// Authorization requires `spanner.instances.getIamPolicy` on
1422 /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
1423 ///
1424 /// @param resource REQUIRED: The resource for which the policy is being requested.
1425 /// See the operation documentation for the appropriate value for this field.
1426 /// @param opts Optional. Override the class-level options, such as retry and
1427 /// backoff policies.
1428 /// @return the result of the RPC. The response message type
1429 /// ([google.iam.v1.Policy])
1430 /// is mapped to a C++ class using the [Protobuf mapping rules].
1431 /// If the request fails, the [`StatusOr`] contains the error details.
1432 ///
1433 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1434 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1435 /// [Long Running Operation]: https://google.aip.dev/151
1436 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1437 /// [`future`]: @ref google::cloud::future
1438 /// [`StatusOr`]: @ref google::cloud::StatusOr
1439 /// [`Status`]: @ref google::cloud::Status
1440 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
1441 /// [google.iam.v1.GetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L126}
1442 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1443 ///
1444 // clang-format on
1445 StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
1446 Options opts = {});
1447
1448 // clang-format off
1449 ///
1450 /// Gets the access control policy for an instance resource. Returns an empty
1451 /// policy if an instance exists but does not have a policy set.
1452 ///
1453 /// Authorization requires `spanner.instances.getIamPolicy` on
1454 /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
1455 ///
1456 /// @param request Unary RPCs, such as the one wrapped by this
1457 /// function, receive a single `request` proto message which includes all
1458 /// the inputs for the RPC. In this case, the proto message is a
1459 /// [google.iam.v1.GetIamPolicyRequest].
1460 /// Proto messages are converted to C++ classes by Protobuf, using the
1461 /// [Protobuf mapping rules].
1462 /// @param opts Optional. Override the class-level options, such as retry and
1463 /// backoff policies.
1464 /// @return the result of the RPC. The response message type
1465 /// ([google.iam.v1.Policy])
1466 /// is mapped to a C++ class using the [Protobuf mapping rules].
1467 /// If the request fails, the [`StatusOr`] contains the error details.
1468 ///
1469 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1470 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1471 /// [Long Running Operation]: https://google.aip.dev/151
1472 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1473 /// [`future`]: @ref google::cloud::future
1474 /// [`StatusOr`]: @ref google::cloud::StatusOr
1475 /// [`Status`]: @ref google::cloud::Status
1476 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
1477 /// [google.iam.v1.GetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L126}
1478 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1479 ///
1480 // clang-format on
1481 StatusOr<google::iam::v1::Policy> GetIamPolicy(
1482 google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
1483
1484 // clang-format off
1485 ///
1486 /// Returns permissions that the caller has on the specified instance resource.
1487 ///
1488 /// Attempting this RPC on a non-existent Cloud Spanner instance resource will
1489 /// result in a NOT_FOUND error if the user has `spanner.instances.list`
1490 /// permission on the containing Google Cloud Project. Otherwise returns an
1491 /// empty set of permissions.
1492 ///
1493 /// @param resource REQUIRED: The resource for which the policy detail is being requested.
1494 /// See the operation documentation for the appropriate value for this field.
1495 /// @param permissions The set of permissions to check for the `resource`. Permissions with
1496 /// wildcards (such as '*' or 'storage.*') are not allowed. For more
1497 /// information see
1498 /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1499 /// @param opts Optional. Override the class-level options, such as retry and
1500 /// backoff policies.
1501 /// @return the result of the RPC. The response message type
1502 /// ([google.iam.v1.TestIamPermissionsResponse])
1503 /// is mapped to a C++ class using the [Protobuf mapping rules].
1504 /// If the request fails, the [`StatusOr`] contains the error details.
1505 ///
1506 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1507 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1508 /// [Long Running Operation]: https://google.aip.dev/151
1509 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1510 /// [`future`]: @ref google::cloud::future
1511 /// [`StatusOr`]: @ref google::cloud::StatusOr
1512 /// [`Status`]: @ref google::cloud::Status
1513 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
1514 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
1515 ///
1516 // clang-format on
1517 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
1518 std::string const& resource, std::vector<std::string> const& permissions,
1519 Options opts = {});
1520
1521 // clang-format off
1522 ///
1523 /// Returns permissions that the caller has on the specified instance resource.
1524 ///
1525 /// Attempting this RPC on a non-existent Cloud Spanner instance resource will
1526 /// result in a NOT_FOUND error if the user has `spanner.instances.list`
1527 /// permission on the containing Google Cloud Project. Otherwise returns an
1528 /// empty set of permissions.
1529 ///
1530 /// @param request Unary RPCs, such as the one wrapped by this
1531 /// function, receive a single `request` proto message which includes all
1532 /// the inputs for the RPC. In this case, the proto message is a
1533 /// [google.iam.v1.TestIamPermissionsRequest].
1534 /// Proto messages are converted to C++ classes by Protobuf, using the
1535 /// [Protobuf mapping rules].
1536 /// @param opts Optional. Override the class-level options, such as retry and
1537 /// backoff policies.
1538 /// @return the result of the RPC. The response message type
1539 /// ([google.iam.v1.TestIamPermissionsResponse])
1540 /// is mapped to a C++ class using the [Protobuf mapping rules].
1541 /// If the request fails, the [`StatusOr`] contains the error details.
1542 ///
1543 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1544 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1545 /// [Long Running Operation]: https://google.aip.dev/151
1546 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1547 /// [`future`]: @ref google::cloud::future
1548 /// [`StatusOr`]: @ref google::cloud::StatusOr
1549 /// [`Status`]: @ref google::cloud::Status
1550 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
1551 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
1552 ///
1553 // clang-format on
1554 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
1555 google::iam::v1::TestIamPermissionsRequest const& request,
1556 Options opts = {});
1557
1558 private:
1559 std::shared_ptr<InstanceAdminConnection> connection_;
1560 Options options_;
1561};
1562
1563GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1564namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
1565} // namespace spanner_admin
1566} // namespace cloud
1567} // namespace google
1568
1569#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H
friend friend class future
Cloud Spanner Instance Admin API.
Definition: instance_admin_client.h:84
InstanceAdminClient & operator=(InstanceAdminClient const &)=default
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
Returns permissions that the caller has on the specified instance resource.
StreamRange< google::spanner::admin::instance::v1::Instance > ListInstances(std::string const &parent, Options opts={})
Lists all instances in the given project.
StatusOr< google::spanner::admin::instance::v1::Instance > GetInstance(google::spanner::admin::instance::v1::GetInstanceRequest const &request, Options opts={})
Gets information about a particular instance.
InstanceAdminClient(InstanceAdminClient const &)=default
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, IamUpdater const &updater, Options opts={})
Updates the IAM policy for resource using an optimistic concurrency control loop.
StreamRange< google::spanner::admin::instance::v1::InstanceConfig > ListInstanceConfigs(google::spanner::admin::instance::v1::ListInstanceConfigsRequest request, Options opts={})
Lists the supported instance configurations for a given project.
StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
Sets the access control policy on an instance resource.
StatusOr< google::spanner::admin::instance::v1::InstanceConfig > GetInstanceConfig(std::string const &name, Options opts={})
Gets information about a particular instance configuration.
Status DeleteInstance(std::string const &name, Options opts={})
Deletes an instance.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > UpdateInstance(google::spanner::admin::instance::v1::Instance const &instance, google::protobuf::FieldMask const &field_mask, Options opts={})
Updates an instance, and begins allocating or releasing resources as requested.
Status DeleteInstance(google::spanner::admin::instance::v1::DeleteInstanceRequest const &request, Options opts={})
Deletes an instance.
StreamRange< google::spanner::admin::instance::v1::Instance > ListInstances(google::spanner::admin::instance::v1::ListInstancesRequest request, Options opts={})
Lists all instances in the given project.
StatusOr< google::spanner::admin::instance::v1::InstanceConfig > GetInstanceConfig(google::spanner::admin::instance::v1::GetInstanceConfigRequest const &request, Options opts={})
Gets information about a particular instance configuration.
InstanceAdminClient(std::shared_ptr< InstanceAdminConnection > connection, Options opts={})
future< StatusOr< google::spanner::admin::instance::v1::Instance > > UpdateInstance(google::spanner::admin::instance::v1::UpdateInstanceRequest const &request, Options opts={})
Updates an instance, and begins allocating or releasing resources as requested.
StreamRange< google::spanner::admin::instance::v1::InstanceConfig > ListInstanceConfigs(std::string const &parent, Options opts={})
Lists the supported instance configurations for a given project.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > CreateInstance(google::spanner::admin::instance::v1::CreateInstanceRequest const &request, Options opts={})
Creates an instance and begins preparing it to begin serving.
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > > UpdateInstanceConfig(google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const &request, Options opts={})
Updates an instance config.
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > > CreateInstanceConfig(std::string const &parent, google::spanner::admin::instance::v1::InstanceConfig const &instance_config, std::string const &instance_config_id, Options opts={})
Creates an instance config and begins preparing it to be used.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > CreateInstance(std::string const &parent, std::string const &instance_id, google::spanner::admin::instance::v1::Instance const &instance, Options opts={})
Creates an instance and begins preparing it to begin serving.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
Sets the access control policy on an instance resource.
StatusOr< google::iam::v1::Policy > GetIamPolicy(std::string const &resource, Options opts={})
Gets the access control policy for an instance resource.
StatusOr< google::spanner::admin::instance::v1::Instance > GetInstance(std::string const &name, Options opts={})
Gets information about a particular instance.
InstanceAdminClient(InstanceAdminClient &&)=default
Status DeleteInstanceConfig(std::string const &name, Options opts={})
Deletes the instance config.
InstanceAdminClient & operator=(InstanceAdminClient &&)=default
StreamRange< google::longrunning::Operation > ListInstanceConfigOperations(google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest request, Options opts={})
Lists the user-managed instance config long-running operations in the given project.
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > > UpdateInstanceConfig(google::spanner::admin::instance::v1::InstanceConfig const &instance_config, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates an instance config.
StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
Gets the access control policy for an instance resource.
StreamRange< google::longrunning::Operation > ListInstanceConfigOperations(std::string const &parent, Options opts={})
Lists the user-managed instance config long-running operations in the given project.
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > > CreateInstanceConfig(google::spanner::admin::instance::v1::CreateInstanceConfigRequest const &request, Options opts={})
Creates an instance config and begins preparing it to be used.
friend bool operator!=(InstanceAdminClient const &a, InstanceAdminClient const &b)
Definition: instance_admin_client.h:104
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
Returns permissions that the caller has on the specified instance resource.
Status DeleteInstanceConfig(google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const &request, Options opts={})
Deletes the instance config.
friend bool operator==(InstanceAdminClient const &a, InstanceAdminClient const &b)
Definition: instance_admin_client.h:100
The InstanceAdminConnection object for InstanceAdminClient.
Definition: instance_admin_connection.h:64
Definition: database_admin_client.h:34