google-cloud-compute-v1 2.2.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +88 -0
  3. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +62 -0
  4. data/lib/google/cloud/compute/v1/compute_pb.rb +47 -1
  5. data/lib/google/cloud/compute/v1/disks/rest/client.rb +346 -0
  6. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +245 -0
  7. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +85 -0
  8. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +61 -0
  9. data/lib/google/cloud/compute/v1/instances/rest/client.rb +3 -1
  10. data/lib/google/cloud/compute/v1/interconnect_remote_locations/credentials.rb +53 -0
  11. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +436 -0
  12. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +167 -0
  13. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest.rb +51 -0
  14. data/lib/google/cloud/compute/v1/interconnect_remote_locations.rb +47 -0
  15. data/lib/google/cloud/compute/v1/projects/rest/client.rb +1 -1
  16. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +346 -0
  17. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +245 -0
  18. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +1 -1
  19. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +90 -0
  20. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +62 -0
  21. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  22. data/lib/google/cloud/compute/v1/routers/rest/client.rb +3 -1
  23. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +2 -2
  24. data/lib/google/cloud/compute/v1/version.rb +1 -1
  25. data/lib/google/cloud/compute/v1.rb +1 -0
  26. data/proto_docs/google/cloud/compute/v1/compute.rb +1098 -123
  27. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c5defbfbc7329377b3fc256a8bd23b4c3ec2680676b5320b5a0b300cd3b3378
4
- data.tar.gz: af68de805e5ed1596aabebd9b5f737cf84e16ba97fb8ca6bb47f359106a4f661
3
+ metadata.gz: 41a4406546d1ba8d0aaa3251029fde8a81d9f2f0310e127357c147e3eac969bd
4
+ data.tar.gz: 525453e6da4fc56556302b43d362a5b06fe263ae658ef4a26de35dfbcb9877d5
5
5
  SHA512:
6
- metadata.gz: 5bd25232ff88e4e410c9ecc1337da70a83c76e91c0fadc6bf35497c1e00dd61f6bd53824ed9bf1152d406e1a70ce37a94e9911afd370f270d84129c18a8a6824
7
- data.tar.gz: 2cef6f279070b7848470c3dfa38d0539bf5025eb6b890a0648520ab1ca559b9f4136adf85e8fc919bcf9cdcdd9c5d4066bc5689ec73136c003d0de1effec8fc5
6
+ metadata.gz: c5f7d4cdd2de7eadf15ee5108568cf0b277c3c4eca1c79993d45d0555aa56248a876232faa37ff52aad36d25e2b7b545868f63cf393dec0b5a1ff6d14f842917
7
+ data.tar.gz: 1df77b3c3b5c5dff59384e52fc4a626bfeba52cbc17d5607796e8471c7366869d66e664a4b05a09aa6c80df0dbf07a5441a2f0c44aa7749df72d395ec0148a17
@@ -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
  #