Google Cloud Bigtable C++ Client  2.4.0
A C++ Client Library for Google Cloud Bigtable
bigtable_instance_admin_connection.h
Go to the documentation of this file.
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 // Generated by the Codegen C++ plugin.
16 // If you make any local changes, they will be lost.
17 // source: google/bigtable/admin/v2/bigtable_instance_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_INSTANCE_ADMIN_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_INSTANCE_ADMIN_CONNECTION_H
21 
22 #include "google/cloud/bigtable/admin/bigtable_instance_admin_connection_idempotency_policy.h"
23 #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_retry_traits.h"
24 #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h"
25 #include "google/cloud/backoff_policy.h"
26 #include "google/cloud/future.h"
27 #include "google/cloud/options.h"
28 #include "google/cloud/polling_policy.h"
29 #include "google/cloud/status_or.h"
30 #include "google/cloud/stream_range.h"
31 #include "google/cloud/version.h"
32 #include <google/longrunning/operations.grpc.pb.h>
33 #include <memory>
34 
35 namespace google {
36 namespace cloud {
37 namespace bigtable_admin {
39 
40 using BigtableInstanceAdminRetryPolicy =
41  ::google::cloud::internal::TraitBasedRetryPolicy<
42  bigtable_admin_internal::BigtableInstanceAdminRetryTraits>;
43 
44 using BigtableInstanceAdminLimitedTimeRetryPolicy =
45  ::google::cloud::internal::LimitedTimeRetryPolicy<
46  bigtable_admin_internal::BigtableInstanceAdminRetryTraits>;
47 
48 using BigtableInstanceAdminLimitedErrorCountRetryPolicy =
49  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
50  bigtable_admin_internal::BigtableInstanceAdminRetryTraits>;
51 
52 /**
53  * The `BigtableInstanceAdminConnection` object for
54  * `BigtableInstanceAdminClient`.
55  *
56  * This interface defines virtual methods for each of the user-facing overload
57  * sets in `BigtableInstanceAdminClient`. This allows users to inject custom
58  * behavior (e.g., with a Google Mock object) when writing tests that use
59  * objects of type `BigtableInstanceAdminClient`.
60  *
61  * To create a concrete instance, see `MakeBigtableInstanceAdminConnection()`.
62  *
63  * For mocking, see `bigtable_admin_mocks::MockBigtableInstanceAdminConnection`.
64  */
66  public:
68 
69  virtual Options options() { return Options{}; }
70 
71  virtual future<StatusOr<google::bigtable::admin::v2::Instance>>
73  google::bigtable::admin::v2::CreateInstanceRequest const& request);
74 
75  virtual StatusOr<google::bigtable::admin::v2::Instance> GetInstance(
76  google::bigtable::admin::v2::GetInstanceRequest const& request);
77 
78  virtual StatusOr<google::bigtable::admin::v2::ListInstancesResponse>
80  google::bigtable::admin::v2::ListInstancesRequest const& request);
81 
82  virtual StatusOr<google::bigtable::admin::v2::Instance> UpdateInstance(
83  google::bigtable::admin::v2::Instance const& request);
84 
85  virtual future<StatusOr<google::bigtable::admin::v2::Instance>>
87  google::bigtable::admin::v2::PartialUpdateInstanceRequest const& request);
88 
90  google::bigtable::admin::v2::DeleteInstanceRequest const& request);
91 
92  virtual future<StatusOr<google::bigtable::admin::v2::Cluster>> CreateCluster(
93  google::bigtable::admin::v2::CreateClusterRequest const& request);
94 
95  virtual StatusOr<google::bigtable::admin::v2::Cluster> GetCluster(
96  google::bigtable::admin::v2::GetClusterRequest const& request);
97 
98  virtual StatusOr<google::bigtable::admin::v2::ListClustersResponse>
99  ListClusters(google::bigtable::admin::v2::ListClustersRequest const& request);
100 
101  virtual future<StatusOr<google::bigtable::admin::v2::Cluster>> UpdateCluster(
102  google::bigtable::admin::v2::Cluster const& request);
103 
104  virtual future<StatusOr<google::bigtable::admin::v2::Cluster>>
106  google::bigtable::admin::v2::PartialUpdateClusterRequest const& request);
107 
109  google::bigtable::admin::v2::DeleteClusterRequest const& request);
110 
111  virtual StatusOr<google::bigtable::admin::v2::AppProfile> CreateAppProfile(
112  google::bigtable::admin::v2::CreateAppProfileRequest const& request);
113 
114  virtual StatusOr<google::bigtable::admin::v2::AppProfile> GetAppProfile(
115  google::bigtable::admin::v2::GetAppProfileRequest const& request);
116 
117  virtual StreamRange<google::bigtable::admin::v2::AppProfile> ListAppProfiles(
118  google::bigtable::admin::v2::ListAppProfilesRequest request);
119 
120  virtual future<StatusOr<google::bigtable::admin::v2::AppProfile>>
122  google::bigtable::admin::v2::UpdateAppProfileRequest const& request);
123 
125  google::bigtable::admin::v2::DeleteAppProfileRequest const& request);
126 
127  virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
128  google::iam::v1::GetIamPolicyRequest const& request);
129 
130  virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
131  google::iam::v1::SetIamPolicyRequest const& request);
132 
133  virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
134  TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
135 
136  virtual StreamRange<google::bigtable::admin::v2::HotTablet> ListHotTablets(
137  google::bigtable::admin::v2::ListHotTabletsRequest request);
138 };
139 
140 /**
141  * A factory function to construct an object of type
142  * `BigtableInstanceAdminConnection`.
143  *
144  * The returned connection object should not be used directly; instead it
145  * should be passed as an argument to the constructor of
146  * BigtableInstanceAdminClient.
147  *
148  * The optional @p options argument may be used to configure aspects of the
149  * returned `BigtableInstanceAdminConnection`. Expected options are any of the
150  * types in the following option lists:
151  *
152  * - `google::cloud::CommonOptionList`
153  * - `google::cloud::GrpcOptionList`
154  * - `google::cloud::UnifiedCredentialsOptionList`
155  * - `google::cloud::bigtable_admin::BigtableInstanceAdminPolicyOptionList`
156  *
157  * @note Unexpected options will be ignored. To log unexpected options instead,
158  * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
159  *
160  * @param options (optional) Configure the `BigtableInstanceAdminConnection`
161  * created by this function.
162  */
163 std::shared_ptr<BigtableInstanceAdminConnection>
165 
167 } // namespace bigtable_admin
168 } // namespace cloud
169 } // namespace google
170 
171 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_INSTANCE_ADMIN_CONNECTION_H