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
@@ -112,10 +112,18 @@ module Google
112
112
 
113
113
  default_config.rpcs.resize.timeout = 600.0
114
114
 
115
+ default_config.rpcs.resume_instances.timeout = 600.0
116
+
115
117
  default_config.rpcs.set_instance_template.timeout = 600.0
116
118
 
117
119
  default_config.rpcs.set_target_pools.timeout = 600.0
118
120
 
121
+ default_config.rpcs.start_instances.timeout = 600.0
122
+
123
+ default_config.rpcs.stop_instances.timeout = 600.0
124
+
125
+ default_config.rpcs.suspend_instances.timeout = 600.0
126
+
119
127
  default_config.rpcs.update_per_instance_configs.timeout = 600.0
120
128
 
121
129
  default_config
@@ -203,8 +211,19 @@ module Google
203
211
  endpoint: @config.endpoint,
204
212
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
205
213
  universe_domain: @config.universe_domain,
206
- credentials: credentials
214
+ credentials: credentials,
215
+ logger: @config.logger
207
216
  )
217
+
218
+ @region_instance_group_managers_stub.logger(stub: true)&.info do |entry|
219
+ entry.set_system_name
220
+ entry.set_service
221
+ entry.message = "Created client for #{entry.service}"
222
+ entry.set_credentials_fields credentials
223
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
224
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
225
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
226
+ end
208
227
  end
209
228
 
210
229
  ##
@@ -214,6 +233,15 @@ module Google
214
233
  #
215
234
  attr_reader :region_operations
216
235
 
236
+ ##
237
+ # The logger used for request/response debug logging.
238
+ #
239
+ # @return [Logger]
240
+ #
241
+ def logger
242
+ @region_instance_group_managers_stub.logger
243
+ end
244
+
217
245
  # Service calls
218
246
 
219
247
  ##
@@ -306,7 +334,7 @@ module Google
306
334
  options: options
307
335
  )
308
336
  yield result, response if block_given?
309
- return result
337
+ throw :response, result
310
338
  end
311
339
  rescue ::Gapic::Rest::Error => e
312
340
  raise ::Google::Cloud::Error.from_error(e)
@@ -400,7 +428,7 @@ module Google
400
428
  options: options
401
429
  )
402
430
  yield result, response if block_given?
403
- return result
431
+ throw :response, result
404
432
  end
405
433
  rescue ::Gapic::Rest::Error => e
406
434
  raise ::Google::Cloud::Error.from_error(e)
@@ -496,7 +524,7 @@ module Google
496
524
  options: options
497
525
  )
498
526
  yield result, response if block_given?
499
- return result
527
+ throw :response, result
500
528
  end
501
529
  rescue ::Gapic::Rest::Error => e
502
530
  raise ::Google::Cloud::Error.from_error(e)
@@ -590,7 +618,7 @@ module Google
590
618
  options: options
591
619
  )
592
620
  yield result, response if block_given?
593
- return result
621
+ throw :response, result
594
622
  end
595
623
  rescue ::Gapic::Rest::Error => e
596
624
  raise ::Google::Cloud::Error.from_error(e)
@@ -686,7 +714,7 @@ module Google
686
714
  options: options
687
715
  )
688
716
  yield result, response if block_given?
689
- return result
717
+ throw :response, result
690
718
  end
691
719
  rescue ::Gapic::Rest::Error => e
692
720
  raise ::Google::Cloud::Error.from_error(e)
@@ -780,7 +808,7 @@ module Google
780
808
  options: options
781
809
  )
782
810
  yield result, response if block_given?
783
- return result
811
+ throw :response, result
784
812
  end
785
813
  rescue ::Gapic::Rest::Error => e
786
814
  raise ::Google::Cloud::Error.from_error(e)
@@ -863,7 +891,6 @@ module Google
863
891
 
864
892
  @region_instance_group_managers_stub.get request, options do |result, operation|
865
893
  yield result, operation if block_given?
866
- return result
867
894
  end
868
895
  rescue ::Gapic::Rest::Error => e
869
896
  raise ::Google::Cloud::Error.from_error(e)
@@ -957,7 +984,7 @@ module Google
957
984
  options: options
958
985
  )
959
986
  yield result, response if block_given?
960
- return result
987
+ throw :response, result
961
988
  end
962
989
  rescue ::Gapic::Rest::Error => e
963
990
  raise ::Google::Cloud::Error.from_error(e)
@@ -1049,7 +1076,7 @@ module Google
1049
1076
  @region_instance_group_managers_stub.list request, options do |result, operation|
1050
1077
  result = ::Gapic::Rest::PagedEnumerable.new @region_instance_group_managers_stub, :list, "items", request, result, options
1051
1078
  yield result, operation if block_given?
1052
- return result
1079
+ throw :response, result
1053
1080
  end
1054
1081
  rescue ::Gapic::Rest::Error => e
1055
1082
  raise ::Google::Cloud::Error.from_error(e)
@@ -1143,7 +1170,7 @@ module Google
1143
1170
  @region_instance_group_managers_stub.list_errors request, options do |result, operation|
1144
1171
  result = ::Gapic::Rest::PagedEnumerable.new @region_instance_group_managers_stub, :list_errors, "items", request, result, options
1145
1172
  yield result, operation if block_given?
1146
- return result
1173
+ throw :response, result
1147
1174
  end
1148
1175
  rescue ::Gapic::Rest::Error => e
1149
1176
  raise ::Google::Cloud::Error.from_error(e)
@@ -1237,7 +1264,7 @@ module Google
1237
1264
  @region_instance_group_managers_stub.list_managed_instances request, options do |result, operation|
1238
1265
  result = ::Gapic::Rest::PagedEnumerable.new @region_instance_group_managers_stub, :list_managed_instances, "managed_instances", request, result, options
1239
1266
  yield result, operation if block_given?
1240
- return result
1267
+ throw :response, result
1241
1268
  end
1242
1269
  rescue ::Gapic::Rest::Error => e
1243
1270
  raise ::Google::Cloud::Error.from_error(e)
@@ -1331,7 +1358,7 @@ module Google
1331
1358
  @region_instance_group_managers_stub.list_per_instance_configs request, options do |result, operation|
1332
1359
  result = ::Gapic::Rest::PagedEnumerable.new @region_instance_group_managers_stub, :list_per_instance_configs, "items", request, result, options
1333
1360
  yield result, operation if block_given?
1334
- return result
1361
+ throw :response, result
1335
1362
  end
1336
1363
  rescue ::Gapic::Rest::Error => e
1337
1364
  raise ::Google::Cloud::Error.from_error(e)
@@ -1427,7 +1454,7 @@ module Google
1427
1454
  options: options
1428
1455
  )
1429
1456
  yield result, response if block_given?
1430
- return result
1457
+ throw :response, result
1431
1458
  end
1432
1459
  rescue ::Gapic::Rest::Error => e
1433
1460
  raise ::Google::Cloud::Error.from_error(e)
@@ -1523,7 +1550,7 @@ module Google
1523
1550
  options: options
1524
1551
  )
1525
1552
  yield result, response if block_given?
1526
- return result
1553
+ throw :response, result
1527
1554
  end
1528
1555
  rescue ::Gapic::Rest::Error => e
1529
1556
  raise ::Google::Cloud::Error.from_error(e)
@@ -1619,7 +1646,7 @@ module Google
1619
1646
  options: options
1620
1647
  )
1621
1648
  yield result, response if block_given?
1622
- return result
1649
+ throw :response, result
1623
1650
  end
1624
1651
  rescue ::Gapic::Rest::Error => e
1625
1652
  raise ::Google::Cloud::Error.from_error(e)
@@ -1715,7 +1742,103 @@ module Google
1715
1742
  options: options
1716
1743
  )
1717
1744
  yield result, response if block_given?
1718
- return result
1745
+ throw :response, result
1746
+ end
1747
+ rescue ::Gapic::Rest::Error => e
1748
+ raise ::Google::Cloud::Error.from_error(e)
1749
+ end
1750
+
1751
+ ##
1752
+ # 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.
1753
+ #
1754
+ # @overload resume_instances(request, options = nil)
1755
+ # Pass arguments to `resume_instances` via a request object, either of type
1756
+ # {::Google::Cloud::Compute::V1::ResumeInstancesRegionInstanceGroupManagerRequest} or an equivalent Hash.
1757
+ #
1758
+ # @param request [::Google::Cloud::Compute::V1::ResumeInstancesRegionInstanceGroupManagerRequest, ::Hash]
1759
+ # A request object representing the call parameters. Required. To specify no
1760
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1761
+ # @param options [::Gapic::CallOptions, ::Hash]
1762
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1763
+ #
1764
+ # @overload resume_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_resume_instances_request_resource: nil, request_id: nil)
1765
+ # Pass arguments to `resume_instances` via keyword arguments. Note that at
1766
+ # least one keyword argument is required. To specify no parameters, or to keep all
1767
+ # the default parameter values, pass an empty Hash as a request object (see above).
1768
+ #
1769
+ # @param instance_group_manager [::String]
1770
+ # Name of the managed instance group.
1771
+ # @param project [::String]
1772
+ # Project ID for this request.
1773
+ # @param region [::String]
1774
+ # Name of the region scoping this request.
1775
+ # @param region_instance_group_managers_resume_instances_request_resource [::Google::Cloud::Compute::V1::RegionInstanceGroupManagersResumeInstancesRequest, ::Hash]
1776
+ # The body resource for this request
1777
+ # @param request_id [::String]
1778
+ # 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).
1779
+ # @yield [result, operation] Access the result along with the TransportOperation object
1780
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1781
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1782
+ #
1783
+ # @return [::Gapic::GenericLRO::Operation]
1784
+ #
1785
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1786
+ #
1787
+ # @example Basic example
1788
+ # require "google/cloud/compute/v1"
1789
+ #
1790
+ # # Create a client object. The client can be reused for multiple calls.
1791
+ # client = Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.new
1792
+ #
1793
+ # # Create a request. To set request fields, pass in keyword arguments.
1794
+ # request = Google::Cloud::Compute::V1::ResumeInstancesRegionInstanceGroupManagerRequest.new
1795
+ #
1796
+ # # Call the resume_instances method.
1797
+ # result = client.resume_instances request
1798
+ #
1799
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1800
+ # p result
1801
+ #
1802
+ def resume_instances request, options = nil
1803
+ raise ::ArgumentError, "request must be provided" if request.nil?
1804
+
1805
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResumeInstancesRegionInstanceGroupManagerRequest
1806
+
1807
+ # Converts hash and nil to an options object
1808
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1809
+
1810
+ # Customize the options with defaults
1811
+ call_metadata = @config.rpcs.resume_instances.metadata.to_h
1812
+
1813
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1814
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1815
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1816
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1817
+ transports_version_send: [:rest]
1818
+
1819
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1820
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1821
+
1822
+ options.apply_defaults timeout: @config.rpcs.resume_instances.timeout,
1823
+ metadata: call_metadata,
1824
+ retry_policy: @config.rpcs.resume_instances.retry_policy
1825
+
1826
+ options.apply_defaults timeout: @config.timeout,
1827
+ metadata: @config.metadata,
1828
+ retry_policy: @config.retry_policy
1829
+
1830
+ @region_instance_group_managers_stub.resume_instances request, options do |result, response|
1831
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
1832
+ operation: result,
1833
+ client: region_operations,
1834
+ request_values: {
1835
+ "project" => request.project,
1836
+ "region" => request.region
1837
+ },
1838
+ options: options
1839
+ )
1840
+ yield result, response if block_given?
1841
+ throw :response, result
1719
1842
  end
1720
1843
  rescue ::Gapic::Rest::Error => e
1721
1844
  raise ::Google::Cloud::Error.from_error(e)
@@ -1811,7 +1934,7 @@ module Google
1811
1934
  options: options
1812
1935
  )
1813
1936
  yield result, response if block_given?
1814
- return result
1937
+ throw :response, result
1815
1938
  end
1816
1939
  rescue ::Gapic::Rest::Error => e
1817
1940
  raise ::Google::Cloud::Error.from_error(e)
@@ -1907,7 +2030,295 @@ module Google
1907
2030
  options: options
1908
2031
  )
1909
2032
  yield result, response if block_given?
1910
- return result
2033
+ throw :response, result
2034
+ end
2035
+ rescue ::Gapic::Rest::Error => e
2036
+ raise ::Google::Cloud::Error.from_error(e)
2037
+ end
2038
+
2039
+ ##
2040
+ # 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.
2041
+ #
2042
+ # @overload start_instances(request, options = nil)
2043
+ # Pass arguments to `start_instances` via a request object, either of type
2044
+ # {::Google::Cloud::Compute::V1::StartInstancesRegionInstanceGroupManagerRequest} or an equivalent Hash.
2045
+ #
2046
+ # @param request [::Google::Cloud::Compute::V1::StartInstancesRegionInstanceGroupManagerRequest, ::Hash]
2047
+ # A request object representing the call parameters. Required. To specify no
2048
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2049
+ # @param options [::Gapic::CallOptions, ::Hash]
2050
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2051
+ #
2052
+ # @overload start_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_start_instances_request_resource: nil, request_id: nil)
2053
+ # Pass arguments to `start_instances` via keyword arguments. Note that at
2054
+ # least one keyword argument is required. To specify no parameters, or to keep all
2055
+ # the default parameter values, pass an empty Hash as a request object (see above).
2056
+ #
2057
+ # @param instance_group_manager [::String]
2058
+ # Name of the managed instance group.
2059
+ # @param project [::String]
2060
+ # Project ID for this request.
2061
+ # @param region [::String]
2062
+ # Name of the region scoping this request.
2063
+ # @param region_instance_group_managers_start_instances_request_resource [::Google::Cloud::Compute::V1::RegionInstanceGroupManagersStartInstancesRequest, ::Hash]
2064
+ # The body resource for this request
2065
+ # @param request_id [::String]
2066
+ # 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).
2067
+ # @yield [result, operation] Access the result along with the TransportOperation object
2068
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2069
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2070
+ #
2071
+ # @return [::Gapic::GenericLRO::Operation]
2072
+ #
2073
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2074
+ #
2075
+ # @example Basic example
2076
+ # require "google/cloud/compute/v1"
2077
+ #
2078
+ # # Create a client object. The client can be reused for multiple calls.
2079
+ # client = Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.new
2080
+ #
2081
+ # # Create a request. To set request fields, pass in keyword arguments.
2082
+ # request = Google::Cloud::Compute::V1::StartInstancesRegionInstanceGroupManagerRequest.new
2083
+ #
2084
+ # # Call the start_instances method.
2085
+ # result = client.start_instances request
2086
+ #
2087
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2088
+ # p result
2089
+ #
2090
+ def start_instances request, options = nil
2091
+ raise ::ArgumentError, "request must be provided" if request.nil?
2092
+
2093
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartInstancesRegionInstanceGroupManagerRequest
2094
+
2095
+ # Converts hash and nil to an options object
2096
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2097
+
2098
+ # Customize the options with defaults
2099
+ call_metadata = @config.rpcs.start_instances.metadata.to_h
2100
+
2101
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2102
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2103
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2104
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2105
+ transports_version_send: [:rest]
2106
+
2107
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2108
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2109
+
2110
+ options.apply_defaults timeout: @config.rpcs.start_instances.timeout,
2111
+ metadata: call_metadata,
2112
+ retry_policy: @config.rpcs.start_instances.retry_policy
2113
+
2114
+ options.apply_defaults timeout: @config.timeout,
2115
+ metadata: @config.metadata,
2116
+ retry_policy: @config.retry_policy
2117
+
2118
+ @region_instance_group_managers_stub.start_instances request, options do |result, response|
2119
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
2120
+ operation: result,
2121
+ client: region_operations,
2122
+ request_values: {
2123
+ "project" => request.project,
2124
+ "region" => request.region
2125
+ },
2126
+ options: options
2127
+ )
2128
+ yield result, response if block_given?
2129
+ throw :response, result
2130
+ end
2131
+ rescue ::Gapic::Rest::Error => e
2132
+ raise ::Google::Cloud::Error.from_error(e)
2133
+ end
2134
+
2135
+ ##
2136
+ # 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.
2137
+ #
2138
+ # @overload stop_instances(request, options = nil)
2139
+ # Pass arguments to `stop_instances` via a request object, either of type
2140
+ # {::Google::Cloud::Compute::V1::StopInstancesRegionInstanceGroupManagerRequest} or an equivalent Hash.
2141
+ #
2142
+ # @param request [::Google::Cloud::Compute::V1::StopInstancesRegionInstanceGroupManagerRequest, ::Hash]
2143
+ # A request object representing the call parameters. Required. To specify no
2144
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2145
+ # @param options [::Gapic::CallOptions, ::Hash]
2146
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2147
+ #
2148
+ # @overload stop_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_stop_instances_request_resource: nil, request_id: nil)
2149
+ # Pass arguments to `stop_instances` via keyword arguments. Note that at
2150
+ # least one keyword argument is required. To specify no parameters, or to keep all
2151
+ # the default parameter values, pass an empty Hash as a request object (see above).
2152
+ #
2153
+ # @param instance_group_manager [::String]
2154
+ # The name of the managed instance group.
2155
+ # @param project [::String]
2156
+ # Project ID for this request.
2157
+ # @param region [::String]
2158
+ # Name of the region scoping this request.
2159
+ # @param region_instance_group_managers_stop_instances_request_resource [::Google::Cloud::Compute::V1::RegionInstanceGroupManagersStopInstancesRequest, ::Hash]
2160
+ # The body resource for this request
2161
+ # @param request_id [::String]
2162
+ # 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).
2163
+ # @yield [result, operation] Access the result along with the TransportOperation object
2164
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2165
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2166
+ #
2167
+ # @return [::Gapic::GenericLRO::Operation]
2168
+ #
2169
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2170
+ #
2171
+ # @example Basic example
2172
+ # require "google/cloud/compute/v1"
2173
+ #
2174
+ # # Create a client object. The client can be reused for multiple calls.
2175
+ # client = Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.new
2176
+ #
2177
+ # # Create a request. To set request fields, pass in keyword arguments.
2178
+ # request = Google::Cloud::Compute::V1::StopInstancesRegionInstanceGroupManagerRequest.new
2179
+ #
2180
+ # # Call the stop_instances method.
2181
+ # result = client.stop_instances request
2182
+ #
2183
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2184
+ # p result
2185
+ #
2186
+ def stop_instances request, options = nil
2187
+ raise ::ArgumentError, "request must be provided" if request.nil?
2188
+
2189
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StopInstancesRegionInstanceGroupManagerRequest
2190
+
2191
+ # Converts hash and nil to an options object
2192
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2193
+
2194
+ # Customize the options with defaults
2195
+ call_metadata = @config.rpcs.stop_instances.metadata.to_h
2196
+
2197
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2198
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2199
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2200
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2201
+ transports_version_send: [:rest]
2202
+
2203
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2204
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2205
+
2206
+ options.apply_defaults timeout: @config.rpcs.stop_instances.timeout,
2207
+ metadata: call_metadata,
2208
+ retry_policy: @config.rpcs.stop_instances.retry_policy
2209
+
2210
+ options.apply_defaults timeout: @config.timeout,
2211
+ metadata: @config.metadata,
2212
+ retry_policy: @config.retry_policy
2213
+
2214
+ @region_instance_group_managers_stub.stop_instances request, options do |result, response|
2215
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
2216
+ operation: result,
2217
+ client: region_operations,
2218
+ request_values: {
2219
+ "project" => request.project,
2220
+ "region" => request.region
2221
+ },
2222
+ options: options
2223
+ )
2224
+ yield result, response if block_given?
2225
+ throw :response, result
2226
+ end
2227
+ rescue ::Gapic::Rest::Error => e
2228
+ raise ::Google::Cloud::Error.from_error(e)
2229
+ end
2230
+
2231
+ ##
2232
+ # 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.
2233
+ #
2234
+ # @overload suspend_instances(request, options = nil)
2235
+ # Pass arguments to `suspend_instances` via a request object, either of type
2236
+ # {::Google::Cloud::Compute::V1::SuspendInstancesRegionInstanceGroupManagerRequest} or an equivalent Hash.
2237
+ #
2238
+ # @param request [::Google::Cloud::Compute::V1::SuspendInstancesRegionInstanceGroupManagerRequest, ::Hash]
2239
+ # A request object representing the call parameters. Required. To specify no
2240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2241
+ # @param options [::Gapic::CallOptions, ::Hash]
2242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2243
+ #
2244
+ # @overload suspend_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_suspend_instances_request_resource: nil, request_id: nil)
2245
+ # Pass arguments to `suspend_instances` via keyword arguments. Note that at
2246
+ # least one keyword argument is required. To specify no parameters, or to keep all
2247
+ # the default parameter values, pass an empty Hash as a request object (see above).
2248
+ #
2249
+ # @param instance_group_manager [::String]
2250
+ # Name of the managed instance group.
2251
+ # @param project [::String]
2252
+ # Project ID for this request.
2253
+ # @param region [::String]
2254
+ # Name of the region scoping this request.
2255
+ # @param region_instance_group_managers_suspend_instances_request_resource [::Google::Cloud::Compute::V1::RegionInstanceGroupManagersSuspendInstancesRequest, ::Hash]
2256
+ # The body resource for this request
2257
+ # @param request_id [::String]
2258
+ # 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).
2259
+ # @yield [result, operation] Access the result along with the TransportOperation object
2260
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2261
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2262
+ #
2263
+ # @return [::Gapic::GenericLRO::Operation]
2264
+ #
2265
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2266
+ #
2267
+ # @example Basic example
2268
+ # require "google/cloud/compute/v1"
2269
+ #
2270
+ # # Create a client object. The client can be reused for multiple calls.
2271
+ # client = Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.new
2272
+ #
2273
+ # # Create a request. To set request fields, pass in keyword arguments.
2274
+ # request = Google::Cloud::Compute::V1::SuspendInstancesRegionInstanceGroupManagerRequest.new
2275
+ #
2276
+ # # Call the suspend_instances method.
2277
+ # result = client.suspend_instances request
2278
+ #
2279
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2280
+ # p result
2281
+ #
2282
+ def suspend_instances request, options = nil
2283
+ raise ::ArgumentError, "request must be provided" if request.nil?
2284
+
2285
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SuspendInstancesRegionInstanceGroupManagerRequest
2286
+
2287
+ # Converts hash and nil to an options object
2288
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2289
+
2290
+ # Customize the options with defaults
2291
+ call_metadata = @config.rpcs.suspend_instances.metadata.to_h
2292
+
2293
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2294
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2295
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2296
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
2297
+ transports_version_send: [:rest]
2298
+
2299
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2300
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2301
+
2302
+ options.apply_defaults timeout: @config.rpcs.suspend_instances.timeout,
2303
+ metadata: call_metadata,
2304
+ retry_policy: @config.rpcs.suspend_instances.retry_policy
2305
+
2306
+ options.apply_defaults timeout: @config.timeout,
2307
+ metadata: @config.metadata,
2308
+ retry_policy: @config.retry_policy
2309
+
2310
+ @region_instance_group_managers_stub.suspend_instances request, options do |result, response|
2311
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
2312
+ operation: result,
2313
+ client: region_operations,
2314
+ request_values: {
2315
+ "project" => request.project,
2316
+ "region" => request.region
2317
+ },
2318
+ options: options
2319
+ )
2320
+ yield result, response if block_given?
2321
+ throw :response, result
1911
2322
  end
1912
2323
  rescue ::Gapic::Rest::Error => e
1913
2324
  raise ::Google::Cloud::Error.from_error(e)
@@ -2003,7 +2414,7 @@ module Google
2003
2414
  options: options
2004
2415
  )
2005
2416
  yield result, response if block_given?
2006
- return result
2417
+ throw :response, result
2007
2418
  end
2008
2419
  rescue ::Gapic::Rest::Error => e
2009
2420
  raise ::Google::Cloud::Error.from_error(e)
@@ -2083,6 +2494,11 @@ module Google
2083
2494
  # default endpoint URL. The default value of nil uses the environment
2084
2495
  # universe (usually the default "googleapis.com" universe).
2085
2496
  # @return [::String,nil]
2497
+ # @!attribute [rw] logger
2498
+ # A custom logger to use for request/response debug logging, or the value
2499
+ # `:default` (the default) to construct a default logger, or `nil` to
2500
+ # explicitly disable logging.
2501
+ # @return [::Logger,:default,nil]
2086
2502
  #
2087
2503
  class Configuration
2088
2504
  extend ::Gapic::Config
@@ -2104,6 +2520,7 @@ module Google
2104
2520
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2105
2521
  config_attr :quota_project, nil, ::String, nil
2106
2522
  config_attr :universe_domain, nil, ::String, nil
2523
+ config_attr :logger, :default, ::Logger, nil, :default
2107
2524
 
2108
2525
  # @private
2109
2526
  def initialize parent_config = nil
@@ -2223,6 +2640,11 @@ module Google
2223
2640
  #
2224
2641
  attr_reader :resize
2225
2642
  ##
2643
+ # RPC-specific configuration for `resume_instances`
2644
+ # @return [::Gapic::Config::Method]
2645
+ #
2646
+ attr_reader :resume_instances
2647
+ ##
2226
2648
  # RPC-specific configuration for `set_instance_template`
2227
2649
  # @return [::Gapic::Config::Method]
2228
2650
  #
@@ -2233,6 +2655,21 @@ module Google
2233
2655
  #
2234
2656
  attr_reader :set_target_pools
2235
2657
  ##
2658
+ # RPC-specific configuration for `start_instances`
2659
+ # @return [::Gapic::Config::Method]
2660
+ #
2661
+ attr_reader :start_instances
2662
+ ##
2663
+ # RPC-specific configuration for `stop_instances`
2664
+ # @return [::Gapic::Config::Method]
2665
+ #
2666
+ attr_reader :stop_instances
2667
+ ##
2668
+ # RPC-specific configuration for `suspend_instances`
2669
+ # @return [::Gapic::Config::Method]
2670
+ #
2671
+ attr_reader :suspend_instances
2672
+ ##
2236
2673
  # RPC-specific configuration for `update_per_instance_configs`
2237
2674
  # @return [::Gapic::Config::Method]
2238
2675
  #
@@ -2272,10 +2709,18 @@ module Google
2272
2709
  @recreate_instances = ::Gapic::Config::Method.new recreate_instances_config
2273
2710
  resize_config = parent_rpcs.resize if parent_rpcs.respond_to? :resize
2274
2711
  @resize = ::Gapic::Config::Method.new resize_config
2712
+ resume_instances_config = parent_rpcs.resume_instances if parent_rpcs.respond_to? :resume_instances
2713
+ @resume_instances = ::Gapic::Config::Method.new resume_instances_config
2275
2714
  set_instance_template_config = parent_rpcs.set_instance_template if parent_rpcs.respond_to? :set_instance_template
2276
2715
  @set_instance_template = ::Gapic::Config::Method.new set_instance_template_config
2277
2716
  set_target_pools_config = parent_rpcs.set_target_pools if parent_rpcs.respond_to? :set_target_pools
2278
2717
  @set_target_pools = ::Gapic::Config::Method.new set_target_pools_config
2718
+ start_instances_config = parent_rpcs.start_instances if parent_rpcs.respond_to? :start_instances
2719
+ @start_instances = ::Gapic::Config::Method.new start_instances_config
2720
+ stop_instances_config = parent_rpcs.stop_instances if parent_rpcs.respond_to? :stop_instances
2721
+ @stop_instances = ::Gapic::Config::Method.new stop_instances_config
2722
+ suspend_instances_config = parent_rpcs.suspend_instances if parent_rpcs.respond_to? :suspend_instances
2723
+ @suspend_instances = ::Gapic::Config::Method.new suspend_instances_config
2279
2724
  update_per_instance_configs_config = parent_rpcs.update_per_instance_configs if parent_rpcs.respond_to? :update_per_instance_configs
2280
2725
  @update_per_instance_configs = ::Gapic::Config::Method.new update_per_instance_configs_config
2281
2726