google-cloud-compute-v1 2.14.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -0
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +29 -4
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +38 -20
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +33 -8
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +70 -44
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +33 -8
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +70 -44
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +35 -13
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +110 -74
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +38 -17
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +142 -98
  13. data/lib/google/cloud/compute/v1/compute_pb.rb +52 -1
  14. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +29 -4
  15. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +38 -20
  16. data/lib/google/cloud/compute/v1/disks/rest/client.rb +41 -19
  17. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +158 -110
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +31 -7
  19. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +62 -38
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +38 -19
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +158 -110
  22. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +32 -7
  23. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +62 -38
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +34 -9
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +78 -50
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +32 -7
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +62 -38
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +33 -8
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +70 -44
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +33 -8
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +70 -44
  32. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +29 -6
  33. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +54 -32
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +28 -4
  35. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +38 -20
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +31 -6
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +54 -32
  38. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +33 -8
  39. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +70 -44
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +27 -2
  41. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +22 -8
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +33 -12
  43. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +102 -68
  44. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +31 -6
  45. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +54 -32
  46. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +466 -21
  47. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +428 -120
  48. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +35 -10
  49. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +86 -56
  50. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +28 -3
  51. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +30 -14
  52. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +31 -9
  53. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +78 -50
  54. data/lib/google/cloud/compute/v1/instances/rest/client.rb +66 -50
  55. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +398 -290
  56. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +32 -10
  57. data/lib/google/cloud/compute/v1/instant_snapshots/rest/service_stub.rb +86 -56
  58. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +33 -8
  59. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +70 -44
  60. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +28 -3
  61. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +30 -14
  62. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +28 -3
  63. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +30 -14
  64. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +32 -9
  65. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +78 -50
  66. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +27 -3
  67. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +30 -14
  68. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +30 -8
  69. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +70 -44
  70. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +30 -8
  71. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +70 -44
  72. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +29 -4
  73. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +38 -20
  74. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +32 -10
  75. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +86 -56
  76. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +31 -6
  77. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +54 -32
  78. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +34 -10
  79. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +86 -56
  80. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +37 -17
  81. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +142 -98
  82. data/lib/google/cloud/compute/v1/network_profiles/credentials.rb +53 -0
  83. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +522 -0
  84. data/lib/google/cloud/compute/v1/network_profiles/rest/service_stub.rb +204 -0
  85. data/lib/google/cloud/compute/v1/network_profiles/rest.rb +51 -0
  86. data/lib/google/cloud/compute/v1/network_profiles.rb +47 -0
  87. data/lib/google/cloud/compute/v1/networks/rest/client.rb +36 -12
  88. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +102 -68
  89. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +38 -16
  90. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +134 -92
  91. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +31 -9
  92. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +78 -50
  93. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +29 -4
  94. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +38 -20
  95. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +32 -8
  96. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +70 -44
  97. data/lib/google/cloud/compute/v1/projects/rest/client.rb +39 -15
  98. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +126 -86
  99. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +33 -8
  100. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +70 -44
  101. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +34 -9
  102. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +78 -50
  103. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +32 -7
  104. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +62 -38
  105. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +34 -13
  106. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +110 -74
  107. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +31 -6
  108. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +54 -32
  109. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +28 -3
  110. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +30 -14
  111. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +40 -18
  112. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +150 -104
  113. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +31 -6
  114. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +54 -32
  115. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +32 -7
  116. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +62 -38
  117. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +465 -20
  118. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +420 -114
  119. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +30 -5
  120. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +46 -26
  121. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +30 -5
  122. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +46 -26
  123. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +28 -2
  124. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +22 -8
  125. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +31 -9
  126. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/service_stub.rb +78 -50
  127. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +33 -8
  128. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +70 -44
  129. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +37 -18
  130. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +150 -104
  131. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +30 -5
  132. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +46 -26
  133. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +28 -5
  134. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +46 -26
  135. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +139 -10
  136. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +149 -55
  137. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +30 -5
  138. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +46 -26
  139. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +31 -7
  140. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +62 -38
  141. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +31 -6
  142. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +54 -32
  143. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +33 -8
  144. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +70 -44
  145. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +30 -5
  146. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +46 -26
  147. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +32 -8
  148. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +70 -44
  149. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +28 -2
  150. data/lib/google/cloud/compute/v1/region_zones/rest/service_stub.rb +22 -8
  151. data/lib/google/cloud/compute/v1/regions/rest/client.rb +28 -3
  152. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +30 -14
  153. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +33 -11
  154. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +94 -62
  155. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +32 -10
  156. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +86 -56
  157. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  158. data/lib/google/cloud/compute/v1/routers/rest/client.rb +34 -12
  159. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +102 -68
  160. data/lib/google/cloud/compute/v1/routes/rest/client.rb +30 -5
  161. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +46 -26
  162. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +36 -13
  163. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +110 -74
  164. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +32 -10
  165. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +86 -56
  166. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +28 -3
  167. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +30 -14
  168. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +31 -9
  169. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +78 -50
  170. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +31 -6
  171. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +54 -32
  172. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +32 -8
  173. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +70 -44
  174. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +29 -4
  175. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +38 -20
  176. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +31 -11
  177. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +94 -62
  178. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +35 -13
  179. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +110 -74
  180. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +31 -6
  181. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +54 -32
  182. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +33 -8
  183. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +70 -44
  184. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +37 -12
  185. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +102 -68
  186. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +32 -7
  187. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +62 -38
  188. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +37 -13
  189. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +110 -74
  190. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +35 -10
  191. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +86 -56
  192. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +33 -8
  193. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +70 -44
  194. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +32 -7
  195. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +62 -38
  196. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +34 -10
  197. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +86 -56
  198. data/lib/google/cloud/compute/v1/version.rb +1 -1
  199. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +32 -9
  200. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +78 -50
  201. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +32 -7
  202. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +62 -38
  203. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +28 -5
  204. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +46 -26
  205. data/lib/google/cloud/compute/v1/zones/rest/client.rb +28 -3
  206. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +30 -14
  207. data/lib/google/cloud/compute/v1.rb +1 -0
  208. data/proto_docs/google/api/client.rb +19 -0
  209. data/proto_docs/google/cloud/compute/v1/compute.rb +889 -33
  210. metadata +10 -5
@@ -117,10 +117,18 @@ module Google
117
117
 
118
118
  default_config.rpcs.resize.timeout = 600.0
119
119
 
120
+ default_config.rpcs.resume_instances.timeout = 600.0
121
+
120
122
  default_config.rpcs.set_instance_template.timeout = 600.0
121
123
 
122
124
  default_config.rpcs.set_target_pools.timeout = 600.0
123
125
 
126
+ default_config.rpcs.start_instances.timeout = 600.0
127
+
128
+ default_config.rpcs.stop_instances.timeout = 600.0
129
+
130
+ default_config.rpcs.suspend_instances.timeout = 600.0
131
+
124
132
  default_config.rpcs.update_per_instance_configs.timeout = 600.0
125
133
 
126
134
  default_config
@@ -208,8 +216,19 @@ module Google
208
216
  endpoint: @config.endpoint,
209
217
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
210
218
  universe_domain: @config.universe_domain,
211
- credentials: credentials
219
+ credentials: credentials,
220
+ logger: @config.logger
212
221
  )
222
+
223
+ @instance_group_managers_stub.logger(stub: true)&.info do |entry|
224
+ entry.set_system_name
225
+ entry.set_service
226
+ entry.message = "Created client for #{entry.service}"
227
+ entry.set_credentials_fields credentials
228
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
229
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
230
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
231
+ end
213
232
  end
214
233
 
215
234
  ##
@@ -219,6 +238,15 @@ module Google
219
238
  #
220
239
  attr_reader :zone_operations
221
240
 
241
+ ##
242
+ # The logger used for request/response debug logging.
243
+ #
244
+ # @return [Logger]
245
+ #
246
+ def logger
247
+ @instance_group_managers_stub.logger
248
+ end
249
+
222
250
  # Service calls
223
251
 
224
252
  ##
@@ -311,7 +339,7 @@ module Google
311
339
  options: options
312
340
  )
313
341
  yield result, response if block_given?
314
- return result
342
+ throw :response, result
315
343
  end
316
344
  rescue ::Gapic::Rest::Error => e
317
345
  raise ::Google::Cloud::Error.from_error(e)
@@ -405,7 +433,7 @@ module Google
405
433
  @instance_group_managers_stub.aggregated_list request, options do |result, operation|
406
434
  result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :aggregated_list, "items", request, result, options
407
435
  yield result, operation if block_given?
408
- return result
436
+ throw :response, result
409
437
  end
410
438
  rescue ::Gapic::Rest::Error => e
411
439
  raise ::Google::Cloud::Error.from_error(e)
@@ -499,7 +527,7 @@ module Google
499
527
  options: options
500
528
  )
501
529
  yield result, response if block_given?
502
- return result
530
+ throw :response, result
503
531
  end
504
532
  rescue ::Gapic::Rest::Error => e
505
533
  raise ::Google::Cloud::Error.from_error(e)
@@ -595,7 +623,7 @@ module Google
595
623
  options: options
596
624
  )
597
625
  yield result, response if block_given?
598
- return result
626
+ throw :response, result
599
627
  end
600
628
  rescue ::Gapic::Rest::Error => e
601
629
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,7 +717,7 @@ module Google
689
717
  options: options
690
718
  )
691
719
  yield result, response if block_given?
692
- return result
720
+ throw :response, result
693
721
  end
694
722
  rescue ::Gapic::Rest::Error => e
695
723
  raise ::Google::Cloud::Error.from_error(e)
@@ -785,7 +813,7 @@ module Google
785
813
  options: options
786
814
  )
787
815
  yield result, response if block_given?
788
- return result
816
+ throw :response, result
789
817
  end
790
818
  rescue ::Gapic::Rest::Error => e
791
819
  raise ::Google::Cloud::Error.from_error(e)
@@ -879,7 +907,7 @@ module Google
879
907
  options: options
880
908
  )
881
909
  yield result, response if block_given?
882
- return result
910
+ throw :response, result
883
911
  end
884
912
  rescue ::Gapic::Rest::Error => e
885
913
  raise ::Google::Cloud::Error.from_error(e)
@@ -962,7 +990,6 @@ module Google
962
990
 
963
991
  @instance_group_managers_stub.get request, options do |result, operation|
964
992
  yield result, operation if block_given?
965
- return result
966
993
  end
967
994
  rescue ::Gapic::Rest::Error => e
968
995
  raise ::Google::Cloud::Error.from_error(e)
@@ -1056,7 +1083,7 @@ module Google
1056
1083
  options: options
1057
1084
  )
1058
1085
  yield result, response if block_given?
1059
- return result
1086
+ throw :response, result
1060
1087
  end
1061
1088
  rescue ::Gapic::Rest::Error => e
1062
1089
  raise ::Google::Cloud::Error.from_error(e)
@@ -1148,7 +1175,7 @@ module Google
1148
1175
  @instance_group_managers_stub.list request, options do |result, operation|
1149
1176
  result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list, "items", request, result, options
1150
1177
  yield result, operation if block_given?
1151
- return result
1178
+ throw :response, result
1152
1179
  end
1153
1180
  rescue ::Gapic::Rest::Error => e
1154
1181
  raise ::Google::Cloud::Error.from_error(e)
@@ -1242,7 +1269,7 @@ module Google
1242
1269
  @instance_group_managers_stub.list_errors request, options do |result, operation|
1243
1270
  result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_errors, "items", request, result, options
1244
1271
  yield result, operation if block_given?
1245
- return result
1272
+ throw :response, result
1246
1273
  end
1247
1274
  rescue ::Gapic::Rest::Error => e
1248
1275
  raise ::Google::Cloud::Error.from_error(e)
@@ -1336,7 +1363,7 @@ module Google
1336
1363
  @instance_group_managers_stub.list_managed_instances request, options do |result, operation|
1337
1364
  result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_managed_instances, "managed_instances", request, result, options
1338
1365
  yield result, operation if block_given?
1339
- return result
1366
+ throw :response, result
1340
1367
  end
1341
1368
  rescue ::Gapic::Rest::Error => e
1342
1369
  raise ::Google::Cloud::Error.from_error(e)
@@ -1430,7 +1457,7 @@ module Google
1430
1457
  @instance_group_managers_stub.list_per_instance_configs request, options do |result, operation|
1431
1458
  result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_per_instance_configs, "items", request, result, options
1432
1459
  yield result, operation if block_given?
1433
- return result
1460
+ throw :response, result
1434
1461
  end
1435
1462
  rescue ::Gapic::Rest::Error => e
1436
1463
  raise ::Google::Cloud::Error.from_error(e)
@@ -1526,7 +1553,7 @@ module Google
1526
1553
  options: options
1527
1554
  )
1528
1555
  yield result, response if block_given?
1529
- return result
1556
+ throw :response, result
1530
1557
  end
1531
1558
  rescue ::Gapic::Rest::Error => e
1532
1559
  raise ::Google::Cloud::Error.from_error(e)
@@ -1622,7 +1649,7 @@ module Google
1622
1649
  options: options
1623
1650
  )
1624
1651
  yield result, response if block_given?
1625
- return result
1652
+ throw :response, result
1626
1653
  end
1627
1654
  rescue ::Gapic::Rest::Error => e
1628
1655
  raise ::Google::Cloud::Error.from_error(e)
@@ -1718,7 +1745,7 @@ module Google
1718
1745
  options: options
1719
1746
  )
1720
1747
  yield result, response if block_given?
1721
- return result
1748
+ throw :response, result
1722
1749
  end
1723
1750
  rescue ::Gapic::Rest::Error => e
1724
1751
  raise ::Google::Cloud::Error.from_error(e)
@@ -1814,7 +1841,103 @@ module Google
1814
1841
  options: options
1815
1842
  )
1816
1843
  yield result, response if block_given?
1817
- return result
1844
+ throw :response, result
1845
+ end
1846
+ rescue ::Gapic::Rest::Error => e
1847
+ raise ::Google::Cloud::Error.from_error(e)
1848
+ end
1849
+
1850
+ ##
1851
+ # Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request.
1852
+ #
1853
+ # @overload resume_instances(request, options = nil)
1854
+ # Pass arguments to `resume_instances` via a request object, either of type
1855
+ # {::Google::Cloud::Compute::V1::ResumeInstancesInstanceGroupManagerRequest} or an equivalent Hash.
1856
+ #
1857
+ # @param request [::Google::Cloud::Compute::V1::ResumeInstancesInstanceGroupManagerRequest, ::Hash]
1858
+ # A request object representing the call parameters. Required. To specify no
1859
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1860
+ # @param options [::Gapic::CallOptions, ::Hash]
1861
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1862
+ #
1863
+ # @overload resume_instances(instance_group_manager: nil, instance_group_managers_resume_instances_request_resource: nil, project: nil, request_id: nil, zone: nil)
1864
+ # Pass arguments to `resume_instances` via keyword arguments. Note that at
1865
+ # least one keyword argument is required. To specify no parameters, or to keep all
1866
+ # the default parameter values, pass an empty Hash as a request object (see above).
1867
+ #
1868
+ # @param instance_group_manager [::String]
1869
+ # The name of the managed instance group.
1870
+ # @param instance_group_managers_resume_instances_request_resource [::Google::Cloud::Compute::V1::InstanceGroupManagersResumeInstancesRequest, ::Hash]
1871
+ # The body resource for this request
1872
+ # @param project [::String]
1873
+ # Project ID for this request.
1874
+ # @param request_id [::String]
1875
+ # 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).
1876
+ # @param zone [::String]
1877
+ # The name of the zone where the managed instance group is located.
1878
+ # @yield [result, operation] Access the result along with the TransportOperation object
1879
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1880
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1881
+ #
1882
+ # @return [::Gapic::GenericLRO::Operation]
1883
+ #
1884
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1885
+ #
1886
+ # @example Basic example
1887
+ # require "google/cloud/compute/v1"
1888
+ #
1889
+ # # Create a client object. The client can be reused for multiple calls.
1890
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new
1891
+ #
1892
+ # # Create a request. To set request fields, pass in keyword arguments.
1893
+ # request = Google::Cloud::Compute::V1::ResumeInstancesInstanceGroupManagerRequest.new
1894
+ #
1895
+ # # Call the resume_instances method.
1896
+ # result = client.resume_instances request
1897
+ #
1898
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1899
+ # p result
1900
+ #
1901
+ def resume_instances request, options = nil
1902
+ raise ::ArgumentError, "request must be provided" if request.nil?
1903
+
1904
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResumeInstancesInstanceGroupManagerRequest
1905
+
1906
+ # Converts hash and nil to an options object
1907
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1908
+
1909
+ # Customize the options with defaults
1910
+ call_metadata = @config.rpcs.resume_instances.metadata.to_h
1911
+
1912
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1913
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1914
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1915
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1916
+ transports_version_send: [:rest]
1917
+
1918
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1919
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1920
+
1921
+ options.apply_defaults timeout: @config.rpcs.resume_instances.timeout,
1922
+ metadata: call_metadata,
1923
+ retry_policy: @config.rpcs.resume_instances.retry_policy
1924
+
1925
+ options.apply_defaults timeout: @config.timeout,
1926
+ metadata: @config.metadata,
1927
+ retry_policy: @config.retry_policy
1928
+
1929
+ @instance_group_managers_stub.resume_instances request, options do |result, response|
1930
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
1931
+ operation: result,
1932
+ client: zone_operations,
1933
+ request_values: {
1934
+ "project" => request.project,
1935
+ "zone" => request.zone
1936
+ },
1937
+ options: options
1938
+ )
1939
+ yield result, response if block_given?
1940
+ throw :response, result
1818
1941
  end
1819
1942
  rescue ::Gapic::Rest::Error => e
1820
1943
  raise ::Google::Cloud::Error.from_error(e)
@@ -1910,7 +2033,7 @@ module Google
1910
2033
  options: options
1911
2034
  )
1912
2035
  yield result, response if block_given?
1913
- return result
2036
+ throw :response, result
1914
2037
  end
1915
2038
  rescue ::Gapic::Rest::Error => e
1916
2039
  raise ::Google::Cloud::Error.from_error(e)
@@ -2006,7 +2129,295 @@ module Google
2006
2129
  options: options
2007
2130
  )
2008
2131
  yield result, response if block_given?
2009
- return result
2132
+ throw :response, result
2133
+ end
2134
+ rescue ::Gapic::Rest::Error => e
2135
+ raise ::Google::Cloud::Error.from_error(e)
2136
+ end
2137
+
2138
+ ##
2139
+ # Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request.
2140
+ #
2141
+ # @overload start_instances(request, options = nil)
2142
+ # Pass arguments to `start_instances` via a request object, either of type
2143
+ # {::Google::Cloud::Compute::V1::StartInstancesInstanceGroupManagerRequest} or an equivalent Hash.
2144
+ #
2145
+ # @param request [::Google::Cloud::Compute::V1::StartInstancesInstanceGroupManagerRequest, ::Hash]
2146
+ # A request object representing the call parameters. Required. To specify no
2147
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2148
+ # @param options [::Gapic::CallOptions, ::Hash]
2149
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2150
+ #
2151
+ # @overload start_instances(instance_group_manager: nil, instance_group_managers_start_instances_request_resource: nil, project: nil, request_id: nil, zone: nil)
2152
+ # Pass arguments to `start_instances` via keyword arguments. Note that at
2153
+ # least one keyword argument is required. To specify no parameters, or to keep all
2154
+ # the default parameter values, pass an empty Hash as a request object (see above).
2155
+ #
2156
+ # @param instance_group_manager [::String]
2157
+ # The name of the managed instance group.
2158
+ # @param instance_group_managers_start_instances_request_resource [::Google::Cloud::Compute::V1::InstanceGroupManagersStartInstancesRequest, ::Hash]
2159
+ # The body resource for this request
2160
+ # @param project [::String]
2161
+ # Project ID for this request.
2162
+ # @param request_id [::String]
2163
+ # 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).
2164
+ # @param zone [::String]
2165
+ # The name of the zone where the managed instance group is located.
2166
+ # @yield [result, operation] Access the result along with the TransportOperation object
2167
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2168
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2169
+ #
2170
+ # @return [::Gapic::GenericLRO::Operation]
2171
+ #
2172
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2173
+ #
2174
+ # @example Basic example
2175
+ # require "google/cloud/compute/v1"
2176
+ #
2177
+ # # Create a client object. The client can be reused for multiple calls.
2178
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new
2179
+ #
2180
+ # # Create a request. To set request fields, pass in keyword arguments.
2181
+ # request = Google::Cloud::Compute::V1::StartInstancesInstanceGroupManagerRequest.new
2182
+ #
2183
+ # # Call the start_instances method.
2184
+ # result = client.start_instances request
2185
+ #
2186
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2187
+ # p result
2188
+ #
2189
+ def start_instances request, options = nil
2190
+ raise ::ArgumentError, "request must be provided" if request.nil?
2191
+
2192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartInstancesInstanceGroupManagerRequest
2193
+
2194
+ # Converts hash and nil to an options object
2195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2196
+
2197
+ # Customize the options with defaults
2198
+ call_metadata = @config.rpcs.start_instances.metadata.to_h
2199
+
2200
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2203
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2204
+ transports_version_send: [:rest]
2205
+
2206
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2207
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2208
+
2209
+ options.apply_defaults timeout: @config.rpcs.start_instances.timeout,
2210
+ metadata: call_metadata,
2211
+ retry_policy: @config.rpcs.start_instances.retry_policy
2212
+
2213
+ options.apply_defaults timeout: @config.timeout,
2214
+ metadata: @config.metadata,
2215
+ retry_policy: @config.retry_policy
2216
+
2217
+ @instance_group_managers_stub.start_instances request, options do |result, response|
2218
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
2219
+ operation: result,
2220
+ client: zone_operations,
2221
+ request_values: {
2222
+ "project" => request.project,
2223
+ "zone" => request.zone
2224
+ },
2225
+ options: options
2226
+ )
2227
+ yield result, response if block_given?
2228
+ throw :response, result
2229
+ end
2230
+ rescue ::Gapic::Rest::Error => e
2231
+ raise ::Google::Cloud::Error.from_error(e)
2232
+ end
2233
+
2234
+ ##
2235
+ # Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request.
2236
+ #
2237
+ # @overload stop_instances(request, options = nil)
2238
+ # Pass arguments to `stop_instances` via a request object, either of type
2239
+ # {::Google::Cloud::Compute::V1::StopInstancesInstanceGroupManagerRequest} or an equivalent Hash.
2240
+ #
2241
+ # @param request [::Google::Cloud::Compute::V1::StopInstancesInstanceGroupManagerRequest, ::Hash]
2242
+ # A request object representing the call parameters. Required. To specify no
2243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2244
+ # @param options [::Gapic::CallOptions, ::Hash]
2245
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2246
+ #
2247
+ # @overload stop_instances(instance_group_manager: nil, instance_group_managers_stop_instances_request_resource: nil, project: nil, request_id: nil, zone: nil)
2248
+ # Pass arguments to `stop_instances` via keyword arguments. Note that at
2249
+ # least one keyword argument is required. To specify no parameters, or to keep all
2250
+ # the default parameter values, pass an empty Hash as a request object (see above).
2251
+ #
2252
+ # @param instance_group_manager [::String]
2253
+ # The name of the managed instance group.
2254
+ # @param instance_group_managers_stop_instances_request_resource [::Google::Cloud::Compute::V1::InstanceGroupManagersStopInstancesRequest, ::Hash]
2255
+ # The body resource for this request
2256
+ # @param project [::String]
2257
+ # Project ID for this request.
2258
+ # @param request_id [::String]
2259
+ # 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).
2260
+ # @param zone [::String]
2261
+ # The name of the zone where the managed instance group is located.
2262
+ # @yield [result, operation] Access the result along with the TransportOperation object
2263
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2265
+ #
2266
+ # @return [::Gapic::GenericLRO::Operation]
2267
+ #
2268
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2269
+ #
2270
+ # @example Basic example
2271
+ # require "google/cloud/compute/v1"
2272
+ #
2273
+ # # Create a client object. The client can be reused for multiple calls.
2274
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new
2275
+ #
2276
+ # # Create a request. To set request fields, pass in keyword arguments.
2277
+ # request = Google::Cloud::Compute::V1::StopInstancesInstanceGroupManagerRequest.new
2278
+ #
2279
+ # # Call the stop_instances method.
2280
+ # result = client.stop_instances request
2281
+ #
2282
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2283
+ # p result
2284
+ #
2285
+ def stop_instances request, options = nil
2286
+ raise ::ArgumentError, "request must be provided" if request.nil?
2287
+
2288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StopInstancesInstanceGroupManagerRequest
2289
+
2290
+ # Converts hash and nil to an options object
2291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2292
+
2293
+ # Customize the options with defaults
2294
+ call_metadata = @config.rpcs.stop_instances.metadata.to_h
2295
+
2296
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2297
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2299
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2300
+ transports_version_send: [:rest]
2301
+
2302
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2303
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2304
+
2305
+ options.apply_defaults timeout: @config.rpcs.stop_instances.timeout,
2306
+ metadata: call_metadata,
2307
+ retry_policy: @config.rpcs.stop_instances.retry_policy
2308
+
2309
+ options.apply_defaults timeout: @config.timeout,
2310
+ metadata: @config.metadata,
2311
+ retry_policy: @config.retry_policy
2312
+
2313
+ @instance_group_managers_stub.stop_instances request, options do |result, response|
2314
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
2315
+ operation: result,
2316
+ client: zone_operations,
2317
+ request_values: {
2318
+ "project" => request.project,
2319
+ "zone" => request.zone
2320
+ },
2321
+ options: options
2322
+ )
2323
+ yield result, response if block_given?
2324
+ throw :response, result
2325
+ end
2326
+ rescue ::Gapic::Rest::Error => e
2327
+ raise ::Google::Cloud::Error.from_error(e)
2328
+ end
2329
+
2330
+ ##
2331
+ # Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request.
2332
+ #
2333
+ # @overload suspend_instances(request, options = nil)
2334
+ # Pass arguments to `suspend_instances` via a request object, either of type
2335
+ # {::Google::Cloud::Compute::V1::SuspendInstancesInstanceGroupManagerRequest} or an equivalent Hash.
2336
+ #
2337
+ # @param request [::Google::Cloud::Compute::V1::SuspendInstancesInstanceGroupManagerRequest, ::Hash]
2338
+ # A request object representing the call parameters. Required. To specify no
2339
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2340
+ # @param options [::Gapic::CallOptions, ::Hash]
2341
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2342
+ #
2343
+ # @overload suspend_instances(instance_group_manager: nil, instance_group_managers_suspend_instances_request_resource: nil, project: nil, request_id: nil, zone: nil)
2344
+ # Pass arguments to `suspend_instances` via keyword arguments. Note that at
2345
+ # least one keyword argument is required. To specify no parameters, or to keep all
2346
+ # the default parameter values, pass an empty Hash as a request object (see above).
2347
+ #
2348
+ # @param instance_group_manager [::String]
2349
+ # The name of the managed instance group.
2350
+ # @param instance_group_managers_suspend_instances_request_resource [::Google::Cloud::Compute::V1::InstanceGroupManagersSuspendInstancesRequest, ::Hash]
2351
+ # The body resource for this request
2352
+ # @param project [::String]
2353
+ # Project ID for this request.
2354
+ # @param request_id [::String]
2355
+ # 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).
2356
+ # @param zone [::String]
2357
+ # The name of the zone where the managed instance group is located.
2358
+ # @yield [result, operation] Access the result along with the TransportOperation object
2359
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2360
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2361
+ #
2362
+ # @return [::Gapic::GenericLRO::Operation]
2363
+ #
2364
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2365
+ #
2366
+ # @example Basic example
2367
+ # require "google/cloud/compute/v1"
2368
+ #
2369
+ # # Create a client object. The client can be reused for multiple calls.
2370
+ # client = Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new
2371
+ #
2372
+ # # Create a request. To set request fields, pass in keyword arguments.
2373
+ # request = Google::Cloud::Compute::V1::SuspendInstancesInstanceGroupManagerRequest.new
2374
+ #
2375
+ # # Call the suspend_instances method.
2376
+ # result = client.suspend_instances request
2377
+ #
2378
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2379
+ # p result
2380
+ #
2381
+ def suspend_instances request, options = nil
2382
+ raise ::ArgumentError, "request must be provided" if request.nil?
2383
+
2384
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SuspendInstancesInstanceGroupManagerRequest
2385
+
2386
+ # Converts hash and nil to an options object
2387
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2388
+
2389
+ # Customize the options with defaults
2390
+ call_metadata = @config.rpcs.suspend_instances.metadata.to_h
2391
+
2392
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2393
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2394
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2395
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2396
+ transports_version_send: [:rest]
2397
+
2398
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2399
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2400
+
2401
+ options.apply_defaults timeout: @config.rpcs.suspend_instances.timeout,
2402
+ metadata: call_metadata,
2403
+ retry_policy: @config.rpcs.suspend_instances.retry_policy
2404
+
2405
+ options.apply_defaults timeout: @config.timeout,
2406
+ metadata: @config.metadata,
2407
+ retry_policy: @config.retry_policy
2408
+
2409
+ @instance_group_managers_stub.suspend_instances request, options do |result, response|
2410
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
2411
+ operation: result,
2412
+ client: zone_operations,
2413
+ request_values: {
2414
+ "project" => request.project,
2415
+ "zone" => request.zone
2416
+ },
2417
+ options: options
2418
+ )
2419
+ yield result, response if block_given?
2420
+ throw :response, result
2010
2421
  end
2011
2422
  rescue ::Gapic::Rest::Error => e
2012
2423
  raise ::Google::Cloud::Error.from_error(e)
@@ -2102,7 +2513,7 @@ module Google
2102
2513
  options: options
2103
2514
  )
2104
2515
  yield result, response if block_given?
2105
- return result
2516
+ throw :response, result
2106
2517
  end
2107
2518
  rescue ::Gapic::Rest::Error => e
2108
2519
  raise ::Google::Cloud::Error.from_error(e)
@@ -2182,6 +2593,11 @@ module Google
2182
2593
  # default endpoint URL. The default value of nil uses the environment
2183
2594
  # universe (usually the default "googleapis.com" universe).
2184
2595
  # @return [::String,nil]
2596
+ # @!attribute [rw] logger
2597
+ # A custom logger to use for request/response debug logging, or the value
2598
+ # `:default` (the default) to construct a default logger, or `nil` to
2599
+ # explicitly disable logging.
2600
+ # @return [::Logger,:default,nil]
2185
2601
  #
2186
2602
  class Configuration
2187
2603
  extend ::Gapic::Config
@@ -2203,6 +2619,7 @@ module Google
2203
2619
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2204
2620
  config_attr :quota_project, nil, ::String, nil
2205
2621
  config_attr :universe_domain, nil, ::String, nil
2622
+ config_attr :logger, :default, ::Logger, nil, :default
2206
2623
 
2207
2624
  # @private
2208
2625
  def initialize parent_config = nil
@@ -2327,6 +2744,11 @@ module Google
2327
2744
  #
2328
2745
  attr_reader :resize
2329
2746
  ##
2747
+ # RPC-specific configuration for `resume_instances`
2748
+ # @return [::Gapic::Config::Method]
2749
+ #
2750
+ attr_reader :resume_instances
2751
+ ##
2330
2752
  # RPC-specific configuration for `set_instance_template`
2331
2753
  # @return [::Gapic::Config::Method]
2332
2754
  #
@@ -2337,6 +2759,21 @@ module Google
2337
2759
  #
2338
2760
  attr_reader :set_target_pools
2339
2761
  ##
2762
+ # RPC-specific configuration for `start_instances`
2763
+ # @return [::Gapic::Config::Method]
2764
+ #
2765
+ attr_reader :start_instances
2766
+ ##
2767
+ # RPC-specific configuration for `stop_instances`
2768
+ # @return [::Gapic::Config::Method]
2769
+ #
2770
+ attr_reader :stop_instances
2771
+ ##
2772
+ # RPC-specific configuration for `suspend_instances`
2773
+ # @return [::Gapic::Config::Method]
2774
+ #
2775
+ attr_reader :suspend_instances
2776
+ ##
2340
2777
  # RPC-specific configuration for `update_per_instance_configs`
2341
2778
  # @return [::Gapic::Config::Method]
2342
2779
  #
@@ -2378,10 +2815,18 @@ module Google
2378
2815
  @recreate_instances = ::Gapic::Config::Method.new recreate_instances_config
2379
2816
  resize_config = parent_rpcs.resize if parent_rpcs.respond_to? :resize
2380
2817
  @resize = ::Gapic::Config::Method.new resize_config
2818
+ resume_instances_config = parent_rpcs.resume_instances if parent_rpcs.respond_to? :resume_instances
2819
+ @resume_instances = ::Gapic::Config::Method.new resume_instances_config
2381
2820
  set_instance_template_config = parent_rpcs.set_instance_template if parent_rpcs.respond_to? :set_instance_template
2382
2821
  @set_instance_template = ::Gapic::Config::Method.new set_instance_template_config
2383
2822
  set_target_pools_config = parent_rpcs.set_target_pools if parent_rpcs.respond_to? :set_target_pools
2384
2823
  @set_target_pools = ::Gapic::Config::Method.new set_target_pools_config
2824
+ start_instances_config = parent_rpcs.start_instances if parent_rpcs.respond_to? :start_instances
2825
+ @start_instances = ::Gapic::Config::Method.new start_instances_config
2826
+ stop_instances_config = parent_rpcs.stop_instances if parent_rpcs.respond_to? :stop_instances
2827
+ @stop_instances = ::Gapic::Config::Method.new stop_instances_config
2828
+ suspend_instances_config = parent_rpcs.suspend_instances if parent_rpcs.respond_to? :suspend_instances
2829
+ @suspend_instances = ::Gapic::Config::Method.new suspend_instances_config
2385
2830
  update_per_instance_configs_config = parent_rpcs.update_per_instance_configs if parent_rpcs.respond_to? :update_per_instance_configs
2386
2831
  @update_per_instance_configs = ::Gapic::Config::Method.new update_per_instance_configs_config
2387
2832