google-cloud-bigtable-admin-v2 0.6.1 → 0.8.1

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