Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
Loading...
Searching...
No Matches
instance_admin_client.h
1// Copyright 2018 Google Inc.
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#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_CLIENT_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_CLIENT_H
17
18#include "google/cloud/bigtable/admin/bigtable_instance_admin_connection.h"
19#include "google/cloud/bigtable/client_options.h"
20#include "google/cloud/bigtable/version.h"
21#include <memory>
22#include <string>
23
24namespace google {
25namespace cloud {
26namespace bigtable {
27GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
28
29/**
30 * Creates a `bigtable_admin::BigtableInstanceAdminConnection` for
31 * `bigtable::InstanceAdmin` to use.
32 *
33 * This class is used to initiate a connection to the Cloud Bigtable Instance
34 * Admin service. It is maintained only for backwards compatibility.
35 *
36 * @deprecated Please use `bigtable_admin::BigtableInstanceAdminConnection` to
37 * configure `bigtable_admin::BigtableInstanceAdminClient`, instead of using
38 * this class to configure `bigtable::InstanceAdmin`.
39 */
40class InstanceAdminClient final {
41 public:
42 virtual ~InstanceAdminClient() = default;
43
44 /// The project id that this AdminClient works on.
45 virtual std::string const& project() { return project_; }
46
47 private:
48 friend class InstanceAdmin;
49 friend std::shared_ptr<InstanceAdminClient> MakeInstanceAdminClient(
50 std::string, Options);
51
52 InstanceAdminClient(std::string project, Options options)
53 : project_(std::move(project)),
55 std::move(options))) {}
56
57 std::string project_;
58 std::shared_ptr<bigtable_admin::BigtableInstanceAdminConnection> connection_;
59};
60
61/// Create a new instance admin client configured via @p options.
62std::shared_ptr<InstanceAdminClient> MakeInstanceAdminClient(
63 std::string project, Options options = {});
64
65/**
66 * Create a new instance admin client configured via @p options.
67 *
68 * @deprecated use the `MakeInstanceAdminClient` method which accepts
69 * `google::cloud::Options` instead.
70 */
71GOOGLE_CLOUD_CPP_DEPRECATED("use `MakeInstanceAdminClient` instead")
72std::shared_ptr<InstanceAdminClient> CreateDefaultInstanceAdminClient(
73 std::string project, ClientOptions options);
74
75GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
76} // namespace bigtable
77} // namespace cloud
78} // namespace google
79
80#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_CLIENT_H
Configuration options for the Bigtable Client.
Definition: client_options.h:55
virtual std::string const & project()
The project id that this AdminClient works on.
Definition: instance_admin_client.h:45
friend std::shared_ptr< InstanceAdminClient > MakeInstanceAdminClient(std::string, Options)
Create a new instance admin client configured via options.
Implements the APIs to administer Cloud Bigtable instances.
Definition: instance_admin.h:132
The BigtableInstanceAdminConnection object for BigtableInstanceAdminClient.
Definition: bigtable_instance_admin_connection.h:65
Definition: bigtable_instance_admin_client.h:35
std::shared_ptr< BigtableInstanceAdminConnection > MakeBigtableInstanceAdminConnection(Options options={})
A factory function to construct an object of type BigtableInstanceAdminConnection.
Contains all the Cloud Bigtable C++ client APIs.
Definition: admin_client.h:28
std::shared_ptr< InstanceAdminClient > CreateDefaultInstanceAdminClient(std::string project, ClientOptions options)
Create a new instance admin client configured via options.