google-cloud-compute-v1 0.5.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/README.md +4 -4
  5. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
  6. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +37 -8
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +59 -14
  8. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +158 -19
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +46 -0
  10. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +169 -23
  11. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +46 -0
  12. data/lib/google/cloud/compute/v1/compute_pb.rb +534 -2
  13. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +2 -2
  14. data/lib/google/cloud/compute/v1/disks/rest/client.rb +93 -24
  15. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +44 -10
  16. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +98 -31
  17. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +2 -2
  18. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +54 -13
  19. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +70 -17
  20. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
  21. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +64 -16
  22. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +55 -14
  23. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
  24. data/lib/google/cloud/compute/v1/global_operations/rest/nonstandard_lro.rb +68 -0
  25. data/lib/google/cloud/compute/v1/global_operations.rb +1 -0
  26. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  27. data/lib/google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro.rb +68 -0
  28. data/lib/google/cloud/compute/v1/global_organization_operations.rb +1 -0
  29. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +47 -13
  30. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +55 -14
  31. data/lib/google/cloud/compute/v1/images/rest/client.rb +64 -16
  32. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +172 -47
  33. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +71 -18
  34. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
  35. data/lib/google/cloud/compute/v1/instances/rest/client.rb +521 -96
  36. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +91 -0
  37. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +48 -11
  38. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  39. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +44 -10
  40. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
  41. data/lib/google/cloud/compute/v1/machine_images/credentials.rb +52 -0
  42. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +804 -0
  43. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +363 -0
  44. data/lib/google/cloud/compute/v1/machine_images/rest.rb +33 -0
  45. data/lib/google/cloud/compute/v1/machine_images.rb +44 -0
  46. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +2 -2
  47. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +60 -15
  48. data/lib/google/cloud/compute/v1/networks/rest/client.rb +85 -23
  49. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +82 -21
  50. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +37 -8
  51. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +2 -2
  52. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +48 -11
  53. data/lib/google/cloud/compute/v1/projects/rest/client.rb +107 -31
  54. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +47 -13
  55. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +51 -14
  56. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +58 -13
  57. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +58 -13
  58. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +116 -5
  59. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +48 -0
  60. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  61. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +92 -23
  62. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +47 -10
  63. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +58 -13
  64. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +171 -46
  65. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +26 -5
  66. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +24 -3
  67. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +36 -7
  68. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +38 -9
  69. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  70. data/lib/google/cloud/compute/v1/region_operations/rest/nonstandard_lro.rb +68 -0
  71. data/lib/google/cloud/compute/v1/region_operations.rb +1 -0
  72. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +38 -9
  73. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +47 -10
  74. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +62 -17
  75. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +58 -13
  76. data/lib/google/cloud/compute/v1/regions/rest/client.rb +3 -3
  77. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +138 -11
  78. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +48 -0
  79. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +37 -8
  80. data/lib/google/cloud/compute/v1/routers/rest/client.rb +60 -15
  81. data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
  82. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +75 -20
  83. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +51 -14
  84. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +116 -7
  85. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +46 -0
  86. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +37 -10
  87. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +45 -11
  88. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +71 -18
  89. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +47 -13
  90. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +56 -15
  91. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +86 -24
  92. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +37 -8
  93. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +92 -23
  94. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +74 -19
  95. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +54 -13
  96. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +37 -8
  97. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +65 -17
  98. data/lib/google/cloud/compute/v1/version.rb +1 -1
  99. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +48 -11
  100. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +37 -8
  101. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  102. data/lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb +68 -0
  103. data/lib/google/cloud/compute/v1/zone_operations.rb +1 -0
  104. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  105. data/lib/google/cloud/compute/v1.rb +3 -0
  106. data/proto_docs/README.md +1 -1
  107. data/proto_docs/google/api/resource.rb +10 -71
  108. data/proto_docs/google/cloud/compute/v1/compute.rb +1647 -330
  109. metadata +14 -7
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/instance_groups/rest/service_stub"
22
+ require "google/cloud/compute/v1/zone_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -147,9 +148,21 @@ module Google
147
148
  credentials = Credentials.new credentials, scope: @config.scope
148
149
  end
149
150
 
151
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
152
+ config.credentials = credentials
153
+ config.endpoint = @config.endpoint
154
+ end
155
+
150
156
  @instance_groups_stub = ::Google::Cloud::Compute::V1::InstanceGroups::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
151
157
  end
152
158
 
159
+ ##
160
+ # Get the associated client for long-running operations via ZoneOperations.
161
+ #
162
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
163
+ #
164
+ attr_reader :zone_operations
165
+
153
166
  # Service calls
154
167
 
155
168
  ##
@@ -183,10 +196,10 @@ module Google
183
196
  # @param zone [::String]
184
197
  # The name of the zone where the instance group is located.
185
198
  # @yield [result, response] Access the result along with the Faraday response object
186
- # @yieldparam result [::Gapic::Rest::BaseOperation]
199
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
187
200
  # @yieldparam response [::Faraday::Response]
188
201
  #
189
- # @return [::Gapic::Rest::BaseOperation]
202
+ # @return [::Gapic::GenericLRO::Operation]
190
203
  #
191
204
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
192
205
  def add_instances request, options = nil
@@ -213,7 +226,15 @@ module Google
213
226
  metadata: @config.metadata
214
227
 
215
228
  @instance_groups_stub.add_instances request, options do |result, response|
216
- result = ::Gapic::Rest::BaseOperation.new result
229
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
230
+ operation: result,
231
+ client: zone_operations,
232
+ request_values: {
233
+ "project" => request.project,
234
+ "zone" => request.zone
235
+ },
236
+ options: options
237
+ )
217
238
  yield result, response if block_given?
218
239
  return result
219
240
  end
@@ -243,7 +264,7 @@ module Google
243
264
  # the default parameter values, pass an empty Hash as a request object (see above).
244
265
  #
245
266
  # @param filter [::String]
246
- # 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) ```
267
+ # 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) ```
247
268
  # @param include_all_scopes [::Boolean]
248
269
  # 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.
249
270
  # @param max_results [::Integer]
@@ -325,10 +346,10 @@ module Google
325
346
  # @param zone [::String]
326
347
  # The name of the zone where the instance group is located.
327
348
  # @yield [result, response] Access the result along with the Faraday response object
328
- # @yieldparam result [::Gapic::Rest::BaseOperation]
349
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
329
350
  # @yieldparam response [::Faraday::Response]
330
351
  #
331
- # @return [::Gapic::Rest::BaseOperation]
352
+ # @return [::Gapic::GenericLRO::Operation]
332
353
  #
333
354
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
334
355
  def delete request, options = nil
@@ -355,7 +376,15 @@ module Google
355
376
  metadata: @config.metadata
356
377
 
357
378
  @instance_groups_stub.delete request, options do |result, response|
358
- result = ::Gapic::Rest::BaseOperation.new result
379
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
380
+ operation: result,
381
+ client: zone_operations,
382
+ request_values: {
383
+ "project" => request.project,
384
+ "zone" => request.zone
385
+ },
386
+ options: options
387
+ )
359
388
  yield result, response if block_given?
360
389
  return result
361
390
  end
@@ -458,10 +487,10 @@ module Google
458
487
  # @param zone [::String]
459
488
  # The name of the zone where you want to create the instance group.
460
489
  # @yield [result, response] Access the result along with the Faraday response object
461
- # @yieldparam result [::Gapic::Rest::BaseOperation]
490
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
462
491
  # @yieldparam response [::Faraday::Response]
463
492
  #
464
- # @return [::Gapic::Rest::BaseOperation]
493
+ # @return [::Gapic::GenericLRO::Operation]
465
494
  #
466
495
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
467
496
  def insert request, options = nil
@@ -488,7 +517,15 @@ module Google
488
517
  metadata: @config.metadata
489
518
 
490
519
  @instance_groups_stub.insert request, options do |result, response|
491
- result = ::Gapic::Rest::BaseOperation.new result
520
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
521
+ operation: result,
522
+ client: zone_operations,
523
+ request_values: {
524
+ "project" => request.project,
525
+ "zone" => request.zone
526
+ },
527
+ options: options
528
+ )
492
529
  yield result, response if block_given?
493
530
  return result
494
531
  end
@@ -518,7 +555,7 @@ module Google
518
555
  # the default parameter values, pass an empty Hash as a request object (see above).
519
556
  #
520
557
  # @param filter [::String]
521
- # 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) ```
558
+ # 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) ```
522
559
  # @param max_results [::Integer]
523
560
  # 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`)
524
561
  # @param order_by [::String]
@@ -592,7 +629,7 @@ module Google
592
629
  # the default parameter values, pass an empty Hash as a request object (see above).
593
630
  #
594
631
  # @param filter [::String]
595
- # 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) ```
632
+ # 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) ```
596
633
  # @param instance_group [::String]
597
634
  # The name of the instance group from which you want to generate a list of included instances.
598
635
  # @param instance_groups_list_instances_request_resource [::Google::Cloud::Compute::V1::InstanceGroupsListInstancesRequest, ::Hash]
@@ -680,10 +717,10 @@ module Google
680
717
  # @param zone [::String]
681
718
  # The name of the zone where the instance group is located.
682
719
  # @yield [result, response] Access the result along with the Faraday response object
683
- # @yieldparam result [::Gapic::Rest::BaseOperation]
720
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
684
721
  # @yieldparam response [::Faraday::Response]
685
722
  #
686
- # @return [::Gapic::Rest::BaseOperation]
723
+ # @return [::Gapic::GenericLRO::Operation]
687
724
  #
688
725
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
689
726
  def remove_instances request, options = nil
@@ -710,7 +747,15 @@ module Google
710
747
  metadata: @config.metadata
711
748
 
712
749
  @instance_groups_stub.remove_instances request, options do |result, response|
713
- result = ::Gapic::Rest::BaseOperation.new result
750
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
751
+ operation: result,
752
+ client: zone_operations,
753
+ request_values: {
754
+ "project" => request.project,
755
+ "zone" => request.zone
756
+ },
757
+ options: options
758
+ )
714
759
  yield result, response if block_given?
715
760
  return result
716
761
  end
@@ -750,10 +795,10 @@ module Google
750
795
  # @param zone [::String]
751
796
  # The name of the zone where the instance group is located.
752
797
  # @yield [result, response] Access the result along with the Faraday response object
753
- # @yieldparam result [::Gapic::Rest::BaseOperation]
798
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
754
799
  # @yieldparam response [::Faraday::Response]
755
800
  #
756
- # @return [::Gapic::Rest::BaseOperation]
801
+ # @return [::Gapic::GenericLRO::Operation]
757
802
  #
758
803
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
759
804
  def set_named_ports request, options = nil
@@ -780,7 +825,15 @@ module Google
780
825
  metadata: @config.metadata
781
826
 
782
827
  @instance_groups_stub.set_named_ports request, options do |result, response|
783
- result = ::Gapic::Rest::BaseOperation.new result
828
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
829
+ operation: result,
830
+ client: zone_operations,
831
+ request_values: {
832
+ "project" => request.project,
833
+ "zone" => request.zone
834
+ },
835
+ options: options
836
+ )
784
837
  yield result, response if block_given?
785
838
  return result
786
839
  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/instance_templates/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
  @instance_templates_stub = ::Google::Cloud::Compute::V1::InstanceTemplates::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
  ##
@@ -175,10 +188,10 @@ module Google
175
188
  # @param request_id [::String]
176
189
  # 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).
177
190
  # @yield [result, response] Access the result along with the Faraday response object
178
- # @yieldparam result [::Gapic::Rest::BaseOperation]
191
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
179
192
  # @yieldparam response [::Faraday::Response]
180
193
  #
181
- # @return [::Gapic::Rest::BaseOperation]
194
+ # @return [::Gapic::GenericLRO::Operation]
182
195
  #
183
196
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
184
197
  def delete request, options = nil
@@ -205,7 +218,14 @@ module Google
205
218
  metadata: @config.metadata
206
219
 
207
220
  @instance_templates_stub.delete request, options do |result, response|
208
- result = ::Gapic::Rest::BaseOperation.new result
221
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
222
+ operation: result,
223
+ client: global_operations,
224
+ request_values: {
225
+ "project" => request.project
226
+ },
227
+ options: options
228
+ )
209
229
  yield result, response if block_given?
210
230
  return result
211
231
  end
@@ -369,10 +389,10 @@ module Google
369
389
  # @param request_id [::String]
370
390
  # 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).
371
391
  # @yield [result, response] Access the result along with the Faraday response object
372
- # @yieldparam result [::Gapic::Rest::BaseOperation]
392
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
373
393
  # @yieldparam response [::Faraday::Response]
374
394
  #
375
- # @return [::Gapic::Rest::BaseOperation]
395
+ # @return [::Gapic::GenericLRO::Operation]
376
396
  #
377
397
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
378
398
  def insert request, options = nil
@@ -399,7 +419,14 @@ module Google
399
419
  metadata: @config.metadata
400
420
 
401
421
  @instance_templates_stub.insert request, options do |result, response|
402
- result = ::Gapic::Rest::BaseOperation.new result
422
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
423
+ operation: result,
424
+ client: global_operations,
425
+ request_values: {
426
+ "project" => request.project
427
+ },
428
+ options: options
429
+ )
403
430
  yield result, response if block_given?
404
431
  return result
405
432
  end
@@ -429,7 +456,7 @@ module Google
429
456
  # the default parameter values, pass an empty Hash as a request object (see above).
430
457
  #
431
458
  # @param filter [::String]
432
- # 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) ```
459
+ # 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) ```
433
460
  # @param max_results [::Integer]
434
461
  # 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`)
435
462
  # @param order_by [::String]