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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +87 -0
  4. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +61 -0
  5. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +151 -0
  6. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +119 -0
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +228 -0
  8. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +82 -0
  9. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +60 -0
  10. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +87 -0
  11. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +61 -0
  12. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +82 -0
  13. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
  14. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +155 -0
  15. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +121 -0
  16. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +759 -0
  18. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  19. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  20. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  21. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +587 -0
  23. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  24. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  25. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  26. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +82 -0
  27. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +60 -0
  28. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +86 -0
  29. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +58 -0
  30. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +87 -0
  31. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +61 -0
  32. data/lib/google/cloud/compute/v1/version.rb +1 -1
  33. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +87 -0
  34. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +61 -0
  35. data/lib/google/cloud/compute/v1.rb +2 -0
  36. data/proto_docs/google/cloud/compute/v1/compute.rb +637 -26
  37. metadata +12 -2
@@ -74,6 +74,11 @@ module Google
74
74
 
75
75
  default_config.rpcs.get_health.timeout = 600.0
76
76
 
77
+ default_config.rpcs.get_iam_policy.timeout = 600.0
78
+ default_config.rpcs.get_iam_policy.retry_policy = {
79
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
80
+ }
81
+
77
82
  default_config.rpcs.insert.timeout = 600.0
78
83
 
79
84
  default_config.rpcs.list.timeout = 600.0
@@ -83,6 +88,8 @@ module Google
83
88
 
84
89
  default_config.rpcs.patch.timeout = 600.0
85
90
 
91
+ default_config.rpcs.set_iam_policy.timeout = 600.0
92
+
86
93
  default_config.rpcs.update.timeout = 600.0
87
94
 
88
95
  default_config
@@ -365,6 +372,73 @@ module Google
365
372
  raise ::Google::Cloud::Error.from_error(gapic_error)
366
373
  end
367
374
 
375
+ ##
376
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
377
+ #
378
+ # @overload get_iam_policy(request, options = nil)
379
+ # Pass arguments to `get_iam_policy` via a request object, either of type
380
+ # {::Google::Cloud::Compute::V1::GetIamPolicyRegionBackendServiceRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyRegionBackendServiceRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
387
+ # Note: currently retry functionality is not implemented. While it is possible
388
+ # to set it using ::Gapic::CallOptions, it will not be applied
389
+ #
390
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, region: nil, resource: nil)
391
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param options_requested_policy_version [::Integer]
396
+ # Requested IAM Policy version.
397
+ # @param project [::String]
398
+ # Project ID for this request.
399
+ # @param region [::String]
400
+ # The name of the region for this request.
401
+ # @param resource [::String]
402
+ # Name or id of the resource for this request.
403
+ # @yield [result, response] Access the result along with the Faraday response object
404
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
405
+ # @yieldparam response [::Faraday::Response]
406
+ #
407
+ # @return [::Google::Cloud::Compute::V1::Policy]
408
+ #
409
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
410
+ def get_iam_policy request, options = nil
411
+ raise ::ArgumentError, "request must be provided" if request.nil?
412
+
413
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyRegionBackendServiceRequest
414
+
415
+ # Converts hash and nil to an options object
416
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
417
+
418
+ # Customize the options with defaults
419
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
420
+
421
+ # Set x-goog-api-client header
422
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
423
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
424
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
425
+ transports_version_send: [:rest]
426
+
427
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
428
+ metadata: call_metadata
429
+
430
+ options.apply_defaults timeout: @config.timeout,
431
+ metadata: @config.metadata
432
+
433
+ @region_backend_services_stub.get_iam_policy request, options do |result, response|
434
+ yield result, response if block_given?
435
+ return result
436
+ end
437
+ rescue ::Faraday::Error => e
438
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
439
+ raise ::Google::Cloud::Error.from_error(gapic_error)
440
+ end
441
+
368
442
  ##
369
443
  # Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.
370
444
  #
@@ -593,6 +667,73 @@ module Google
593
667
  raise ::Google::Cloud::Error.from_error(gapic_error)
594
668
  end
595
669
 
670
+ ##
671
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
672
+ #
673
+ # @overload set_iam_policy(request, options = nil)
674
+ # Pass arguments to `set_iam_policy` via a request object, either of type
675
+ # {::Google::Cloud::Compute::V1::SetIamPolicyRegionBackendServiceRequest} or an equivalent Hash.
676
+ #
677
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyRegionBackendServiceRequest, ::Hash]
678
+ # A request object representing the call parameters. Required. To specify no
679
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
680
+ # @param options [::Gapic::CallOptions, ::Hash]
681
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
682
+ # Note: currently retry functionality is not implemented. While it is possible
683
+ # to set it using ::Gapic::CallOptions, it will not be applied
684
+ #
685
+ # @overload set_iam_policy(project: nil, region: nil, region_set_policy_request_resource: nil, resource: nil)
686
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
687
+ # least one keyword argument is required. To specify no parameters, or to keep all
688
+ # the default parameter values, pass an empty Hash as a request object (see above).
689
+ #
690
+ # @param project [::String]
691
+ # Project ID for this request.
692
+ # @param region [::String]
693
+ # The name of the region for this request.
694
+ # @param region_set_policy_request_resource [::Google::Cloud::Compute::V1::RegionSetPolicyRequest, ::Hash]
695
+ # The body resource for this request
696
+ # @param resource [::String]
697
+ # Name or id of the resource for this request.
698
+ # @yield [result, response] Access the result along with the Faraday response object
699
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
700
+ # @yieldparam response [::Faraday::Response]
701
+ #
702
+ # @return [::Google::Cloud::Compute::V1::Policy]
703
+ #
704
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
705
+ def set_iam_policy request, options = nil
706
+ raise ::ArgumentError, "request must be provided" if request.nil?
707
+
708
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyRegionBackendServiceRequest
709
+
710
+ # Converts hash and nil to an options object
711
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
712
+
713
+ # Customize the options with defaults
714
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
715
+
716
+ # Set x-goog-api-client header
717
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
718
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
719
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
720
+ transports_version_send: [:rest]
721
+
722
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
723
+ metadata: call_metadata
724
+
725
+ options.apply_defaults timeout: @config.timeout,
726
+ metadata: @config.metadata
727
+
728
+ @region_backend_services_stub.set_iam_policy request, options do |result, response|
729
+ yield result, response if block_given?
730
+ return result
731
+ end
732
+ rescue ::Faraday::Error => e
733
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
734
+ raise ::Google::Cloud::Error.from_error(gapic_error)
735
+ end
736
+
596
737
  ##
597
738
  # Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview .
598
739
  #
@@ -786,6 +927,11 @@ module Google
786
927
  #
787
928
  attr_reader :get_health
788
929
  ##
930
+ # RPC-specific configuration for `get_iam_policy`
931
+ # @return [::Gapic::Config::Method]
932
+ #
933
+ attr_reader :get_iam_policy
934
+ ##
789
935
  # RPC-specific configuration for `insert`
790
936
  # @return [::Gapic::Config::Method]
791
937
  #
@@ -801,6 +947,11 @@ module Google
801
947
  #
802
948
  attr_reader :patch
803
949
  ##
950
+ # RPC-specific configuration for `set_iam_policy`
951
+ # @return [::Gapic::Config::Method]
952
+ #
953
+ attr_reader :set_iam_policy
954
+ ##
804
955
  # RPC-specific configuration for `update`
805
956
  # @return [::Gapic::Config::Method]
806
957
  #
@@ -814,12 +965,16 @@ module Google
814
965
  @get = ::Gapic::Config::Method.new get_config
815
966
  get_health_config = parent_rpcs.get_health if parent_rpcs.respond_to? :get_health
816
967
  @get_health = ::Gapic::Config::Method.new get_health_config
968
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
969
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
817
970
  insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
818
971
  @insert = ::Gapic::Config::Method.new insert_config
819
972
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
820
973
  @list = ::Gapic::Config::Method.new list_config
821
974
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
822
975
  @patch = ::Gapic::Config::Method.new patch_config
976
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
977
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
823
978
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
824
979
  @update = ::Gapic::Config::Method.new update_config
825
980
 
@@ -149,6 +149,43 @@ module Google
149
149
  result
150
150
  end
151
151
 
152
+ ##
153
+ # Baseline implementation for the get_iam_policy REST call
154
+ #
155
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyRegionBackendServiceRequest]
156
+ # A request object representing the call parameters. Required.
157
+ # @param options [::Gapic::CallOptions]
158
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
159
+ #
160
+ # @yield [result, response] Access the result along with the Faraday response object
161
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
162
+ # @yieldparam response [::Faraday::Response]
163
+ #
164
+ # @return [::Google::Cloud::Compute::V1::Policy]
165
+ # A result object deserialized from the server's reply
166
+ def get_iam_policy request_pb, options = nil
167
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
168
+
169
+ verb, uri, query_string_params, body = transcode_get_iam_policy_request request_pb
170
+ query_string_params = if query_string_params.any?
171
+ query_string_params.to_h { |p| p.split("=", 2) }
172
+ else
173
+ {}
174
+ end
175
+
176
+ response = @client_stub.make_http_request(
177
+ verb,
178
+ uri: uri,
179
+ body: body || "",
180
+ params: query_string_params,
181
+ options: options
182
+ )
183
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
184
+
185
+ yield result, response if block_given?
186
+ result
187
+ end
188
+
152
189
  ##
153
190
  # Baseline implementation for the insert REST call
154
191
  #
@@ -260,6 +297,43 @@ module Google
260
297
  result
261
298
  end
262
299
 
300
+ ##
301
+ # Baseline implementation for the set_iam_policy REST call
302
+ #
303
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyRegionBackendServiceRequest]
304
+ # A request object representing the call parameters. Required.
305
+ # @param options [::Gapic::CallOptions]
306
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
307
+ #
308
+ # @yield [result, response] Access the result along with the Faraday response object
309
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
310
+ # @yieldparam response [::Faraday::Response]
311
+ #
312
+ # @return [::Google::Cloud::Compute::V1::Policy]
313
+ # A result object deserialized from the server's reply
314
+ def set_iam_policy request_pb, options = nil
315
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
316
+
317
+ verb, uri, query_string_params, body = transcode_set_iam_policy_request request_pb
318
+ query_string_params = if query_string_params.any?
319
+ query_string_params.to_h { |p| p.split("=", 2) }
320
+ else
321
+ {}
322
+ end
323
+
324
+ response = @client_stub.make_http_request(
325
+ verb,
326
+ uri: uri,
327
+ body: body || "",
328
+ params: query_string_params,
329
+ options: options
330
+ )
331
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
332
+
333
+ yield result, response if block_given?
334
+ result
335
+ end
336
+
263
337
  ##
264
338
  # Baseline implementation for the update REST call
265
339
  #
@@ -370,6 +444,29 @@ module Google
370
444
  transcoder.transcode request_pb
371
445
  end
372
446
 
447
+ ##
448
+ # @private
449
+ #
450
+ # GRPC transcoding helper method for the get_iam_policy REST call
451
+ #
452
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyRegionBackendServiceRequest]
453
+ # A request object representing the call parameters. Required.
454
+ # @return [Array(String, [String, nil], Hash{String => String})]
455
+ # Uri, Body, Query string parameters
456
+ def transcode_get_iam_policy_request request_pb
457
+ transcoder = Gapic::Rest::GrpcTranscoder.new
458
+ .with_bindings(
459
+ uri_method: :get,
460
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy",
461
+ matches: [
462
+ ["project", %r{^[^/]+/?$}, false],
463
+ ["region", %r{^[^/]+/?$}, false],
464
+ ["resource", %r{^[^/]+/?$}, false]
465
+ ]
466
+ )
467
+ transcoder.transcode request_pb
468
+ end
469
+
373
470
  ##
374
471
  # @private
375
472
  #
@@ -439,6 +536,30 @@ module Google
439
536
  transcoder.transcode request_pb
440
537
  end
441
538
 
539
+ ##
540
+ # @private
541
+ #
542
+ # GRPC transcoding helper method for the set_iam_policy REST call
543
+ #
544
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyRegionBackendServiceRequest]
545
+ # A request object representing the call parameters. Required.
546
+ # @return [Array(String, [String, nil], Hash{String => String})]
547
+ # Uri, Body, Query string parameters
548
+ def transcode_set_iam_policy_request request_pb
549
+ transcoder = Gapic::Rest::GrpcTranscoder.new
550
+ .with_bindings(
551
+ uri_method: :post,
552
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy",
553
+ body: "region_set_policy_request_resource",
554
+ matches: [
555
+ ["project", %r{^[^/]+/?$}, false],
556
+ ["region", %r{^[^/]+/?$}, false],
557
+ ["resource", %r{^[^/]+/?$}, false]
558
+ ]
559
+ )
560
+ transcoder.transcode request_pb
561
+ end
562
+
442
563
  ##
443
564
  # @private
444
565
  #
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 RegionSslPolicies
26
+ # Credentials for the RegionSslPolicies 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