google-cloud-compute-v1 0.5.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/README.md +4 -4
  5. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
  6. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +37 -8
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +59 -14
  8. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +158 -19
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +46 -0
  10. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +169 -23
  11. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +46 -0
  12. data/lib/google/cloud/compute/v1/compute_pb.rb +534 -2
  13. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +2 -2
  14. data/lib/google/cloud/compute/v1/disks/rest/client.rb +93 -24
  15. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +44 -10
  16. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +98 -31
  17. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +2 -2
  18. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +54 -13
  19. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +70 -17
  20. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
  21. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +64 -16
  22. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +55 -14
  23. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
  24. data/lib/google/cloud/compute/v1/global_operations/rest/nonstandard_lro.rb +68 -0
  25. data/lib/google/cloud/compute/v1/global_operations.rb +1 -0
  26. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  27. data/lib/google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro.rb +68 -0
  28. data/lib/google/cloud/compute/v1/global_organization_operations.rb +1 -0
  29. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +47 -13
  30. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +55 -14
  31. data/lib/google/cloud/compute/v1/images/rest/client.rb +64 -16
  32. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +172 -47
  33. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +71 -18
  34. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
  35. data/lib/google/cloud/compute/v1/instances/rest/client.rb +521 -96
  36. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +91 -0
  37. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +48 -11
  38. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  39. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +44 -10
  40. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
  41. data/lib/google/cloud/compute/v1/machine_images/credentials.rb +52 -0
  42. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +804 -0
  43. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +363 -0
  44. data/lib/google/cloud/compute/v1/machine_images/rest.rb +33 -0
  45. data/lib/google/cloud/compute/v1/machine_images.rb +44 -0
  46. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +2 -2
  47. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +60 -15
  48. data/lib/google/cloud/compute/v1/networks/rest/client.rb +85 -23
  49. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +82 -21
  50. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +37 -8
  51. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +2 -2
  52. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +48 -11
  53. data/lib/google/cloud/compute/v1/projects/rest/client.rb +107 -31
  54. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +47 -13
  55. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +51 -14
  56. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +58 -13
  57. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +58 -13
  58. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +116 -5
  59. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +48 -0
  60. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  61. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +92 -23
  62. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +47 -10
  63. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +58 -13
  64. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +171 -46
  65. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +26 -5
  66. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +24 -3
  67. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +36 -7
  68. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +38 -9
  69. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  70. data/lib/google/cloud/compute/v1/region_operations/rest/nonstandard_lro.rb +68 -0
  71. data/lib/google/cloud/compute/v1/region_operations.rb +1 -0
  72. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +38 -9
  73. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +47 -10
  74. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +62 -17
  75. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +58 -13
  76. data/lib/google/cloud/compute/v1/regions/rest/client.rb +3 -3
  77. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +138 -11
  78. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +48 -0
  79. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +37 -8
  80. data/lib/google/cloud/compute/v1/routers/rest/client.rb +60 -15
  81. data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
  82. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +75 -20
  83. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +51 -14
  84. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +116 -7
  85. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +46 -0
  86. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +37 -10
  87. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +45 -11
  88. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +71 -18
  89. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +47 -13
  90. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +56 -15
  91. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +86 -24
  92. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +37 -8
  93. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +92 -23
  94. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +74 -19
  95. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +54 -13
  96. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +37 -8
  97. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +65 -17
  98. data/lib/google/cloud/compute/v1/version.rb +1 -1
  99. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +48 -11
  100. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +37 -8
  101. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  102. data/lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb +68 -0
  103. data/lib/google/cloud/compute/v1/zone_operations.rb +1 -0
  104. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  105. data/lib/google/cloud/compute/v1.rb +3 -0
  106. data/proto_docs/README.md +1 -1
  107. data/proto_docs/google/api/resource.rb +10 -71
  108. data/proto_docs/google/cloud/compute/v1/compute.rb +1647 -330
  109. metadata +14 -7
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/target_instances/rest/service_stub"
22
+ require "google/cloud/compute/v1/zone_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -139,9 +140,21 @@ module Google
139
140
  credentials = Credentials.new credentials, scope: @config.scope
140
141
  end
141
142
 
143
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
144
+ config.credentials = credentials
145
+ config.endpoint = @config.endpoint
146
+ end
147
+
142
148
  @target_instances_stub = ::Google::Cloud::Compute::V1::TargetInstances::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
143
149
  end
144
150
 
151
+ ##
152
+ # Get the associated client for long-running operations via ZoneOperations.
153
+ #
154
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
155
+ #
156
+ attr_reader :zone_operations
157
+
145
158
  # Service calls
146
159
 
147
160
  ##
@@ -165,7 +178,7 @@ module Google
165
178
  # the default parameter values, pass an empty Hash as a request object (see above).
166
179
  #
167
180
  # @param filter [::String]
168
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
181
+ # A filter expression that filters resources listed in the response. The 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) ```
169
182
  # @param include_all_scopes [::Boolean]
170
183
  # 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.
171
184
  # @param max_results [::Integer]
@@ -247,10 +260,10 @@ module Google
247
260
  # @param zone [::String]
248
261
  # Name of the zone scoping this request.
249
262
  # @yield [result, response] Access the result along with the Faraday response object
250
- # @yieldparam result [::Gapic::Rest::BaseOperation]
263
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
251
264
  # @yieldparam response [::Faraday::Response]
252
265
  #
253
- # @return [::Gapic::Rest::BaseOperation]
266
+ # @return [::Gapic::GenericLRO::Operation]
254
267
  #
255
268
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
256
269
  def delete request, options = nil
@@ -277,7 +290,15 @@ module Google
277
290
  metadata: @config.metadata
278
291
 
279
292
  @target_instances_stub.delete request, options do |result, response|
280
- result = ::Gapic::Rest::BaseOperation.new result
293
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
294
+ operation: result,
295
+ client: zone_operations,
296
+ request_values: {
297
+ "project" => request.project,
298
+ "zone" => request.zone
299
+ },
300
+ options: options
301
+ )
281
302
  yield result, response if block_given?
282
303
  return result
283
304
  end
@@ -380,10 +401,10 @@ module Google
380
401
  # @param zone [::String]
381
402
  # Name of the zone scoping this request.
382
403
  # @yield [result, response] Access the result along with the Faraday response object
383
- # @yieldparam result [::Gapic::Rest::BaseOperation]
404
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
384
405
  # @yieldparam response [::Faraday::Response]
385
406
  #
386
- # @return [::Gapic::Rest::BaseOperation]
407
+ # @return [::Gapic::GenericLRO::Operation]
387
408
  #
388
409
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
389
410
  def insert request, options = nil
@@ -410,7 +431,15 @@ module Google
410
431
  metadata: @config.metadata
411
432
 
412
433
  @target_instances_stub.insert request, options do |result, response|
413
- result = ::Gapic::Rest::BaseOperation.new result
434
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
435
+ operation: result,
436
+ client: zone_operations,
437
+ request_values: {
438
+ "project" => request.project,
439
+ "zone" => request.zone
440
+ },
441
+ options: options
442
+ )
414
443
  yield result, response if block_given?
415
444
  return result
416
445
  end
@@ -440,7 +469,7 @@ module Google
440
469
  # the default parameter values, pass an empty Hash as a request object (see above).
441
470
  #
442
471
  # @param filter [::String]
443
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
472
+ # A filter expression that filters resources listed in the response. The 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) ```
444
473
  # @param max_results [::Integer]
445
474
  # 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`)
446
475
  # @param order_by [::String]
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/target_pools/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -151,9 +152,21 @@ module Google
151
152
  credentials = Credentials.new credentials, scope: @config.scope
152
153
  end
153
154
 
155
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
156
+ config.credentials = credentials
157
+ config.endpoint = @config.endpoint
158
+ end
159
+
154
160
  @target_pools_stub = ::Google::Cloud::Compute::V1::TargetPools::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
155
161
  end
156
162
 
163
+ ##
164
+ # Get the associated client for long-running operations via RegionOperations.
165
+ #
166
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
167
+ #
168
+ attr_reader :region_operations
169
+
157
170
  # Service calls
158
171
 
159
172
  ##
@@ -187,10 +200,10 @@ module Google
187
200
  # @param target_pools_add_health_check_request_resource [::Google::Cloud::Compute::V1::TargetPoolsAddHealthCheckRequest, ::Hash]
188
201
  # The body resource for this request
189
202
  # @yield [result, response] Access the result along with the Faraday response object
190
- # @yieldparam result [::Gapic::Rest::BaseOperation]
203
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
191
204
  # @yieldparam response [::Faraday::Response]
192
205
  #
193
- # @return [::Gapic::Rest::BaseOperation]
206
+ # @return [::Gapic::GenericLRO::Operation]
194
207
  #
195
208
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
196
209
  def add_health_check request, options = nil
@@ -217,7 +230,15 @@ module Google
217
230
  metadata: @config.metadata
218
231
 
219
232
  @target_pools_stub.add_health_check request, options do |result, response|
220
- result = ::Gapic::Rest::BaseOperation.new result
233
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
234
+ operation: result,
235
+ client: region_operations,
236
+ request_values: {
237
+ "project" => request.project,
238
+ "region" => request.region
239
+ },
240
+ options: options
241
+ )
221
242
  yield result, response if block_given?
222
243
  return result
223
244
  end
@@ -257,10 +278,10 @@ module Google
257
278
  # @param target_pools_add_instance_request_resource [::Google::Cloud::Compute::V1::TargetPoolsAddInstanceRequest, ::Hash]
258
279
  # The body resource for this request
259
280
  # @yield [result, response] Access the result along with the Faraday response object
260
- # @yieldparam result [::Gapic::Rest::BaseOperation]
281
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
261
282
  # @yieldparam response [::Faraday::Response]
262
283
  #
263
- # @return [::Gapic::Rest::BaseOperation]
284
+ # @return [::Gapic::GenericLRO::Operation]
264
285
  #
265
286
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
266
287
  def add_instance request, options = nil
@@ -287,7 +308,15 @@ module Google
287
308
  metadata: @config.metadata
288
309
 
289
310
  @target_pools_stub.add_instance request, options do |result, response|
290
- result = ::Gapic::Rest::BaseOperation.new result
311
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
312
+ operation: result,
313
+ client: region_operations,
314
+ request_values: {
315
+ "project" => request.project,
316
+ "region" => request.region
317
+ },
318
+ options: options
319
+ )
291
320
  yield result, response if block_given?
292
321
  return result
293
322
  end
@@ -317,7 +346,7 @@ module Google
317
346
  # the default parameter values, pass an empty Hash as a request object (see above).
318
347
  #
319
348
  # @param filter [::String]
320
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
349
+ # A filter expression that filters resources listed in the response. The 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) ```
321
350
  # @param include_all_scopes [::Boolean]
322
351
  # 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.
323
352
  # @param max_results [::Integer]
@@ -399,10 +428,10 @@ module Google
399
428
  # @param target_pool [::String]
400
429
  # Name of the TargetPool resource to delete.
401
430
  # @yield [result, response] Access the result along with the Faraday response object
402
- # @yieldparam result [::Gapic::Rest::BaseOperation]
431
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
403
432
  # @yieldparam response [::Faraday::Response]
404
433
  #
405
- # @return [::Gapic::Rest::BaseOperation]
434
+ # @return [::Gapic::GenericLRO::Operation]
406
435
  #
407
436
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
408
437
  def delete request, options = nil
@@ -429,7 +458,15 @@ module Google
429
458
  metadata: @config.metadata
430
459
 
431
460
  @target_pools_stub.delete request, options do |result, response|
432
- result = ::Gapic::Rest::BaseOperation.new result
461
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
462
+ operation: result,
463
+ client: region_operations,
464
+ request_values: {
465
+ "project" => request.project,
466
+ "region" => request.region
467
+ },
468
+ options: options
469
+ )
433
470
  yield result, response if block_given?
434
471
  return result
435
472
  end
@@ -599,10 +636,10 @@ module Google
599
636
  # @param target_pool_resource [::Google::Cloud::Compute::V1::TargetPool, ::Hash]
600
637
  # The body resource for this request
601
638
  # @yield [result, response] Access the result along with the Faraday response object
602
- # @yieldparam result [::Gapic::Rest::BaseOperation]
639
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
603
640
  # @yieldparam response [::Faraday::Response]
604
641
  #
605
- # @return [::Gapic::Rest::BaseOperation]
642
+ # @return [::Gapic::GenericLRO::Operation]
606
643
  #
607
644
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
608
645
  def insert request, options = nil
@@ -629,7 +666,15 @@ module Google
629
666
  metadata: @config.metadata
630
667
 
631
668
  @target_pools_stub.insert request, options do |result, response|
632
- result = ::Gapic::Rest::BaseOperation.new result
669
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
670
+ operation: result,
671
+ client: region_operations,
672
+ request_values: {
673
+ "project" => request.project,
674
+ "region" => request.region
675
+ },
676
+ options: options
677
+ )
633
678
  yield result, response if block_given?
634
679
  return result
635
680
  end
@@ -659,7 +704,7 @@ module Google
659
704
  # the default parameter values, pass an empty Hash as a request object (see above).
660
705
  #
661
706
  # @param filter [::String]
662
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
707
+ # A filter expression that filters resources listed in the response. The 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) ```
663
708
  # @param max_results [::Integer]
664
709
  # 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`)
665
710
  # @param order_by [::String]
@@ -743,10 +788,10 @@ module Google
743
788
  # @param target_pools_remove_health_check_request_resource [::Google::Cloud::Compute::V1::TargetPoolsRemoveHealthCheckRequest, ::Hash]
744
789
  # The body resource for this request
745
790
  # @yield [result, response] Access the result along with the Faraday response object
746
- # @yieldparam result [::Gapic::Rest::BaseOperation]
791
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
747
792
  # @yieldparam response [::Faraday::Response]
748
793
  #
749
- # @return [::Gapic::Rest::BaseOperation]
794
+ # @return [::Gapic::GenericLRO::Operation]
750
795
  #
751
796
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
752
797
  def remove_health_check request, options = nil
@@ -773,7 +818,15 @@ module Google
773
818
  metadata: @config.metadata
774
819
 
775
820
  @target_pools_stub.remove_health_check request, options do |result, response|
776
- result = ::Gapic::Rest::BaseOperation.new result
821
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
822
+ operation: result,
823
+ client: region_operations,
824
+ request_values: {
825
+ "project" => request.project,
826
+ "region" => request.region
827
+ },
828
+ options: options
829
+ )
777
830
  yield result, response if block_given?
778
831
  return result
779
832
  end
@@ -813,10 +866,10 @@ module Google
813
866
  # @param target_pools_remove_instance_request_resource [::Google::Cloud::Compute::V1::TargetPoolsRemoveInstanceRequest, ::Hash]
814
867
  # The body resource for this request
815
868
  # @yield [result, response] Access the result along with the Faraday response object
816
- # @yieldparam result [::Gapic::Rest::BaseOperation]
869
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
817
870
  # @yieldparam response [::Faraday::Response]
818
871
  #
819
- # @return [::Gapic::Rest::BaseOperation]
872
+ # @return [::Gapic::GenericLRO::Operation]
820
873
  #
821
874
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
822
875
  def remove_instance request, options = nil
@@ -843,7 +896,15 @@ module Google
843
896
  metadata: @config.metadata
844
897
 
845
898
  @target_pools_stub.remove_instance request, options do |result, response|
846
- result = ::Gapic::Rest::BaseOperation.new result
899
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
900
+ operation: result,
901
+ client: region_operations,
902
+ request_values: {
903
+ "project" => request.project,
904
+ "region" => request.region
905
+ },
906
+ options: options
907
+ )
847
908
  yield result, response if block_given?
848
909
  return result
849
910
  end
@@ -885,10 +946,10 @@ module Google
885
946
  # @param target_reference_resource [::Google::Cloud::Compute::V1::TargetReference, ::Hash]
886
947
  # The body resource for this request
887
948
  # @yield [result, response] Access the result along with the Faraday response object
888
- # @yieldparam result [::Gapic::Rest::BaseOperation]
949
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
889
950
  # @yieldparam response [::Faraday::Response]
890
951
  #
891
- # @return [::Gapic::Rest::BaseOperation]
952
+ # @return [::Gapic::GenericLRO::Operation]
892
953
  #
893
954
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
894
955
  def set_backup request, options = nil
@@ -915,7 +976,15 @@ module Google
915
976
  metadata: @config.metadata
916
977
 
917
978
  @target_pools_stub.set_backup request, options do |result, response|
918
- result = ::Gapic::Rest::BaseOperation.new result
979
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
980
+ operation: result,
981
+ client: region_operations,
982
+ request_values: {
983
+ "project" => request.project,
984
+ "region" => request.region
985
+ },
986
+ options: options
987
+ )
919
988
  yield result, response if block_given?
920
989
  return result
921
990
  end
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/target_ssl_proxies/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -142,9 +143,21 @@ module Google
142
143
  credentials = Credentials.new credentials, scope: @config.scope
143
144
  end
144
145
 
146
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
147
+ config.credentials = credentials
148
+ config.endpoint = @config.endpoint
149
+ end
150
+
145
151
  @target_ssl_proxies_stub = ::Google::Cloud::Compute::V1::TargetSslProxies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
152
  end
147
153
 
154
+ ##
155
+ # Get the associated client for long-running operations via GlobalOperations.
156
+ #
157
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
158
+ #
159
+ attr_reader :global_operations
160
+
148
161
  # Service calls
149
162
 
150
163
  ##
@@ -174,10 +187,10 @@ module Google
174
187
  # @param target_ssl_proxy [::String]
175
188
  # Name of the TargetSslProxy resource to delete.
176
189
  # @yield [result, response] Access the result along with the Faraday response object
177
- # @yieldparam result [::Gapic::Rest::BaseOperation]
190
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
178
191
  # @yieldparam response [::Faraday::Response]
179
192
  #
180
- # @return [::Gapic::Rest::BaseOperation]
193
+ # @return [::Gapic::GenericLRO::Operation]
181
194
  #
182
195
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
183
196
  def delete request, options = nil
@@ -204,7 +217,14 @@ module Google
204
217
  metadata: @config.metadata
205
218
 
206
219
  @target_ssl_proxies_stub.delete request, options do |result, response|
207
- result = ::Gapic::Rest::BaseOperation.new result
220
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
221
+ operation: result,
222
+ client: global_operations,
223
+ request_values: {
224
+ "project" => request.project
225
+ },
226
+ options: options
227
+ )
208
228
  yield result, response if block_given?
209
229
  return result
210
230
  end
@@ -303,10 +323,10 @@ module Google
303
323
  # @param target_ssl_proxy_resource [::Google::Cloud::Compute::V1::TargetSslProxy, ::Hash]
304
324
  # The body resource for this request
305
325
  # @yield [result, response] Access the result along with the Faraday response object
306
- # @yieldparam result [::Gapic::Rest::BaseOperation]
326
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
307
327
  # @yieldparam response [::Faraday::Response]
308
328
  #
309
- # @return [::Gapic::Rest::BaseOperation]
329
+ # @return [::Gapic::GenericLRO::Operation]
310
330
  #
311
331
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
312
332
  def insert request, options = nil
@@ -333,7 +353,14 @@ module Google
333
353
  metadata: @config.metadata
334
354
 
335
355
  @target_ssl_proxies_stub.insert request, options do |result, response|
336
- result = ::Gapic::Rest::BaseOperation.new result
356
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
357
+ operation: result,
358
+ client: global_operations,
359
+ request_values: {
360
+ "project" => request.project
361
+ },
362
+ options: options
363
+ )
337
364
  yield result, response if block_given?
338
365
  return result
339
366
  end
@@ -363,7 +390,7 @@ module Google
363
390
  # the default parameter values, pass an empty Hash as a request object (see above).
364
391
  #
365
392
  # @param filter [::String]
366
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
393
+ # A filter expression that filters resources listed in the response. The 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) ```
367
394
  # @param max_results [::Integer]
368
395
  # 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`)
369
396
  # @param order_by [::String]
@@ -443,10 +470,10 @@ module Google
443
470
  # @param target_ssl_proxy [::String]
444
471
  # Name of the TargetSslProxy resource whose BackendService resource is to be set.
445
472
  # @yield [result, response] Access the result along with the Faraday response object
446
- # @yieldparam result [::Gapic::Rest::BaseOperation]
473
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
447
474
  # @yieldparam response [::Faraday::Response]
448
475
  #
449
- # @return [::Gapic::Rest::BaseOperation]
476
+ # @return [::Gapic::GenericLRO::Operation]
450
477
  #
451
478
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
452
479
  def set_backend_service request, options = nil
@@ -473,7 +500,14 @@ module Google
473
500
  metadata: @config.metadata
474
501
 
475
502
  @target_ssl_proxies_stub.set_backend_service request, options do |result, response|
476
- result = ::Gapic::Rest::BaseOperation.new result
503
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
504
+ operation: result,
505
+ client: global_operations,
506
+ request_values: {
507
+ "project" => request.project
508
+ },
509
+ options: options
510
+ )
477
511
  yield result, response if block_given?
478
512
  return result
479
513
  end
@@ -511,10 +545,10 @@ module Google
511
545
  # @param target_ssl_proxy [::String]
512
546
  # Name of the TargetSslProxy resource whose ProxyHeader is to be set.
513
547
  # @yield [result, response] Access the result along with the Faraday response object
514
- # @yieldparam result [::Gapic::Rest::BaseOperation]
548
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
515
549
  # @yieldparam response [::Faraday::Response]
516
550
  #
517
- # @return [::Gapic::Rest::BaseOperation]
551
+ # @return [::Gapic::GenericLRO::Operation]
518
552
  #
519
553
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
520
554
  def set_proxy_header request, options = nil
@@ -541,7 +575,14 @@ module Google
541
575
  metadata: @config.metadata
542
576
 
543
577
  @target_ssl_proxies_stub.set_proxy_header request, options do |result, response|
544
- result = ::Gapic::Rest::BaseOperation.new result
578
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
579
+ operation: result,
580
+ client: global_operations,
581
+ request_values: {
582
+ "project" => request.project
583
+ },
584
+ options: options
585
+ )
545
586
  yield result, response if block_given?
546
587
  return result
547
588
  end
@@ -579,10 +620,10 @@ module Google
579
620
  # @param target_ssl_proxy [::String]
580
621
  # Name of the TargetSslProxy resource whose SslCertificate resource is to be set.
581
622
  # @yield [result, response] Access the result along with the Faraday response object
582
- # @yieldparam result [::Gapic::Rest::BaseOperation]
623
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
583
624
  # @yieldparam response [::Faraday::Response]
584
625
  #
585
- # @return [::Gapic::Rest::BaseOperation]
626
+ # @return [::Gapic::GenericLRO::Operation]
586
627
  #
587
628
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
588
629
  def set_ssl_certificates request, options = nil
@@ -609,7 +650,14 @@ module Google
609
650
  metadata: @config.metadata
610
651
 
611
652
  @target_ssl_proxies_stub.set_ssl_certificates request, options do |result, response|
612
- result = ::Gapic::Rest::BaseOperation.new result
653
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
654
+ operation: result,
655
+ client: global_operations,
656
+ request_values: {
657
+ "project" => request.project
658
+ },
659
+ options: options
660
+ )
613
661
  yield result, response if block_given?
614
662
  return result
615
663
  end
@@ -647,10 +695,10 @@ module Google
647
695
  # @param target_ssl_proxy [::String]
648
696
  # Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.
649
697
  # @yield [result, response] Access the result along with the Faraday response object
650
- # @yieldparam result [::Gapic::Rest::BaseOperation]
698
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
651
699
  # @yieldparam response [::Faraday::Response]
652
700
  #
653
- # @return [::Gapic::Rest::BaseOperation]
701
+ # @return [::Gapic::GenericLRO::Operation]
654
702
  #
655
703
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
656
704
  def set_ssl_policy request, options = nil
@@ -677,7 +725,14 @@ module Google
677
725
  metadata: @config.metadata
678
726
 
679
727
  @target_ssl_proxies_stub.set_ssl_policy request, options do |result, response|
680
- result = ::Gapic::Rest::BaseOperation.new result
728
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
729
+ operation: result,
730
+ client: global_operations,
731
+ request_values: {
732
+ "project" => request.project
733
+ },
734
+ options: options
735
+ )
681
736
  yield result, response if block_given?
682
737
  return result
683
738
  end