google-cloud-bigtable-admin-v2 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,6 +108,11 @@ module Google
108
108
  initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
109
109
  }
110
110
 
111
+ default_config.rpcs.partial_update_cluster.timeout = 60.0
112
+ default_config.rpcs.partial_update_cluster.retry_policy = {
113
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
114
+ }
115
+
111
116
  default_config.rpcs.delete_cluster.timeout = 60.0
112
117
 
113
118
  default_config.rpcs.create_app_profile.timeout = 60.0
@@ -236,6 +241,12 @@ module Google
236
241
  ##
237
242
  # Create an instance within a project.
238
243
  #
244
+ # Note that exactly one of Cluster.serve_nodes and
245
+ # Cluster.cluster_config.cluster_autoscaling_config can be set. If
246
+ # serve_nodes is set to non-zero, then the cluster is manually scaled. If
247
+ # cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
248
+ # enabled.
249
+ #
239
250
  # @overload create_instance(request, options = nil)
240
251
  # Pass arguments to `create_instance` via a request object, either of type
241
252
  # {::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest} or an equivalent Hash.
@@ -276,6 +287,28 @@ module Google
276
287
  #
277
288
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
278
289
  #
290
+ # @example Basic example
291
+ # require "google/cloud/bigtable/admin/v2"
292
+ #
293
+ # # Create a client object. The client can be reused for multiple calls.
294
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
295
+ #
296
+ # # Create a request. To set request fields, pass in keyword arguments.
297
+ # request = Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest.new
298
+ #
299
+ # # Call the create_instance method.
300
+ # result = client.create_instance request
301
+ #
302
+ # # The returned object is of type Gapic::Operation. You can use this
303
+ # # object to check the status of an operation, cancel it, or wait
304
+ # # for results. Here is how to block until completion:
305
+ # result.wait_until_done! timeout: 60
306
+ # if result.response?
307
+ # p result.response
308
+ # else
309
+ # puts "Error!"
310
+ # end
311
+ #
279
312
  def create_instance request, options = nil
280
313
  raise ::ArgumentError, "request must be provided" if request.nil?
281
314
 
@@ -293,9 +326,11 @@ module Google
293
326
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
294
327
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
328
 
296
- header_params = {
297
- "parent" => request.parent
298
- }
329
+ header_params = {}
330
+ if request.parent
331
+ header_params["parent"] = request.parent
332
+ end
333
+
299
334
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
300
335
  metadata[:"x-goog-request-params"] ||= request_params_header
301
336
 
@@ -346,6 +381,21 @@ module Google
346
381
  #
347
382
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
348
383
  #
384
+ # @example Basic example
385
+ # require "google/cloud/bigtable/admin/v2"
386
+ #
387
+ # # Create a client object. The client can be reused for multiple calls.
388
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
389
+ #
390
+ # # Create a request. To set request fields, pass in keyword arguments.
391
+ # request = Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest.new
392
+ #
393
+ # # Call the get_instance method.
394
+ # result = client.get_instance request
395
+ #
396
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance.
397
+ # p result
398
+ #
349
399
  def get_instance request, options = nil
350
400
  raise ::ArgumentError, "request must be provided" if request.nil?
351
401
 
@@ -363,9 +413,11 @@ module Google
363
413
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
364
414
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
365
415
 
366
- header_params = {
367
- "name" => request.name
368
- }
416
+ header_params = {}
417
+ if request.name
418
+ header_params["name"] = request.name
419
+ end
420
+
369
421
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
370
422
  metadata[:"x-goog-request-params"] ||= request_params_header
371
423
 
@@ -417,6 +469,21 @@ module Google
417
469
  #
418
470
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
419
471
  #
472
+ # @example Basic example
473
+ # require "google/cloud/bigtable/admin/v2"
474
+ #
475
+ # # Create a client object. The client can be reused for multiple calls.
476
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
477
+ #
478
+ # # Create a request. To set request fields, pass in keyword arguments.
479
+ # request = Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest.new
480
+ #
481
+ # # Call the list_instances method.
482
+ # result = client.list_instances request
483
+ #
484
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse.
485
+ # p result
486
+ #
420
487
  def list_instances request, options = nil
421
488
  raise ::ArgumentError, "request must be provided" if request.nil?
422
489
 
@@ -434,9 +501,11 @@ module Google
434
501
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
435
502
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
503
 
437
- header_params = {
438
- "parent" => request.parent
439
- }
504
+ header_params = {}
505
+ if request.parent
506
+ header_params["parent"] = request.parent
507
+ end
508
+
440
509
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
441
510
  metadata[:"x-goog-request-params"] ||= request_params_header
442
511
 
@@ -506,6 +575,21 @@ module Google
506
575
  #
507
576
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
508
577
  #
578
+ # @example Basic example
579
+ # require "google/cloud/bigtable/admin/v2"
580
+ #
581
+ # # Create a client object. The client can be reused for multiple calls.
582
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
583
+ #
584
+ # # Create a request. To set request fields, pass in keyword arguments.
585
+ # request = Google::Cloud::Bigtable::Admin::V2::Instance.new
586
+ #
587
+ # # Call the update_instance method.
588
+ # result = client.update_instance request
589
+ #
590
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance.
591
+ # p result
592
+ #
509
593
  def update_instance request, options = nil
510
594
  raise ::ArgumentError, "request must be provided" if request.nil?
511
595
 
@@ -523,9 +607,11 @@ module Google
523
607
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
524
608
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
525
609
 
526
- header_params = {
527
- "name" => request.name
528
- }
610
+ header_params = {}
611
+ if request.name
612
+ header_params["name"] = request.name
613
+ end
614
+
529
615
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
530
616
  metadata[:"x-goog-request-params"] ||= request_params_header
531
617
 
@@ -578,6 +664,28 @@ module Google
578
664
  #
579
665
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
580
666
  #
667
+ # @example Basic example
668
+ # require "google/cloud/bigtable/admin/v2"
669
+ #
670
+ # # Create a client object. The client can be reused for multiple calls.
671
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
672
+ #
673
+ # # Create a request. To set request fields, pass in keyword arguments.
674
+ # request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest.new
675
+ #
676
+ # # Call the partial_update_instance method.
677
+ # result = client.partial_update_instance request
678
+ #
679
+ # # The returned object is of type Gapic::Operation. You can use this
680
+ # # object to check the status of an operation, cancel it, or wait
681
+ # # for results. Here is how to block until completion:
682
+ # result.wait_until_done! timeout: 60
683
+ # if result.response?
684
+ # p result.response
685
+ # else
686
+ # puts "Error!"
687
+ # end
688
+ #
581
689
  def partial_update_instance request, options = nil
582
690
  raise ::ArgumentError, "request must be provided" if request.nil?
583
691
 
@@ -595,9 +703,11 @@ module Google
595
703
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
596
704
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
597
705
 
598
- header_params = {
599
- "instance.name" => request.instance.name
600
- }
706
+ header_params = {}
707
+ if request.instance&.name
708
+ header_params["instance.name"] = request.instance.name
709
+ end
710
+
601
711
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
602
712
  metadata[:"x-goog-request-params"] ||= request_params_header
603
713
 
@@ -648,6 +758,21 @@ module Google
648
758
  #
649
759
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
650
760
  #
761
+ # @example Basic example
762
+ # require "google/cloud/bigtable/admin/v2"
763
+ #
764
+ # # Create a client object. The client can be reused for multiple calls.
765
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
766
+ #
767
+ # # Create a request. To set request fields, pass in keyword arguments.
768
+ # request = Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest.new
769
+ #
770
+ # # Call the delete_instance method.
771
+ # result = client.delete_instance request
772
+ #
773
+ # # The returned object is of type Google::Protobuf::Empty.
774
+ # p result
775
+ #
651
776
  def delete_instance request, options = nil
652
777
  raise ::ArgumentError, "request must be provided" if request.nil?
653
778
 
@@ -665,9 +790,11 @@ module Google
665
790
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
666
791
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
667
792
 
668
- header_params = {
669
- "name" => request.name
670
- }
793
+ header_params = {}
794
+ if request.name
795
+ header_params["name"] = request.name
796
+ end
797
+
671
798
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
672
799
  metadata[:"x-goog-request-params"] ||= request_params_header
673
800
 
@@ -690,6 +817,12 @@ module Google
690
817
  ##
691
818
  # Creates a cluster within an instance.
692
819
  #
820
+ # Note that exactly one of Cluster.serve_nodes and
821
+ # Cluster.cluster_config.cluster_autoscaling_config can be set. If
822
+ # serve_nodes is set to non-zero, then the cluster is manually scaled. If
823
+ # cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
824
+ # enabled.
825
+ #
693
826
  # @overload create_cluster(request, options = nil)
694
827
  # Pass arguments to `create_cluster` via a request object, either of type
695
828
  # {::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest} or an equivalent Hash.
@@ -725,6 +858,28 @@ module Google
725
858
  #
726
859
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
727
860
  #
861
+ # @example Basic example
862
+ # require "google/cloud/bigtable/admin/v2"
863
+ #
864
+ # # Create a client object. The client can be reused for multiple calls.
865
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
866
+ #
867
+ # # Create a request. To set request fields, pass in keyword arguments.
868
+ # request = Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest.new
869
+ #
870
+ # # Call the create_cluster method.
871
+ # result = client.create_cluster request
872
+ #
873
+ # # The returned object is of type Gapic::Operation. You can use this
874
+ # # object to check the status of an operation, cancel it, or wait
875
+ # # for results. Here is how to block until completion:
876
+ # result.wait_until_done! timeout: 60
877
+ # if result.response?
878
+ # p result.response
879
+ # else
880
+ # puts "Error!"
881
+ # end
882
+ #
728
883
  def create_cluster request, options = nil
729
884
  raise ::ArgumentError, "request must be provided" if request.nil?
730
885
 
@@ -742,9 +897,11 @@ module Google
742
897
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
743
898
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
744
899
 
745
- header_params = {
746
- "parent" => request.parent
747
- }
900
+ header_params = {}
901
+ if request.parent
902
+ header_params["parent"] = request.parent
903
+ end
904
+
748
905
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
749
906
  metadata[:"x-goog-request-params"] ||= request_params_header
750
907
 
@@ -795,6 +952,21 @@ module Google
795
952
  #
796
953
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
797
954
  #
955
+ # @example Basic example
956
+ # require "google/cloud/bigtable/admin/v2"
957
+ #
958
+ # # Create a client object. The client can be reused for multiple calls.
959
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
960
+ #
961
+ # # Create a request. To set request fields, pass in keyword arguments.
962
+ # request = Google::Cloud::Bigtable::Admin::V2::GetClusterRequest.new
963
+ #
964
+ # # Call the get_cluster method.
965
+ # result = client.get_cluster request
966
+ #
967
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Cluster.
968
+ # p result
969
+ #
798
970
  def get_cluster request, options = nil
799
971
  raise ::ArgumentError, "request must be provided" if request.nil?
800
972
 
@@ -812,9 +984,11 @@ module Google
812
984
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
813
985
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
814
986
 
815
- header_params = {
816
- "name" => request.name
817
- }
987
+ header_params = {}
988
+ if request.name
989
+ header_params["name"] = request.name
990
+ end
991
+
818
992
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
819
993
  metadata[:"x-goog-request-params"] ||= request_params_header
820
994
 
@@ -868,6 +1042,21 @@ module Google
868
1042
  #
869
1043
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
870
1044
  #
1045
+ # @example Basic example
1046
+ # require "google/cloud/bigtable/admin/v2"
1047
+ #
1048
+ # # Create a client object. The client can be reused for multiple calls.
1049
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1050
+ #
1051
+ # # Create a request. To set request fields, pass in keyword arguments.
1052
+ # request = Google::Cloud::Bigtable::Admin::V2::ListClustersRequest.new
1053
+ #
1054
+ # # Call the list_clusters method.
1055
+ # result = client.list_clusters request
1056
+ #
1057
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListClustersResponse.
1058
+ # p result
1059
+ #
871
1060
  def list_clusters request, options = nil
872
1061
  raise ::ArgumentError, "request must be provided" if request.nil?
873
1062
 
@@ -885,9 +1074,11 @@ module Google
885
1074
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
886
1075
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
887
1076
 
888
- header_params = {
889
- "parent" => request.parent
890
- }
1077
+ header_params = {}
1078
+ if request.parent
1079
+ header_params["parent"] = request.parent
1080
+ end
1081
+
891
1082
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
892
1083
  metadata[:"x-goog-request-params"] ||= request_params_header
893
1084
 
@@ -910,6 +1101,10 @@ module Google
910
1101
  ##
911
1102
  # Updates a cluster within an instance.
912
1103
  #
1104
+ # Note that UpdateCluster does not support updating
1105
+ # cluster_config.cluster_autoscaling_config. In order to update it, you
1106
+ # must use PartialUpdateCluster.
1107
+ #
913
1108
  # @overload update_cluster(request, options = nil)
914
1109
  # Pass arguments to `update_cluster` via a request object, either of type
915
1110
  # {::Google::Cloud::Bigtable::Admin::V2::Cluster} or an equivalent Hash.
@@ -920,7 +1115,7 @@ module Google
920
1115
  # @param options [::Gapic::CallOptions, ::Hash]
921
1116
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
922
1117
  #
923
- # @overload update_cluster(location: nil, serve_nodes: nil, default_storage_type: nil, encryption_config: nil)
1118
+ # @overload update_cluster(location: nil, serve_nodes: nil, cluster_config: nil, default_storage_type: nil, encryption_config: nil)
924
1119
  # Pass arguments to `update_cluster` via keyword arguments. Note that at
925
1120
  # least one keyword argument is required. To specify no parameters, or to keep all
926
1121
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -932,8 +1127,10 @@ module Google
932
1127
  # cluster. Currently only zones are supported, so values should be of the
933
1128
  # form `projects/{project}/locations/{zone}`.
934
1129
  # @param serve_nodes [::Integer]
935
- # Required. The number of nodes allocated to this cluster. More nodes enable
936
- # higher throughput and more consistent performance.
1130
+ # The number of nodes allocated to this cluster. More nodes enable higher
1131
+ # throughput and more consistent performance.
1132
+ # @param cluster_config [::Google::Cloud::Bigtable::Admin::V2::Cluster::ClusterConfig, ::Hash]
1133
+ # Configuration for this cluster.
937
1134
  # @param default_storage_type [::Google::Cloud::Bigtable::Admin::V2::StorageType]
938
1135
  # (`CreationOnly`)
939
1136
  # The type of storage used by this cluster to serve its
@@ -949,6 +1146,28 @@ module Google
949
1146
  #
950
1147
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
951
1148
  #
1149
+ # @example Basic example
1150
+ # require "google/cloud/bigtable/admin/v2"
1151
+ #
1152
+ # # Create a client object. The client can be reused for multiple calls.
1153
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1154
+ #
1155
+ # # Create a request. To set request fields, pass in keyword arguments.
1156
+ # request = Google::Cloud::Bigtable::Admin::V2::Cluster.new
1157
+ #
1158
+ # # Call the update_cluster method.
1159
+ # result = client.update_cluster request
1160
+ #
1161
+ # # The returned object is of type Gapic::Operation. You can use this
1162
+ # # object to check the status of an operation, cancel it, or wait
1163
+ # # for results. Here is how to block until completion:
1164
+ # result.wait_until_done! timeout: 60
1165
+ # if result.response?
1166
+ # p result.response
1167
+ # else
1168
+ # puts "Error!"
1169
+ # end
1170
+ #
952
1171
  def update_cluster request, options = nil
953
1172
  raise ::ArgumentError, "request must be provided" if request.nil?
954
1173
 
@@ -966,9 +1185,11 @@ module Google
966
1185
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
967
1186
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
968
1187
 
969
- header_params = {
970
- "name" => request.name
971
- }
1188
+ header_params = {}
1189
+ if request.name
1190
+ header_params["name"] = request.name
1191
+ end
1192
+
972
1193
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
973
1194
  metadata[:"x-goog-request-params"] ||= request_params_header
974
1195
 
@@ -989,6 +1210,113 @@ module Google
989
1210
  raise ::Google::Cloud::Error.from_error(e)
990
1211
  end
991
1212
 
1213
+ ##
1214
+ # Partially updates a cluster within a project. This method is the preferred
1215
+ # way to update a Cluster.
1216
+ #
1217
+ # To enable and update autoscaling, set
1218
+ # cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
1219
+ # serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
1220
+ # are ignored. Note that an update cannot simultaneously set serve_nodes to
1221
+ # non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
1222
+ # also specify both in the update_mask.
1223
+ #
1224
+ # To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
1225
+ # and explicitly set a serve_node count via the update_mask.
1226
+ #
1227
+ # @overload partial_update_cluster(request, options = nil)
1228
+ # Pass arguments to `partial_update_cluster` via a request object, either of type
1229
+ # {::Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest} or an equivalent Hash.
1230
+ #
1231
+ # @param request [::Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest, ::Hash]
1232
+ # A request object representing the call parameters. Required. To specify no
1233
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1234
+ # @param options [::Gapic::CallOptions, ::Hash]
1235
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1236
+ #
1237
+ # @overload partial_update_cluster(cluster: nil, update_mask: nil)
1238
+ # Pass arguments to `partial_update_cluster` via keyword arguments. Note that at
1239
+ # least one keyword argument is required. To specify no parameters, or to keep all
1240
+ # the default parameter values, pass an empty Hash as a request object (see above).
1241
+ #
1242
+ # @param cluster [::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash]
1243
+ # Required. The Cluster which contains the partial updates to be applied, subject to
1244
+ # the update_mask.
1245
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1246
+ # Required. The subset of Cluster fields which should be replaced.
1247
+ #
1248
+ # @yield [response, operation] Access the result along with the RPC operation
1249
+ # @yieldparam response [::Gapic::Operation]
1250
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1251
+ #
1252
+ # @return [::Gapic::Operation]
1253
+ #
1254
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1255
+ #
1256
+ # @example Basic example
1257
+ # require "google/cloud/bigtable/admin/v2"
1258
+ #
1259
+ # # Create a client object. The client can be reused for multiple calls.
1260
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1261
+ #
1262
+ # # Create a request. To set request fields, pass in keyword arguments.
1263
+ # request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest.new
1264
+ #
1265
+ # # Call the partial_update_cluster method.
1266
+ # result = client.partial_update_cluster request
1267
+ #
1268
+ # # The returned object is of type Gapic::Operation. You can use this
1269
+ # # object to check the status of an operation, cancel it, or wait
1270
+ # # for results. Here is how to block until completion:
1271
+ # result.wait_until_done! timeout: 60
1272
+ # if result.response?
1273
+ # p result.response
1274
+ # else
1275
+ # puts "Error!"
1276
+ # end
1277
+ #
1278
+ def partial_update_cluster request, options = nil
1279
+ raise ::ArgumentError, "request must be provided" if request.nil?
1280
+
1281
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest
1282
+
1283
+ # Converts hash and nil to an options object
1284
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1285
+
1286
+ # Customize the options with defaults
1287
+ metadata = @config.rpcs.partial_update_cluster.metadata.to_h
1288
+
1289
+ # Set x-goog-api-client and x-goog-user-project headers
1290
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1291
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1292
+ gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1293
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1294
+
1295
+ header_params = {}
1296
+ if request.cluster&.name
1297
+ header_params["cluster.name"] = request.cluster.name
1298
+ end
1299
+
1300
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1301
+ metadata[:"x-goog-request-params"] ||= request_params_header
1302
+
1303
+ options.apply_defaults timeout: @config.rpcs.partial_update_cluster.timeout,
1304
+ metadata: metadata,
1305
+ retry_policy: @config.rpcs.partial_update_cluster.retry_policy
1306
+
1307
+ options.apply_defaults timeout: @config.timeout,
1308
+ metadata: @config.metadata,
1309
+ retry_policy: @config.retry_policy
1310
+
1311
+ @bigtable_instance_admin_stub.call_rpc :partial_update_cluster, request, options: options do |response, operation|
1312
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1313
+ yield response, operation if block_given?
1314
+ return response
1315
+ end
1316
+ rescue ::GRPC::BadStatus => e
1317
+ raise ::Google::Cloud::Error.from_error(e)
1318
+ end
1319
+
992
1320
  ##
993
1321
  # Deletes a cluster from an instance.
994
1322
  #
@@ -1019,6 +1347,21 @@ module Google
1019
1347
  #
1020
1348
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1021
1349
  #
1350
+ # @example Basic example
1351
+ # require "google/cloud/bigtable/admin/v2"
1352
+ #
1353
+ # # Create a client object. The client can be reused for multiple calls.
1354
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1355
+ #
1356
+ # # Create a request. To set request fields, pass in keyword arguments.
1357
+ # request = Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest.new
1358
+ #
1359
+ # # Call the delete_cluster method.
1360
+ # result = client.delete_cluster request
1361
+ #
1362
+ # # The returned object is of type Google::Protobuf::Empty.
1363
+ # p result
1364
+ #
1022
1365
  def delete_cluster request, options = nil
1023
1366
  raise ::ArgumentError, "request must be provided" if request.nil?
1024
1367
 
@@ -1036,9 +1379,11 @@ module Google
1036
1379
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1037
1380
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1038
1381
 
1039
- header_params = {
1040
- "name" => request.name
1041
- }
1382
+ header_params = {}
1383
+ if request.name
1384
+ header_params["name"] = request.name
1385
+ end
1386
+
1042
1387
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1043
1388
  metadata[:"x-goog-request-params"] ||= request_params_header
1044
1389
 
@@ -1098,6 +1443,21 @@ module Google
1098
1443
  #
1099
1444
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1100
1445
  #
1446
+ # @example Basic example
1447
+ # require "google/cloud/bigtable/admin/v2"
1448
+ #
1449
+ # # Create a client object. The client can be reused for multiple calls.
1450
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1451
+ #
1452
+ # # Create a request. To set request fields, pass in keyword arguments.
1453
+ # request = Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest.new
1454
+ #
1455
+ # # Call the create_app_profile method.
1456
+ # result = client.create_app_profile request
1457
+ #
1458
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile.
1459
+ # p result
1460
+ #
1101
1461
  def create_app_profile request, options = nil
1102
1462
  raise ::ArgumentError, "request must be provided" if request.nil?
1103
1463
 
@@ -1115,9 +1475,11 @@ module Google
1115
1475
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1116
1476
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1117
1477
 
1118
- header_params = {
1119
- "parent" => request.parent
1120
- }
1478
+ header_params = {}
1479
+ if request.parent
1480
+ header_params["parent"] = request.parent
1481
+ end
1482
+
1121
1483
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1122
1484
  metadata[:"x-goog-request-params"] ||= request_params_header
1123
1485
 
@@ -1167,6 +1529,21 @@ module Google
1167
1529
  #
1168
1530
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1169
1531
  #
1532
+ # @example Basic example
1533
+ # require "google/cloud/bigtable/admin/v2"
1534
+ #
1535
+ # # Create a client object. The client can be reused for multiple calls.
1536
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1537
+ #
1538
+ # # Create a request. To set request fields, pass in keyword arguments.
1539
+ # request = Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest.new
1540
+ #
1541
+ # # Call the get_app_profile method.
1542
+ # result = client.get_app_profile request
1543
+ #
1544
+ # # The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile.
1545
+ # p result
1546
+ #
1170
1547
  def get_app_profile request, options = nil
1171
1548
  raise ::ArgumentError, "request must be provided" if request.nil?
1172
1549
 
@@ -1184,9 +1561,11 @@ module Google
1184
1561
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1185
1562
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1186
1563
 
1187
- header_params = {
1188
- "name" => request.name
1189
- }
1564
+ header_params = {}
1565
+ if request.name
1566
+ header_params["name"] = request.name
1567
+ end
1568
+
1190
1569
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1191
1570
  metadata[:"x-goog-request-params"] ||= request_params_header
1192
1571
 
@@ -1251,6 +1630,27 @@ module Google
1251
1630
  #
1252
1631
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1253
1632
  #
1633
+ # @example Basic example
1634
+ # require "google/cloud/bigtable/admin/v2"
1635
+ #
1636
+ # # Create a client object. The client can be reused for multiple calls.
1637
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1638
+ #
1639
+ # # Create a request. To set request fields, pass in keyword arguments.
1640
+ # request = Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest.new
1641
+ #
1642
+ # # Call the list_app_profiles method.
1643
+ # result = client.list_app_profiles request
1644
+ #
1645
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1646
+ # # iterate over all elements by calling #each, and the enumerable
1647
+ # # will lazily make API calls to fetch subsequent pages. Other
1648
+ # # methods are also available for managing paging directly.
1649
+ # result.each do |response|
1650
+ # # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::AppProfile.
1651
+ # p response
1652
+ # end
1653
+ #
1254
1654
  def list_app_profiles request, options = nil
1255
1655
  raise ::ArgumentError, "request must be provided" if request.nil?
1256
1656
 
@@ -1268,9 +1668,11 @@ module Google
1268
1668
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1269
1669
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1270
1670
 
1271
- header_params = {
1272
- "parent" => request.parent
1273
- }
1671
+ header_params = {}
1672
+ if request.parent
1673
+ header_params["parent"] = request.parent
1674
+ end
1675
+
1274
1676
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1275
1677
  metadata[:"x-goog-request-params"] ||= request_params_header
1276
1678
 
@@ -1325,6 +1727,28 @@ module Google
1325
1727
  #
1326
1728
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1327
1729
  #
1730
+ # @example Basic example
1731
+ # require "google/cloud/bigtable/admin/v2"
1732
+ #
1733
+ # # Create a client object. The client can be reused for multiple calls.
1734
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1735
+ #
1736
+ # # Create a request. To set request fields, pass in keyword arguments.
1737
+ # request = Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest.new
1738
+ #
1739
+ # # Call the update_app_profile method.
1740
+ # result = client.update_app_profile request
1741
+ #
1742
+ # # The returned object is of type Gapic::Operation. You can use this
1743
+ # # object to check the status of an operation, cancel it, or wait
1744
+ # # for results. Here is how to block until completion:
1745
+ # result.wait_until_done! timeout: 60
1746
+ # if result.response?
1747
+ # p result.response
1748
+ # else
1749
+ # puts "Error!"
1750
+ # end
1751
+ #
1328
1752
  def update_app_profile request, options = nil
1329
1753
  raise ::ArgumentError, "request must be provided" if request.nil?
1330
1754
 
@@ -1342,9 +1766,11 @@ module Google
1342
1766
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1343
1767
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1344
1768
 
1345
- header_params = {
1346
- "app_profile.name" => request.app_profile.name
1347
- }
1769
+ header_params = {}
1770
+ if request.app_profile&.name
1771
+ header_params["app_profile.name"] = request.app_profile.name
1772
+ end
1773
+
1348
1774
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1349
1775
  metadata[:"x-goog-request-params"] ||= request_params_header
1350
1776
 
@@ -1397,6 +1823,21 @@ module Google
1397
1823
  #
1398
1824
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1399
1825
  #
1826
+ # @example Basic example
1827
+ # require "google/cloud/bigtable/admin/v2"
1828
+ #
1829
+ # # Create a client object. The client can be reused for multiple calls.
1830
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1831
+ #
1832
+ # # Create a request. To set request fields, pass in keyword arguments.
1833
+ # request = Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest.new
1834
+ #
1835
+ # # Call the delete_app_profile method.
1836
+ # result = client.delete_app_profile request
1837
+ #
1838
+ # # The returned object is of type Google::Protobuf::Empty.
1839
+ # p result
1840
+ #
1400
1841
  def delete_app_profile request, options = nil
1401
1842
  raise ::ArgumentError, "request must be provided" if request.nil?
1402
1843
 
@@ -1414,9 +1855,11 @@ module Google
1414
1855
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1415
1856
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1416
1857
 
1417
- header_params = {
1418
- "name" => request.name
1419
- }
1858
+ header_params = {}
1859
+ if request.name
1860
+ header_params["name"] = request.name
1861
+ end
1862
+
1420
1863
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1421
1864
  metadata[:"x-goog-request-params"] ||= request_params_header
1422
1865
 
@@ -1470,6 +1913,21 @@ module Google
1470
1913
  #
1471
1914
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1472
1915
  #
1916
+ # @example Basic example
1917
+ # require "google/cloud/bigtable/admin/v2"
1918
+ #
1919
+ # # Create a client object. The client can be reused for multiple calls.
1920
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
1921
+ #
1922
+ # # Create a request. To set request fields, pass in keyword arguments.
1923
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1924
+ #
1925
+ # # Call the get_iam_policy method.
1926
+ # result = client.get_iam_policy request
1927
+ #
1928
+ # # The returned object is of type Google::Iam::V1::Policy.
1929
+ # p result
1930
+ #
1473
1931
  def get_iam_policy request, options = nil
1474
1932
  raise ::ArgumentError, "request must be provided" if request.nil?
1475
1933
 
@@ -1487,9 +1945,11 @@ module Google
1487
1945
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1488
1946
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1489
1947
 
1490
- header_params = {
1491
- "resource" => request.resource
1492
- }
1948
+ header_params = {}
1949
+ if request.resource
1950
+ header_params["resource"] = request.resource
1951
+ end
1952
+
1493
1953
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1494
1954
  metadata[:"x-goog-request-params"] ||= request_params_header
1495
1955
 
@@ -1545,6 +2005,21 @@ module Google
1545
2005
  #
1546
2006
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1547
2007
  #
2008
+ # @example Basic example
2009
+ # require "google/cloud/bigtable/admin/v2"
2010
+ #
2011
+ # # Create a client object. The client can be reused for multiple calls.
2012
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
2013
+ #
2014
+ # # Create a request. To set request fields, pass in keyword arguments.
2015
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
2016
+ #
2017
+ # # Call the set_iam_policy method.
2018
+ # result = client.set_iam_policy request
2019
+ #
2020
+ # # The returned object is of type Google::Iam::V1::Policy.
2021
+ # p result
2022
+ #
1548
2023
  def set_iam_policy request, options = nil
1549
2024
  raise ::ArgumentError, "request must be provided" if request.nil?
1550
2025
 
@@ -1562,9 +2037,11 @@ module Google
1562
2037
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1563
2038
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1564
2039
 
1565
- header_params = {
1566
- "resource" => request.resource
1567
- }
2040
+ header_params = {}
2041
+ if request.resource
2042
+ header_params["resource"] = request.resource
2043
+ end
2044
+
1568
2045
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1569
2046
  metadata[:"x-goog-request-params"] ||= request_params_header
1570
2047
 
@@ -1619,6 +2096,21 @@ module Google
1619
2096
  #
1620
2097
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1621
2098
  #
2099
+ # @example Basic example
2100
+ # require "google/cloud/bigtable/admin/v2"
2101
+ #
2102
+ # # Create a client object. The client can be reused for multiple calls.
2103
+ # client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
2104
+ #
2105
+ # # Create a request. To set request fields, pass in keyword arguments.
2106
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
2107
+ #
2108
+ # # Call the test_iam_permissions method.
2109
+ # result = client.test_iam_permissions request
2110
+ #
2111
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
2112
+ # p result
2113
+ #
1622
2114
  def test_iam_permissions request, options = nil
1623
2115
  raise ::ArgumentError, "request must be provided" if request.nil?
1624
2116
 
@@ -1636,9 +2128,11 @@ module Google
1636
2128
  gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
1637
2129
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1638
2130
 
1639
- header_params = {
1640
- "resource" => request.resource
1641
- }
2131
+ header_params = {}
2132
+ if request.resource
2133
+ header_params["resource"] = request.resource
2134
+ end
2135
+
1642
2136
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1643
2137
  metadata[:"x-goog-request-params"] ||= request_params_header
1644
2138
 
@@ -1844,6 +2338,11 @@ module Google
1844
2338
  #
1845
2339
  attr_reader :update_cluster
1846
2340
  ##
2341
+ # RPC-specific configuration for `partial_update_cluster`
2342
+ # @return [::Gapic::Config::Method]
2343
+ #
2344
+ attr_reader :partial_update_cluster
2345
+ ##
1847
2346
  # RPC-specific configuration for `delete_cluster`
1848
2347
  # @return [::Gapic::Config::Method]
1849
2348
  #
@@ -1911,6 +2410,8 @@ module Google
1911
2410
  @list_clusters = ::Gapic::Config::Method.new list_clusters_config
1912
2411
  update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
1913
2412
  @update_cluster = ::Gapic::Config::Method.new update_cluster_config
2413
+ partial_update_cluster_config = parent_rpcs.partial_update_cluster if parent_rpcs.respond_to? :partial_update_cluster
2414
+ @partial_update_cluster = ::Gapic::Config::Method.new partial_update_cluster_config
1914
2415
  delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
1915
2416
  @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
1916
2417
  create_app_profile_config = parent_rpcs.create_app_profile if parent_rpcs.respond_to? :create_app_profile