Class: Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::ServiceStub

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb

Overview

REST service stub for the InstanceGroupManagers service. service stub contains baseline method implementations including transcoding, making the REST call and deserialing the response

Instance Method Summary collapse

Constructor Details

#initialize(endpoint:, credentials:) ⇒ ServiceStub

Returns a new instance of ServiceStub.



33
34
35
36
37
38
39
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 33

def initialize endpoint:, credentials:
  # These require statements are intentionally placed here to initialize
  # the REST modules only when it's required.
  require "gapic/rest"

  @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
end

Instance Method Details

#abandon_instances(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the abandon_instances REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 55

def abandon_instances request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_abandon_instances_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#aggregated_list(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManagerAggregatedList

Baseline implementation for the aggregated_list REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 101

def aggregated_list request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_aggregated_list_request request_pb
  response = @client_stub.make_get_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::InstanceGroupManagerAggregatedList.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#apply_updates_to_instances(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the apply_updates_to_instances REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 151

def apply_updates_to_instances request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, _query_string_params = transcode_apply_updates_to_instances_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#create_instances(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the create_instances REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 195

def create_instances request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_create_instances_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#delete(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the delete REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 241

def delete request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_delete_request request_pb
  response = @client_stub.make_delete_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#delete_instances(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the delete_instances REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 286

def delete_instances request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_delete_instances_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#delete_per_instance_configs(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the delete_per_instance_configs REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 332

def delete_per_instance_configs request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, _query_string_params = transcode_delete_per_instance_configs_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#get(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager

Baseline implementation for the get REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 376

def get request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, _query_string_params = transcode_get_request request_pb
  response = @client_stub.make_get_request(
    uri:     uri,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::InstanceGroupManager.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#insert(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the insert REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 419

def insert request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_insert_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#list(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManagerList

Baseline implementation for the list REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 465

def list request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_list_request request_pb
  response = @client_stub.make_get_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::InstanceGroupManagerList.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#list_errors(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManagersListErrorsResponse

Baseline implementation for the list_errors REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 514

def list_errors request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_list_errors_request request_pb
  response = @client_stub.make_get_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::InstanceGroupManagersListErrorsResponse.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#list_managed_instances(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManagersListManagedInstancesResponse

Baseline implementation for the list_managed_instances REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 563

def list_managed_instances request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_list_managed_instances_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::InstanceGroupManagersListManagedInstancesResponse.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#list_per_instance_configs(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManagersListPerInstanceConfigsResp

Baseline implementation for the list_per_instance_configs REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 612

def list_per_instance_configs request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_list_per_instance_configs_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::InstanceGroupManagersListPerInstanceConfigsResp.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#patch(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the patch REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 661

def patch request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_patch_request request_pb
  response = @client_stub.make_patch_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#patch_per_instance_configs(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the patch_per_instance_configs REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 707

def patch_per_instance_configs request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_patch_per_instance_configs_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#recreate_instances(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the recreate_instances REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 753

def recreate_instances request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_recreate_instances_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#resize(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the resize REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


799
800
801
802
803
804
805
806
807
808
809
810
811
812
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 799

def resize request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, _body, query_string_params = transcode_resize_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#set_instance_template(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the set_instance_template REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 845

def set_instance_template request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_set_instance_template_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#set_target_pools(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the set_target_pools REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 891

def set_target_pools request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_set_target_pools_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end

#transcode_abandon_instances_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the abandon_instances REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



78
79
80
81
82
83
84
85
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 78

def transcode_abandon_instances_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/abandonInstances"
  body = request_pb.instance_group_managers_abandon_instances_request_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_aggregated_list_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the aggregated_list REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 123

def transcode_aggregated_list_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/aggregated/instanceGroupManagers"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["includeAllScopes"] = request_pb.include_all_scopes.to_s if request_pb.has_include_all_scopes?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_apply_updates_to_instances_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the apply_updates_to_instances REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



173
174
175
176
177
178
179
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 173

def transcode_apply_updates_to_instances_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/applyUpdatesToInstances"
  body = request_pb.instance_group_managers_apply_updates_request_resource.to_json
  query_string_params = {}

  [uri, body, query_string_params]
end

#transcode_create_instances_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the create_instances REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



218
219
220
221
222
223
224
225
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 218

def transcode_create_instances_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/createInstances"
  body = request_pb.instance_group_managers_create_instances_request_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_delete_instances_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the delete_instances REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



309
310
311
312
313
314
315
316
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 309

def transcode_delete_instances_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/deleteInstances"
  body = request_pb.instance_group_managers_delete_instances_request_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_delete_per_instance_configs_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the delete_per_instance_configs REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



354
355
356
357
358
359
360
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 354

def transcode_delete_per_instance_configs_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/deletePerInstanceConfigs"
  body = request_pb.instance_group_managers_delete_per_instance_configs_req_resource.to_json
  query_string_params = {}

  [uri, body, query_string_params]
end

#transcode_delete_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the delete REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



263
264
265
266
267
268
269
270
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 263

def transcode_delete_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}"
  body = nil
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_get_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the get REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



397
398
399
400
401
402
403
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 397

def transcode_get_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}"
  body = nil
  query_string_params = {}

  [uri, body, query_string_params]
end

#transcode_insert_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the insert REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



442
443
444
445
446
447
448
449
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 442

def transcode_insert_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers"
  body = request_pb.instance_group_manager_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_list_errors_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the list_errors REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 536

def transcode_list_errors_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/listErrors"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_list_managed_instances_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the list_managed_instances REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 585

def transcode_list_managed_instances_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/listManagedInstances"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_list_per_instance_configs_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the list_per_instance_configs REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 634

def transcode_list_per_instance_configs_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/listPerInstanceConfigs"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_list_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the list REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 487

def transcode_list_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_patch_per_instance_configs_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the patch_per_instance_configs REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



730
731
732
733
734
735
736
737
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 730

def transcode_patch_per_instance_configs_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/patchPerInstanceConfigs"
  body = request_pb.instance_group_managers_patch_per_instance_configs_req_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_patch_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the patch REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



684
685
686
687
688
689
690
691
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 684

def transcode_patch_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}"
  body = request_pb.instance_group_manager_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_recreate_instances_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the recreate_instances REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



776
777
778
779
780
781
782
783
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 776

def transcode_recreate_instances_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/recreateInstances"
  body = request_pb.instance_group_managers_recreate_instances_request_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_resize_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the resize REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



821
822
823
824
825
826
827
828
829
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 821

def transcode_resize_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/resize"
  body = nil
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
  query_string_params["size"] = request_pb.size.to_s

  [uri, body, query_string_params]
end

#transcode_set_instance_template_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the set_instance_template REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



868
869
870
871
872
873
874
875
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 868

def transcode_set_instance_template_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/setInstanceTemplate"
  body = request_pb.instance_group_managers_set_instance_template_request_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_set_target_pools_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the set_target_pools REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



914
915
916
917
918
919
920
921
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 914

def transcode_set_target_pools_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/setTargetPools"
  body = request_pb.instance_group_managers_set_target_pools_request_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_update_per_instance_configs_request(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

GRPC transcoding helper method for the update_per_instance_configs REST call

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



960
961
962
963
964
965
966
967
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 960

def transcode_update_per_instance_configs_request request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/instanceGroupManagers/#{request_pb.instance_group_manager}/updatePerInstanceConfigs"
  body = request_pb.instance_group_managers_update_per_instance_configs_req_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#update_per_instance_configs(request_pb, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Operation

Baseline implementation for the update_per_instance_configs REST call

Parameters:

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

  • (::ArgumentError)


937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb', line 937

def update_per_instance_configs request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?

  uri, body, query_string_params = transcode_update_per_instance_configs_request request_pb
  response = @client_stub.make_post_request(
    uri:     uri,
    body:    body,
    params:  query_string_params,
    options: options
  )
  result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true

  yield result, response if block_given?
  result
end