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
@@ -449,6 +449,54 @@ module Google
449
449
 
450
450
  [uri, body, query_string_params]
451
451
  end
452
+
453
+ ##
454
+ # Baseline implementation for the update REST call
455
+ #
456
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateReservationRequest]
457
+ # A request object representing the call parameters. Required.
458
+ # @param options [::Gapic::CallOptions]
459
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
460
+ #
461
+ # @yield [result, response] Access the result along with the Faraday response object
462
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
463
+ # @yieldparam response [::Faraday::Response]
464
+ #
465
+ # @return [::Google::Cloud::Compute::V1::Operation]
466
+ # A result object deserialized from the server's reply
467
+ def update request_pb, options = nil
468
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
469
+
470
+ uri, body, query_string_params = transcode_update_request request_pb
471
+ response = @client_stub.make_patch_request(
472
+ uri: uri,
473
+ body: body,
474
+ params: query_string_params,
475
+ options: options
476
+ )
477
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
478
+
479
+ yield result, response if block_given?
480
+ result
481
+ end
482
+
483
+ ##
484
+ # GRPC transcoding helper method for the update REST call
485
+ #
486
+ # @param request_pb [::Google::Cloud::Compute::V1::UpdateReservationRequest]
487
+ # A request object representing the call parameters. Required.
488
+ # @return [Array(String, [String, nil], Hash{String => String})]
489
+ # Uri, Body, Query string parameters
490
+ def transcode_update_request request_pb
491
+ uri = "/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/reservations/#{request_pb.reservation}"
492
+ body = request_pb.reservation_resource.to_json
493
+ query_string_params = {}
494
+ query_string_params["paths"] = request_pb.paths.to_s if request_pb.has_paths?
495
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
496
+ query_string_params["updateMask"] = request_pb.update_mask.to_s if request_pb.has_update_mask?
497
+
498
+ [uri, body, query_string_params]
499
+ end
452
500
  end
453
501
  end
454
502
  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/resource_policies/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -148,9 +149,21 @@ module Google
148
149
  credentials = Credentials.new credentials, scope: @config.scope
149
150
  end
150
151
 
152
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
153
+ config.credentials = credentials
154
+ config.endpoint = @config.endpoint
155
+ end
156
+
151
157
  @resource_policies_stub = ::Google::Cloud::Compute::V1::ResourcePolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
152
158
  end
153
159
 
160
+ ##
161
+ # Get the associated client for long-running operations via RegionOperations.
162
+ #
163
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
164
+ #
165
+ attr_reader :region_operations
166
+
154
167
  # Service calls
155
168
 
156
169
  ##
@@ -174,7 +187,7 @@ module Google
174
187
  # the default parameter values, pass an empty Hash as a request object (see above).
175
188
  #
176
189
  # @param filter [::String]
177
- # 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) ```
190
+ # 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) ```
178
191
  # @param include_all_scopes [::Boolean]
179
192
  # 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.
180
193
  # @param max_results [::Integer]
@@ -256,10 +269,10 @@ module Google
256
269
  # @param resource_policy [::String]
257
270
  # Name of the resource policy to delete.
258
271
  # @yield [result, response] Access the result along with the Faraday response object
259
- # @yieldparam result [::Gapic::Rest::BaseOperation]
272
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
260
273
  # @yieldparam response [::Faraday::Response]
261
274
  #
262
- # @return [::Gapic::Rest::BaseOperation]
275
+ # @return [::Gapic::GenericLRO::Operation]
263
276
  #
264
277
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
265
278
  def delete request, options = nil
@@ -286,7 +299,15 @@ module Google
286
299
  metadata: @config.metadata
287
300
 
288
301
  @resource_policies_stub.delete request, options do |result, response|
289
- result = ::Gapic::Rest::BaseOperation.new result
302
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
303
+ operation: result,
304
+ client: region_operations,
305
+ request_values: {
306
+ "project" => request.project,
307
+ "region" => request.region
308
+ },
309
+ options: options
310
+ )
290
311
  yield result, response if block_given?
291
312
  return result
292
313
  end
@@ -456,10 +477,10 @@ module Google
456
477
  # @param resource_policy_resource [::Google::Cloud::Compute::V1::ResourcePolicy, ::Hash]
457
478
  # The body resource for this request
458
479
  # @yield [result, response] Access the result along with the Faraday response object
459
- # @yieldparam result [::Gapic::Rest::BaseOperation]
480
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
460
481
  # @yieldparam response [::Faraday::Response]
461
482
  #
462
- # @return [::Gapic::Rest::BaseOperation]
483
+ # @return [::Gapic::GenericLRO::Operation]
463
484
  #
464
485
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
465
486
  def insert request, options = nil
@@ -486,7 +507,15 @@ module Google
486
507
  metadata: @config.metadata
487
508
 
488
509
  @resource_policies_stub.insert request, options do |result, response|
489
- result = ::Gapic::Rest::BaseOperation.new result
510
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
511
+ operation: result,
512
+ client: region_operations,
513
+ request_values: {
514
+ "project" => request.project,
515
+ "region" => request.region
516
+ },
517
+ options: options
518
+ )
490
519
  yield result, response if block_given?
491
520
  return result
492
521
  end
@@ -516,7 +545,7 @@ module Google
516
545
  # the default parameter values, pass an empty Hash as a request object (see above).
517
546
  #
518
547
  # @param filter [::String]
519
- # 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) ```
548
+ # 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) ```
520
549
  # @param max_results [::Integer]
521
550
  # 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`)
522
551
  # @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/routers/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -155,9 +156,21 @@ module Google
155
156
  credentials = Credentials.new credentials, scope: @config.scope
156
157
  end
157
158
 
159
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
160
+ config.credentials = credentials
161
+ config.endpoint = @config.endpoint
162
+ end
163
+
158
164
  @routers_stub = ::Google::Cloud::Compute::V1::Routers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
159
165
  end
160
166
 
167
+ ##
168
+ # Get the associated client for long-running operations via RegionOperations.
169
+ #
170
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
171
+ #
172
+ attr_reader :region_operations
173
+
161
174
  # Service calls
162
175
 
163
176
  ##
@@ -181,7 +194,7 @@ module Google
181
194
  # the default parameter values, pass an empty Hash as a request object (see above).
182
195
  #
183
196
  # @param filter [::String]
184
- # 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) ```
197
+ # 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
198
  # @param include_all_scopes [::Boolean]
186
199
  # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
187
200
  # @param max_results [::Integer]
@@ -263,10 +276,10 @@ module Google
263
276
  # @param router [::String]
264
277
  # Name of the Router resource to delete.
265
278
  # @yield [result, response] Access the result along with the Faraday response object
266
- # @yieldparam result [::Gapic::Rest::BaseOperation]
279
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
267
280
  # @yieldparam response [::Faraday::Response]
268
281
  #
269
- # @return [::Gapic::Rest::BaseOperation]
282
+ # @return [::Gapic::GenericLRO::Operation]
270
283
  #
271
284
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
272
285
  def delete request, options = nil
@@ -293,7 +306,15 @@ module Google
293
306
  metadata: @config.metadata
294
307
 
295
308
  @routers_stub.delete request, options do |result, response|
296
- result = ::Gapic::Rest::BaseOperation.new result
309
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
310
+ operation: result,
311
+ client: region_operations,
312
+ request_values: {
313
+ "project" => request.project,
314
+ "region" => request.region
315
+ },
316
+ options: options
317
+ )
297
318
  yield result, response if block_given?
298
319
  return result
299
320
  end
@@ -388,7 +409,7 @@ module Google
388
409
  # the default parameter values, pass an empty Hash as a request object (see above).
389
410
  #
390
411
  # @param filter [::String]
391
- # 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) ```
412
+ # 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) ```
392
413
  # @param max_results [::Integer]
393
414
  # 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`)
394
415
  # @param order_by [::String]
@@ -537,10 +558,10 @@ module Google
537
558
  # @param router_resource [::Google::Cloud::Compute::V1::Router, ::Hash]
538
559
  # The body resource for this request
539
560
  # @yield [result, response] Access the result along with the Faraday response object
540
- # @yieldparam result [::Gapic::Rest::BaseOperation]
561
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
541
562
  # @yieldparam response [::Faraday::Response]
542
563
  #
543
- # @return [::Gapic::Rest::BaseOperation]
564
+ # @return [::Gapic::GenericLRO::Operation]
544
565
  #
545
566
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
546
567
  def insert request, options = nil
@@ -567,7 +588,15 @@ module Google
567
588
  metadata: @config.metadata
568
589
 
569
590
  @routers_stub.insert request, options do |result, response|
570
- result = ::Gapic::Rest::BaseOperation.new result
591
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
592
+ operation: result,
593
+ client: region_operations,
594
+ request_values: {
595
+ "project" => request.project,
596
+ "region" => request.region
597
+ },
598
+ options: options
599
+ )
571
600
  yield result, response if block_given?
572
601
  return result
573
602
  end
@@ -597,7 +626,7 @@ module Google
597
626
  # the default parameter values, pass an empty Hash as a request object (see above).
598
627
  #
599
628
  # @param filter [::String]
600
- # 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) ```
629
+ # 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) ```
601
630
  # @param max_results [::Integer]
602
631
  # 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`)
603
632
  # @param order_by [::String]
@@ -681,10 +710,10 @@ module Google
681
710
  # @param router_resource [::Google::Cloud::Compute::V1::Router, ::Hash]
682
711
  # The body resource for this request
683
712
  # @yield [result, response] Access the result along with the Faraday response object
684
- # @yieldparam result [::Gapic::Rest::BaseOperation]
713
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
685
714
  # @yieldparam response [::Faraday::Response]
686
715
  #
687
- # @return [::Gapic::Rest::BaseOperation]
716
+ # @return [::Gapic::GenericLRO::Operation]
688
717
  #
689
718
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
690
719
  def patch request, options = nil
@@ -711,7 +740,15 @@ module Google
711
740
  metadata: @config.metadata
712
741
 
713
742
  @routers_stub.patch request, options do |result, response|
714
- result = ::Gapic::Rest::BaseOperation.new result
743
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
744
+ operation: result,
745
+ client: region_operations,
746
+ request_values: {
747
+ "project" => request.project,
748
+ "region" => request.region
749
+ },
750
+ options: options
751
+ )
715
752
  yield result, response if block_given?
716
753
  return result
717
754
  end
@@ -818,10 +855,10 @@ module Google
818
855
  # @param router_resource [::Google::Cloud::Compute::V1::Router, ::Hash]
819
856
  # The body resource for this request
820
857
  # @yield [result, response] Access the result along with the Faraday response object
821
- # @yieldparam result [::Gapic::Rest::BaseOperation]
858
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
822
859
  # @yieldparam response [::Faraday::Response]
823
860
  #
824
- # @return [::Gapic::Rest::BaseOperation]
861
+ # @return [::Gapic::GenericLRO::Operation]
825
862
  #
826
863
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
827
864
  def update request, options = nil
@@ -848,7 +885,15 @@ module Google
848
885
  metadata: @config.metadata
849
886
 
850
887
  @routers_stub.update request, options do |result, response|
851
- result = ::Gapic::Rest::BaseOperation.new result
888
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
889
+ operation: result,
890
+ client: region_operations,
891
+ request_values: {
892
+ "project" => request.project,
893
+ "region" => request.region
894
+ },
895
+ options: options
896
+ )
852
897
  yield result, response if block_given?
853
898
  return result
854
899
  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/routes/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
  @routes_stub = ::Google::Cloud::Compute::V1::Routes::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 route [::String]
167
180
  # Name of the Route resource to delete.
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
  @routes_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 route_resource [::Google::Cloud::Compute::V1::Route, ::Hash]
296
316
  # The body resource for this request
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
  @routes_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, 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) ```
385
+ # 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) ```
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]