google-cloud-compute-v1 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c5defbfbc7329377b3fc256a8bd23b4c3ec2680676b5320b5a0b300cd3b3378
4
- data.tar.gz: af68de805e5ed1596aabebd9b5f737cf84e16ba97fb8ca6bb47f359106a4f661
3
+ metadata.gz: 1cdaab745a63d311ff4d3d33a8a9300e9bf2dff2188c1cbfb62f9c5a9ee0f3fd
4
+ data.tar.gz: '09c55d9933c114f35d2a8d46802769ffd5fd05674da38d364c0a215c948b4dde'
5
5
  SHA512:
6
- metadata.gz: 5bd25232ff88e4e410c9ecc1337da70a83c76e91c0fadc6bf35497c1e00dd61f6bd53824ed9bf1152d406e1a70ce37a94e9911afd370f270d84129c18a8a6824
7
- data.tar.gz: 2cef6f279070b7848470c3dfa38d0539bf5025eb6b890a0648520ab1ca559b9f4136adf85e8fc919bcf9cdcdd9c5d4066bc5689ec73136c003d0de1effec8fc5
6
+ metadata.gz: 1b208a6ad1a29bbe19d689da81db649ce34f6f6f3cda083299f6c6a5e57f5bd9682ca8fa91b167a92607786132db03c478b6072abd2d68776a13c963b736ba11
7
+ data.tar.gz: 014b184d2b805f87c5fe536a390731f64f32a31d895c052c59c31a34e01b63e52ab241c4db4107d0c82e77bf65a56636dee199fc64d91e489a218d6b807ba9e0
@@ -84,6 +84,8 @@ module Google
84
84
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
85
  }
86
86
 
87
+ default_config.rpcs.move.timeout = 600.0
88
+
87
89
  default_config.rpcs.set_labels.timeout = 600.0
88
90
 
89
91
  default_config
@@ -538,6 +540,85 @@ module Google
538
540
  raise ::Google::Cloud::Error.from_error(e)
539
541
  end
540
542
 
543
+ ##
544
+ # Moves the specified address resource.
545
+ #
546
+ # @overload move(request, options = nil)
547
+ # Pass arguments to `move` via a request object, either of type
548
+ # {::Google::Cloud::Compute::V1::MoveAddressRequest} or an equivalent Hash.
549
+ #
550
+ # @param request [::Google::Cloud::Compute::V1::MoveAddressRequest, ::Hash]
551
+ # A request object representing the call parameters. Required. To specify no
552
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
553
+ # @param options [::Gapic::CallOptions, ::Hash]
554
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
555
+ #
556
+ # @overload move(address: nil, project: nil, region: nil, region_addresses_move_request_resource: nil, request_id: nil)
557
+ # Pass arguments to `move` via keyword arguments. Note that at
558
+ # least one keyword argument is required. To specify no parameters, or to keep all
559
+ # the default parameter values, pass an empty Hash as a request object (see above).
560
+ #
561
+ # @param address [::String]
562
+ # Name of the address resource to move.
563
+ # @param project [::String]
564
+ # Source project ID which the Address is moved from.
565
+ # @param region [::String]
566
+ # Name of the region for this request.
567
+ # @param region_addresses_move_request_resource [::Google::Cloud::Compute::V1::RegionAddressesMoveRequest, ::Hash]
568
+ # The body resource for this request
569
+ # @param request_id [::String]
570
+ # 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).
571
+ # @yield [result, operation] Access the result along with the TransportOperation object
572
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
573
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
574
+ #
575
+ # @return [::Gapic::GenericLRO::Operation]
576
+ #
577
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
578
+ def move request, options = nil
579
+ raise ::ArgumentError, "request must be provided" if request.nil?
580
+
581
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::MoveAddressRequest
582
+
583
+ # Converts hash and nil to an options object
584
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
585
+
586
+ # Customize the options with defaults
587
+ call_metadata = @config.rpcs.move.metadata.to_h
588
+
589
+ # Set x-goog-api-client and x-goog-user-project headers
590
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
591
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
592
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
593
+ transports_version_send: [:rest]
594
+
595
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
596
+
597
+ options.apply_defaults timeout: @config.rpcs.move.timeout,
598
+ metadata: call_metadata,
599
+ retry_policy: @config.rpcs.move.retry_policy
600
+
601
+ options.apply_defaults timeout: @config.timeout,
602
+ metadata: @config.metadata,
603
+ retry_policy: @config.retry_policy
604
+
605
+ @addresses_stub.move request, options do |result, response|
606
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
607
+ operation: result,
608
+ client: region_operations,
609
+ request_values: {
610
+ "project" => request.project,
611
+ "region" => request.region
612
+ },
613
+ options: options
614
+ )
615
+ yield result, response if block_given?
616
+ return result
617
+ end
618
+ rescue ::Gapic::Rest::Error => e
619
+ raise ::Google::Cloud::Error.from_error(e)
620
+ end
621
+
541
622
  ##
542
623
  # Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.
543
624
  #
@@ -768,6 +849,11 @@ module Google
768
849
  #
769
850
  attr_reader :list
770
851
  ##
852
+ # RPC-specific configuration for `move`
853
+ # @return [::Gapic::Config::Method]
854
+ #
855
+ attr_reader :move
856
+ ##
771
857
  # RPC-specific configuration for `set_labels`
772
858
  # @return [::Gapic::Config::Method]
773
859
  #
@@ -785,6 +871,8 @@ module Google
785
871
  @insert = ::Gapic::Config::Method.new insert_config
786
872
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
787
873
  @list = ::Gapic::Config::Method.new list_config
874
+ move_config = parent_rpcs.move if parent_rpcs.respond_to? :move
875
+ @move = ::Gapic::Config::Method.new move_config
788
876
  set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
789
877
  @set_labels = ::Gapic::Config::Method.new set_labels_config
790
878
 
@@ -230,6 +230,44 @@ module Google
230
230
  result
231
231
  end
232
232
 
233
+ ##
234
+ # Baseline implementation for the move REST call
235
+ #
236
+ # @param request_pb [::Google::Cloud::Compute::V1::MoveAddressRequest]
237
+ # A request object representing the call parameters. Required.
238
+ # @param options [::Gapic::CallOptions]
239
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
240
+ #
241
+ # @yield [result, operation] Access the result along with the TransportOperation object
242
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
243
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
244
+ #
245
+ # @return [::Google::Cloud::Compute::V1::Operation]
246
+ # A result object deserialized from the server's reply
247
+ def move request_pb, options = nil
248
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
249
+
250
+ verb, uri, query_string_params, body = ServiceStub.transcode_move_request request_pb
251
+ query_string_params = if query_string_params.any?
252
+ query_string_params.to_h { |p| p.split "=", 2 }
253
+ else
254
+ {}
255
+ end
256
+
257
+ response = @client_stub.make_http_request(
258
+ verb,
259
+ uri: uri,
260
+ body: body || "",
261
+ params: query_string_params,
262
+ options: options
263
+ )
264
+ operation = ::Gapic::Rest::TransportOperation.new response
265
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
266
+
267
+ yield result, operation if block_given?
268
+ result
269
+ end
270
+
233
271
  ##
234
272
  # Baseline implementation for the set_labels REST call
235
273
  #
@@ -380,6 +418,30 @@ module Google
380
418
  transcoder.transcode request_pb
381
419
  end
382
420
 
421
+ ##
422
+ # @private
423
+ #
424
+ # GRPC transcoding helper method for the move REST call
425
+ #
426
+ # @param request_pb [::Google::Cloud::Compute::V1::MoveAddressRequest]
427
+ # A request object representing the call parameters. Required.
428
+ # @return [Array(String, [String, nil], Hash{String => String})]
429
+ # Uri, Body, Query string parameters
430
+ def self.transcode_move_request request_pb
431
+ transcoder = Gapic::Rest::GrpcTranscoder.new
432
+ .with_bindings(
433
+ uri_method: :post,
434
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses/{address}/move",
435
+ body: "region_addresses_move_request_resource",
436
+ matches: [
437
+ ["project", %r{^[^/]+/?$}, false],
438
+ ["region", %r{^[^/]+/?$}, false],
439
+ ["address", %r{^[^/]+/?$}, false]
440
+ ]
441
+ )
442
+ transcoder.transcode request_pb
443
+ end
444
+
383
445
  ##
384
446
  # @private
385
447
  #