google-cloud-compute-v1 1.1.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
  4. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +37 -8
  5. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +59 -14
  6. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +84 -22
  7. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +95 -26
  8. data/lib/google/cloud/compute/v1/compute_pb.rb +671 -3
  9. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +2 -2
  10. data/lib/google/cloud/compute/v1/disks/rest/client.rb +93 -24
  11. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +44 -10
  12. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +98 -31
  13. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +2 -2
  14. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +54 -13
  15. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +70 -17
  16. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
  17. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +64 -16
  18. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +55 -14
  19. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
  20. data/lib/google/cloud/compute/v1/global_operations/rest/nonstandard_lro.rb +68 -0
  21. data/lib/google/cloud/compute/v1/global_operations.rb +1 -0
  22. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  23. data/lib/google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro.rb +68 -0
  24. data/lib/google/cloud/compute/v1/global_organization_operations.rb +1 -0
  25. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +44 -10
  26. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +55 -14
  27. data/lib/google/cloud/compute/v1/images/rest/client.rb +64 -16
  28. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +177 -52
  29. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +72 -19
  30. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
  31. data/lib/google/cloud/compute/v1/instances/rest/client.rb +372 -101
  32. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +48 -11
  33. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  34. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +44 -10
  35. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
  36. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +34 -7
  37. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +2 -2
  38. data/lib/google/cloud/compute/v1/network_edge_security_services/credentials.rb +52 -0
  39. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +679 -0
  40. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +279 -0
  41. data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +33 -0
  42. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +44 -0
  43. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +60 -15
  44. data/lib/google/cloud/compute/v1/network_firewall_policies/credentials.rb +52 -0
  45. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1552 -0
  46. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +778 -0
  47. data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +33 -0
  48. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +44 -0
  49. data/lib/google/cloud/compute/v1/networks/rest/client.rb +85 -23
  50. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +82 -21
  51. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +37 -8
  52. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +2 -2
  53. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +48 -11
  54. data/lib/google/cloud/compute/v1/projects/rest/client.rb +105 -29
  55. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +44 -10
  56. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +48 -11
  57. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +58 -13
  58. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +58 -13
  59. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +37 -8
  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 +91 -22
  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 +176 -51
  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_network_firewall_policies/credentials.rb +52 -0
  69. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1670 -0
  70. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +823 -0
  71. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +33 -0
  72. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +44 -0
  73. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +36 -7
  74. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  75. data/lib/google/cloud/compute/v1/region_operations/rest/nonstandard_lro.rb +68 -0
  76. data/lib/google/cloud/compute/v1/region_operations.rb +1 -0
  77. data/lib/google/cloud/compute/v1/region_security_policies/credentials.rb +52 -0
  78. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +676 -0
  79. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +276 -0
  80. data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +33 -0
  81. data/lib/google/cloud/compute/v1/region_security_policies.rb +44 -0
  82. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +36 -7
  83. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +47 -10
  84. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +145 -13
  85. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +46 -0
  86. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +58 -13
  87. data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
  88. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +59 -14
  89. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +37 -8
  90. data/lib/google/cloud/compute/v1/routers/rest/client.rb +60 -15
  91. data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
  92. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +170 -23
  93. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +55 -1
  94. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +48 -11
  95. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +44 -10
  96. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +35 -8
  97. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +45 -11
  98. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +71 -18
  99. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +44 -10
  100. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +55 -14
  101. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +169 -23
  102. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +46 -0
  103. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +37 -8
  104. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +92 -23
  105. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +158 -19
  106. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +46 -0
  107. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +54 -13
  108. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +37 -8
  109. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +65 -17
  110. data/lib/google/cloud/compute/v1/version.rb +1 -1
  111. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +48 -11
  112. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +37 -8
  113. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  114. data/lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb +68 -0
  115. data/lib/google/cloud/compute/v1/zone_operations.rb +1 -0
  116. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  117. data/lib/google/cloud/compute/v1.rb +6 -0
  118. data/proto_docs/google/cloud/compute/v1/compute.rb +1946 -229
  119. metadata +27 -3
@@ -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/forwarding_rules/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -145,9 +146,21 @@ module Google
145
146
  credentials = Credentials.new credentials, scope: @config.scope
146
147
  end
147
148
 
149
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
150
+ config.credentials = credentials
151
+ config.endpoint = @config.endpoint
152
+ end
153
+
148
154
  @forwarding_rules_stub = ::Google::Cloud::Compute::V1::ForwardingRules::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
149
155
  end
150
156
 
157
+ ##
158
+ # Get the associated client for long-running operations via RegionOperations.
159
+ #
160
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
161
+ #
162
+ attr_reader :region_operations
163
+
151
164
  # Service calls
152
165
 
153
166
  ##
@@ -171,7 +184,7 @@ module Google
171
184
  # the default parameter values, pass an empty Hash as a request object (see above).
172
185
  #
173
186
  # @param filter [::String]
174
- # 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) ```
187
+ # 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`.
175
188
  # @param include_all_scopes [::Boolean]
176
189
  # 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.
177
190
  # @param max_results [::Integer]
@@ -253,10 +266,10 @@ module Google
253
266
  # @param request_id [::String]
254
267
  # 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).
255
268
  # @yield [result, response] Access the result along with the Faraday response object
256
- # @yieldparam result [::Gapic::Rest::BaseOperation]
269
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
257
270
  # @yieldparam response [::Faraday::Response]
258
271
  #
259
- # @return [::Gapic::Rest::BaseOperation]
272
+ # @return [::Gapic::GenericLRO::Operation]
260
273
  #
261
274
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
262
275
  def delete request, options = nil
@@ -283,7 +296,15 @@ module Google
283
296
  metadata: @config.metadata
284
297
 
285
298
  @forwarding_rules_stub.delete request, options do |result, response|
286
- result = ::Gapic::Rest::BaseOperation.new result
299
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
300
+ operation: result,
301
+ client: region_operations,
302
+ request_values: {
303
+ "project" => request.project,
304
+ "region" => request.region
305
+ },
306
+ options: options
307
+ )
287
308
  yield result, response if block_given?
288
309
  return result
289
310
  end
@@ -386,10 +407,10 @@ module Google
386
407
  # @param request_id [::String]
387
408
  # 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).
388
409
  # @yield [result, response] Access the result along with the Faraday response object
389
- # @yieldparam result [::Gapic::Rest::BaseOperation]
410
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
390
411
  # @yieldparam response [::Faraday::Response]
391
412
  #
392
- # @return [::Gapic::Rest::BaseOperation]
413
+ # @return [::Gapic::GenericLRO::Operation]
393
414
  #
394
415
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
395
416
  def insert request, options = nil
@@ -416,7 +437,15 @@ module Google
416
437
  metadata: @config.metadata
417
438
 
418
439
  @forwarding_rules_stub.insert request, options do |result, response|
419
- result = ::Gapic::Rest::BaseOperation.new result
440
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
441
+ operation: result,
442
+ client: region_operations,
443
+ request_values: {
444
+ "project" => request.project,
445
+ "region" => request.region
446
+ },
447
+ options: options
448
+ )
420
449
  yield result, response if block_given?
421
450
  return result
422
451
  end
@@ -446,7 +475,7 @@ module Google
446
475
  # the default parameter values, pass an empty Hash as a request object (see above).
447
476
  #
448
477
  # @param filter [::String]
449
- # 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) ```
478
+ # 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`.
450
479
  # @param max_results [::Integer]
451
480
  # 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`)
452
481
  # @param order_by [::String]
@@ -530,10 +559,10 @@ module Google
530
559
  # @param request_id [::String]
531
560
  # 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).
532
561
  # @yield [result, response] Access the result along with the Faraday response object
533
- # @yieldparam result [::Gapic::Rest::BaseOperation]
562
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
534
563
  # @yieldparam response [::Faraday::Response]
535
564
  #
536
- # @return [::Gapic::Rest::BaseOperation]
565
+ # @return [::Gapic::GenericLRO::Operation]
537
566
  #
538
567
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
539
568
  def patch request, options = nil
@@ -560,7 +589,15 @@ module Google
560
589
  metadata: @config.metadata
561
590
 
562
591
  @forwarding_rules_stub.patch request, options do |result, response|
563
- result = ::Gapic::Rest::BaseOperation.new result
592
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
593
+ operation: result,
594
+ client: region_operations,
595
+ request_values: {
596
+ "project" => request.project,
597
+ "region" => request.region
598
+ },
599
+ options: options
600
+ )
564
601
  yield result, response if block_given?
565
602
  return result
566
603
  end
@@ -600,10 +637,10 @@ module Google
600
637
  # @param resource [::String]
601
638
  # Name or id of the resource for this request.
602
639
  # @yield [result, response] Access the result along with the Faraday response object
603
- # @yieldparam result [::Gapic::Rest::BaseOperation]
640
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
604
641
  # @yieldparam response [::Faraday::Response]
605
642
  #
606
- # @return [::Gapic::Rest::BaseOperation]
643
+ # @return [::Gapic::GenericLRO::Operation]
607
644
  #
608
645
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
609
646
  def set_labels request, options = nil
@@ -630,7 +667,15 @@ module Google
630
667
  metadata: @config.metadata
631
668
 
632
669
  @forwarding_rules_stub.set_labels request, options do |result, response|
633
- result = ::Gapic::Rest::BaseOperation.new result
670
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
671
+ operation: result,
672
+ client: region_operations,
673
+ request_values: {
674
+ "project" => request.project,
675
+ "region" => request.region
676
+ },
677
+ options: options
678
+ )
634
679
  yield result, response if block_given?
635
680
  return result
636
681
  end
@@ -670,10 +715,10 @@ module Google
670
715
  # @param target_reference_resource [::Google::Cloud::Compute::V1::TargetReference, ::Hash]
671
716
  # The body resource for this request
672
717
  # @yield [result, response] Access the result along with the Faraday response object
673
- # @yieldparam result [::Gapic::Rest::BaseOperation]
718
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
674
719
  # @yieldparam response [::Faraday::Response]
675
720
  #
676
- # @return [::Gapic::Rest::BaseOperation]
721
+ # @return [::Gapic::GenericLRO::Operation]
677
722
  #
678
723
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
679
724
  def set_target request, options = nil
@@ -700,7 +745,15 @@ module Google
700
745
  metadata: @config.metadata
701
746
 
702
747
  @forwarding_rules_stub.set_target request, options do |result, response|
703
- result = ::Gapic::Rest::BaseOperation.new result
748
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
749
+ operation: result,
750
+ client: region_operations,
751
+ request_values: {
752
+ "project" => request.project,
753
+ "region" => request.region
754
+ },
755
+ options: options
756
+ )
704
757
  yield result, response if block_given?
705
758
  return result
706
759
  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/global_addresses/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -134,9 +135,21 @@ module Google
134
135
  credentials = Credentials.new credentials, scope: @config.scope
135
136
  end
136
137
 
138
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
139
+ config.credentials = credentials
140
+ config.endpoint = @config.endpoint
141
+ end
142
+
137
143
  @global_addresses_stub = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
138
144
  end
139
145
 
146
+ ##
147
+ # Get the associated client for long-running operations via GlobalOperations.
148
+ #
149
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
150
+ #
151
+ attr_reader :global_operations
152
+
140
153
  # Service calls
141
154
 
142
155
  ##
@@ -166,10 +179,10 @@ module Google
166
179
  # @param request_id [::String]
167
180
  # 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).
168
181
  # @yield [result, response] Access the result along with the Faraday response object
169
- # @yieldparam result [::Gapic::Rest::BaseOperation]
182
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
170
183
  # @yieldparam response [::Faraday::Response]
171
184
  #
172
- # @return [::Gapic::Rest::BaseOperation]
185
+ # @return [::Gapic::GenericLRO::Operation]
173
186
  #
174
187
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
175
188
  def delete request, options = nil
@@ -196,7 +209,14 @@ module Google
196
209
  metadata: @config.metadata
197
210
 
198
211
  @global_addresses_stub.delete request, options do |result, response|
199
- result = ::Gapic::Rest::BaseOperation.new result
212
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
213
+ operation: result,
214
+ client: global_operations,
215
+ request_values: {
216
+ "project" => request.project
217
+ },
218
+ options: options
219
+ )
200
220
  yield result, response if block_given?
201
221
  return result
202
222
  end
@@ -295,10 +315,10 @@ module Google
295
315
  # @param request_id [::String]
296
316
  # 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).
297
317
  # @yield [result, response] Access the result along with the Faraday response object
298
- # @yieldparam result [::Gapic::Rest::BaseOperation]
318
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
299
319
  # @yieldparam response [::Faraday::Response]
300
320
  #
301
- # @return [::Gapic::Rest::BaseOperation]
321
+ # @return [::Gapic::GenericLRO::Operation]
302
322
  #
303
323
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
304
324
  def insert request, options = nil
@@ -325,7 +345,14 @@ module Google
325
345
  metadata: @config.metadata
326
346
 
327
347
  @global_addresses_stub.insert request, options do |result, response|
328
- result = ::Gapic::Rest::BaseOperation.new result
348
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
349
+ operation: result,
350
+ client: global_operations,
351
+ request_values: {
352
+ "project" => request.project
353
+ },
354
+ options: options
355
+ )
329
356
  yield result, response if block_given?
330
357
  return result
331
358
  end
@@ -355,7 +382,7 @@ module Google
355
382
  # the default parameter values, pass an empty Hash as a request object (see above).
356
383
  #
357
384
  # @param filter [::String]
358
- # 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) ```
385
+ # 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`.
359
386
  # @param max_results [::Integer]
360
387
  # 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`)
361
388
  # @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/global_forwarding_rules/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -140,9 +141,21 @@ module Google
140
141
  credentials = Credentials.new credentials, scope: @config.scope
141
142
  end
142
143
 
144
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
145
+ config.credentials = credentials
146
+ config.endpoint = @config.endpoint
147
+ end
148
+
143
149
  @global_forwarding_rules_stub = ::Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
144
150
  end
145
151
 
152
+ ##
153
+ # Get the associated client for long-running operations via GlobalOperations.
154
+ #
155
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
156
+ #
157
+ attr_reader :global_operations
158
+
146
159
  # Service calls
147
160
 
148
161
  ##
@@ -172,10 +185,10 @@ module Google
172
185
  # @param request_id [::String]
173
186
  # 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).
174
187
  # @yield [result, response] Access the result along with the Faraday response object
175
- # @yieldparam result [::Gapic::Rest::BaseOperation]
188
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
176
189
  # @yieldparam response [::Faraday::Response]
177
190
  #
178
- # @return [::Gapic::Rest::BaseOperation]
191
+ # @return [::Gapic::GenericLRO::Operation]
179
192
  #
180
193
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
181
194
  def delete request, options = nil
@@ -202,7 +215,14 @@ module Google
202
215
  metadata: @config.metadata
203
216
 
204
217
  @global_forwarding_rules_stub.delete request, options do |result, response|
205
- result = ::Gapic::Rest::BaseOperation.new result
218
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
219
+ operation: result,
220
+ client: global_operations,
221
+ request_values: {
222
+ "project" => request.project
223
+ },
224
+ options: options
225
+ )
206
226
  yield result, response if block_given?
207
227
  return result
208
228
  end
@@ -301,10 +321,10 @@ module Google
301
321
  # @param request_id [::String]
302
322
  # 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).
303
323
  # @yield [result, response] Access the result along with the Faraday response object
304
- # @yieldparam result [::Gapic::Rest::BaseOperation]
324
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
305
325
  # @yieldparam response [::Faraday::Response]
306
326
  #
307
- # @return [::Gapic::Rest::BaseOperation]
327
+ # @return [::Gapic::GenericLRO::Operation]
308
328
  #
309
329
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
310
330
  def insert request, options = nil
@@ -331,7 +351,14 @@ module Google
331
351
  metadata: @config.metadata
332
352
 
333
353
  @global_forwarding_rules_stub.insert request, options do |result, response|
334
- result = ::Gapic::Rest::BaseOperation.new result
354
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
355
+ operation: result,
356
+ client: global_operations,
357
+ request_values: {
358
+ "project" => request.project
359
+ },
360
+ options: options
361
+ )
335
362
  yield result, response if block_given?
336
363
  return result
337
364
  end
@@ -361,7 +388,7 @@ module Google
361
388
  # the default parameter values, pass an empty Hash as a request object (see above).
362
389
  #
363
390
  # @param filter [::String]
364
- # 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) ```
391
+ # 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`.
365
392
  # @param max_results [::Integer]
366
393
  # 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`)
367
394
  # @param order_by [::String]
@@ -441,10 +468,10 @@ module Google
441
468
  # @param request_id [::String]
442
469
  # 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).
443
470
  # @yield [result, response] Access the result along with the Faraday response object
444
- # @yieldparam result [::Gapic::Rest::BaseOperation]
471
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
445
472
  # @yieldparam response [::Faraday::Response]
446
473
  #
447
- # @return [::Gapic::Rest::BaseOperation]
474
+ # @return [::Gapic::GenericLRO::Operation]
448
475
  #
449
476
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
450
477
  def patch request, options = nil
@@ -471,7 +498,14 @@ module Google
471
498
  metadata: @config.metadata
472
499
 
473
500
  @global_forwarding_rules_stub.patch request, options do |result, response|
474
- result = ::Gapic::Rest::BaseOperation.new result
501
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
502
+ operation: result,
503
+ client: global_operations,
504
+ request_values: {
505
+ "project" => request.project
506
+ },
507
+ options: options
508
+ )
475
509
  yield result, response if block_given?
476
510
  return result
477
511
  end
@@ -507,10 +541,10 @@ module Google
507
541
  # @param resource [::String]
508
542
  # Name or id of the resource for this request.
509
543
  # @yield [result, response] Access the result along with the Faraday response object
510
- # @yieldparam result [::Gapic::Rest::BaseOperation]
544
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
511
545
  # @yieldparam response [::Faraday::Response]
512
546
  #
513
- # @return [::Gapic::Rest::BaseOperation]
547
+ # @return [::Gapic::GenericLRO::Operation]
514
548
  #
515
549
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
516
550
  def set_labels request, options = nil
@@ -537,7 +571,14 @@ module Google
537
571
  metadata: @config.metadata
538
572
 
539
573
  @global_forwarding_rules_stub.set_labels request, options do |result, response|
540
- result = ::Gapic::Rest::BaseOperation.new result
574
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
575
+ operation: result,
576
+ client: global_operations,
577
+ request_values: {
578
+ "project" => request.project
579
+ },
580
+ options: options
581
+ )
541
582
  yield result, response if block_given?
542
583
  return result
543
584
  end
@@ -575,10 +616,10 @@ module Google
575
616
  # @param target_reference_resource [::Google::Cloud::Compute::V1::TargetReference, ::Hash]
576
617
  # The body resource for this request
577
618
  # @yield [result, response] Access the result along with the Faraday response object
578
- # @yieldparam result [::Gapic::Rest::BaseOperation]
619
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
579
620
  # @yieldparam response [::Faraday::Response]
580
621
  #
581
- # @return [::Gapic::Rest::BaseOperation]
622
+ # @return [::Gapic::GenericLRO::Operation]
582
623
  #
583
624
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
584
625
  def set_target request, options = nil
@@ -605,7 +646,14 @@ module Google
605
646
  metadata: @config.metadata
606
647
 
607
648
  @global_forwarding_rules_stub.set_target request, options do |result, response|
608
- result = ::Gapic::Rest::BaseOperation.new result
649
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
650
+ operation: result,
651
+ client: global_operations,
652
+ request_values: {
653
+ "project" => request.project
654
+ },
655
+ options: options
656
+ )
609
657
  yield result, response if block_given?
610
658
  return result
611
659
  end