15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_H
18#include "google/cloud/bigtable/admin/bigtable_instance_admin_connection.h"
19#include "google/cloud/bigtable/admin/bigtable_instance_admin_options.h"
20#include "google/cloud/bigtable/app_profile_config.h"
21#include "google/cloud/bigtable/cluster_config.h"
22#include "google/cloud/bigtable/cluster_list_responses.h"
23#include "google/cloud/bigtable/completion_queue.h"
24#include "google/cloud/bigtable/iam_policy.h"
25#include "google/cloud/bigtable/instance_admin_client.h"
26#include "google/cloud/bigtable/instance_config.h"
27#include "google/cloud/bigtable/instance_list_responses.h"
28#include "google/cloud/bigtable/instance_update_config.h"
29#include "google/cloud/bigtable/internal/convert_policies.h"
30#include "google/cloud/bigtable/polling_policy.h"
31#include "google/cloud/bigtable/resource_names.h"
32#include "google/cloud/bigtable/version.h"
33#include "google/cloud/future.h"
34#include "google/cloud/project.h"
35#include "google/cloud/status_or.h"
43namespace bigtable_internal {
44GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
45class InstanceAdminTester;
46GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
49GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
138 : connection_(std::move(connection)),
139 project_id_(std::move(project)),
148 bigtable_internal::MakeInstanceAdminOptions(
149 retry_prototype_, backoff_prototype_, polling_prototype_),
153
154
156 explicit InstanceAdmin(std::shared_ptr<InstanceAdminClient> client)
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182 template <
typename... Policies>
184 explicit InstanceAdmin(std::shared_ptr<InstanceAdminClient> client,
185 Policies&&... policies)
186 : connection_(client->connection_),
195 ChangePolicies(std::forward<Policies>(policies)...);
197 bigtable_internal::MakeInstanceAdminOptions(
198 retry_prototype_, backoff_prototype_, polling_prototype_),
203 std::string
const&
project_name()
const {
return project_name_; }
205 std::string
const&
project_id()
const {
return project_id_; }
208
209
210
213 admin.project_id_ = std::move(project_id);
219 std::string
InstanceName(std::string
const& instance_id)
const {
225 std::string
ClusterName(std::string
const& instance_id,
226 std::string
const& cluster_id)
const {
232 std::string
const& profile_id)
const {
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
290 ClusterConfig cluster_config, std::string
const& instance_id,
291 std::string
const& cluster_id);
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
347
348
349
350
351
352
353
354
355
356
357
358
359
361 std::string
const& instance_id);
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
477 std::string
const& cluster_id);
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
499 std::string
const& instance_id, std::string
const& cluster_id);
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
544 std::string
const& instance_id, std::string
const& profile_id);
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
572 std::string
const& instance_id, std::string
const& profile_id,
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592 StatusOr<std::vector<
google::bigtable::admin::v2::AppProfile>>
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
617 std::string
const& profile_id,
618 bool ignore_warnings =
true);
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
638 std::string
const& instance_id);
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
662 std::string
const& instance_id,
663 google::iam::v1::Policy
const& iam_policy);
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
686 std::string
const& instance_id,
687 std::vector<std::string>
const& permissions);
690 friend class bigtable_internal::InstanceAdminTester;
699 backoff_prototype_ = policy
.clone();
703 polling_prototype_ = policy
.clone();
706 template <
typename Policy,
typename... Policies>
707 void ChangePolicies(Policy&& policy, Policies&&... policies) {
708 ChangePolicy(policy);
709 ChangePolicies(std::forward<Policies>(policies)...);
711 void ChangePolicies() {}
715 std::string project_id_;
716 std::string project_name_;
727GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Options & operator=(Options &&)=default
Project(std::string project_id)
std::string FullName() const
Specify the initial configuration for an application profile.
Definition: app_profile_config.h:27
Build a proto to update an Application Profile configuration.
Definition: app_profile_config.h:99
Specify the initial configuration for a new cluster.
Definition: cluster_config.h:28
virtual std::string const & project()
The project id that this AdminClient works on.
Definition: instance_admin_client.h:45
Implements the APIs to administer Cloud Bigtable instances.
Definition: instance_admin.h:132
StatusOr< ClusterList > ListClusters(std::string const &instance_id)
Obtain the list of clusters in an instance.
StatusOr< std::vector< std::string > > TestIamPermissions(std::string const &instance_id, std::vector< std::string > const &permissions)
Returns a permission set that the caller has on the specified instance.
std::string const & project_name() const
The full name (projects/<project_id>) of the project.
Definition: instance_admin.h:203
future< StatusOr< google::bigtable::admin::v2::Instance > > CreateInstance(InstanceConfig instance_config)
Create a new instance of Cloud Bigtable.
std::string AppProfileName(std::string const &instance_id, std::string const &profile_id) const
Definition: instance_admin.h:231
InstanceAdmin WithNewTarget(std::string project_id) const
Returns an InstanceAdmin that reuses the connection and configuration of this InstanceAdmin,...
Definition: instance_admin.h:211
Status DeleteInstance(std::string const &instance_id)
Deletes the instances in the project.
StatusOr< ClusterList > ListClusters()
Obtain the list of clusters in an instance.
StatusOr< google::bigtable::admin::v2::AppProfile > GetAppProfile(std::string const &instance_id, std::string const &profile_id)
Fetch the detailed information about an existing application profile.
future< StatusOr< google::bigtable::admin::v2::Cluster > > CreateCluster(ClusterConfig cluster_config, std::string const &instance_id, std::string const &cluster_id)
Create a new Cluster of Cloud Bigtable.
StatusOr< std::vector< google::bigtable::admin::v2::AppProfile > > ListAppProfiles(std::string const &instance_id)
List the application profiles in an instance.
future< StatusOr< google::bigtable::admin::v2::Cluster > > UpdateCluster(ClusterConfig cluster_config)
Update an existing cluster of Cloud Bigtable.
future< StatusOr< google::bigtable::admin::v2::Instance > > UpdateInstance(InstanceUpdateConfig instance_update_config)
Update an existing instance of Cloud Bigtable.
StatusOr< google::iam::v1::Policy > GetNativeIamPolicy(std::string const &instance_id)
Gets the native policy for instance_id.
StatusOr< google::bigtable::admin::v2::Instance > GetInstance(std::string const &instance_id)
Return the details of instance_id.
InstanceAdmin(std::shared_ptr< bigtable_admin::BigtableInstanceAdminConnection > connection, std::string project)
Definition: instance_admin.h:134
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &instance_id, google::iam::v1::Policy const &iam_policy)
Sets the IAM policy for an instance.
InstanceAdmin(std::shared_ptr< InstanceAdminClient > client)
Definition: instance_admin.h:156
StatusOr< google::bigtable::admin::v2::Cluster > GetCluster(std::string const &instance_id, std::string const &cluster_id)
Gets the specified cluster of an instance in the project.
std::string const & project_id() const
The project id, i.e., project_name() without the projects/ prefix.
Definition: instance_admin.h:205
StatusOr< google::bigtable::admin::v2::AppProfile > CreateAppProfile(std::string const &instance_id, AppProfileConfig config)
Create a new application profile.
std::string ClusterName(std::string const &instance_id, std::string const &cluster_id) const
Return the fully qualified name of the given cluster_id in give instance_id.
Definition: instance_admin.h:225
future< StatusOr< google::bigtable::admin::v2::AppProfile > > UpdateAppProfile(std::string const &instance_id, std::string const &profile_id, AppProfileUpdateConfig config)
Updates an existing application profile.
StatusOr< InstanceList > ListInstances()
Obtain the list of instances in the project.
Status DeleteAppProfile(std::string const &instance_id, std::string const &profile_id, bool ignore_warnings=true)
Delete an existing application profile.
InstanceAdmin(std::shared_ptr< InstanceAdminClient > client, Policies &&... policies)
Create a new InstanceAdmin using explicit policies to handle RPC errors.
Definition: instance_admin.h:184
Status DeleteCluster(std::string const &instance_id, std::string const &cluster_id)
Deletes the specified cluster of an instance in the project.
std::string InstanceName(std::string const &instance_id) const
Return the fully qualified name of the given instance_id.
Definition: instance_admin.h:219
Specify the initial configuration for a new instance.
Definition: instance_config.h:30
Specify the initial configuration for updating an instance.
Definition: instance_update_config.h:33
Define the interface for providing asynchronous repetitive call rules.
Definition: polling_policy.h:34
virtual std::unique_ptr< PollingPolicy > clone() const =0
Return a new copy of this object.
Define the interface for controlling how the Bigtable client backsoff from failed RPC operations.
Definition: rpc_backoff_policy.h:44
virtual std::unique_ptr< RPCBackoffPolicy > clone() const =0
Return a new copy of this object.
Define the interface for controlling how the Bigtable client retries RPC operations.
Definition: rpc_retry_policy.h:78
virtual std::unique_ptr< RPCRetryPolicy > clone() const =0
Return a new copy of this object.
The BigtableInstanceAdminConnection object for BigtableInstanceAdminClient.
Definition: bigtable_instance_admin_connection.h:65
virtual Options options()
Definition: bigtable_instance_admin_connection.h:69
friend friend class future
Definition: bigtable_instance_admin_client.h:35
Contains all the Cloud Bigtable C++ client APIs.
Definition: admin_client.h:28
std::unique_ptr< RPCBackoffPolicy > DefaultRPCBackoffPolicy(internal::RPCPolicyParameters defaults)
Return an instance of the default RPCBackoffPolicy.
std::string InstanceName(std::string const &project_id, std::string const &instance_id)
std::string ClusterName(std::string const &project_id, std::string const &instance_id, std::string const &cluster_id)
std::unique_ptr< RPCRetryPolicy > DefaultRPCRetryPolicy(internal::RPCPolicyParameters defaults)
Return an instance of the default RPCRetryPolicy.
std::unique_ptr< PollingPolicy > DefaultPollingPolicy(internal::RPCPolicyParameters defaults)
std::string AppProfileName(std::string const &project_id, std::string const &instance_id, std::string const &app_profile_id)
The response for an asynchronous request listing all the clusters.
Definition: cluster_list_responses.h:30
The response for an asynchronous request listing all the instances.
Definition: instance_list_responses.h:30