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.
- checksums.yaml +4 -4
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +375 -0
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +122 -0
- data/lib/google/cloud/compute/v1/compute_pb.rb +94 -1
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +118 -0
- data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +64 -0
- data/lib/google/cloud/compute/v1/instant_snapshot_groups/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/client.rb +1145 -0
- data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/service_stub.rb +523 -0
- data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/instant_snapshot_groups.rb +47 -0
- data/lib/google/cloud/compute/v1/region_backend_buckets/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_backend_buckets/rest/client.rb +1450 -0
- data/lib/google/cloud/compute/v1/region_backend_buckets/rest/service_stub.rb +649 -0
- data/lib/google/cloud/compute/v1/region_backend_buckets/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/region_backend_buckets.rb +47 -0
- data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/client.rb +95 -0
- data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/service_stub.rb +63 -0
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +118 -0
- data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +64 -0
- data/lib/google/cloud/compute/v1/region_health_sources/rest/client.rb +95 -0
- data/lib/google/cloud/compute/v1/region_health_sources/rest/service_stub.rb +63 -0
- data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/client.rb +1002 -0
- data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/service_stub.rb +400 -0
- data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests.rb +47 -0
- data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/client.rb +1146 -0
- data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/service_stub.rb +523 -0
- data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/region_instant_snapshot_groups.rb +47 -0
- data/lib/google/cloud/compute/v1/region_snapshot_settings/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/client.rb +561 -0
- data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/service_stub.rb +206 -0
- data/lib/google/cloud/compute/v1/region_snapshot_settings/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/region_snapshot_settings.rb +47 -0
- data/lib/google/cloud/compute/v1/region_snapshots/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_snapshots/rest/client.rb +1388 -0
- data/lib/google/cloud/compute/v1/region_snapshots/rest/service_stub.rb +651 -0
- data/lib/google/cloud/compute/v1/region_snapshots/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/region_snapshots.rb +47 -0
- data/lib/google/cloud/compute/v1/rest.rb +7 -0
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +115 -0
- data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +63 -0
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/zone_vm_extension_policies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/client.rb +975 -0
- data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/service_stub.rb +396 -0
- data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/zone_vm_extension_policies.rb +47 -0
- data/lib/google/cloud/compute/v1.rb +7 -0
- data/proto_docs/google/cloud/compute/v1/compute.rb +4753 -1599
- metadata +36 -1
|
@@ -0,0 +1,51 @@
|
|
|
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 "gapic/rest"
|
|
20
|
+
require "gapic/config"
|
|
21
|
+
require "gapic/config/method"
|
|
22
|
+
|
|
23
|
+
require "google/cloud/compute/v1/version"
|
|
24
|
+
|
|
25
|
+
require "google/cloud/compute/v1/region_backend_buckets/credentials"
|
|
26
|
+
require "google/cloud/compute/v1/region_backend_buckets/rest/client"
|
|
27
|
+
|
|
28
|
+
module Google
|
|
29
|
+
module Cloud
|
|
30
|
+
module Compute
|
|
31
|
+
module V1
|
|
32
|
+
##
|
|
33
|
+
# The RegionBackendBuckets API.
|
|
34
|
+
#
|
|
35
|
+
# To load this service and instantiate a REST client:
|
|
36
|
+
#
|
|
37
|
+
# require "google/cloud/compute/v1/region_backend_buckets/rest"
|
|
38
|
+
# client = ::Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client.new
|
|
39
|
+
#
|
|
40
|
+
module RegionBackendBuckets
|
|
41
|
+
# Client for the REST transport
|
|
42
|
+
module Rest
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
|
51
|
+
require "google/cloud/compute/v1/region_backend_buckets/rest/helpers" if ::File.file? helper_path
|
|
@@ -0,0 +1,47 @@
|
|
|
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 "gapic/config"
|
|
20
|
+
require "gapic/config/method"
|
|
21
|
+
|
|
22
|
+
require "google/cloud/compute/v1/version"
|
|
23
|
+
|
|
24
|
+
require "google/cloud/compute/v1/region_backend_buckets/credentials"
|
|
25
|
+
require "google/cloud/compute/v1/region_backend_buckets/rest"
|
|
26
|
+
|
|
27
|
+
module Google
|
|
28
|
+
module Cloud
|
|
29
|
+
module Compute
|
|
30
|
+
module V1
|
|
31
|
+
##
|
|
32
|
+
# The RegionBackendBuckets API.
|
|
33
|
+
#
|
|
34
|
+
# @example Load this service and instantiate a REST client
|
|
35
|
+
#
|
|
36
|
+
# require "google/cloud/compute/v1/region_backend_buckets/rest"
|
|
37
|
+
# client = ::Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client.new
|
|
38
|
+
#
|
|
39
|
+
module RegionBackendBuckets
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
helper_path = ::File.join __dir__, "region_backend_buckets", "helpers.rb"
|
|
47
|
+
require "google/cloud/compute/v1/region_backend_buckets/helpers" if ::File.file? helper_path
|
|
@@ -83,6 +83,11 @@ module Google
|
|
|
83
83
|
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
default_config.rpcs.get_health.timeout = 600.0
|
|
87
|
+
default_config.rpcs.get_health.retry_policy = {
|
|
88
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
default_config.rpcs.insert.timeout = 600.0
|
|
87
92
|
|
|
88
93
|
default_config.rpcs.list.timeout = 600.0
|
|
@@ -583,6 +588,89 @@ module Google
|
|
|
583
588
|
raise ::Google::Cloud::Error.from_error(e)
|
|
584
589
|
end
|
|
585
590
|
|
|
591
|
+
##
|
|
592
|
+
# Gets the most recent health check results for this
|
|
593
|
+
# regional CompositeHealthCheck.
|
|
594
|
+
#
|
|
595
|
+
# @overload get_health(request, options = nil)
|
|
596
|
+
# Pass arguments to `get_health` via a request object, either of type
|
|
597
|
+
# {::Google::Cloud::Compute::V1::GetHealthRegionCompositeHealthCheckRequest} or an equivalent Hash.
|
|
598
|
+
#
|
|
599
|
+
# @param request [::Google::Cloud::Compute::V1::GetHealthRegionCompositeHealthCheckRequest, ::Hash]
|
|
600
|
+
# A request object representing the call parameters. Required. To specify no
|
|
601
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
602
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
603
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
604
|
+
#
|
|
605
|
+
# @overload get_health(composite_health_check: nil, project: nil, region: nil)
|
|
606
|
+
# Pass arguments to `get_health` via keyword arguments. Note that at
|
|
607
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
608
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
609
|
+
#
|
|
610
|
+
# @param composite_health_check [::String]
|
|
611
|
+
# Name of the CompositeHealthCheck resource to get health for.
|
|
612
|
+
# @param project [::String]
|
|
613
|
+
# Name of the project scoping this request.
|
|
614
|
+
# @param region [::String]
|
|
615
|
+
# Name of the region scoping this request.
|
|
616
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
617
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::CompositeHealthCheckHealth]
|
|
618
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
619
|
+
#
|
|
620
|
+
# @return [::Google::Cloud::Compute::V1::CompositeHealthCheckHealth]
|
|
621
|
+
#
|
|
622
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
623
|
+
#
|
|
624
|
+
# @example Basic example
|
|
625
|
+
# require "google/cloud/compute/v1"
|
|
626
|
+
#
|
|
627
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
628
|
+
# client = Google::Cloud::Compute::V1::RegionCompositeHealthChecks::Rest::Client.new
|
|
629
|
+
#
|
|
630
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
631
|
+
# request = Google::Cloud::Compute::V1::GetHealthRegionCompositeHealthCheckRequest.new
|
|
632
|
+
#
|
|
633
|
+
# # Call the get_health method.
|
|
634
|
+
# result = client.get_health request
|
|
635
|
+
#
|
|
636
|
+
# # The returned object is of type Google::Cloud::Compute::V1::CompositeHealthCheckHealth.
|
|
637
|
+
# p result
|
|
638
|
+
#
|
|
639
|
+
def get_health request, options = nil
|
|
640
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
641
|
+
|
|
642
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetHealthRegionCompositeHealthCheckRequest
|
|
643
|
+
|
|
644
|
+
# Converts hash and nil to an options object
|
|
645
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
646
|
+
|
|
647
|
+
# Customize the options with defaults
|
|
648
|
+
call_metadata = @config.rpcs.get_health.metadata.to_h
|
|
649
|
+
|
|
650
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
651
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
652
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
653
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
|
654
|
+
transports_version_send: [:rest]
|
|
655
|
+
|
|
656
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
657
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
658
|
+
|
|
659
|
+
options.apply_defaults timeout: @config.rpcs.get_health.timeout,
|
|
660
|
+
metadata: call_metadata,
|
|
661
|
+
retry_policy: @config.rpcs.get_health.retry_policy
|
|
662
|
+
|
|
663
|
+
options.apply_defaults timeout: @config.timeout,
|
|
664
|
+
metadata: @config.metadata,
|
|
665
|
+
retry_policy: @config.retry_policy
|
|
666
|
+
|
|
667
|
+
@region_composite_health_checks_stub.get_health request, options do |result, operation|
|
|
668
|
+
yield result, operation if block_given?
|
|
669
|
+
end
|
|
670
|
+
rescue ::Gapic::Rest::Error => e
|
|
671
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
672
|
+
end
|
|
673
|
+
|
|
586
674
|
##
|
|
587
675
|
# Create a CompositeHealthCheck in the specified project in the given region
|
|
588
676
|
# using the parameters that are included in the request.
|
|
@@ -1218,6 +1306,11 @@ module Google
|
|
|
1218
1306
|
#
|
|
1219
1307
|
attr_reader :get
|
|
1220
1308
|
##
|
|
1309
|
+
# RPC-specific configuration for `get_health`
|
|
1310
|
+
# @return [::Gapic::Config::Method]
|
|
1311
|
+
#
|
|
1312
|
+
attr_reader :get_health
|
|
1313
|
+
##
|
|
1221
1314
|
# RPC-specific configuration for `insert`
|
|
1222
1315
|
# @return [::Gapic::Config::Method]
|
|
1223
1316
|
#
|
|
@@ -1246,6 +1339,8 @@ module Google
|
|
|
1246
1339
|
@delete = ::Gapic::Config::Method.new delete_config
|
|
1247
1340
|
get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
|
|
1248
1341
|
@get = ::Gapic::Config::Method.new get_config
|
|
1342
|
+
get_health_config = parent_rpcs.get_health if parent_rpcs.respond_to? :get_health
|
|
1343
|
+
@get_health = ::Gapic::Config::Method.new get_health_config
|
|
1249
1344
|
insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
|
|
1250
1345
|
@insert = ::Gapic::Config::Method.new insert_config
|
|
1251
1346
|
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
|
|
@@ -193,6 +193,46 @@ module Google
|
|
|
193
193
|
end
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
+
##
|
|
197
|
+
# Baseline implementation for the get_health REST call
|
|
198
|
+
#
|
|
199
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetHealthRegionCompositeHealthCheckRequest]
|
|
200
|
+
# A request object representing the call parameters. Required.
|
|
201
|
+
# @param options [::Gapic::CallOptions]
|
|
202
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
203
|
+
#
|
|
204
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
205
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::CompositeHealthCheckHealth]
|
|
206
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
207
|
+
#
|
|
208
|
+
# @return [::Google::Cloud::Compute::V1::CompositeHealthCheckHealth]
|
|
209
|
+
# A result object deserialized from the server's reply
|
|
210
|
+
def get_health request_pb, options = nil
|
|
211
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
212
|
+
|
|
213
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_health_request request_pb
|
|
214
|
+
query_string_params = if query_string_params.any?
|
|
215
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
216
|
+
else
|
|
217
|
+
{}
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
response = @client_stub.make_http_request(
|
|
221
|
+
verb,
|
|
222
|
+
uri: uri,
|
|
223
|
+
body: body || "",
|
|
224
|
+
params: query_string_params,
|
|
225
|
+
method_name: "get_health",
|
|
226
|
+
options: options
|
|
227
|
+
)
|
|
228
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
229
|
+
result = ::Google::Cloud::Compute::V1::CompositeHealthCheckHealth.decode_json response.body, ignore_unknown_fields: true
|
|
230
|
+
catch :response do
|
|
231
|
+
yield result, operation if block_given?
|
|
232
|
+
result
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
196
236
|
##
|
|
197
237
|
# Baseline implementation for the insert REST call
|
|
198
238
|
#
|
|
@@ -420,6 +460,29 @@ module Google
|
|
|
420
460
|
transcoder.transcode request_pb
|
|
421
461
|
end
|
|
422
462
|
|
|
463
|
+
##
|
|
464
|
+
# @private
|
|
465
|
+
#
|
|
466
|
+
# GRPC transcoding helper method for the get_health REST call
|
|
467
|
+
#
|
|
468
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetHealthRegionCompositeHealthCheckRequest]
|
|
469
|
+
# A request object representing the call parameters. Required.
|
|
470
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
471
|
+
# Uri, Body, Query string parameters
|
|
472
|
+
def self.transcode_get_health_request request_pb
|
|
473
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
474
|
+
.with_bindings(
|
|
475
|
+
uri_method: :get,
|
|
476
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/compositeHealthChecks/{composite_health_check}/getHealth",
|
|
477
|
+
matches: [
|
|
478
|
+
["project", %r{^[^/]+/?$}, false],
|
|
479
|
+
["region", %r{^[^/]+/?$}, false],
|
|
480
|
+
["composite_health_check", %r{^[^/]+/?$}, false]
|
|
481
|
+
]
|
|
482
|
+
)
|
|
483
|
+
transcoder.transcode request_pb
|
|
484
|
+
end
|
|
485
|
+
|
|
423
486
|
##
|
|
424
487
|
# @private
|
|
425
488
|
#
|
|
@@ -114,6 +114,8 @@ module Google
|
|
|
114
114
|
|
|
115
115
|
default_config.rpcs.update.timeout = 600.0
|
|
116
116
|
|
|
117
|
+
default_config.rpcs.update_kms_key.timeout = 600.0
|
|
118
|
+
|
|
117
119
|
default_config
|
|
118
120
|
end
|
|
119
121
|
yield @configure if block_given?
|
|
@@ -2045,6 +2047,115 @@ module Google
|
|
|
2045
2047
|
raise ::Google::Cloud::Error.from_error(e)
|
|
2046
2048
|
end
|
|
2047
2049
|
|
|
2050
|
+
##
|
|
2051
|
+
# Rotates the customer-managed
|
|
2052
|
+
# encryption key to the latest version for the specified persistent disk.
|
|
2053
|
+
#
|
|
2054
|
+
# @overload update_kms_key(request, options = nil)
|
|
2055
|
+
# Pass arguments to `update_kms_key` via a request object, either of type
|
|
2056
|
+
# {::Google::Cloud::Compute::V1::UpdateKmsKeyRegionDiskRequest} or an equivalent Hash.
|
|
2057
|
+
#
|
|
2058
|
+
# @param request [::Google::Cloud::Compute::V1::UpdateKmsKeyRegionDiskRequest, ::Hash]
|
|
2059
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2060
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2061
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2062
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2063
|
+
#
|
|
2064
|
+
# @overload update_kms_key(disk: nil, project: nil, region: nil, region_disk_update_kms_key_request_resource: nil, request_id: nil)
|
|
2065
|
+
# Pass arguments to `update_kms_key` via keyword arguments. Note that at
|
|
2066
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2067
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2068
|
+
#
|
|
2069
|
+
# @param disk [::String]
|
|
2070
|
+
# Name of the Disk resource, should conform to RFC1035.
|
|
2071
|
+
# @param project [::String]
|
|
2072
|
+
# Project ID for this request.
|
|
2073
|
+
# @param region [::String]
|
|
2074
|
+
# The name of the region for this request.
|
|
2075
|
+
# @param region_disk_update_kms_key_request_resource [::Google::Cloud::Compute::V1::RegionDiskUpdateKmsKeyRequest, ::Hash]
|
|
2076
|
+
# The body resource for this request
|
|
2077
|
+
# @param request_id [::String]
|
|
2078
|
+
# An optional request ID to identify requests. Specify a unique request ID so
|
|
2079
|
+
# that if you must retry your request, the server will know to ignore the
|
|
2080
|
+
# request if it has already been completed.
|
|
2081
|
+
#
|
|
2082
|
+
# For example, consider a situation where you make an initial request and
|
|
2083
|
+
# the request times out. If you make the request again with the same
|
|
2084
|
+
# request ID, the server can check if original operation with the same
|
|
2085
|
+
# request ID was received, and if so, will ignore the second request. This
|
|
2086
|
+
# prevents clients from accidentally creating duplicate commitments.
|
|
2087
|
+
#
|
|
2088
|
+
# The request ID must be
|
|
2089
|
+
# a valid UUID with the exception that zero UUID is not supported
|
|
2090
|
+
# (00000000-0000-0000-0000-000000000000).
|
|
2091
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2092
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
|
2093
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2094
|
+
#
|
|
2095
|
+
# @return [::Gapic::GenericLRO::Operation]
|
|
2096
|
+
#
|
|
2097
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2098
|
+
#
|
|
2099
|
+
# @example Basic example
|
|
2100
|
+
# require "google/cloud/compute/v1"
|
|
2101
|
+
#
|
|
2102
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2103
|
+
# client = Google::Cloud::Compute::V1::RegionDisks::Rest::Client.new
|
|
2104
|
+
#
|
|
2105
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2106
|
+
# request = Google::Cloud::Compute::V1::UpdateKmsKeyRegionDiskRequest.new
|
|
2107
|
+
#
|
|
2108
|
+
# # Call the update_kms_key method.
|
|
2109
|
+
# result = client.update_kms_key request
|
|
2110
|
+
#
|
|
2111
|
+
# # The returned object is of type Google::Cloud::Compute::V1::Operation.
|
|
2112
|
+
# p result
|
|
2113
|
+
#
|
|
2114
|
+
def update_kms_key request, options = nil
|
|
2115
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2116
|
+
|
|
2117
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateKmsKeyRegionDiskRequest
|
|
2118
|
+
|
|
2119
|
+
# Converts hash and nil to an options object
|
|
2120
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2121
|
+
|
|
2122
|
+
# Customize the options with defaults
|
|
2123
|
+
call_metadata = @config.rpcs.update_kms_key.metadata.to_h
|
|
2124
|
+
|
|
2125
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2126
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2127
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2128
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
|
2129
|
+
transports_version_send: [:rest]
|
|
2130
|
+
|
|
2131
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2132
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2133
|
+
|
|
2134
|
+
options.apply_defaults timeout: @config.rpcs.update_kms_key.timeout,
|
|
2135
|
+
metadata: call_metadata,
|
|
2136
|
+
retry_policy: @config.rpcs.update_kms_key.retry_policy
|
|
2137
|
+
|
|
2138
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2139
|
+
metadata: @config.metadata,
|
|
2140
|
+
retry_policy: @config.retry_policy
|
|
2141
|
+
|
|
2142
|
+
@region_disks_stub.update_kms_key request, options do |result, response|
|
|
2143
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
|
2144
|
+
operation: result,
|
|
2145
|
+
client: region_operations,
|
|
2146
|
+
request_values: {
|
|
2147
|
+
"project" => request.project,
|
|
2148
|
+
"region" => request.region
|
|
2149
|
+
},
|
|
2150
|
+
options: options
|
|
2151
|
+
)
|
|
2152
|
+
yield result, response if block_given?
|
|
2153
|
+
throw :response, result
|
|
2154
|
+
end
|
|
2155
|
+
rescue ::Gapic::Rest::Error => e
|
|
2156
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2157
|
+
end
|
|
2158
|
+
|
|
2048
2159
|
##
|
|
2049
2160
|
# Configuration class for the RegionDisks REST API.
|
|
2050
2161
|
#
|
|
@@ -2276,6 +2387,11 @@ module Google
|
|
|
2276
2387
|
# @return [::Gapic::Config::Method]
|
|
2277
2388
|
#
|
|
2278
2389
|
attr_reader :update
|
|
2390
|
+
##
|
|
2391
|
+
# RPC-specific configuration for `update_kms_key`
|
|
2392
|
+
# @return [::Gapic::Config::Method]
|
|
2393
|
+
#
|
|
2394
|
+
attr_reader :update_kms_key
|
|
2279
2395
|
|
|
2280
2396
|
# @private
|
|
2281
2397
|
def initialize parent_rpcs = nil
|
|
@@ -2313,6 +2429,8 @@ module Google
|
|
|
2313
2429
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
|
2314
2430
|
update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
|
|
2315
2431
|
@update = ::Gapic::Config::Method.new update_config
|
|
2432
|
+
update_kms_key_config = parent_rpcs.update_kms_key if parent_rpcs.respond_to? :update_kms_key
|
|
2433
|
+
@update_kms_key = ::Gapic::Config::Method.new update_kms_key_config
|
|
2316
2434
|
|
|
2317
2435
|
yield self if block_given?
|
|
2318
2436
|
end
|
|
@@ -753,6 +753,46 @@ module Google
|
|
|
753
753
|
end
|
|
754
754
|
end
|
|
755
755
|
|
|
756
|
+
##
|
|
757
|
+
# Baseline implementation for the update_kms_key REST call
|
|
758
|
+
#
|
|
759
|
+
# @param request_pb [::Google::Cloud::Compute::V1::UpdateKmsKeyRegionDiskRequest]
|
|
760
|
+
# A request object representing the call parameters. Required.
|
|
761
|
+
# @param options [::Gapic::CallOptions]
|
|
762
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
763
|
+
#
|
|
764
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
765
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
|
766
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
767
|
+
#
|
|
768
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
|
769
|
+
# A result object deserialized from the server's reply
|
|
770
|
+
def update_kms_key request_pb, options = nil
|
|
771
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
772
|
+
|
|
773
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_update_kms_key_request request_pb
|
|
774
|
+
query_string_params = if query_string_params.any?
|
|
775
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
776
|
+
else
|
|
777
|
+
{}
|
|
778
|
+
end
|
|
779
|
+
|
|
780
|
+
response = @client_stub.make_http_request(
|
|
781
|
+
verb,
|
|
782
|
+
uri: uri,
|
|
783
|
+
body: body || "",
|
|
784
|
+
params: query_string_params,
|
|
785
|
+
method_name: "update_kms_key",
|
|
786
|
+
options: options
|
|
787
|
+
)
|
|
788
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
789
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
|
790
|
+
catch :response do
|
|
791
|
+
yield result, operation if block_given?
|
|
792
|
+
result
|
|
793
|
+
end
|
|
794
|
+
end
|
|
795
|
+
|
|
756
796
|
##
|
|
757
797
|
# @private
|
|
758
798
|
#
|
|
@@ -1151,6 +1191,30 @@ module Google
|
|
|
1151
1191
|
)
|
|
1152
1192
|
transcoder.transcode request_pb
|
|
1153
1193
|
end
|
|
1194
|
+
|
|
1195
|
+
##
|
|
1196
|
+
# @private
|
|
1197
|
+
#
|
|
1198
|
+
# GRPC transcoding helper method for the update_kms_key REST call
|
|
1199
|
+
#
|
|
1200
|
+
# @param request_pb [::Google::Cloud::Compute::V1::UpdateKmsKeyRegionDiskRequest]
|
|
1201
|
+
# A request object representing the call parameters. Required.
|
|
1202
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
1203
|
+
# Uri, Body, Query string parameters
|
|
1204
|
+
def self.transcode_update_kms_key_request request_pb
|
|
1205
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
1206
|
+
.with_bindings(
|
|
1207
|
+
uri_method: :post,
|
|
1208
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/updateKmsKey",
|
|
1209
|
+
body: "region_disk_update_kms_key_request_resource",
|
|
1210
|
+
matches: [
|
|
1211
|
+
["project", %r{^[^/]+/?$}, false],
|
|
1212
|
+
["region", %r{^[^/]+/?$}, false],
|
|
1213
|
+
["disk", %r{^[^/]+/?$}, false]
|
|
1214
|
+
]
|
|
1215
|
+
)
|
|
1216
|
+
transcoder.transcode request_pb
|
|
1217
|
+
end
|
|
1154
1218
|
end
|
|
1155
1219
|
end
|
|
1156
1220
|
end
|
|
@@ -83,6 +83,11 @@ module Google
|
|
|
83
83
|
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
default_config.rpcs.get_health.timeout = 600.0
|
|
87
|
+
default_config.rpcs.get_health.retry_policy = {
|
|
88
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
default_config.rpcs.insert.timeout = 600.0
|
|
87
92
|
|
|
88
93
|
default_config.rpcs.list.timeout = 600.0
|
|
@@ -583,6 +588,89 @@ module Google
|
|
|
583
588
|
raise ::Google::Cloud::Error.from_error(e)
|
|
584
589
|
end
|
|
585
590
|
|
|
591
|
+
##
|
|
592
|
+
# Gets the most recent health check results for this
|
|
593
|
+
# regional HealthSource.
|
|
594
|
+
#
|
|
595
|
+
# @overload get_health(request, options = nil)
|
|
596
|
+
# Pass arguments to `get_health` via a request object, either of type
|
|
597
|
+
# {::Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest} or an equivalent Hash.
|
|
598
|
+
#
|
|
599
|
+
# @param request [::Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest, ::Hash]
|
|
600
|
+
# A request object representing the call parameters. Required. To specify no
|
|
601
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
602
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
603
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
604
|
+
#
|
|
605
|
+
# @overload get_health(health_source: nil, project: nil, region: nil)
|
|
606
|
+
# Pass arguments to `get_health` via keyword arguments. Note that at
|
|
607
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
608
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
609
|
+
#
|
|
610
|
+
# @param health_source [::String]
|
|
611
|
+
# Name of the HealthSource resource to get health for.
|
|
612
|
+
# @param project [::String]
|
|
613
|
+
# Name of the project scoping this request.
|
|
614
|
+
# @param region [::String]
|
|
615
|
+
# Name of the region scoping this request.
|
|
616
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
617
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::HealthSourceHealth]
|
|
618
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
619
|
+
#
|
|
620
|
+
# @return [::Google::Cloud::Compute::V1::HealthSourceHealth]
|
|
621
|
+
#
|
|
622
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
623
|
+
#
|
|
624
|
+
# @example Basic example
|
|
625
|
+
# require "google/cloud/compute/v1"
|
|
626
|
+
#
|
|
627
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
628
|
+
# client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
|
|
629
|
+
#
|
|
630
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
631
|
+
# request = Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest.new
|
|
632
|
+
#
|
|
633
|
+
# # Call the get_health method.
|
|
634
|
+
# result = client.get_health request
|
|
635
|
+
#
|
|
636
|
+
# # The returned object is of type Google::Cloud::Compute::V1::HealthSourceHealth.
|
|
637
|
+
# p result
|
|
638
|
+
#
|
|
639
|
+
def get_health request, options = nil
|
|
640
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
641
|
+
|
|
642
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest
|
|
643
|
+
|
|
644
|
+
# Converts hash and nil to an options object
|
|
645
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
646
|
+
|
|
647
|
+
# Customize the options with defaults
|
|
648
|
+
call_metadata = @config.rpcs.get_health.metadata.to_h
|
|
649
|
+
|
|
650
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
651
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
652
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
653
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
|
654
|
+
transports_version_send: [:rest]
|
|
655
|
+
|
|
656
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
657
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
658
|
+
|
|
659
|
+
options.apply_defaults timeout: @config.rpcs.get_health.timeout,
|
|
660
|
+
metadata: call_metadata,
|
|
661
|
+
retry_policy: @config.rpcs.get_health.retry_policy
|
|
662
|
+
|
|
663
|
+
options.apply_defaults timeout: @config.timeout,
|
|
664
|
+
metadata: @config.metadata,
|
|
665
|
+
retry_policy: @config.retry_policy
|
|
666
|
+
|
|
667
|
+
@region_health_sources_stub.get_health request, options do |result, operation|
|
|
668
|
+
yield result, operation if block_given?
|
|
669
|
+
end
|
|
670
|
+
rescue ::Gapic::Rest::Error => e
|
|
671
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
672
|
+
end
|
|
673
|
+
|
|
586
674
|
##
|
|
587
675
|
# Create a HealthSource in the specified project in the given region
|
|
588
676
|
# using the parameters that are included in the request.
|
|
@@ -1218,6 +1306,11 @@ module Google
|
|
|
1218
1306
|
#
|
|
1219
1307
|
attr_reader :get
|
|
1220
1308
|
##
|
|
1309
|
+
# RPC-specific configuration for `get_health`
|
|
1310
|
+
# @return [::Gapic::Config::Method]
|
|
1311
|
+
#
|
|
1312
|
+
attr_reader :get_health
|
|
1313
|
+
##
|
|
1221
1314
|
# RPC-specific configuration for `insert`
|
|
1222
1315
|
# @return [::Gapic::Config::Method]
|
|
1223
1316
|
#
|
|
@@ -1246,6 +1339,8 @@ module Google
|
|
|
1246
1339
|
@delete = ::Gapic::Config::Method.new delete_config
|
|
1247
1340
|
get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
|
|
1248
1341
|
@get = ::Gapic::Config::Method.new get_config
|
|
1342
|
+
get_health_config = parent_rpcs.get_health if parent_rpcs.respond_to? :get_health
|
|
1343
|
+
@get_health = ::Gapic::Config::Method.new get_health_config
|
|
1249
1344
|
insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
|
|
1250
1345
|
@insert = ::Gapic::Config::Method.new insert_config
|
|
1251
1346
|
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
|