google-cloud-compute-v1 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +87 -0
- data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +61 -0
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +151 -0
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +119 -0
- data/lib/google/cloud/compute/v1/compute_pb.rb +228 -0
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +82 -0
- data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +60 -0
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +87 -0
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +61 -0
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +82 -0
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +155 -0
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +121 -0
- data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +759 -0
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +587 -0
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +82 -0
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +60 -0
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +86 -0
- data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +58 -0
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +87 -0
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +61 -0
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +87 -0
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +61 -0
- data/lib/google/cloud/compute/v1.rb +2 -0
- data/proto_docs/google/cloud/compute/v1/compute.rb +637 -26
- metadata +12 -2
@@ -79,6 +79,8 @@ module Google
|
|
79
79
|
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
80
80
|
}
|
81
81
|
|
82
|
+
default_config.rpcs.set_labels.timeout = 600.0
|
83
|
+
|
82
84
|
default_config
|
83
85
|
end
|
84
86
|
yield @configure if block_given?
|
@@ -433,6 +435,79 @@ module Google
|
|
433
435
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
434
436
|
end
|
435
437
|
|
438
|
+
##
|
439
|
+
# Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.
|
440
|
+
#
|
441
|
+
# @overload set_labels(request, options = nil)
|
442
|
+
# Pass arguments to `set_labels` via a request object, either of type
|
443
|
+
# {::Google::Cloud::Compute::V1::SetLabelsGlobalAddressRequest} or an equivalent Hash.
|
444
|
+
#
|
445
|
+
# @param request [::Google::Cloud::Compute::V1::SetLabelsGlobalAddressRequest, ::Hash]
|
446
|
+
# A request object representing the call parameters. Required. To specify no
|
447
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
448
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
449
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
450
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
451
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
452
|
+
#
|
453
|
+
# @overload set_labels(global_set_labels_request_resource: nil, project: nil, resource: nil)
|
454
|
+
# Pass arguments to `set_labels` via keyword arguments. Note that at
|
455
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
456
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
457
|
+
#
|
458
|
+
# @param global_set_labels_request_resource [::Google::Cloud::Compute::V1::GlobalSetLabelsRequest, ::Hash]
|
459
|
+
# The body resource for this request
|
460
|
+
# @param project [::String]
|
461
|
+
# Project ID for this request.
|
462
|
+
# @param resource [::String]
|
463
|
+
# Name or id of the resource for this request.
|
464
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
465
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
466
|
+
# @yieldparam response [::Faraday::Response]
|
467
|
+
#
|
468
|
+
# @return [::Gapic::GenericLRO::Operation]
|
469
|
+
#
|
470
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
471
|
+
def set_labels request, options = nil
|
472
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
473
|
+
|
474
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsGlobalAddressRequest
|
475
|
+
|
476
|
+
# Converts hash and nil to an options object
|
477
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
478
|
+
|
479
|
+
# Customize the options with defaults
|
480
|
+
call_metadata = @config.rpcs.set_labels.metadata.to_h
|
481
|
+
|
482
|
+
# Set x-goog-api-client header
|
483
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
484
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
485
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
486
|
+
transports_version_send: [:rest]
|
487
|
+
|
488
|
+
options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
|
489
|
+
metadata: call_metadata
|
490
|
+
|
491
|
+
options.apply_defaults timeout: @config.timeout,
|
492
|
+
metadata: @config.metadata
|
493
|
+
|
494
|
+
@global_addresses_stub.set_labels request, options do |result, response|
|
495
|
+
result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
|
496
|
+
operation: result,
|
497
|
+
client: global_operations,
|
498
|
+
request_values: {
|
499
|
+
"project" => request.project
|
500
|
+
},
|
501
|
+
options: options
|
502
|
+
)
|
503
|
+
yield result, response if block_given?
|
504
|
+
return result
|
505
|
+
end
|
506
|
+
rescue ::Faraday::Error => e
|
507
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
508
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
509
|
+
end
|
510
|
+
|
436
511
|
##
|
437
512
|
# Configuration class for the GlobalAddresses REST API.
|
438
513
|
#
|
@@ -552,6 +627,11 @@ module Google
|
|
552
627
|
# @return [::Gapic::Config::Method]
|
553
628
|
#
|
554
629
|
attr_reader :list
|
630
|
+
##
|
631
|
+
# RPC-specific configuration for `set_labels`
|
632
|
+
# @return [::Gapic::Config::Method]
|
633
|
+
#
|
634
|
+
attr_reader :set_labels
|
555
635
|
|
556
636
|
# @private
|
557
637
|
def initialize parent_rpcs = nil
|
@@ -563,6 +643,8 @@ module Google
|
|
563
643
|
@insert = ::Gapic::Config::Method.new insert_config
|
564
644
|
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
|
565
645
|
@list = ::Gapic::Config::Method.new list_config
|
646
|
+
set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
|
647
|
+
@set_labels = ::Gapic::Config::Method.new set_labels_config
|
566
648
|
|
567
649
|
yield self if block_given?
|
568
650
|
end
|
@@ -186,6 +186,43 @@ module Google
|
|
186
186
|
result
|
187
187
|
end
|
188
188
|
|
189
|
+
##
|
190
|
+
# Baseline implementation for the set_labels REST call
|
191
|
+
#
|
192
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetLabelsGlobalAddressRequest]
|
193
|
+
# A request object representing the call parameters. Required.
|
194
|
+
# @param options [::Gapic::CallOptions]
|
195
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
196
|
+
#
|
197
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
198
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
199
|
+
# @yieldparam response [::Faraday::Response]
|
200
|
+
#
|
201
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
202
|
+
# A result object deserialized from the server's reply
|
203
|
+
def set_labels request_pb, options = nil
|
204
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
205
|
+
|
206
|
+
verb, uri, query_string_params, body = transcode_set_labels_request request_pb
|
207
|
+
query_string_params = if query_string_params.any?
|
208
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
209
|
+
else
|
210
|
+
{}
|
211
|
+
end
|
212
|
+
|
213
|
+
response = @client_stub.make_http_request(
|
214
|
+
verb,
|
215
|
+
uri: uri,
|
216
|
+
body: body || "",
|
217
|
+
params: query_string_params,
|
218
|
+
options: options
|
219
|
+
)
|
220
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
221
|
+
|
222
|
+
yield result, response if block_given?
|
223
|
+
result
|
224
|
+
end
|
225
|
+
|
189
226
|
|
190
227
|
private
|
191
228
|
|
@@ -275,6 +312,29 @@ module Google
|
|
275
312
|
)
|
276
313
|
transcoder.transcode request_pb
|
277
314
|
end
|
315
|
+
|
316
|
+
##
|
317
|
+
# @private
|
318
|
+
#
|
319
|
+
# GRPC transcoding helper method for the set_labels REST call
|
320
|
+
#
|
321
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetLabelsGlobalAddressRequest]
|
322
|
+
# A request object representing the call parameters. Required.
|
323
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
324
|
+
# Uri, Body, Query string parameters
|
325
|
+
def transcode_set_labels_request request_pb
|
326
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
327
|
+
.with_bindings(
|
328
|
+
uri_method: :post,
|
329
|
+
uri_template: "/compute/v1/projects/{project}/global/addresses/{resource}/setLabels",
|
330
|
+
body: "global_set_labels_request_resource",
|
331
|
+
matches: [
|
332
|
+
["project", %r{^[^/]+/?$}, false],
|
333
|
+
["resource", %r{^[^/]+/?$}, false]
|
334
|
+
]
|
335
|
+
)
|
336
|
+
transcoder.transcode request_pb
|
337
|
+
end
|
278
338
|
end
|
279
339
|
end
|
280
340
|
end
|
@@ -86,6 +86,8 @@ module Google
|
|
86
86
|
|
87
87
|
default_config.rpcs.patch.timeout = 600.0
|
88
88
|
|
89
|
+
default_config.rpcs.set_labels.timeout = 600.0
|
90
|
+
|
89
91
|
default_config
|
90
92
|
end
|
91
93
|
yield @configure if block_given?
|
@@ -604,6 +606,84 @@ module Google
|
|
604
606
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
605
607
|
end
|
606
608
|
|
609
|
+
##
|
610
|
+
# Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.
|
611
|
+
#
|
612
|
+
# @overload set_labels(request, options = nil)
|
613
|
+
# Pass arguments to `set_labels` via a request object, either of type
|
614
|
+
# {::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest} or an equivalent Hash.
|
615
|
+
#
|
616
|
+
# @param request [::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest, ::Hash]
|
617
|
+
# A request object representing the call parameters. Required. To specify no
|
618
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
619
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
620
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
621
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
622
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
623
|
+
#
|
624
|
+
# @overload set_labels(project: nil, region: nil, region_set_labels_request_resource: nil, request_id: nil, resource: nil)
|
625
|
+
# Pass arguments to `set_labels` via keyword arguments. Note that at
|
626
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
627
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
628
|
+
#
|
629
|
+
# @param project [::String]
|
630
|
+
# Project ID for this request.
|
631
|
+
# @param region [::String]
|
632
|
+
# The region for this request.
|
633
|
+
# @param region_set_labels_request_resource [::Google::Cloud::Compute::V1::RegionSetLabelsRequest, ::Hash]
|
634
|
+
# The body resource for this request
|
635
|
+
# @param request_id [::String]
|
636
|
+
# An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
|
637
|
+
# @param resource [::String]
|
638
|
+
# Name or id of the resource for this request.
|
639
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
640
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
641
|
+
# @yieldparam response [::Faraday::Response]
|
642
|
+
#
|
643
|
+
# @return [::Gapic::GenericLRO::Operation]
|
644
|
+
#
|
645
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
646
|
+
def set_labels request, options = nil
|
647
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
648
|
+
|
649
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest
|
650
|
+
|
651
|
+
# Converts hash and nil to an options object
|
652
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
653
|
+
|
654
|
+
# Customize the options with defaults
|
655
|
+
call_metadata = @config.rpcs.set_labels.metadata.to_h
|
656
|
+
|
657
|
+
# Set x-goog-api-client header
|
658
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
659
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
660
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
661
|
+
transports_version_send: [:rest]
|
662
|
+
|
663
|
+
options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
|
664
|
+
metadata: call_metadata
|
665
|
+
|
666
|
+
options.apply_defaults timeout: @config.timeout,
|
667
|
+
metadata: @config.metadata
|
668
|
+
|
669
|
+
@interconnect_attachments_stub.set_labels request, options do |result, response|
|
670
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
671
|
+
operation: result,
|
672
|
+
client: region_operations,
|
673
|
+
request_values: {
|
674
|
+
"project" => request.project,
|
675
|
+
"region" => request.region
|
676
|
+
},
|
677
|
+
options: options
|
678
|
+
)
|
679
|
+
yield result, response if block_given?
|
680
|
+
return result
|
681
|
+
end
|
682
|
+
rescue ::Faraday::Error => e
|
683
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
684
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
685
|
+
end
|
686
|
+
|
607
687
|
##
|
608
688
|
# Configuration class for the InterconnectAttachments REST API.
|
609
689
|
#
|
@@ -733,6 +813,11 @@ module Google
|
|
733
813
|
# @return [::Gapic::Config::Method]
|
734
814
|
#
|
735
815
|
attr_reader :patch
|
816
|
+
##
|
817
|
+
# RPC-specific configuration for `set_labels`
|
818
|
+
# @return [::Gapic::Config::Method]
|
819
|
+
#
|
820
|
+
attr_reader :set_labels
|
736
821
|
|
737
822
|
# @private
|
738
823
|
def initialize parent_rpcs = nil
|
@@ -748,6 +833,8 @@ module Google
|
|
748
833
|
@list = ::Gapic::Config::Method.new list_config
|
749
834
|
patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
|
750
835
|
@patch = ::Gapic::Config::Method.new patch_config
|
836
|
+
set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
|
837
|
+
@set_labels = ::Gapic::Config::Method.new set_labels_config
|
751
838
|
|
752
839
|
yield self if block_given?
|
753
840
|
end
|
@@ -260,6 +260,43 @@ module Google
|
|
260
260
|
result
|
261
261
|
end
|
262
262
|
|
263
|
+
##
|
264
|
+
# Baseline implementation for the set_labels REST call
|
265
|
+
#
|
266
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest]
|
267
|
+
# A request object representing the call parameters. Required.
|
268
|
+
# @param options [::Gapic::CallOptions]
|
269
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
270
|
+
#
|
271
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
272
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
273
|
+
# @yieldparam response [::Faraday::Response]
|
274
|
+
#
|
275
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
276
|
+
# A result object deserialized from the server's reply
|
277
|
+
def set_labels request_pb, options = nil
|
278
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
279
|
+
|
280
|
+
verb, uri, query_string_params, body = transcode_set_labels_request request_pb
|
281
|
+
query_string_params = if query_string_params.any?
|
282
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
283
|
+
else
|
284
|
+
{}
|
285
|
+
end
|
286
|
+
|
287
|
+
response = @client_stub.make_http_request(
|
288
|
+
verb,
|
289
|
+
uri: uri,
|
290
|
+
body: body || "",
|
291
|
+
params: query_string_params,
|
292
|
+
options: options
|
293
|
+
)
|
294
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
295
|
+
|
296
|
+
yield result, response if block_given?
|
297
|
+
result
|
298
|
+
end
|
299
|
+
|
263
300
|
|
264
301
|
private
|
265
302
|
|
@@ -398,6 +435,30 @@ module Google
|
|
398
435
|
)
|
399
436
|
transcoder.transcode request_pb
|
400
437
|
end
|
438
|
+
|
439
|
+
##
|
440
|
+
# @private
|
441
|
+
#
|
442
|
+
# GRPC transcoding helper method for the set_labels REST call
|
443
|
+
#
|
444
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest]
|
445
|
+
# A request object representing the call parameters. Required.
|
446
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
447
|
+
# Uri, Body, Query string parameters
|
448
|
+
def transcode_set_labels_request request_pb
|
449
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
450
|
+
.with_bindings(
|
451
|
+
uri_method: :post,
|
452
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
|
453
|
+
body: "region_set_labels_request_resource",
|
454
|
+
matches: [
|
455
|
+
["project", %r{^[^/]+/?$}, false],
|
456
|
+
["region", %r{^[^/]+/?$}, false],
|
457
|
+
["resource", %r{^[^/]+/?$}, false]
|
458
|
+
]
|
459
|
+
)
|
460
|
+
transcoder.transcode request_pb
|
461
|
+
end
|
401
462
|
end
|
402
463
|
end
|
403
464
|
end
|
@@ -86,6 +86,8 @@ module Google
|
|
86
86
|
|
87
87
|
default_config.rpcs.patch.timeout = 600.0
|
88
88
|
|
89
|
+
default_config.rpcs.set_labels.timeout = 600.0
|
90
|
+
|
89
91
|
default_config
|
90
92
|
end
|
91
93
|
yield @configure if block_given?
|
@@ -578,6 +580,79 @@ module Google
|
|
578
580
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
579
581
|
end
|
580
582
|
|
583
|
+
##
|
584
|
+
# Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.
|
585
|
+
#
|
586
|
+
# @overload set_labels(request, options = nil)
|
587
|
+
# Pass arguments to `set_labels` via a request object, either of type
|
588
|
+
# {::Google::Cloud::Compute::V1::SetLabelsInterconnectRequest} or an equivalent Hash.
|
589
|
+
#
|
590
|
+
# @param request [::Google::Cloud::Compute::V1::SetLabelsInterconnectRequest, ::Hash]
|
591
|
+
# A request object representing the call parameters. Required. To specify no
|
592
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
593
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
594
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
595
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
596
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
597
|
+
#
|
598
|
+
# @overload set_labels(global_set_labels_request_resource: nil, project: nil, resource: nil)
|
599
|
+
# Pass arguments to `set_labels` via keyword arguments. Note that at
|
600
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
601
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
602
|
+
#
|
603
|
+
# @param global_set_labels_request_resource [::Google::Cloud::Compute::V1::GlobalSetLabelsRequest, ::Hash]
|
604
|
+
# The body resource for this request
|
605
|
+
# @param project [::String]
|
606
|
+
# Project ID for this request.
|
607
|
+
# @param resource [::String]
|
608
|
+
# Name or id of the resource for this request.
|
609
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
610
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
611
|
+
# @yieldparam response [::Faraday::Response]
|
612
|
+
#
|
613
|
+
# @return [::Gapic::GenericLRO::Operation]
|
614
|
+
#
|
615
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
616
|
+
def set_labels request, options = nil
|
617
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
618
|
+
|
619
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsInterconnectRequest
|
620
|
+
|
621
|
+
# Converts hash and nil to an options object
|
622
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
623
|
+
|
624
|
+
# Customize the options with defaults
|
625
|
+
call_metadata = @config.rpcs.set_labels.metadata.to_h
|
626
|
+
|
627
|
+
# Set x-goog-api-client header
|
628
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
629
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
630
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
631
|
+
transports_version_send: [:rest]
|
632
|
+
|
633
|
+
options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
|
634
|
+
metadata: call_metadata
|
635
|
+
|
636
|
+
options.apply_defaults timeout: @config.timeout,
|
637
|
+
metadata: @config.metadata
|
638
|
+
|
639
|
+
@interconnects_stub.set_labels request, options do |result, response|
|
640
|
+
result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
|
641
|
+
operation: result,
|
642
|
+
client: global_operations,
|
643
|
+
request_values: {
|
644
|
+
"project" => request.project
|
645
|
+
},
|
646
|
+
options: options
|
647
|
+
)
|
648
|
+
yield result, response if block_given?
|
649
|
+
return result
|
650
|
+
end
|
651
|
+
rescue ::Faraday::Error => e
|
652
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
653
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
654
|
+
end
|
655
|
+
|
581
656
|
##
|
582
657
|
# Configuration class for the Interconnects REST API.
|
583
658
|
#
|
@@ -707,6 +782,11 @@ module Google
|
|
707
782
|
# @return [::Gapic::Config::Method]
|
708
783
|
#
|
709
784
|
attr_reader :patch
|
785
|
+
##
|
786
|
+
# RPC-specific configuration for `set_labels`
|
787
|
+
# @return [::Gapic::Config::Method]
|
788
|
+
#
|
789
|
+
attr_reader :set_labels
|
710
790
|
|
711
791
|
# @private
|
712
792
|
def initialize parent_rpcs = nil
|
@@ -722,6 +802,8 @@ module Google
|
|
722
802
|
@list = ::Gapic::Config::Method.new list_config
|
723
803
|
patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
|
724
804
|
@patch = ::Gapic::Config::Method.new patch_config
|
805
|
+
set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
|
806
|
+
@set_labels = ::Gapic::Config::Method.new set_labels_config
|
725
807
|
|
726
808
|
yield self if block_given?
|
727
809
|
end
|
@@ -260,6 +260,43 @@ module Google
|
|
260
260
|
result
|
261
261
|
end
|
262
262
|
|
263
|
+
##
|
264
|
+
# Baseline implementation for the set_labels REST call
|
265
|
+
#
|
266
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInterconnectRequest]
|
267
|
+
# A request object representing the call parameters. Required.
|
268
|
+
# @param options [::Gapic::CallOptions]
|
269
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
270
|
+
#
|
271
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
272
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
273
|
+
# @yieldparam response [::Faraday::Response]
|
274
|
+
#
|
275
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
276
|
+
# A result object deserialized from the server's reply
|
277
|
+
def set_labels request_pb, options = nil
|
278
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
279
|
+
|
280
|
+
verb, uri, query_string_params, body = transcode_set_labels_request request_pb
|
281
|
+
query_string_params = if query_string_params.any?
|
282
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
283
|
+
else
|
284
|
+
{}
|
285
|
+
end
|
286
|
+
|
287
|
+
response = @client_stub.make_http_request(
|
288
|
+
verb,
|
289
|
+
uri: uri,
|
290
|
+
body: body || "",
|
291
|
+
params: query_string_params,
|
292
|
+
options: options
|
293
|
+
)
|
294
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
295
|
+
|
296
|
+
yield result, response if block_given?
|
297
|
+
result
|
298
|
+
end
|
299
|
+
|
263
300
|
|
264
301
|
private
|
265
302
|
|
@@ -394,6 +431,29 @@ module Google
|
|
394
431
|
)
|
395
432
|
transcoder.transcode request_pb
|
396
433
|
end
|
434
|
+
|
435
|
+
##
|
436
|
+
# @private
|
437
|
+
#
|
438
|
+
# GRPC transcoding helper method for the set_labels REST call
|
439
|
+
#
|
440
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetLabelsInterconnectRequest]
|
441
|
+
# A request object representing the call parameters. Required.
|
442
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
443
|
+
# Uri, Body, Query string parameters
|
444
|
+
def transcode_set_labels_request request_pb
|
445
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
446
|
+
.with_bindings(
|
447
|
+
uri_method: :post,
|
448
|
+
uri_template: "/compute/v1/projects/{project}/global/interconnects/{resource}/setLabels",
|
449
|
+
body: "global_set_labels_request_resource",
|
450
|
+
matches: [
|
451
|
+
["project", %r{^[^/]+/?$}, false],
|
452
|
+
["resource", %r{^[^/]+/?$}, false]
|
453
|
+
]
|
454
|
+
)
|
455
|
+
transcoder.transcode request_pb
|
456
|
+
end
|
397
457
|
end
|
398
458
|
end
|
399
459
|
end
|