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/health_checks/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -143,9 +144,21 @@ module Google
143
144
  credentials = Credentials.new credentials, scope: @config.scope
144
145
  end
145
146
 
147
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
148
+ config.credentials = credentials
149
+ config.endpoint = @config.endpoint
150
+ end
151
+
146
152
  @health_checks_stub = ::Google::Cloud::Compute::V1::HealthChecks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
153
  end
148
154
 
155
+ ##
156
+ # Get the associated client for long-running operations via GlobalOperations.
157
+ #
158
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
159
+ #
160
+ attr_reader :global_operations
161
+
149
162
  # Service calls
150
163
 
151
164
  ##
@@ -169,7 +182,7 @@ module Google
169
182
  # the default parameter values, pass an empty Hash as a request object (see above).
170
183
  #
171
184
  # @param filter [::String]
172
- # 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) ```
185
+ # 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`.
173
186
  # @param include_all_scopes [::Boolean]
174
187
  # 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.
175
188
  # @param max_results [::Integer]
@@ -249,10 +262,10 @@ module Google
249
262
  # @param request_id [::String]
250
263
  # 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).
251
264
  # @yield [result, response] Access the result along with the Faraday response object
252
- # @yieldparam result [::Gapic::Rest::BaseOperation]
265
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
253
266
  # @yieldparam response [::Faraday::Response]
254
267
  #
255
- # @return [::Gapic::Rest::BaseOperation]
268
+ # @return [::Gapic::GenericLRO::Operation]
256
269
  #
257
270
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
258
271
  def delete request, options = nil
@@ -279,7 +292,14 @@ module Google
279
292
  metadata: @config.metadata
280
293
 
281
294
  @health_checks_stub.delete request, options do |result, response|
282
- result = ::Gapic::Rest::BaseOperation.new result
295
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
296
+ operation: result,
297
+ client: global_operations,
298
+ request_values: {
299
+ "project" => request.project
300
+ },
301
+ options: options
302
+ )
283
303
  yield result, response if block_given?
284
304
  return result
285
305
  end
@@ -378,10 +398,10 @@ module Google
378
398
  # @param request_id [::String]
379
399
  # 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).
380
400
  # @yield [result, response] Access the result along with the Faraday response object
381
- # @yieldparam result [::Gapic::Rest::BaseOperation]
401
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
382
402
  # @yieldparam response [::Faraday::Response]
383
403
  #
384
- # @return [::Gapic::Rest::BaseOperation]
404
+ # @return [::Gapic::GenericLRO::Operation]
385
405
  #
386
406
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
387
407
  def insert request, options = nil
@@ -408,7 +428,14 @@ module Google
408
428
  metadata: @config.metadata
409
429
 
410
430
  @health_checks_stub.insert request, options do |result, response|
411
- result = ::Gapic::Rest::BaseOperation.new result
431
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
432
+ operation: result,
433
+ client: global_operations,
434
+ request_values: {
435
+ "project" => request.project
436
+ },
437
+ options: options
438
+ )
412
439
  yield result, response if block_given?
413
440
  return result
414
441
  end
@@ -438,7 +465,7 @@ module Google
438
465
  # the default parameter values, pass an empty Hash as a request object (see above).
439
466
  #
440
467
  # @param filter [::String]
441
- # 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) ```
468
+ # 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`.
442
469
  # @param max_results [::Integer]
443
470
  # 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`)
444
471
  # @param order_by [::String]
@@ -518,10 +545,10 @@ module Google
518
545
  # @param request_id [::String]
519
546
  # 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).
520
547
  # @yield [result, response] Access the result along with the Faraday response object
521
- # @yieldparam result [::Gapic::Rest::BaseOperation]
548
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
522
549
  # @yieldparam response [::Faraday::Response]
523
550
  #
524
- # @return [::Gapic::Rest::BaseOperation]
551
+ # @return [::Gapic::GenericLRO::Operation]
525
552
  #
526
553
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
527
554
  def patch request, options = nil
@@ -548,7 +575,14 @@ module Google
548
575
  metadata: @config.metadata
549
576
 
550
577
  @health_checks_stub.patch request, options do |result, response|
551
- 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
+ )
552
586
  yield result, response if block_given?
553
587
  return result
554
588
  end
@@ -586,10 +620,10 @@ module Google
586
620
  # @param request_id [::String]
587
621
  # 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).
588
622
  # @yield [result, response] Access the result along with the Faraday response object
589
- # @yieldparam result [::Gapic::Rest::BaseOperation]
623
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
590
624
  # @yieldparam response [::Faraday::Response]
591
625
  #
592
- # @return [::Gapic::Rest::BaseOperation]
626
+ # @return [::Gapic::GenericLRO::Operation]
593
627
  #
594
628
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
595
629
  def update request, options = nil
@@ -616,7 +650,14 @@ module Google
616
650
  metadata: @config.metadata
617
651
 
618
652
  @health_checks_stub.update request, options do |result, response|
619
- 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
+ )
620
661
  yield result, response if block_given?
621
662
  return result
622
663
  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/images/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -154,9 +155,21 @@ module Google
154
155
  credentials = Credentials.new credentials, scope: @config.scope
155
156
  end
156
157
 
158
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
159
+ config.credentials = credentials
160
+ config.endpoint = @config.endpoint
161
+ end
162
+
157
163
  @images_stub = ::Google::Cloud::Compute::V1::Images::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
158
164
  end
159
165
 
166
+ ##
167
+ # Get the associated client for long-running operations via GlobalOperations.
168
+ #
169
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
170
+ #
171
+ attr_reader :global_operations
172
+
160
173
  # Service calls
161
174
 
162
175
  ##
@@ -186,10 +199,10 @@ module Google
186
199
  # @param request_id [::String]
187
200
  # 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).
188
201
  # @yield [result, response] Access the result along with the Faraday response object
189
- # @yieldparam result [::Gapic::Rest::BaseOperation]
202
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
190
203
  # @yieldparam response [::Faraday::Response]
191
204
  #
192
- # @return [::Gapic::Rest::BaseOperation]
205
+ # @return [::Gapic::GenericLRO::Operation]
193
206
  #
194
207
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
195
208
  def delete request, options = nil
@@ -216,7 +229,14 @@ module Google
216
229
  metadata: @config.metadata
217
230
 
218
231
  @images_stub.delete request, options do |result, response|
219
- result = ::Gapic::Rest::BaseOperation.new result
232
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
233
+ operation: result,
234
+ client: global_operations,
235
+ request_values: {
236
+ "project" => request.project
237
+ },
238
+ options: options
239
+ )
220
240
  yield result, response if block_given?
221
241
  return result
222
242
  end
@@ -254,10 +274,10 @@ module Google
254
274
  # @param request_id [::String]
255
275
  # 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).
256
276
  # @yield [result, response] Access the result along with the Faraday response object
257
- # @yieldparam result [::Gapic::Rest::BaseOperation]
277
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
258
278
  # @yieldparam response [::Faraday::Response]
259
279
  #
260
- # @return [::Gapic::Rest::BaseOperation]
280
+ # @return [::Gapic::GenericLRO::Operation]
261
281
  #
262
282
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
263
283
  def deprecate request, options = nil
@@ -284,7 +304,14 @@ module Google
284
304
  metadata: @config.metadata
285
305
 
286
306
  @images_stub.deprecate request, options do |result, response|
287
- result = ::Gapic::Rest::BaseOperation.new result
307
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
308
+ operation: result,
309
+ client: global_operations,
310
+ request_values: {
311
+ "project" => request.project
312
+ },
313
+ options: options
314
+ )
288
315
  yield result, response if block_given?
289
316
  return result
290
317
  end
@@ -513,10 +540,10 @@ module Google
513
540
  # @param request_id [::String]
514
541
  # 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).
515
542
  # @yield [result, response] Access the result along with the Faraday response object
516
- # @yieldparam result [::Gapic::Rest::BaseOperation]
543
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
517
544
  # @yieldparam response [::Faraday::Response]
518
545
  #
519
- # @return [::Gapic::Rest::BaseOperation]
546
+ # @return [::Gapic::GenericLRO::Operation]
520
547
  #
521
548
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
522
549
  def insert request, options = nil
@@ -543,7 +570,14 @@ module Google
543
570
  metadata: @config.metadata
544
571
 
545
572
  @images_stub.insert request, options do |result, response|
546
- result = ::Gapic::Rest::BaseOperation.new result
573
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
574
+ operation: result,
575
+ client: global_operations,
576
+ request_values: {
577
+ "project" => request.project
578
+ },
579
+ options: options
580
+ )
547
581
  yield result, response if block_given?
548
582
  return result
549
583
  end
@@ -573,7 +607,7 @@ module Google
573
607
  # the default parameter values, pass an empty Hash as a request object (see above).
574
608
  #
575
609
  # @param filter [::String]
576
- # 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) ```
610
+ # 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`.
577
611
  # @param max_results [::Integer]
578
612
  # 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`)
579
613
  # @param order_by [::String]
@@ -653,10 +687,10 @@ module Google
653
687
  # @param request_id [::String]
654
688
  # 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).
655
689
  # @yield [result, response] Access the result along with the Faraday response object
656
- # @yieldparam result [::Gapic::Rest::BaseOperation]
690
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
657
691
  # @yieldparam response [::Faraday::Response]
658
692
  #
659
- # @return [::Gapic::Rest::BaseOperation]
693
+ # @return [::Gapic::GenericLRO::Operation]
660
694
  #
661
695
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
662
696
  def patch request, options = nil
@@ -683,7 +717,14 @@ module Google
683
717
  metadata: @config.metadata
684
718
 
685
719
  @images_stub.patch request, options do |result, response|
686
- result = ::Gapic::Rest::BaseOperation.new result
720
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
721
+ operation: result,
722
+ client: global_operations,
723
+ request_values: {
724
+ "project" => request.project
725
+ },
726
+ options: options
727
+ )
687
728
  yield result, response if block_given?
688
729
  return result
689
730
  end
@@ -784,10 +825,10 @@ module Google
784
825
  # @param resource [::String]
785
826
  # Name or id of the resource for this request.
786
827
  # @yield [result, response] Access the result along with the Faraday response object
787
- # @yieldparam result [::Gapic::Rest::BaseOperation]
828
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
788
829
  # @yieldparam response [::Faraday::Response]
789
830
  #
790
- # @return [::Gapic::Rest::BaseOperation]
831
+ # @return [::Gapic::GenericLRO::Operation]
791
832
  #
792
833
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
793
834
  def set_labels request, options = nil
@@ -814,7 +855,14 @@ module Google
814
855
  metadata: @config.metadata
815
856
 
816
857
  @images_stub.set_labels request, options do |result, response|
817
- result = ::Gapic::Rest::BaseOperation.new result
858
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
859
+ operation: result,
860
+ client: global_operations,
861
+ request_values: {
862
+ "project" => request.project
863
+ },
864
+ options: options
865
+ )
818
866
  yield result, response if block_given?
819
867
  return result
820
868
  end