google-cloud-compute-v1 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +2 -2
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +3 -3
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +3 -3
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +3 -3
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +145 -0
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +3 -3
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +94 -3
  10. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +62 -0
  11. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +2 -2
  12. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +4 -4
  13. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +2 -2
  14. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +2 -2
  15. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +3 -3
  16. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +2 -2
  17. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +3 -3
  18. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
  19. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +2 -2
  20. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +2 -2
  21. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +3 -3
  22. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +2 -2
  23. data/lib/google/cloud/compute/v1/images/rest/client.rb +5 -5
  24. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +3 -3
  25. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +2 -2
  26. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +93 -6
  27. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +59 -0
  28. data/lib/google/cloud/compute/v1/instances/rest/client.rb +91 -3
  29. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +62 -0
  30. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +2 -2
  31. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +2 -2
  32. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +2 -2
  33. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +2 -2
  34. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +2 -2
  35. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +3 -3
  36. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +3 -3
  37. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +2 -2
  38. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +2 -2
  39. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +3 -3
  40. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +2 -2
  41. data/lib/google/cloud/compute/v1/networks/rest/client.rb +3 -3
  42. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +90 -2
  43. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +62 -0
  44. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +3 -3
  45. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +3 -3
  46. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +2 -2
  47. data/lib/google/cloud/compute/v1/projects/rest/client.rb +2 -2
  48. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +2 -2
  49. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +2 -2
  50. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +2 -2
  51. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +2 -2
  52. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +3 -3
  53. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +3 -3
  54. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +93 -2
  55. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +62 -0
  56. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +2 -2
  57. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +3 -3
  58. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +2 -2
  59. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +2 -2
  60. data/lib/google/cloud/compute/v1/region_instance_templates/credentials.rb +52 -0
  61. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +624 -0
  62. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +291 -0
  63. data/lib/google/cloud/compute/v1/region_instance_templates/rest.rb +51 -0
  64. data/lib/google/cloud/compute/v1/region_instance_templates.rb +47 -0
  65. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +2 -2
  66. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +3 -3
  67. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +2 -2
  68. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +2 -2
  69. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +2 -2
  70. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +2 -2
  71. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +2 -2
  72. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +2 -2
  73. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +3 -3
  74. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +3 -3
  75. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +2 -2
  76. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +3 -3
  77. data/lib/google/cloud/compute/v1/regions/rest/client.rb +3 -3
  78. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +2 -2
  79. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +2 -2
  80. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  81. data/lib/google/cloud/compute/v1/routers/rest/client.rb +3 -3
  82. data/lib/google/cloud/compute/v1/routes/rest/client.rb +3 -3
  83. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +2 -2
  84. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +2 -2
  85. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +3 -3
  86. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +3 -3
  87. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +3 -3
  88. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +3 -3
  89. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +2 -2
  90. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +3 -3
  91. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +3 -3
  92. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +3 -3
  93. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +3 -3
  94. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +3 -3
  95. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +3 -3
  96. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +3 -3
  97. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +3 -3
  98. data/lib/google/cloud/compute/v1/version.rb +1 -1
  99. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +3 -3
  100. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +3 -3
  101. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +2 -2
  102. data/lib/google/cloud/compute/v1/zones/rest/client.rb +3 -3
  103. data/lib/google/cloud/compute/v1.rb +1 -0
  104. data/proto_docs/google/api/client.rb +9 -3
  105. data/proto_docs/google/cloud/compute/v1/compute.rb +414 -29
  106. metadata +9 -4
@@ -65,6 +65,11 @@ module Google
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
67
67
 
68
+ default_config.rpcs.aggregated_list.timeout = 600.0
69
+ default_config.rpcs.aggregated_list.retry_policy = {
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
71
+ }
72
+
68
73
  default_config.rpcs.delete.timeout = 600.0
69
74
 
70
75
  default_config.rpcs.get.timeout = 600.0
@@ -170,6 +175,81 @@ module Google
170
175
 
171
176
  # Service calls
172
177
 
178
+ ##
179
+ # Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project.
180
+ #
181
+ # @overload aggregated_list(request, options = nil)
182
+ # Pass arguments to `aggregated_list` via a request object, either of type
183
+ # {::Google::Cloud::Compute::V1::AggregatedListInstanceTemplatesRequest} or an equivalent Hash.
184
+ #
185
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListInstanceTemplatesRequest, ::Hash]
186
+ # A request object representing the call parameters. Required. To specify no
187
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
188
+ # @param options [::Gapic::CallOptions, ::Hash]
189
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
190
+ #
191
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
192
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
193
+ # least one keyword argument is required. To specify no parameters, or to keep all
194
+ # the default parameter values, pass an empty Hash as a request object (see above).
195
+ #
196
+ # @param filter [::String]
197
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
198
+ # @param include_all_scopes [::Boolean]
199
+ # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
200
+ # @param max_results [::Integer]
201
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
202
+ # @param order_by [::String]
203
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
204
+ # @param page_token [::String]
205
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
206
+ # @param project [::String]
207
+ # Name of the project scoping this request.
208
+ # @param return_partial_success [::Boolean]
209
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
210
+ # @yield [result, operation] Access the result along with the TransportOperation object
211
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceTemplatesScopedList>]
212
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
213
+ #
214
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceTemplatesScopedList>]
215
+ #
216
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
217
+ def aggregated_list request, options = nil
218
+ raise ::ArgumentError, "request must be provided" if request.nil?
219
+
220
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListInstanceTemplatesRequest
221
+
222
+ # Converts hash and nil to an options object
223
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
224
+
225
+ # Customize the options with defaults
226
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
227
+
228
+ # Set x-goog-api-client and x-goog-user-project headers
229
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
230
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
231
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
232
+ transports_version_send: [:rest]
233
+
234
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
235
+
236
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
237
+ metadata: call_metadata,
238
+ retry_policy: @config.rpcs.aggregated_list.retry_policy
239
+
240
+ options.apply_defaults timeout: @config.timeout,
241
+ metadata: @config.metadata,
242
+ retry_policy: @config.retry_policy
243
+
244
+ @instance_templates_stub.aggregated_list request, options do |result, operation|
245
+ result = ::Gapic::Rest::PagedEnumerable.new @instance_templates_stub, :aggregated_list, "items", request, result, options
246
+ yield result, operation if block_given?
247
+ return result
248
+ end
249
+ rescue ::Gapic::Rest::Error => e
250
+ raise ::Google::Cloud::Error.from_error(e)
251
+ end
252
+
173
253
  ##
174
254
  # Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.
175
255
  #
@@ -245,7 +325,7 @@ module Google
245
325
  end
246
326
 
247
327
  ##
248
- # Returns the specified instance template. Gets a list of available instance templates by making a list() request.
328
+ # Returns the specified instance template.
249
329
  #
250
330
  # @overload get(request, options = nil)
251
331
  # Pass arguments to `get` via a request object, either of type
@@ -669,17 +749,17 @@ module Google
669
749
  # @example
670
750
  #
671
751
  # # Modify the global config, setting the timeout for
672
- # # delete to 20 seconds,
752
+ # # aggregated_list to 20 seconds,
673
753
  # # and all remaining timeouts to 10 seconds.
674
754
  # ::Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client.configure do |config|
675
755
  # config.timeout = 10.0
676
- # config.rpcs.delete.timeout = 20.0
756
+ # config.rpcs.aggregated_list.timeout = 20.0
677
757
  # end
678
758
  #
679
759
  # # Apply the above configuration only to a new client.
680
760
  # client = ::Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client.new do |config|
681
761
  # config.timeout = 10.0
682
- # config.rpcs.delete.timeout = 20.0
762
+ # config.rpcs.aggregated_list.timeout = 20.0
683
763
  # end
684
764
  #
685
765
  # @!attribute [rw] endpoint
@@ -691,9 +771,9 @@ module Google
691
771
  # * (`String`) The path to a service account key file in JSON format
692
772
  # * (`Hash`) A service account key as a Hash
693
773
  # * (`Google::Auth::Credentials`) A googleauth credentials object
694
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
774
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
695
775
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
696
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
776
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
697
777
  # * (`nil`) indicating no credentials
698
778
  # @return [::Object]
699
779
  # @!attribute [rw] scope
@@ -776,6 +856,11 @@ module Google
776
856
  # trigger a retry.
777
857
  #
778
858
  class Rpcs
859
+ ##
860
+ # RPC-specific configuration for `aggregated_list`
861
+ # @return [::Gapic::Config::Method]
862
+ #
863
+ attr_reader :aggregated_list
779
864
  ##
780
865
  # RPC-specific configuration for `delete`
781
866
  # @return [::Gapic::Config::Method]
@@ -814,6 +899,8 @@ module Google
814
899
 
815
900
  # @private
816
901
  def initialize parent_rpcs = nil
902
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
903
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
817
904
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
818
905
  @delete = ::Gapic::Config::Method.new delete_config
819
906
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
@@ -40,6 +40,44 @@ module Google
40
40
  raise_faraday_errors: false
41
41
  end
42
42
 
43
+ ##
44
+ # Baseline implementation for the aggregated_list REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::Compute::V1::AggregatedListInstanceTemplatesRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceTemplateAggregatedList]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::Compute::V1::InstanceTemplateAggregatedList]
56
+ # A result object deserialized from the server's reply
57
+ def aggregated_list request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_aggregated_list_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split("=", 2) }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::Compute::V1::InstanceTemplateAggregatedList.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
43
81
  ##
44
82
  # Baseline implementation for the delete REST call
45
83
  #
@@ -306,6 +344,27 @@ module Google
306
344
  result
307
345
  end
308
346
 
347
+ ##
348
+ # @private
349
+ #
350
+ # GRPC transcoding helper method for the aggregated_list REST call
351
+ #
352
+ # @param request_pb [::Google::Cloud::Compute::V1::AggregatedListInstanceTemplatesRequest]
353
+ # A request object representing the call parameters. Required.
354
+ # @return [Array(String, [String, nil], Hash{String => String})]
355
+ # Uri, Body, Query string parameters
356
+ def self.transcode_aggregated_list_request request_pb
357
+ transcoder = Gapic::Rest::GrpcTranscoder.new
358
+ .with_bindings(
359
+ uri_method: :get,
360
+ uri_template: "/compute/v1/projects/{project}/aggregated/instanceTemplates",
361
+ matches: [
362
+ ["project", %r{^[^/]+/?$}, false]
363
+ ]
364
+ )
365
+ transcoder.transcode request_pb
366
+ end
367
+
309
368
  ##
310
369
  # @private
311
370
  #
@@ -155,6 +155,8 @@ module Google
155
155
 
156
156
  default_config.rpcs.set_min_cpu_platform.timeout = 600.0
157
157
 
158
+ default_config.rpcs.set_name.timeout = 600.0
159
+
158
160
  default_config.rpcs.set_scheduling.timeout = 600.0
159
161
 
160
162
  default_config.rpcs.set_service_account.timeout = 600.0
@@ -898,7 +900,7 @@ module Google
898
900
  end
899
901
 
900
902
  ##
901
- # Returns the specified Instance resource. Gets a list of available instances by making a list() request.
903
+ # Returns the specified Instance resource.
902
904
  #
903
905
  # @overload get(request, options = nil)
904
906
  # Pass arguments to `get` via a request object, either of type
@@ -2526,6 +2528,85 @@ module Google
2526
2528
  raise ::Google::Cloud::Error.from_error(e)
2527
2529
  end
2528
2530
 
2531
+ ##
2532
+ # Sets name of an instance.
2533
+ #
2534
+ # @overload set_name(request, options = nil)
2535
+ # Pass arguments to `set_name` via a request object, either of type
2536
+ # {::Google::Cloud::Compute::V1::SetNameInstanceRequest} or an equivalent Hash.
2537
+ #
2538
+ # @param request [::Google::Cloud::Compute::V1::SetNameInstanceRequest, ::Hash]
2539
+ # A request object representing the call parameters. Required. To specify no
2540
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2541
+ # @param options [::Gapic::CallOptions, ::Hash]
2542
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2543
+ #
2544
+ # @overload set_name(instance: nil, instances_set_name_request_resource: nil, project: nil, request_id: nil, zone: nil)
2545
+ # Pass arguments to `set_name` via keyword arguments. Note that at
2546
+ # least one keyword argument is required. To specify no parameters, or to keep all
2547
+ # the default parameter values, pass an empty Hash as a request object (see above).
2548
+ #
2549
+ # @param instance [::String]
2550
+ # The instance name for this request.
2551
+ # @param instances_set_name_request_resource [::Google::Cloud::Compute::V1::InstancesSetNameRequest, ::Hash]
2552
+ # The body resource for this request
2553
+ # @param project [::String]
2554
+ # Project ID for this request.
2555
+ # @param request_id [::String]
2556
+ # 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).
2557
+ # @param zone [::String]
2558
+ # The name of the zone for this request.
2559
+ # @yield [result, operation] Access the result along with the TransportOperation object
2560
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2561
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2562
+ #
2563
+ # @return [::Gapic::GenericLRO::Operation]
2564
+ #
2565
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2566
+ def set_name request, options = nil
2567
+ raise ::ArgumentError, "request must be provided" if request.nil?
2568
+
2569
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetNameInstanceRequest
2570
+
2571
+ # Converts hash and nil to an options object
2572
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2573
+
2574
+ # Customize the options with defaults
2575
+ call_metadata = @config.rpcs.set_name.metadata.to_h
2576
+
2577
+ # Set x-goog-api-client and x-goog-user-project headers
2578
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2579
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2580
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2581
+ transports_version_send: [:rest]
2582
+
2583
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2584
+
2585
+ options.apply_defaults timeout: @config.rpcs.set_name.timeout,
2586
+ metadata: call_metadata,
2587
+ retry_policy: @config.rpcs.set_name.retry_policy
2588
+
2589
+ options.apply_defaults timeout: @config.timeout,
2590
+ metadata: @config.metadata,
2591
+ retry_policy: @config.retry_policy
2592
+
2593
+ @instances_stub.set_name request, options do |result, response|
2594
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
2595
+ operation: result,
2596
+ client: zone_operations,
2597
+ request_values: {
2598
+ "project" => request.project,
2599
+ "zone" => request.zone
2600
+ },
2601
+ options: options
2602
+ )
2603
+ yield result, response if block_given?
2604
+ return result
2605
+ end
2606
+ rescue ::Gapic::Rest::Error => e
2607
+ raise ::Google::Cloud::Error.from_error(e)
2608
+ end
2609
+
2529
2610
  ##
2530
2611
  # Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.
2531
2612
  #
@@ -3742,9 +3823,9 @@ module Google
3742
3823
  # * (`String`) The path to a service account key file in JSON format
3743
3824
  # * (`Hash`) A service account key as a Hash
3744
3825
  # * (`Google::Auth::Credentials`) A googleauth credentials object
3745
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
3826
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3746
3827
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3747
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
3828
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3748
3829
  # * (`nil`) indicating no credentials
3749
3830
  # @return [::Object]
3750
3831
  # @!attribute [rw] scope
@@ -3978,6 +4059,11 @@ module Google
3978
4059
  #
3979
4060
  attr_reader :set_min_cpu_platform
3980
4061
  ##
4062
+ # RPC-specific configuration for `set_name`
4063
+ # @return [::Gapic::Config::Method]
4064
+ #
4065
+ attr_reader :set_name
4066
+ ##
3981
4067
  # RPC-specific configuration for `set_scheduling`
3982
4068
  # @return [::Gapic::Config::Method]
3983
4069
  #
@@ -4115,6 +4201,8 @@ module Google
4115
4201
  @set_metadata = ::Gapic::Config::Method.new set_metadata_config
4116
4202
  set_min_cpu_platform_config = parent_rpcs.set_min_cpu_platform if parent_rpcs.respond_to? :set_min_cpu_platform
4117
4203
  @set_min_cpu_platform = ::Gapic::Config::Method.new set_min_cpu_platform_config
4204
+ set_name_config = parent_rpcs.set_name if parent_rpcs.respond_to? :set_name
4205
+ @set_name = ::Gapic::Config::Method.new set_name_config
4118
4206
  set_scheduling_config = parent_rpcs.set_scheduling if parent_rpcs.respond_to? :set_scheduling
4119
4207
  @set_scheduling = ::Gapic::Config::Method.new set_scheduling_config
4120
4208
  set_service_account_config = parent_rpcs.set_service_account if parent_rpcs.respond_to? :set_service_account
@@ -1180,6 +1180,44 @@ module Google
1180
1180
  result
1181
1181
  end
1182
1182
 
1183
+ ##
1184
+ # Baseline implementation for the set_name REST call
1185
+ #
1186
+ # @param request_pb [::Google::Cloud::Compute::V1::SetNameInstanceRequest]
1187
+ # A request object representing the call parameters. Required.
1188
+ # @param options [::Gapic::CallOptions]
1189
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1190
+ #
1191
+ # @yield [result, operation] Access the result along with the TransportOperation object
1192
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1193
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1194
+ #
1195
+ # @return [::Google::Cloud::Compute::V1::Operation]
1196
+ # A result object deserialized from the server's reply
1197
+ def set_name request_pb, options = nil
1198
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1199
+
1200
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_name_request request_pb
1201
+ query_string_params = if query_string_params.any?
1202
+ query_string_params.to_h { |p| p.split("=", 2) }
1203
+ else
1204
+ {}
1205
+ end
1206
+
1207
+ response = @client_stub.make_http_request(
1208
+ verb,
1209
+ uri: uri,
1210
+ body: body || "",
1211
+ params: query_string_params,
1212
+ options: options
1213
+ )
1214
+ operation = ::Gapic::Rest::TransportOperation.new response
1215
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1216
+
1217
+ yield result, operation if block_given?
1218
+ result
1219
+ end
1220
+
1183
1221
  ##
1184
1222
  # Baseline implementation for the set_scheduling REST call
1185
1223
  #
@@ -2447,6 +2485,30 @@ module Google
2447
2485
  transcoder.transcode request_pb
2448
2486
  end
2449
2487
 
2488
+ ##
2489
+ # @private
2490
+ #
2491
+ # GRPC transcoding helper method for the set_name REST call
2492
+ #
2493
+ # @param request_pb [::Google::Cloud::Compute::V1::SetNameInstanceRequest]
2494
+ # A request object representing the call parameters. Required.
2495
+ # @return [Array(String, [String, nil], Hash{String => String})]
2496
+ # Uri, Body, Query string parameters
2497
+ def self.transcode_set_name_request request_pb
2498
+ transcoder = Gapic::Rest::GrpcTranscoder.new
2499
+ .with_bindings(
2500
+ uri_method: :post,
2501
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setName",
2502
+ body: "instances_set_name_request_resource",
2503
+ matches: [
2504
+ ["project", %r{^[^/]+/?$}, false],
2505
+ ["zone", %r{^[^/]+/?$}, false],
2506
+ ["instance", %r{^[^/]+/?$}, false]
2507
+ ]
2508
+ )
2509
+ transcoder.transcode request_pb
2510
+ end
2511
+
2450
2512
  ##
2451
2513
  # @private
2452
2514
  #
@@ -738,9 +738,9 @@ module Google
738
738
  # * (`String`) The path to a service account key file in JSON format
739
739
  # * (`Hash`) A service account key as a Hash
740
740
  # * (`Google::Auth::Credentials`) A googleauth credentials object
741
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
741
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
742
742
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
743
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
743
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
744
744
  # * (`nil`) indicating no credentials
745
745
  # @return [::Object]
746
746
  # @!attribute [rw] scope
@@ -318,9 +318,9 @@ module Google
318
318
  # * (`String`) The path to a service account key file in JSON format
319
319
  # * (`Hash`) A service account key as a Hash
320
320
  # * (`Google::Auth::Credentials`) A googleauth credentials object
321
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
321
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
322
322
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
323
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
323
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
324
324
  # * (`nil`) indicating no credentials
325
325
  # @return [::Object]
326
326
  # @!attribute [rw] scope
@@ -707,9 +707,9 @@ module Google
707
707
  # * (`String`) The path to a service account key file in JSON format
708
708
  # * (`Hash`) A service account key as a Hash
709
709
  # * (`Google::Auth::Credentials`) A googleauth credentials object
710
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
710
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
711
711
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
712
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
712
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
713
713
  # * (`nil`) indicating no credentials
714
714
  # @return [::Object]
715
715
  # @!attribute [rw] scope
@@ -308,9 +308,9 @@ module Google
308
308
  # * (`String`) The path to a service account key file in JSON format
309
309
  # * (`Hash`) A service account key as a Hash
310
310
  # * (`Google::Auth::Credentials`) A googleauth credentials object
311
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
311
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
312
312
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
313
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
313
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
314
314
  # * (`nil`) indicating no credentials
315
315
  # @return [::Object]
316
316
  # @!attribute [rw] scope
@@ -691,9 +691,9 @@ module Google
691
691
  # * (`String`) The path to a service account key file in JSON format
692
692
  # * (`Hash`) A service account key as a Hash
693
693
  # * (`Google::Auth::Credentials`) A googleauth credentials object
694
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
694
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
695
695
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
696
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
696
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
697
697
  # * (`nil`) indicating no credentials
698
698
  # @return [::Object]
699
699
  # @!attribute [rw] scope
@@ -245,7 +245,7 @@ module Google
245
245
  end
246
246
 
247
247
  ##
248
- # Returns the specified machine image. Gets a list of available machine images by making a list() request.
248
+ # Returns the specified machine image.
249
249
  #
250
250
  # @overload get(request, options = nil)
251
251
  # Pass arguments to `get` via a request object, either of type
@@ -693,9 +693,9 @@ module Google
693
693
  # * (`String`) The path to a service account key file in JSON format
694
694
  # * (`Hash`) A service account key as a Hash
695
695
  # * (`Google::Auth::Credentials`) A googleauth credentials object
696
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
696
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
697
697
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
698
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
698
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
699
699
  # * (`nil`) indicating no credentials
700
700
  # @return [::Object]
701
701
  # @!attribute [rw] scope
@@ -224,7 +224,7 @@ module Google
224
224
  end
225
225
 
226
226
  ##
227
- # Returns the specified machine type. Gets a list of available machine types by making a list() request.
227
+ # Returns the specified machine type.
228
228
  #
229
229
  # @overload get(request, options = nil)
230
230
  # Pass arguments to `get` via a request object, either of type
@@ -402,9 +402,9 @@ module Google
402
402
  # * (`String`) The path to a service account key file in JSON format
403
403
  # * (`Hash`) A service account key as a Hash
404
404
  # * (`Google::Auth::Credentials`) A googleauth credentials object
405
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
405
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
406
406
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
407
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
407
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
408
408
  # * (`nil`) indicating no credentials
409
409
  # @return [::Object]
410
410
  # @!attribute [rw] scope
@@ -787,9 +787,9 @@ module Google
787
787
  # * (`String`) The path to a service account key file in JSON format
788
788
  # * (`Hash`) A service account key as a Hash
789
789
  # * (`Google::Auth::Credentials`) A googleauth credentials object
790
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
790
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
791
791
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
792
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
792
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
793
793
  # * (`nil`) indicating no credentials
794
794
  # @return [::Object]
795
795
  # @!attribute [rw] scope
@@ -580,9 +580,9 @@ module Google
580
580
  # * (`String`) The path to a service account key file in JSON format
581
581
  # * (`Hash`) A service account key as a Hash
582
582
  # * (`Google::Auth::Credentials`) A googleauth credentials object
583
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
583
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
584
584
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
585
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
585
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
586
586
  # * (`nil`) indicating no credentials
587
587
  # @return [::Object]
588
588
  # @!attribute [rw] scope
@@ -485,7 +485,7 @@ module Google
485
485
  end
486
486
 
487
487
  ##
488
- # Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.
488
+ # Returns the specified network endpoint group.
489
489
  #
490
490
  # @overload get(request, options = nil)
491
491
  # Pass arguments to `get` via a request object, either of type
@@ -887,9 +887,9 @@ module Google
887
887
  # * (`String`) The path to a service account key file in JSON format
888
888
  # * (`Hash`) A service account key as a Hash
889
889
  # * (`Google::Auth::Credentials`) A googleauth credentials object
890
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
890
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
891
891
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
892
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
892
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
893
893
  # * (`nil`) indicating no credentials
894
894
  # @return [::Object]
895
895
  # @!attribute [rw] scope
@@ -1387,9 +1387,9 @@ module Google
1387
1387
  # * (`String`) The path to a service account key file in JSON format
1388
1388
  # * (`Hash`) A service account key as a Hash
1389
1389
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1390
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1390
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1391
1391
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1392
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1392
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1393
1393
  # * (`nil`) indicating no credentials
1394
1394
  # @return [::Object]
1395
1395
  # @!attribute [rw] scope