google-cloud-compute-v1 3.5.0 → 3.6.0

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +375 -0
  3. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +122 -0
  4. data/lib/google/cloud/compute/v1/compute_pb.rb +94 -1
  5. data/lib/google/cloud/compute/v1/disks/rest/client.rb +118 -0
  6. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +64 -0
  7. data/lib/google/cloud/compute/v1/instant_snapshot_groups/credentials.rb +52 -0
  8. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/client.rb +1145 -0
  9. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/service_stub.rb +523 -0
  10. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest.rb +51 -0
  11. data/lib/google/cloud/compute/v1/instant_snapshot_groups.rb +47 -0
  12. data/lib/google/cloud/compute/v1/region_backend_buckets/credentials.rb +52 -0
  13. data/lib/google/cloud/compute/v1/region_backend_buckets/rest/client.rb +1450 -0
  14. data/lib/google/cloud/compute/v1/region_backend_buckets/rest/service_stub.rb +649 -0
  15. data/lib/google/cloud/compute/v1/region_backend_buckets/rest.rb +51 -0
  16. data/lib/google/cloud/compute/v1/region_backend_buckets.rb +47 -0
  17. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/client.rb +95 -0
  18. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/service_stub.rb +63 -0
  19. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +118 -0
  20. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +64 -0
  21. data/lib/google/cloud/compute/v1/region_health_sources/rest/client.rb +95 -0
  22. data/lib/google/cloud/compute/v1/region_health_sources/rest/service_stub.rb +63 -0
  23. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/credentials.rb +52 -0
  24. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/client.rb +1002 -0
  25. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/service_stub.rb +400 -0
  26. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest.rb +51 -0
  27. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests.rb +47 -0
  28. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/credentials.rb +52 -0
  29. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/client.rb +1146 -0
  30. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/service_stub.rb +523 -0
  31. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest.rb +51 -0
  32. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups.rb +47 -0
  33. data/lib/google/cloud/compute/v1/region_snapshot_settings/credentials.rb +52 -0
  34. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/client.rb +561 -0
  35. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/service_stub.rb +206 -0
  36. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest.rb +51 -0
  37. data/lib/google/cloud/compute/v1/region_snapshot_settings.rb +47 -0
  38. data/lib/google/cloud/compute/v1/region_snapshots/credentials.rb +52 -0
  39. data/lib/google/cloud/compute/v1/region_snapshots/rest/client.rb +1388 -0
  40. data/lib/google/cloud/compute/v1/region_snapshots/rest/service_stub.rb +651 -0
  41. data/lib/google/cloud/compute/v1/region_snapshots/rest.rb +51 -0
  42. data/lib/google/cloud/compute/v1/region_snapshots.rb +47 -0
  43. data/lib/google/cloud/compute/v1/rest.rb +7 -0
  44. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +115 -0
  45. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +63 -0
  46. data/lib/google/cloud/compute/v1/version.rb +1 -1
  47. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/credentials.rb +52 -0
  48. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/client.rb +975 -0
  49. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/service_stub.rb +396 -0
  50. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest.rb +51 -0
  51. data/lib/google/cloud/compute/v1/zone_vm_extension_policies.rb +47 -0
  52. data/lib/google/cloud/compute/v1.rb +7 -0
  53. data/proto_docs/google/cloud/compute/v1/compute.rb +4753 -1599
  54. metadata +36 -1
@@ -121,6 +121,8 @@ module Google
121
121
 
122
122
  default_config.rpcs.update.timeout = 600.0
123
123
 
124
+ default_config.rpcs.update_kms_key.timeout = 600.0
125
+
124
126
  default_config
125
127
  end
126
128
  yield @configure if block_given?
@@ -2352,6 +2354,115 @@ module Google
2352
2354
  raise ::Google::Cloud::Error.from_error(e)
2353
2355
  end
2354
2356
 
2357
+ ##
2358
+ # Rotates the customer-managed
2359
+ # encryption key to the latest version for the specified persistent disk.
2360
+ #
2361
+ # @overload update_kms_key(request, options = nil)
2362
+ # Pass arguments to `update_kms_key` via a request object, either of type
2363
+ # {::Google::Cloud::Compute::V1::UpdateKmsKeyDiskRequest} or an equivalent Hash.
2364
+ #
2365
+ # @param request [::Google::Cloud::Compute::V1::UpdateKmsKeyDiskRequest, ::Hash]
2366
+ # A request object representing the call parameters. Required. To specify no
2367
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2368
+ # @param options [::Gapic::CallOptions, ::Hash]
2369
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2370
+ #
2371
+ # @overload update_kms_key(disk: nil, disk_update_kms_key_request_resource: nil, project: nil, request_id: nil, zone: nil)
2372
+ # Pass arguments to `update_kms_key` via keyword arguments. Note that at
2373
+ # least one keyword argument is required. To specify no parameters, or to keep all
2374
+ # the default parameter values, pass an empty Hash as a request object (see above).
2375
+ #
2376
+ # @param disk [::String]
2377
+ # Name of the Disk resource, should conform to RFC1035.
2378
+ # @param disk_update_kms_key_request_resource [::Google::Cloud::Compute::V1::DiskUpdateKmsKeyRequest, ::Hash]
2379
+ # The body resource for this request
2380
+ # @param project [::String]
2381
+ # Project ID for this request.
2382
+ # @param request_id [::String]
2383
+ # An optional request ID to identify requests. Specify a unique request ID so
2384
+ # that if you must retry your request, the server will know to ignore the
2385
+ # request if it has already been completed.
2386
+ #
2387
+ # For example, consider a situation where you make an initial request and
2388
+ # the request times out. If you make the request again with the same
2389
+ # request ID, the server can check if original operation with the same
2390
+ # request ID was received, and if so, will ignore the second request. This
2391
+ # prevents clients from accidentally creating duplicate commitments.
2392
+ #
2393
+ # The request ID must be
2394
+ # a valid UUID with the exception that zero UUID is not supported
2395
+ # (00000000-0000-0000-0000-000000000000).
2396
+ # @param zone [::String]
2397
+ # The name of the zone for this request.
2398
+ # @yield [result, operation] Access the result along with the TransportOperation object
2399
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2400
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2401
+ #
2402
+ # @return [::Gapic::GenericLRO::Operation]
2403
+ #
2404
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2405
+ #
2406
+ # @example Basic example
2407
+ # require "google/cloud/compute/v1"
2408
+ #
2409
+ # # Create a client object. The client can be reused for multiple calls.
2410
+ # client = Google::Cloud::Compute::V1::Disks::Rest::Client.new
2411
+ #
2412
+ # # Create a request. To set request fields, pass in keyword arguments.
2413
+ # request = Google::Cloud::Compute::V1::UpdateKmsKeyDiskRequest.new
2414
+ #
2415
+ # # Call the update_kms_key method.
2416
+ # result = client.update_kms_key request
2417
+ #
2418
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2419
+ # p result
2420
+ #
2421
+ def update_kms_key request, options = nil
2422
+ raise ::ArgumentError, "request must be provided" if request.nil?
2423
+
2424
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateKmsKeyDiskRequest
2425
+
2426
+ # Converts hash and nil to an options object
2427
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2428
+
2429
+ # Customize the options with defaults
2430
+ call_metadata = @config.rpcs.update_kms_key.metadata.to_h
2431
+
2432
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2433
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2434
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2435
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2436
+ transports_version_send: [:rest]
2437
+
2438
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2439
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2440
+
2441
+ options.apply_defaults timeout: @config.rpcs.update_kms_key.timeout,
2442
+ metadata: call_metadata,
2443
+ retry_policy: @config.rpcs.update_kms_key.retry_policy
2444
+
2445
+ options.apply_defaults timeout: @config.timeout,
2446
+ metadata: @config.metadata,
2447
+ retry_policy: @config.retry_policy
2448
+
2449
+ @disks_stub.update_kms_key request, options do |result, response|
2450
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
2451
+ operation: result,
2452
+ client: zone_operations,
2453
+ request_values: {
2454
+ "project" => request.project,
2455
+ "zone" => request.zone
2456
+ },
2457
+ options: options
2458
+ )
2459
+ yield result, response if block_given?
2460
+ throw :response, result
2461
+ end
2462
+ rescue ::Gapic::Rest::Error => e
2463
+ raise ::Google::Cloud::Error.from_error(e)
2464
+ end
2465
+
2355
2466
  ##
2356
2467
  # Configuration class for the Disks REST API.
2357
2468
  #
@@ -2593,6 +2704,11 @@ module Google
2593
2704
  # @return [::Gapic::Config::Method]
2594
2705
  #
2595
2706
  attr_reader :update
2707
+ ##
2708
+ # RPC-specific configuration for `update_kms_key`
2709
+ # @return [::Gapic::Config::Method]
2710
+ #
2711
+ attr_reader :update_kms_key
2596
2712
 
2597
2713
  # @private
2598
2714
  def initialize parent_rpcs = nil
@@ -2634,6 +2750,8 @@ module Google
2634
2750
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
2635
2751
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
2636
2752
  @update = ::Gapic::Config::Method.new update_config
2753
+ update_kms_key_config = parent_rpcs.update_kms_key if parent_rpcs.respond_to? :update_kms_key
2754
+ @update_kms_key = ::Gapic::Config::Method.new update_kms_key_config
2637
2755
 
2638
2756
  yield self if block_given?
2639
2757
  end
@@ -833,6 +833,46 @@ module Google
833
833
  end
834
834
  end
835
835
 
836
+ ##
837
+ # Baseline implementation for the update_kms_key REST call
838
+ #
839
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateKmsKeyDiskRequest]
840
+ # A request object representing the call parameters. Required.
841
+ # @param options [::Gapic::CallOptions]
842
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
843
+ #
844
+ # @yield [result, operation] Access the result along with the TransportOperation object
845
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
846
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
847
+ #
848
+ # @return [::Google::Cloud::Compute::V1::Operation]
849
+ # A result object deserialized from the server's reply
850
+ def update_kms_key request_pb, options = nil
851
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
852
+
853
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_kms_key_request request_pb
854
+ query_string_params = if query_string_params.any?
855
+ query_string_params.to_h { |p| p.split "=", 2 }
856
+ else
857
+ {}
858
+ end
859
+
860
+ response = @client_stub.make_http_request(
861
+ verb,
862
+ uri: uri,
863
+ body: body || "",
864
+ params: query_string_params,
865
+ method_name: "update_kms_key",
866
+ options: options
867
+ )
868
+ operation = ::Gapic::Rest::TransportOperation.new response
869
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
870
+ catch :response do
871
+ yield result, operation if block_given?
872
+ result
873
+ end
874
+ end
875
+
836
876
  ##
837
877
  # @private
838
878
  #
@@ -1275,6 +1315,30 @@ module Google
1275
1315
  )
1276
1316
  transcoder.transcode request_pb
1277
1317
  end
1318
+
1319
+ ##
1320
+ # @private
1321
+ #
1322
+ # GRPC transcoding helper method for the update_kms_key REST call
1323
+ #
1324
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateKmsKeyDiskRequest]
1325
+ # A request object representing the call parameters. Required.
1326
+ # @return [Array(String, [String, nil], Hash{String => String})]
1327
+ # Uri, Body, Query string parameters
1328
+ def self.transcode_update_kms_key_request request_pb
1329
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1330
+ .with_bindings(
1331
+ uri_method: :post,
1332
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/updateKmsKey",
1333
+ body: "disk_update_kms_key_request_resource",
1334
+ matches: [
1335
+ ["project", %r{^[^/]+/?$}, false],
1336
+ ["zone", %r{^[^/]+/?$}, false],
1337
+ ["disk", %r{^[^/]+/?$}, false]
1338
+ ]
1339
+ )
1340
+ transcoder.transcode request_pb
1341
+ end
1278
1342
  end
1279
1343
  end
1280
1344
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module InstantSnapshotGroups
26
+ # Credentials for the InstantSnapshotGroups API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/compute",
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "COMPUTE_CREDENTIALS",
34
+ "COMPUTE_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "COMPUTE_CREDENTIALS_JSON",
39
+ "COMPUTE_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end