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
@@ -161,7 +161,7 @@ module Google
161
161
  # the default parameter values, pass an empty Hash as a request object (see above).
162
162
  #
163
163
  # @param filter [::String]
164
- # 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) ```
164
+ # 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) ```
165
165
  # @param include_all_scopes [::Boolean]
166
166
  # 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.
167
167
  # @param max_results [::Integer]
@@ -300,7 +300,7 @@ module Google
300
300
  # the default parameter values, pass an empty Hash as a request object (see above).
301
301
  #
302
302
  # @param filter [::String]
303
- # 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) ```
303
+ # 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) ```
304
304
  # @param max_results [::Integer]
305
305
  # 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`)
306
306
  # @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/disks/rest/service_stub"
22
+ require "google/cloud/compute/v1/zone_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -158,9 +159,21 @@ module Google
158
159
  credentials = Credentials.new credentials, scope: @config.scope
159
160
  end
160
161
 
162
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
163
+ config.credentials = credentials
164
+ config.endpoint = @config.endpoint
165
+ end
166
+
161
167
  @disks_stub = ::Google::Cloud::Compute::V1::Disks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
162
168
  end
163
169
 
170
+ ##
171
+ # Get the associated client for long-running operations via ZoneOperations.
172
+ #
173
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
174
+ #
175
+ attr_reader :zone_operations
176
+
164
177
  # Service calls
165
178
 
166
179
  ##
@@ -194,10 +207,10 @@ module Google
194
207
  # @param zone [::String]
195
208
  # The name of the zone for this request.
196
209
  # @yield [result, response] Access the result along with the Faraday response object
197
- # @yieldparam result [::Gapic::Rest::BaseOperation]
210
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
198
211
  # @yieldparam response [::Faraday::Response]
199
212
  #
200
- # @return [::Gapic::Rest::BaseOperation]
213
+ # @return [::Gapic::GenericLRO::Operation]
201
214
  #
202
215
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
203
216
  def add_resource_policies request, options = nil
@@ -224,7 +237,15 @@ module Google
224
237
  metadata: @config.metadata
225
238
 
226
239
  @disks_stub.add_resource_policies request, options do |result, response|
227
- result = ::Gapic::Rest::BaseOperation.new result
240
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
241
+ operation: result,
242
+ client: zone_operations,
243
+ request_values: {
244
+ "project" => request.project,
245
+ "zone" => request.zone
246
+ },
247
+ options: options
248
+ )
228
249
  yield result, response if block_given?
229
250
  return result
230
251
  end
@@ -254,7 +275,7 @@ module Google
254
275
  # the default parameter values, pass an empty Hash as a request object (see above).
255
276
  #
256
277
  # @param filter [::String]
257
- # 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) ```
278
+ # 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) ```
258
279
  # @param include_all_scopes [::Boolean]
259
280
  # 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.
260
281
  # @param max_results [::Integer]
@@ -308,7 +329,7 @@ module Google
308
329
  end
309
330
 
310
331
  ##
311
- # Creates a snapshot of a specified persistent disk.
332
+ # Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
312
333
  #
313
334
  # @overload create_snapshot(request, options = nil)
314
335
  # Pass arguments to `create_snapshot` via a request object, either of type
@@ -340,10 +361,10 @@ module Google
340
361
  # @param zone [::String]
341
362
  # The name of the zone for this request.
342
363
  # @yield [result, response] Access the result along with the Faraday response object
343
- # @yieldparam result [::Gapic::Rest::BaseOperation]
364
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
344
365
  # @yieldparam response [::Faraday::Response]
345
366
  #
346
- # @return [::Gapic::Rest::BaseOperation]
367
+ # @return [::Gapic::GenericLRO::Operation]
347
368
  #
348
369
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
349
370
  def create_snapshot request, options = nil
@@ -370,7 +391,15 @@ module Google
370
391
  metadata: @config.metadata
371
392
 
372
393
  @disks_stub.create_snapshot request, options do |result, response|
373
- result = ::Gapic::Rest::BaseOperation.new result
394
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
395
+ operation: result,
396
+ client: zone_operations,
397
+ request_values: {
398
+ "project" => request.project,
399
+ "zone" => request.zone
400
+ },
401
+ options: options
402
+ )
374
403
  yield result, response if block_given?
375
404
  return result
376
405
  end
@@ -408,10 +437,10 @@ module Google
408
437
  # @param zone [::String]
409
438
  # The name of the zone for this request.
410
439
  # @yield [result, response] Access the result along with the Faraday response object
411
- # @yieldparam result [::Gapic::Rest::BaseOperation]
440
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
412
441
  # @yieldparam response [::Faraday::Response]
413
442
  #
414
- # @return [::Gapic::Rest::BaseOperation]
443
+ # @return [::Gapic::GenericLRO::Operation]
415
444
  #
416
445
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
417
446
  def delete request, options = nil
@@ -438,7 +467,15 @@ module Google
438
467
  metadata: @config.metadata
439
468
 
440
469
  @disks_stub.delete request, options do |result, response|
441
- result = ::Gapic::Rest::BaseOperation.new result
470
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
471
+ operation: result,
472
+ client: zone_operations,
473
+ request_values: {
474
+ "project" => request.project,
475
+ "zone" => request.zone
476
+ },
477
+ options: options
478
+ )
442
479
  yield result, response if block_given?
443
480
  return result
444
481
  end
@@ -610,10 +647,10 @@ module Google
610
647
  # @param zone [::String]
611
648
  # The name of the zone for this request.
612
649
  # @yield [result, response] Access the result along with the Faraday response object
613
- # @yieldparam result [::Gapic::Rest::BaseOperation]
650
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
614
651
  # @yieldparam response [::Faraday::Response]
615
652
  #
616
- # @return [::Gapic::Rest::BaseOperation]
653
+ # @return [::Gapic::GenericLRO::Operation]
617
654
  #
618
655
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
619
656
  def insert request, options = nil
@@ -640,7 +677,15 @@ module Google
640
677
  metadata: @config.metadata
641
678
 
642
679
  @disks_stub.insert request, options do |result, response|
643
- result = ::Gapic::Rest::BaseOperation.new result
680
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
681
+ operation: result,
682
+ client: zone_operations,
683
+ request_values: {
684
+ "project" => request.project,
685
+ "zone" => request.zone
686
+ },
687
+ options: options
688
+ )
644
689
  yield result, response if block_given?
645
690
  return result
646
691
  end
@@ -670,7 +715,7 @@ module Google
670
715
  # the default parameter values, pass an empty Hash as a request object (see above).
671
716
  #
672
717
  # @param filter [::String]
673
- # 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) ```
718
+ # 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) ```
674
719
  # @param max_results [::Integer]
675
720
  # 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`)
676
721
  # @param order_by [::String]
@@ -754,10 +799,10 @@ module Google
754
799
  # @param zone [::String]
755
800
  # The name of the zone for this request.
756
801
  # @yield [result, response] Access the result along with the Faraday response object
757
- # @yieldparam result [::Gapic::Rest::BaseOperation]
802
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
758
803
  # @yieldparam response [::Faraday::Response]
759
804
  #
760
- # @return [::Gapic::Rest::BaseOperation]
805
+ # @return [::Gapic::GenericLRO::Operation]
761
806
  #
762
807
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
763
808
  def remove_resource_policies request, options = nil
@@ -784,7 +829,15 @@ module Google
784
829
  metadata: @config.metadata
785
830
 
786
831
  @disks_stub.remove_resource_policies request, options do |result, response|
787
- result = ::Gapic::Rest::BaseOperation.new result
832
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
833
+ operation: result,
834
+ client: zone_operations,
835
+ request_values: {
836
+ "project" => request.project,
837
+ "zone" => request.zone
838
+ },
839
+ options: options
840
+ )
788
841
  yield result, response if block_given?
789
842
  return result
790
843
  end
@@ -824,10 +877,10 @@ module Google
824
877
  # @param zone [::String]
825
878
  # The name of the zone for this request.
826
879
  # @yield [result, response] Access the result along with the Faraday response object
827
- # @yieldparam result [::Gapic::Rest::BaseOperation]
880
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
828
881
  # @yieldparam response [::Faraday::Response]
829
882
  #
830
- # @return [::Gapic::Rest::BaseOperation]
883
+ # @return [::Gapic::GenericLRO::Operation]
831
884
  #
832
885
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
833
886
  def resize request, options = nil
@@ -854,7 +907,15 @@ module Google
854
907
  metadata: @config.metadata
855
908
 
856
909
  @disks_stub.resize request, options do |result, response|
857
- result = ::Gapic::Rest::BaseOperation.new result
910
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
911
+ operation: result,
912
+ client: zone_operations,
913
+ request_values: {
914
+ "project" => request.project,
915
+ "zone" => request.zone
916
+ },
917
+ options: options
918
+ )
858
919
  yield result, response if block_given?
859
920
  return result
860
921
  end
@@ -961,10 +1022,10 @@ module Google
961
1022
  # @param zone_set_labels_request_resource [::Google::Cloud::Compute::V1::ZoneSetLabelsRequest, ::Hash]
962
1023
  # The body resource for this request
963
1024
  # @yield [result, response] Access the result along with the Faraday response object
964
- # @yieldparam result [::Gapic::Rest::BaseOperation]
1025
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
965
1026
  # @yieldparam response [::Faraday::Response]
966
1027
  #
967
- # @return [::Gapic::Rest::BaseOperation]
1028
+ # @return [::Gapic::GenericLRO::Operation]
968
1029
  #
969
1030
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
970
1031
  def set_labels request, options = nil
@@ -991,7 +1052,15 @@ module Google
991
1052
  metadata: @config.metadata
992
1053
 
993
1054
  @disks_stub.set_labels request, options do |result, response|
994
- result = ::Gapic::Rest::BaseOperation.new result
1055
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
1056
+ operation: result,
1057
+ client: zone_operations,
1058
+ request_values: {
1059
+ "project" => request.project,
1060
+ "zone" => request.zone
1061
+ },
1062
+ options: options
1063
+ )
995
1064
  yield result, response if block_given?
996
1065
  return result
997
1066
  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/external_vpn_gateways/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -138,9 +139,21 @@ module Google
138
139
  credentials = Credentials.new credentials, scope: @config.scope
139
140
  end
140
141
 
142
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.endpoint = @config.endpoint
145
+ end
146
+
141
147
  @external_vpn_gateways_stub = ::Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
142
148
  end
143
149
 
150
+ ##
151
+ # Get the associated client for long-running operations via GlobalOperations.
152
+ #
153
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
154
+ #
155
+ attr_reader :global_operations
156
+
144
157
  # Service calls
145
158
 
146
159
  ##
@@ -170,10 +183,10 @@ module Google
170
183
  # @param request_id [::String]
171
184
  # 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).
172
185
  # @yield [result, response] Access the result along with the Faraday response object
173
- # @yieldparam result [::Gapic::Rest::BaseOperation]
186
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
174
187
  # @yieldparam response [::Faraday::Response]
175
188
  #
176
- # @return [::Gapic::Rest::BaseOperation]
189
+ # @return [::Gapic::GenericLRO::Operation]
177
190
  #
178
191
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
179
192
  def delete request, options = nil
@@ -200,7 +213,14 @@ module Google
200
213
  metadata: @config.metadata
201
214
 
202
215
  @external_vpn_gateways_stub.delete request, options do |result, response|
203
- result = ::Gapic::Rest::BaseOperation.new result
216
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
217
+ operation: result,
218
+ client: global_operations,
219
+ request_values: {
220
+ "project" => request.project
221
+ },
222
+ options: options
223
+ )
204
224
  yield result, response if block_given?
205
225
  return result
206
226
  end
@@ -299,10 +319,10 @@ module Google
299
319
  # @param request_id [::String]
300
320
  # 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).
301
321
  # @yield [result, response] Access the result along with the Faraday response object
302
- # @yieldparam result [::Gapic::Rest::BaseOperation]
322
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
303
323
  # @yieldparam response [::Faraday::Response]
304
324
  #
305
- # @return [::Gapic::Rest::BaseOperation]
325
+ # @return [::Gapic::GenericLRO::Operation]
306
326
  #
307
327
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
308
328
  def insert request, options = nil
@@ -329,7 +349,14 @@ module Google
329
349
  metadata: @config.metadata
330
350
 
331
351
  @external_vpn_gateways_stub.insert request, options do |result, response|
332
- result = ::Gapic::Rest::BaseOperation.new result
352
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
353
+ operation: result,
354
+ client: global_operations,
355
+ request_values: {
356
+ "project" => request.project
357
+ },
358
+ options: options
359
+ )
333
360
  yield result, response if block_given?
334
361
  return result
335
362
  end
@@ -359,7 +386,7 @@ module Google
359
386
  # the default parameter values, pass an empty Hash as a request object (see above).
360
387
  #
361
388
  # @param filter [::String]
362
- # 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) ```
389
+ # 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) ```
363
390
  # @param max_results [::Integer]
364
391
  # 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`)
365
392
  # @param order_by [::String]
@@ -437,10 +464,10 @@ module Google
437
464
  # @param resource [::String]
438
465
  # Name or id of the resource for this request.
439
466
  # @yield [result, response] Access the result along with the Faraday response object
440
- # @yieldparam result [::Gapic::Rest::BaseOperation]
467
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
441
468
  # @yieldparam response [::Faraday::Response]
442
469
  #
443
- # @return [::Gapic::Rest::BaseOperation]
470
+ # @return [::Gapic::GenericLRO::Operation]
444
471
  #
445
472
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
446
473
  def set_labels request, options = nil
@@ -467,7 +494,14 @@ module Google
467
494
  metadata: @config.metadata
468
495
 
469
496
  @external_vpn_gateways_stub.set_labels request, options do |result, response|
470
- result = ::Gapic::Rest::BaseOperation.new result
497
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
498
+ operation: result,
499
+ client: global_operations,
500
+ request_values: {
501
+ "project" => request.project
502
+ },
503
+ options: options
504
+ )
471
505
  yield result, response if block_given?
472
506
  return result
473
507
  end