google-cloud-compute-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +73 -0
  6. data/lib/google-cloud-compute-v1.rb +21 -0
  7. data/lib/google/cloud/compute/v1.rb +110 -0
  8. data/lib/google/cloud/compute/v1/accelerator_types.rb +44 -0
  9. data/lib/google/cloud/compute/v1/accelerator_types/credentials.rb +53 -0
  10. data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +35 -0
  11. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +452 -0
  12. data/lib/google/cloud/compute/v1/accelerator_types/rest/grpc_transcoding.rb +81 -0
  13. data/lib/google/cloud/compute/v1/addresses.rb +44 -0
  14. data/lib/google/cloud/compute/v1/addresses/credentials.rb +52 -0
  15. data/lib/google/cloud/compute/v1/addresses/rest.rb +35 -0
  16. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +596 -0
  17. data/lib/google/cloud/compute/v1/addresses/rest/grpc_transcoding.rb +106 -0
  18. data/lib/google/cloud/compute/v1/autoscalers.rb +44 -0
  19. data/lib/google/cloud/compute/v1/autoscalers/credentials.rb +52 -0
  20. data/lib/google/cloud/compute/v1/autoscalers/rest.rb +35 -0
  21. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +746 -0
  22. data/lib/google/cloud/compute/v1/autoscalers/rest/grpc_transcoding.rb +130 -0
  23. data/lib/google/cloud/compute/v1/backend_buckets.rb +44 -0
  24. data/lib/google/cloud/compute/v1/backend_buckets/credentials.rb +52 -0
  25. data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +35 -0
  26. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +795 -0
  27. data/lib/google/cloud/compute/v1/backend_buckets/rest/grpc_transcoding.rb +138 -0
  28. data/lib/google/cloud/compute/v1/backend_services.rb +44 -0
  29. data/lib/google/cloud/compute/v1/backend_services/credentials.rb +52 -0
  30. data/lib/google/cloud/compute/v1/backend_services/rest.rb +35 -0
  31. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +1023 -0
  32. data/lib/google/cloud/compute/v1/backend_services/rest/grpc_transcoding.rb +180 -0
  33. data/lib/google/cloud/compute/v1/compute_pb.rb +9482 -0
  34. data/lib/google/cloud/compute/v1/disk_types.rb +44 -0
  35. data/lib/google/cloud/compute/v1/disk_types/credentials.rb +53 -0
  36. data/lib/google/cloud/compute/v1/disk_types/rest.rb +35 -0
  37. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +450 -0
  38. data/lib/google/cloud/compute/v1/disk_types/rest/grpc_transcoding.rb +81 -0
  39. data/lib/google/cloud/compute/v1/disks.rb +44 -0
  40. data/lib/google/cloud/compute/v1/disks/credentials.rb +52 -0
  41. data/lib/google/cloud/compute/v1/disks/rest.rb +35 -0
  42. data/lib/google/cloud/compute/v1/disks/rest/client.rb +1182 -0
  43. data/lib/google/cloud/compute/v1/disks/rest/grpc_transcoding.rb +203 -0
  44. data/lib/google/cloud/compute/v1/external_vpn_gateways.rb +44 -0
  45. data/lib/google/cloud/compute/v1/external_vpn_gateways/credentials.rb +52 -0
  46. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +35 -0
  47. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +637 -0
  48. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/grpc_transcoding.rb +112 -0
  49. data/lib/google/cloud/compute/v1/firewalls.rb +44 -0
  50. data/lib/google/cloud/compute/v1/firewalls/credentials.rb +52 -0
  51. data/lib/google/cloud/compute/v1/firewalls/rest.rb +35 -0
  52. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +649 -0
  53. data/lib/google/cloud/compute/v1/firewalls/rest/grpc_transcoding.rb +112 -0
  54. data/lib/google/cloud/compute/v1/forwarding_rules.rb +44 -0
  55. data/lib/google/cloud/compute/v1/forwarding_rules/credentials.rb +52 -0
  56. data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +35 -0
  57. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +746 -0
  58. data/lib/google/cloud/compute/v1/forwarding_rules/rest/grpc_transcoding.rb +130 -0
  59. data/lib/google/cloud/compute/v1/global_addresses.rb +44 -0
  60. data/lib/google/cloud/compute/v1/global_addresses/credentials.rb +52 -0
  61. data/lib/google/cloud/compute/v1/global_addresses/rest.rb +35 -0
  62. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +503 -0
  63. data/lib/google/cloud/compute/v1/global_addresses/rest/grpc_transcoding.rb +88 -0
  64. data/lib/google/cloud/compute/v1/global_forwarding_rules.rb +44 -0
  65. data/lib/google/cloud/compute/v1/global_forwarding_rules/credentials.rb +52 -0
  66. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +35 -0
  67. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +649 -0
  68. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/grpc_transcoding.rb +112 -0
  69. data/lib/google/cloud/compute/v1/global_network_endpoint_groups.rb +44 -0
  70. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/credentials.rb +52 -0
  71. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +35 -0
  72. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +734 -0
  73. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/grpc_transcoding.rb +129 -0
  74. data/lib/google/cloud/compute/v1/global_operations.rb +44 -0
  75. data/lib/google/cloud/compute/v1/global_operations/credentials.rb +52 -0
  76. data/lib/google/cloud/compute/v1/global_operations/rest.rb +35 -0
  77. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +578 -0
  78. data/lib/google/cloud/compute/v1/global_operations/rest/grpc_transcoding.rb +105 -0
  79. data/lib/google/cloud/compute/v1/global_organization_operations.rb +44 -0
  80. data/lib/google/cloud/compute/v1/global_organization_operations/credentials.rb +52 -0
  81. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +35 -0
  82. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +427 -0
  83. data/lib/google/cloud/compute/v1/global_organization_operations/rest/grpc_transcoding.rb +78 -0
  84. data/lib/google/cloud/compute/v1/health_checks.rb +44 -0
  85. data/lib/google/cloud/compute/v1/health_checks/credentials.rb +52 -0
  86. data/lib/google/cloud/compute/v1/health_checks/rest.rb +35 -0
  87. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +734 -0
  88. data/lib/google/cloud/compute/v1/health_checks/rest/grpc_transcoding.rb +130 -0
  89. data/lib/google/cloud/compute/v1/images.rb +44 -0
  90. data/lib/google/cloud/compute/v1/images/credentials.rb +52 -0
  91. data/lib/google/cloud/compute/v1/images/rest.rb +35 -0
  92. data/lib/google/cloud/compute/v1/images/rest/client.rb +985 -0
  93. data/lib/google/cloud/compute/v1/images/rest/grpc_transcoding.rb +173 -0
  94. data/lib/google/cloud/compute/v1/instance_group_managers.rb +44 -0
  95. data/lib/google/cloud/compute/v1/instance_group_managers/credentials.rb +52 -0
  96. data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +35 -0
  97. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +1767 -0
  98. data/lib/google/cloud/compute/v1/instance_group_managers/rest/grpc_transcoding.rb +303 -0
  99. data/lib/google/cloud/compute/v1/instance_groups.rb +44 -0
  100. data/lib/google/cloud/compute/v1/instance_groups/credentials.rb +52 -0
  101. data/lib/google/cloud/compute/v1/instance_groups/rest.rb +35 -0
  102. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +916 -0
  103. data/lib/google/cloud/compute/v1/instance_groups/rest/grpc_transcoding.rb +154 -0
  104. data/lib/google/cloud/compute/v1/instance_templates.rb +44 -0
  105. data/lib/google/cloud/compute/v1/instance_templates/credentials.rb +52 -0
  106. data/lib/google/cloud/compute/v1/instance_templates/rest.rb +35 -0
  107. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +704 -0
  108. data/lib/google/cloud/compute/v1/instance_templates/rest/grpc_transcoding.rb +125 -0
  109. data/lib/google/cloud/compute/v1/instances.rb +44 -0
  110. data/lib/google/cloud/compute/v1/instances/credentials.rb +52 -0
  111. data/lib/google/cloud/compute/v1/instances/rest.rb +35 -0
  112. data/lib/google/cloud/compute/v1/instances/rest/client.rb +3201 -0
  113. data/lib/google/cloud/compute/v1/instances/rest/grpc_transcoding.rb +549 -0
  114. data/lib/google/cloud/compute/v1/interconnect_attachments.rb +44 -0
  115. data/lib/google/cloud/compute/v1/interconnect_attachments/credentials.rb +52 -0
  116. data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +35 -0
  117. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +673 -0
  118. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/grpc_transcoding.rb +118 -0
  119. data/lib/google/cloud/compute/v1/interconnect_locations.rb +44 -0
  120. data/lib/google/cloud/compute/v1/interconnect_locations/credentials.rb +53 -0
  121. data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +35 -0
  122. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +361 -0
  123. data/lib/google/cloud/compute/v1/interconnect_locations/rest/grpc_transcoding.rb +63 -0
  124. data/lib/google/cloud/compute/v1/interconnects.rb +44 -0
  125. data/lib/google/cloud/compute/v1/interconnects/credentials.rb +52 -0
  126. data/lib/google/cloud/compute/v1/interconnects/rest.rb +35 -0
  127. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +640 -0
  128. data/lib/google/cloud/compute/v1/interconnects/rest/grpc_transcoding.rb +112 -0
  129. data/lib/google/cloud/compute/v1/license_codes.rb +44 -0
  130. data/lib/google/cloud/compute/v1/license_codes/credentials.rb +53 -0
  131. data/lib/google/cloud/compute/v1/license_codes/rest.rb +35 -0
  132. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +345 -0
  133. data/lib/google/cloud/compute/v1/license_codes/rest/grpc_transcoding.rb +58 -0
  134. data/lib/google/cloud/compute/v1/licenses.rb +44 -0
  135. data/lib/google/cloud/compute/v1/licenses/credentials.rb +52 -0
  136. data/lib/google/cloud/compute/v1/licenses/rest.rb +35 -0
  137. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +704 -0
  138. data/lib/google/cloud/compute/v1/licenses/rest/grpc_transcoding.rb +125 -0
  139. data/lib/google/cloud/compute/v1/machine_types.rb +44 -0
  140. data/lib/google/cloud/compute/v1/machine_types/credentials.rb +53 -0
  141. data/lib/google/cloud/compute/v1/machine_types/rest.rb +35 -0
  142. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +450 -0
  143. data/lib/google/cloud/compute/v1/machine_types/rest/grpc_transcoding.rb +81 -0
  144. data/lib/google/cloud/compute/v1/network_endpoint_groups.rb +44 -0
  145. data/lib/google/cloud/compute/v1/network_endpoint_groups/credentials.rb +52 -0
  146. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +35 -0
  147. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +904 -0
  148. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/grpc_transcoding.rb +154 -0
  149. data/lib/google/cloud/compute/v1/networks.rb +44 -0
  150. data/lib/google/cloud/compute/v1/networks/credentials.rb +52 -0
  151. data/lib/google/cloud/compute/v1/networks/rest.rb +35 -0
  152. data/lib/google/cloud/compute/v1/networks/rest/client.rb +957 -0
  153. data/lib/google/cloud/compute/v1/networks/rest/grpc_transcoding.rb +169 -0
  154. data/lib/google/cloud/compute/v1/node_groups.rb +44 -0
  155. data/lib/google/cloud/compute/v1/node_groups/credentials.rb +52 -0
  156. data/lib/google/cloud/compute/v1/node_groups/rest.rb +35 -0
  157. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +1192 -0
  158. data/lib/google/cloud/compute/v1/node_groups/rest/grpc_transcoding.rb +208 -0
  159. data/lib/google/cloud/compute/v1/node_templates.rb +44 -0
  160. data/lib/google/cloud/compute/v1/node_templates/credentials.rb +52 -0
  161. data/lib/google/cloud/compute/v1/node_templates/rest.rb +35 -0
  162. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +803 -0
  163. data/lib/google/cloud/compute/v1/node_templates/rest/grpc_transcoding.rb +143 -0
  164. data/lib/google/cloud/compute/v1/node_types.rb +44 -0
  165. data/lib/google/cloud/compute/v1/node_types/credentials.rb +53 -0
  166. data/lib/google/cloud/compute/v1/node_types/rest.rb +35 -0
  167. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +450 -0
  168. data/lib/google/cloud/compute/v1/node_types/rest/grpc_transcoding.rb +81 -0
  169. data/lib/google/cloud/compute/v1/packet_mirrorings.rb +44 -0
  170. data/lib/google/cloud/compute/v1/packet_mirrorings/credentials.rb +52 -0
  171. data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +35 -0
  172. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +740 -0
  173. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/grpc_transcoding.rb +130 -0
  174. data/lib/google/cloud/compute/v1/projects.rb +44 -0
  175. data/lib/google/cloud/compute/v1/projects/credentials.rb +52 -0
  176. data/lib/google/cloud/compute/v1/projects/rest.rb +35 -0
  177. data/lib/google/cloud/compute/v1/projects/rest/client.rb +1141 -0
  178. data/lib/google/cloud/compute/v1/projects/rest/grpc_transcoding.rb +197 -0
  179. data/lib/google/cloud/compute/v1/region_autoscalers.rb +44 -0
  180. data/lib/google/cloud/compute/v1/region_autoscalers/credentials.rb +52 -0
  181. data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +35 -0
  182. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +661 -0
  183. data/lib/google/cloud/compute/v1/region_autoscalers/rest/grpc_transcoding.rb +112 -0
  184. data/lib/google/cloud/compute/v1/region_backend_services.rb +44 -0
  185. data/lib/google/cloud/compute/v1/region_backend_services/credentials.rb +52 -0
  186. data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +35 -0
  187. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +729 -0
  188. data/lib/google/cloud/compute/v1/region_backend_services/rest/grpc_transcoding.rb +124 -0
  189. data/lib/google/cloud/compute/v1/region_commitments.rb +44 -0
  190. data/lib/google/cloud/compute/v1/region_commitments/credentials.rb +52 -0
  191. data/lib/google/cloud/compute/v1/region_commitments/rest.rb +35 -0
  192. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +523 -0
  193. data/lib/google/cloud/compute/v1/region_commitments/rest/grpc_transcoding.rb +93 -0
  194. data/lib/google/cloud/compute/v1/region_disk_types.rb +44 -0
  195. data/lib/google/cloud/compute/v1/region_disk_types/credentials.rb +53 -0
  196. data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +35 -0
  197. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +365 -0
  198. data/lib/google/cloud/compute/v1/region_disk_types/rest/grpc_transcoding.rb +63 -0
  199. data/lib/google/cloud/compute/v1/region_disks.rb +44 -0
  200. data/lib/google/cloud/compute/v1/region_disks/credentials.rb +52 -0
  201. data/lib/google/cloud/compute/v1/region_disks/rest.rb +35 -0
  202. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1095 -0
  203. data/lib/google/cloud/compute/v1/region_disks/rest/grpc_transcoding.rb +185 -0
  204. data/lib/google/cloud/compute/v1/region_health_check_services.rb +44 -0
  205. data/lib/google/cloud/compute/v1/region_health_check_services/credentials.rb +52 -0
  206. data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +35 -0
  207. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +586 -0
  208. data/lib/google/cloud/compute/v1/region_health_check_services/rest/grpc_transcoding.rb +100 -0
  209. data/lib/google/cloud/compute/v1/region_health_checks.rb +44 -0
  210. data/lib/google/cloud/compute/v1/region_health_checks/credentials.rb +52 -0
  211. data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +35 -0
  212. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +661 -0
  213. data/lib/google/cloud/compute/v1/region_health_checks/rest/grpc_transcoding.rb +112 -0
  214. data/lib/google/cloud/compute/v1/region_instance_group_managers.rb +44 -0
  215. data/lib/google/cloud/compute/v1/region_instance_group_managers/credentials.rb +52 -0
  216. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +35 -0
  217. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +1678 -0
  218. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/grpc_transcoding.rb +285 -0
  219. data/lib/google/cloud/compute/v1/region_instance_groups.rb +44 -0
  220. data/lib/google/cloud/compute/v1/region_instance_groups/credentials.rb +52 -0
  221. data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +35 -0
  222. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +529 -0
  223. data/lib/google/cloud/compute/v1/region_instance_groups/rest/grpc_transcoding.rb +87 -0
  224. data/lib/google/cloud/compute/v1/region_network_endpoint_groups.rb +44 -0
  225. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/credentials.rb +52 -0
  226. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +35 -0
  227. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +511 -0
  228. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/grpc_transcoding.rb +88 -0
  229. data/lib/google/cloud/compute/v1/region_notification_endpoints.rb +44 -0
  230. data/lib/google/cloud/compute/v1/region_notification_endpoints/credentials.rb +52 -0
  231. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +35 -0
  232. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +511 -0
  233. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/grpc_transcoding.rb +88 -0
  234. data/lib/google/cloud/compute/v1/region_operations.rb +44 -0
  235. data/lib/google/cloud/compute/v1/region_operations/credentials.rb +52 -0
  236. data/lib/google/cloud/compute/v1/region_operations/rest.rb +35 -0
  237. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +501 -0
  238. data/lib/google/cloud/compute/v1/region_operations/rest/grpc_transcoding.rb +87 -0
  239. data/lib/google/cloud/compute/v1/region_ssl_certificates.rb +44 -0
  240. data/lib/google/cloud/compute/v1/region_ssl_certificates/credentials.rb +52 -0
  241. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +35 -0
  242. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +511 -0
  243. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/grpc_transcoding.rb +88 -0
  244. data/lib/google/cloud/compute/v1/region_target_http_proxies.rb +44 -0
  245. data/lib/google/cloud/compute/v1/region_target_http_proxies/credentials.rb +52 -0
  246. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +35 -0
  247. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +586 -0
  248. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/grpc_transcoding.rb +100 -0
  249. data/lib/google/cloud/compute/v1/region_target_https_proxies.rb +44 -0
  250. data/lib/google/cloud/compute/v1/region_target_https_proxies/credentials.rb +52 -0
  251. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +35 -0
  252. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +661 -0
  253. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/grpc_transcoding.rb +112 -0
  254. data/lib/google/cloud/compute/v1/region_url_maps.rb +44 -0
  255. data/lib/google/cloud/compute/v1/region_url_maps/credentials.rb +52 -0
  256. data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +35 -0
  257. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +714 -0
  258. data/lib/google/cloud/compute/v1/region_url_maps/rest/grpc_transcoding.rb +124 -0
  259. data/lib/google/cloud/compute/v1/regions.rb +44 -0
  260. data/lib/google/cloud/compute/v1/regions/credentials.rb +53 -0
  261. data/lib/google/cloud/compute/v1/regions/rest.rb +35 -0
  262. data/lib/google/cloud/compute/v1/regions/rest/client.rb +361 -0
  263. data/lib/google/cloud/compute/v1/regions/rest/grpc_transcoding.rb +63 -0
  264. data/lib/google/cloud/compute/v1/reservations.rb +44 -0
  265. data/lib/google/cloud/compute/v1/reservations/credentials.rb +52 -0
  266. data/lib/google/cloud/compute/v1/reservations/rest.rb +35 -0
  267. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +878 -0
  268. data/lib/google/cloud/compute/v1/reservations/rest/grpc_transcoding.rb +155 -0
  269. data/lib/google/cloud/compute/v1/resource_policies.rb +44 -0
  270. data/lib/google/cloud/compute/v1/resource_policies/credentials.rb +52 -0
  271. data/lib/google/cloud/compute/v1/resource_policies/rest.rb +35 -0
  272. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +803 -0
  273. data/lib/google/cloud/compute/v1/resource_policies/rest/grpc_transcoding.rb +143 -0
  274. data/lib/google/cloud/compute/v1/routers.rb +44 -0
  275. data/lib/google/cloud/compute/v1/routers/credentials.rb +52 -0
  276. data/lib/google/cloud/compute/v1/routers/rest.rb +35 -0
  277. data/lib/google/cloud/compute/v1/routers/rest/client.rb +968 -0
  278. data/lib/google/cloud/compute/v1/routers/rest/grpc_transcoding.rb +171 -0
  279. data/lib/google/cloud/compute/v1/routes.rb +44 -0
  280. data/lib/google/cloud/compute/v1/routes/credentials.rb +52 -0
  281. data/lib/google/cloud/compute/v1/routes/rest.rb +35 -0
  282. data/lib/google/cloud/compute/v1/routes/rest/client.rb +503 -0
  283. data/lib/google/cloud/compute/v1/routes/rest/grpc_transcoding.rb +88 -0
  284. data/lib/google/cloud/compute/v1/security_policies.rb +44 -0
  285. data/lib/google/cloud/compute/v1/security_policies/credentials.rb +52 -0
  286. data/lib/google/cloud/compute/v1/security_policies/rest.rb +35 -0
  287. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +929 -0
  288. data/lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb +167 -0
  289. data/lib/google/cloud/compute/v1/snapshots.rb +44 -0
  290. data/lib/google/cloud/compute/v1/snapshots/credentials.rb +52 -0
  291. data/lib/google/cloud/compute/v1/snapshots/rest.rb +35 -0
  292. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +702 -0
  293. data/lib/google/cloud/compute/v1/snapshots/rest/grpc_transcoding.rb +125 -0
  294. data/lib/google/cloud/compute/v1/ssl_certificates.rb +44 -0
  295. data/lib/google/cloud/compute/v1/ssl_certificates/credentials.rb +52 -0
  296. data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +35 -0
  297. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +588 -0
  298. data/lib/google/cloud/compute/v1/ssl_certificates/rest/grpc_transcoding.rb +106 -0
  299. data/lib/google/cloud/compute/v1/ssl_policies.rb +44 -0
  300. data/lib/google/cloud/compute/v1/ssl_policies/credentials.rb +52 -0
  301. data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +35 -0
  302. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +659 -0
  303. data/lib/google/cloud/compute/v1/ssl_policies/rest/grpc_transcoding.rb +117 -0
  304. data/lib/google/cloud/compute/v1/subnetworks.rb +44 -0
  305. data/lib/google/cloud/compute/v1/subnetworks/credentials.rb +52 -0
  306. data/lib/google/cloud/compute/v1/subnetworks/rest.rb +35 -0
  307. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +1113 -0
  308. data/lib/google/cloud/compute/v1/subnetworks/rest/grpc_transcoding.rb +196 -0
  309. data/lib/google/cloud/compute/v1/target_grpc_proxies.rb +44 -0
  310. data/lib/google/cloud/compute/v1/target_grpc_proxies/credentials.rb +52 -0
  311. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +35 -0
  312. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +576 -0
  313. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/grpc_transcoding.rb +100 -0
  314. data/lib/google/cloud/compute/v1/target_http_proxies.rb +44 -0
  315. data/lib/google/cloud/compute/v1/target_http_proxies/credentials.rb +52 -0
  316. data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +35 -0
  317. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +734 -0
  318. data/lib/google/cloud/compute/v1/target_http_proxies/rest/grpc_transcoding.rb +130 -0
  319. data/lib/google/cloud/compute/v1/target_https_proxies.rb +44 -0
  320. data/lib/google/cloud/compute/v1/target_https_proxies/credentials.rb +52 -0
  321. data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +35 -0
  322. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +880 -0
  323. data/lib/google/cloud/compute/v1/target_https_proxies/rest/grpc_transcoding.rb +154 -0
  324. data/lib/google/cloud/compute/v1/target_instances.rb +44 -0
  325. data/lib/google/cloud/compute/v1/target_instances/credentials.rb +52 -0
  326. data/lib/google/cloud/compute/v1/target_instances/rest.rb +35 -0
  327. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +596 -0
  328. data/lib/google/cloud/compute/v1/target_instances/rest/grpc_transcoding.rb +106 -0
  329. data/lib/google/cloud/compute/v1/target_pools.rb +44 -0
  330. data/lib/google/cloud/compute/v1/target_pools/credentials.rb +52 -0
  331. data/lib/google/cloud/compute/v1/target_pools/rest.rb +35 -0
  332. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +1042 -0
  333. data/lib/google/cloud/compute/v1/target_pools/rest/grpc_transcoding.rb +178 -0
  334. data/lib/google/cloud/compute/v1/target_ssl_proxies.rb +44 -0
  335. data/lib/google/cloud/compute/v1/target_ssl_proxies/credentials.rb +52 -0
  336. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +35 -0
  337. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +795 -0
  338. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/grpc_transcoding.rb +136 -0
  339. data/lib/google/cloud/compute/v1/target_tcp_proxies.rb +44 -0
  340. data/lib/google/cloud/compute/v1/target_tcp_proxies/credentials.rb +52 -0
  341. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +35 -0
  342. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +649 -0
  343. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/grpc_transcoding.rb +112 -0
  344. data/lib/google/cloud/compute/v1/target_vpn_gateways.rb +44 -0
  345. data/lib/google/cloud/compute/v1/target_vpn_gateways/credentials.rb +52 -0
  346. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +35 -0
  347. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +596 -0
  348. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/grpc_transcoding.rb +106 -0
  349. data/lib/google/cloud/compute/v1/url_maps.rb +44 -0
  350. data/lib/google/cloud/compute/v1/url_maps/credentials.rb +52 -0
  351. data/lib/google/cloud/compute/v1/url_maps/rest.rb +35 -0
  352. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +876 -0
  353. data/lib/google/cloud/compute/v1/url_maps/rest/grpc_transcoding.rb +154 -0
  354. data/lib/google/cloud/compute/v1/version.rb +28 -0
  355. data/lib/google/cloud/compute/v1/vpn_gateways.rb +44 -0
  356. data/lib/google/cloud/compute/v1/vpn_gateways/credentials.rb +52 -0
  357. data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +35 -0
  358. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +806 -0
  359. data/lib/google/cloud/compute/v1/vpn_gateways/rest/grpc_transcoding.rb +142 -0
  360. data/lib/google/cloud/compute/v1/vpn_tunnels.rb +44 -0
  361. data/lib/google/cloud/compute/v1/vpn_tunnels/credentials.rb +52 -0
  362. data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +35 -0
  363. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +596 -0
  364. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/grpc_transcoding.rb +106 -0
  365. data/lib/google/cloud/compute/v1/zone_operations.rb +44 -0
  366. data/lib/google/cloud/compute/v1/zone_operations/credentials.rb +52 -0
  367. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +35 -0
  368. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +501 -0
  369. data/lib/google/cloud/compute/v1/zone_operations/rest/grpc_transcoding.rb +87 -0
  370. data/lib/google/cloud/compute/v1/zones.rb +44 -0
  371. data/lib/google/cloud/compute/v1/zones/credentials.rb +53 -0
  372. data/lib/google/cloud/compute/v1/zones/rest.rb +35 -0
  373. data/lib/google/cloud/compute/v1/zones/rest/client.rb +361 -0
  374. data/lib/google/cloud/compute/v1/zones/rest/grpc_transcoding.rb +63 -0
  375. data/proto_docs/README.md +4 -0
  376. data/proto_docs/google/api/field_behavior.rb +65 -0
  377. data/proto_docs/google/api/resource.rb +283 -0
  378. data/proto_docs/google/cloud/compute/v1/compute.rb +27425 -0
  379. metadata +568 -0
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Compute
23
+ module V1
24
+ module InstanceTemplates
25
+ module Rest
26
+ # GRPC transcoding helper methods for the InstanceTemplates REST API.
27
+ module GrpcTranscoding
28
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteInstanceTemplateRequest]
29
+ # A request object representing the call parameters. Required.
30
+ # @return [Array(String, [String, nil], Hash{String => String})]
31
+ # Uri, Body, Query string parameters
32
+ def transcode_delete request_pb
33
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates/#{request_pb.instance_template}"
34
+ body = nil
35
+ query_string_params = {}
36
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
37
+
38
+ [uri, body, query_string_params]
39
+ end
40
+
41
+ # @param request_pb [::Google::Cloud::Compute::V1::GetInstanceTemplateRequest]
42
+ # A request object representing the call parameters. Required.
43
+ # @return [Array(String, [String, nil], Hash{String => String})]
44
+ # Uri, Body, Query string parameters
45
+ def transcode_get request_pb
46
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates/#{request_pb.instance_template}"
47
+ body = nil
48
+ query_string_params = {}
49
+
50
+ [uri, body, query_string_params]
51
+ end
52
+
53
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyInstanceTemplateRequest]
54
+ # A request object representing the call parameters. Required.
55
+ # @return [Array(String, [String, nil], Hash{String => String})]
56
+ # Uri, Body, Query string parameters
57
+ def transcode_get_iam_policy request_pb
58
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates/#{request_pb.resource}/getIamPolicy"
59
+ body = nil
60
+ query_string_params = {}
61
+ query_string_params["optionsRequestedPolicyVersion"] = request_pb.options_requested_policy_version.to_s if request_pb.has_options_requested_policy_version?
62
+
63
+ [uri, body, query_string_params]
64
+ end
65
+
66
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertInstanceTemplateRequest]
67
+ # A request object representing the call parameters. Required.
68
+ # @return [Array(String, [String, nil], Hash{String => String})]
69
+ # Uri, Body, Query string parameters
70
+ def transcode_insert request_pb
71
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates"
72
+ body = request_pb.instance_template_resource.to_json
73
+ query_string_params = {}
74
+
75
+ [uri, body, query_string_params]
76
+ end
77
+
78
+ # @param request_pb [::Google::Cloud::Compute::V1::ListInstanceTemplatesRequest]
79
+ # A request object representing the call parameters. Required.
80
+ # @return [Array(String, [String, nil], Hash{String => String})]
81
+ # Uri, Body, Query string parameters
82
+ def transcode_list request_pb
83
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates"
84
+ body = nil
85
+ query_string_params = {}
86
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
87
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
88
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
89
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
90
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
91
+
92
+ [uri, body, query_string_params]
93
+ end
94
+
95
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyInstanceTemplateRequest]
96
+ # A request object representing the call parameters. Required.
97
+ # @return [Array(String, [String, nil], Hash{String => String})]
98
+ # Uri, Body, Query string parameters
99
+ def transcode_set_iam_policy request_pb
100
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates/#{request_pb.resource}/setIamPolicy"
101
+ body = request_pb.global_set_policy_request_resource.to_json
102
+ query_string_params = {}
103
+
104
+ [uri, body, query_string_params]
105
+ end
106
+
107
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsInstanceTemplateRequest]
108
+ # A request object representing the call parameters. Required.
109
+ # @return [Array(String, [String, nil], Hash{String => String})]
110
+ # Uri, Body, Query string parameters
111
+ def transcode_test_iam_permissions request_pb
112
+ uri = "/compute/v1/projects/#{request_pb.project}/global/instanceTemplates/#{request_pb.resource}/testIamPermissions"
113
+ body = request_pb.test_permissions_request_resource.to_json
114
+ query_string_params = {}
115
+
116
+ [uri, body, query_string_params]
117
+ end
118
+ extend self
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/instances/credentials"
25
+ require "google/cloud/compute/v1/instances/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ # To load this service and instantiate a REST client:
32
+ #
33
+ # require "google/cloud/compute/v1/instances"
34
+ # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new
35
+ #
36
+ module Instances
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ helper_path = ::File.join __dir__, "instances", "helpers.rb"
44
+ require "google/cloud/compute/v1/instances/helpers" if ::File.file? helper_path
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module Instances
26
+ # Credentials for the Instances API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/compute",
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "COMPUTE_CREDENTIALS",
34
+ "COMPUTE_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "COMPUTE_CREDENTIALS_JSON",
39
+ "COMPUTE_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "google/cloud/compute/v1/instances/rest/grpc_transcoding"
21
+ require "google/cloud/compute/v1/instances/rest/client"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module Instances
28
+ # Client for the REST transport
29
+ module Rest
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,3201 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Compute
25
+ module V1
26
+ module Instances
27
+ module Rest
28
+ ##
29
+ # REST client for the Instances service.
30
+ #
31
+ # The Instances API.
32
+ #
33
+ class Client
34
+ include GrpcTranscoding
35
+
36
+ # @private
37
+ attr_reader :instances_stub
38
+
39
+ ##
40
+ # Configure the Instances Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::Instances::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all Instances clients:
48
+ #
49
+ # ::Google::Cloud::Compute::V1::Instances::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Compute", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config
70
+ end
71
+ yield @configure if block_given?
72
+ @configure
73
+ end
74
+
75
+ ##
76
+ # Configure the Instances Client instance.
77
+ #
78
+ # The configuration is set to the derived mode, meaning that values can be changed,
79
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
80
+ # should be made on {Client.configure}.
81
+ #
82
+ # See {::Google::Cloud::Compute::V1::Instances::Rest::Client::Configuration}
83
+ # for a description of the configuration fields.
84
+ #
85
+ # @yield [config] Configure the Client client.
86
+ # @yieldparam config [Client::Configuration]
87
+ #
88
+ # @return [Client::Configuration]
89
+ #
90
+ def configure
91
+ yield @config if block_given?
92
+ @config
93
+ end
94
+
95
+ ##
96
+ # Create a new Instances REST client object.
97
+ #
98
+ # ## Examples
99
+ #
100
+ # To create a new Instances REST client with the default
101
+ # configuration:
102
+ #
103
+ # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new
104
+ #
105
+ # To create a new Instances REST client with a custom
106
+ # configuration:
107
+ #
108
+ # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the Instances client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # These require statements are intentionally placed here to initialize
117
+ # the REST modules only when it's required.
118
+ require "gapic/rest"
119
+
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ credentials ||= Credentials.default scope: @config.scope
129
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
130
+ credentials = Credentials.new credentials, scope: @config.scope
131
+ end
132
+
133
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
134
+ end
135
+
136
+ # Service calls
137
+
138
+ ##
139
+ # Adds an access config to an instance's network interface.
140
+ #
141
+ # @overload add_access_config(request, options = nil)
142
+ # Pass arguments to `add_access_config` via a request object, either of type
143
+ # {::Google::Cloud::Compute::V1::AddAccessConfigInstanceRequest} or an equivalent Hash.
144
+ #
145
+ # @param request [::Google::Cloud::Compute::V1::AddAccessConfigInstanceRequest, ::Hash]
146
+ # A request object representing the call parameters. Required. To specify no
147
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
148
+ # @param options [::Gapic::CallOptions, ::Hash]
149
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
150
+ # Note: currently retry functionality is not implemented. While it is possible
151
+ # to set it using ::Gapic::CallOptions, it will not be applied
152
+ #
153
+ # @overload add_access_config(access_config_resource: nil, instance: nil, network_interface: nil, project: nil, request_id: nil, zone: nil)
154
+ # Pass arguments to `add_access_config` via keyword arguments. Note that at
155
+ # least one keyword argument is required. To specify no parameters, or to keep all
156
+ # the default parameter values, pass an empty Hash as a request object (see above).
157
+ #
158
+ # @param access_config_resource [::Google::Cloud::Compute::V1::AccessConfig, ::Hash]
159
+ # The body resource for this request
160
+ # @param instance [::String]
161
+ # The instance name for this request.
162
+ # @param network_interface [::String]
163
+ # The name of the network interface to add to this instance.
164
+ # @param project [::String]
165
+ # Project ID for this request.
166
+ # @param request_id [::String]
167
+ # 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.
168
+ #
169
+ # 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.
170
+ #
171
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
172
+ # @param zone [::String]
173
+ # The name of the zone for this request.
174
+ # @yield [result, env] Access the result along with the Faraday environment object
175
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
176
+ # @yieldparam response [::Faraday::Response]
177
+ #
178
+ # @return [::Google::Cloud::Compute::V1::Operation]
179
+ #
180
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
181
+ def add_access_config request, options = nil
182
+ raise ::ArgumentError, "request must be provided" if request.nil?
183
+
184
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddAccessConfigInstanceRequest
185
+
186
+ # Converts hash and nil to an options object
187
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
188
+
189
+ # Customize the options with defaults
190
+ call_metadata = {}
191
+
192
+ # Set x-goog-api-client header
193
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
194
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
195
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
196
+
197
+ options.apply_defaults timeout: @config.timeout,
198
+ metadata: call_metadata
199
+
200
+ uri, body, _query_string_params = transcode_add_access_config request
201
+ response = @client_stub.make_post_request(
202
+ uri: uri,
203
+ body: body,
204
+ options: options
205
+ )
206
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
207
+
208
+ yield result, response if block_given?
209
+ result
210
+ rescue ::Faraday::Error => e
211
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
212
+ raise ::Google::Cloud::Error.from_error(gapic_error)
213
+ end
214
+
215
+ ##
216
+ # Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.
217
+ #
218
+ # @overload add_resource_policies(request, options = nil)
219
+ # Pass arguments to `add_resource_policies` via a request object, either of type
220
+ # {::Google::Cloud::Compute::V1::AddResourcePoliciesInstanceRequest} or an equivalent Hash.
221
+ #
222
+ # @param request [::Google::Cloud::Compute::V1::AddResourcePoliciesInstanceRequest, ::Hash]
223
+ # A request object representing the call parameters. Required. To specify no
224
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
225
+ # @param options [::Gapic::CallOptions, ::Hash]
226
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
227
+ # Note: currently retry functionality is not implemented. While it is possible
228
+ # to set it using ::Gapic::CallOptions, it will not be applied
229
+ #
230
+ # @overload add_resource_policies(instance: nil, instances_add_resource_policies_request_resource: nil, project: nil, request_id: nil, zone: nil)
231
+ # Pass arguments to `add_resource_policies` via keyword arguments. Note that at
232
+ # least one keyword argument is required. To specify no parameters, or to keep all
233
+ # the default parameter values, pass an empty Hash as a request object (see above).
234
+ #
235
+ # @param instance [::String]
236
+ # The instance name for this request.
237
+ # @param instances_add_resource_policies_request_resource [::Google::Cloud::Compute::V1::InstancesAddResourcePoliciesRequest, ::Hash]
238
+ # The body resource for this request
239
+ # @param project [::String]
240
+ # Project ID for this request.
241
+ # @param request_id [::String]
242
+ # 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.
243
+ #
244
+ # 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.
245
+ #
246
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
247
+ # @param zone [::String]
248
+ # The name of the zone for this request.
249
+ # @yield [result, env] Access the result along with the Faraday environment object
250
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
251
+ # @yieldparam response [::Faraday::Response]
252
+ #
253
+ # @return [::Google::Cloud::Compute::V1::Operation]
254
+ #
255
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
256
+ def add_resource_policies request, options = nil
257
+ raise ::ArgumentError, "request must be provided" if request.nil?
258
+
259
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddResourcePoliciesInstanceRequest
260
+
261
+ # Converts hash and nil to an options object
262
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
263
+
264
+ # Customize the options with defaults
265
+ call_metadata = {}
266
+
267
+ # Set x-goog-api-client header
268
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
270
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
271
+
272
+ options.apply_defaults timeout: @config.timeout,
273
+ metadata: call_metadata
274
+
275
+ uri, body, _query_string_params = transcode_add_resource_policies request
276
+ response = @client_stub.make_post_request(
277
+ uri: uri,
278
+ body: body,
279
+ options: options
280
+ )
281
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
282
+
283
+ yield result, response if block_given?
284
+ result
285
+ rescue ::Faraday::Error => e
286
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
287
+ raise ::Google::Cloud::Error.from_error(gapic_error)
288
+ end
289
+
290
+ ##
291
+ # Retrieves aggregated list of all of the instances in your project across all regions and zones.
292
+ #
293
+ # @overload aggregated_list(request, options = nil)
294
+ # Pass arguments to `aggregated_list` via a request object, either of type
295
+ # {::Google::Cloud::Compute::V1::AggregatedListInstancesRequest} or an equivalent Hash.
296
+ #
297
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListInstancesRequest, ::Hash]
298
+ # A request object representing the call parameters. Required. To specify no
299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
300
+ # @param options [::Gapic::CallOptions, ::Hash]
301
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
302
+ # Note: currently retry functionality is not implemented. While it is possible
303
+ # to set it using ::Gapic::CallOptions, it will not be applied
304
+ #
305
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
306
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
307
+ # least one keyword argument is required. To specify no parameters, or to keep all
308
+ # the default parameter values, pass an empty Hash as a request object (see above).
309
+ #
310
+ # @param filter [::String]
311
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
312
+ #
313
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
314
+ #
315
+ # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
316
+ #
317
+ # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
318
+ # @param include_all_scopes [::Boolean]
319
+ # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
320
+ # @param max_results [::Integer]
321
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
322
+ # @param order_by [::String]
323
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
324
+ #
325
+ # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
326
+ #
327
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
328
+ # @param page_token [::String]
329
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
330
+ # @param project [::String]
331
+ # Project ID for this request.
332
+ # @param return_partial_success [::Boolean]
333
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
334
+ # @yield [result, env] Access the result along with the Faraday environment object
335
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceAggregatedList]
336
+ # @yieldparam response [::Faraday::Response]
337
+ #
338
+ # @return [::Google::Cloud::Compute::V1::InstanceAggregatedList]
339
+ #
340
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
341
+ def aggregated_list request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListInstancesRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ call_metadata = {}
351
+
352
+ # Set x-goog-api-client header
353
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
356
+
357
+ options.apply_defaults timeout: @config.timeout,
358
+ metadata: call_metadata
359
+
360
+ uri, _body, query_string_params = transcode_aggregated_list request
361
+ response = @client_stub.make_get_request(
362
+ uri: uri,
363
+ params: query_string_params,
364
+ options: options
365
+ )
366
+ result = ::Google::Cloud::Compute::V1::InstanceAggregatedList.decode_json response.body, ignore_unknown_fields: true
367
+
368
+ yield result, response if block_given?
369
+ result
370
+ rescue ::Faraday::Error => e
371
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
372
+ raise ::Google::Cloud::Error.from_error(gapic_error)
373
+ end
374
+
375
+ ##
376
+ # Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.
377
+ #
378
+ # @overload attach_disk(request, options = nil)
379
+ # Pass arguments to `attach_disk` via a request object, either of type
380
+ # {::Google::Cloud::Compute::V1::AttachDiskInstanceRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::Compute::V1::AttachDiskInstanceRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
387
+ # Note: currently retry functionality is not implemented. While it is possible
388
+ # to set it using ::Gapic::CallOptions, it will not be applied
389
+ #
390
+ # @overload attach_disk(attached_disk_resource: nil, force_attach: nil, instance: nil, project: nil, request_id: nil, zone: nil)
391
+ # Pass arguments to `attach_disk` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param attached_disk_resource [::Google::Cloud::Compute::V1::AttachedDisk, ::Hash]
396
+ # The body resource for this request
397
+ # @param force_attach [::Boolean]
398
+ # Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.
399
+ # @param instance [::String]
400
+ # The instance name for this request.
401
+ # @param project [::String]
402
+ # Project ID for this request.
403
+ # @param request_id [::String]
404
+ # 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.
405
+ #
406
+ # 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.
407
+ #
408
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
409
+ # @param zone [::String]
410
+ # The name of the zone for this request.
411
+ # @yield [result, env] Access the result along with the Faraday environment object
412
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
413
+ # @yieldparam response [::Faraday::Response]
414
+ #
415
+ # @return [::Google::Cloud::Compute::V1::Operation]
416
+ #
417
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
418
+ def attach_disk request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AttachDiskInstanceRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ call_metadata = {}
428
+
429
+ # Set x-goog-api-client header
430
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
433
+
434
+ options.apply_defaults timeout: @config.timeout,
435
+ metadata: call_metadata
436
+
437
+ uri, body, _query_string_params = transcode_attach_disk request
438
+ response = @client_stub.make_post_request(
439
+ uri: uri,
440
+ body: body,
441
+ options: options
442
+ )
443
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
444
+
445
+ yield result, response if block_given?
446
+ result
447
+ rescue ::Faraday::Error => e
448
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
449
+ raise ::Google::Cloud::Error.from_error(gapic_error)
450
+ end
451
+
452
+ ##
453
+ # Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
454
+ #
455
+ # @overload delete(request, options = nil)
456
+ # Pass arguments to `delete` via a request object, either of type
457
+ # {::Google::Cloud::Compute::V1::DeleteInstanceRequest} or an equivalent Hash.
458
+ #
459
+ # @param request [::Google::Cloud::Compute::V1::DeleteInstanceRequest, ::Hash]
460
+ # A request object representing the call parameters. Required. To specify no
461
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
462
+ # @param options [::Gapic::CallOptions, ::Hash]
463
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
464
+ # Note: currently retry functionality is not implemented. While it is possible
465
+ # to set it using ::Gapic::CallOptions, it will not be applied
466
+ #
467
+ # @overload delete(instance: nil, project: nil, request_id: nil, zone: nil)
468
+ # Pass arguments to `delete` via keyword arguments. Note that at
469
+ # least one keyword argument is required. To specify no parameters, or to keep all
470
+ # the default parameter values, pass an empty Hash as a request object (see above).
471
+ #
472
+ # @param instance [::String]
473
+ # Name of the instance resource to delete.
474
+ # @param project [::String]
475
+ # Project ID for this request.
476
+ # @param request_id [::String]
477
+ # 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.
478
+ #
479
+ # 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.
480
+ #
481
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
482
+ # @param zone [::String]
483
+ # The name of the zone for this request.
484
+ # @yield [result, env] Access the result along with the Faraday environment object
485
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
486
+ # @yieldparam response [::Faraday::Response]
487
+ #
488
+ # @return [::Google::Cloud::Compute::V1::Operation]
489
+ #
490
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
491
+ def delete request, options = nil
492
+ raise ::ArgumentError, "request must be provided" if request.nil?
493
+
494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInstanceRequest
495
+
496
+ # Converts hash and nil to an options object
497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
498
+
499
+ # Customize the options with defaults
500
+ call_metadata = {}
501
+
502
+ # Set x-goog-api-client header
503
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
505
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
506
+
507
+ options.apply_defaults timeout: @config.timeout,
508
+ metadata: call_metadata
509
+
510
+ uri, _body, query_string_params = transcode_delete request
511
+ response = @client_stub.make_delete_request(
512
+ uri: uri,
513
+ params: query_string_params,
514
+ options: options
515
+ )
516
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
517
+
518
+ yield result, response if block_given?
519
+ result
520
+ rescue ::Faraday::Error => e
521
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
522
+ raise ::Google::Cloud::Error.from_error(gapic_error)
523
+ end
524
+
525
+ ##
526
+ # Deletes an access config from an instance's network interface.
527
+ #
528
+ # @overload delete_access_config(request, options = nil)
529
+ # Pass arguments to `delete_access_config` via a request object, either of type
530
+ # {::Google::Cloud::Compute::V1::DeleteAccessConfigInstanceRequest} or an equivalent Hash.
531
+ #
532
+ # @param request [::Google::Cloud::Compute::V1::DeleteAccessConfigInstanceRequest, ::Hash]
533
+ # A request object representing the call parameters. Required. To specify no
534
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
535
+ # @param options [::Gapic::CallOptions, ::Hash]
536
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
537
+ # Note: currently retry functionality is not implemented. While it is possible
538
+ # to set it using ::Gapic::CallOptions, it will not be applied
539
+ #
540
+ # @overload delete_access_config(access_config: nil, instance: nil, network_interface: nil, project: nil, request_id: nil, zone: nil)
541
+ # Pass arguments to `delete_access_config` via keyword arguments. Note that at
542
+ # least one keyword argument is required. To specify no parameters, or to keep all
543
+ # the default parameter values, pass an empty Hash as a request object (see above).
544
+ #
545
+ # @param access_config [::String]
546
+ # The name of the access config to delete.
547
+ # @param instance [::String]
548
+ # The instance name for this request.
549
+ # @param network_interface [::String]
550
+ # The name of the network interface.
551
+ # @param project [::String]
552
+ # Project ID for this request.
553
+ # @param request_id [::String]
554
+ # 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.
555
+ #
556
+ # 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.
557
+ #
558
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
559
+ # @param zone [::String]
560
+ # The name of the zone for this request.
561
+ # @yield [result, env] Access the result along with the Faraday environment object
562
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
563
+ # @yieldparam response [::Faraday::Response]
564
+ #
565
+ # @return [::Google::Cloud::Compute::V1::Operation]
566
+ #
567
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
568
+ def delete_access_config request, options = nil
569
+ raise ::ArgumentError, "request must be provided" if request.nil?
570
+
571
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteAccessConfigInstanceRequest
572
+
573
+ # Converts hash and nil to an options object
574
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
575
+
576
+ # Customize the options with defaults
577
+ call_metadata = {}
578
+
579
+ # Set x-goog-api-client header
580
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
581
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
582
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
583
+
584
+ options.apply_defaults timeout: @config.timeout,
585
+ metadata: call_metadata
586
+
587
+ uri, _body, query_string_params = transcode_delete_access_config request
588
+ response = @client_stub.make_post_request(
589
+ uri: uri,
590
+ params: query_string_params,
591
+ options: options
592
+ )
593
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
594
+
595
+ yield result, response if block_given?
596
+ result
597
+ rescue ::Faraday::Error => e
598
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
599
+ raise ::Google::Cloud::Error.from_error(gapic_error)
600
+ end
601
+
602
+ ##
603
+ # Detaches a disk from an instance.
604
+ #
605
+ # @overload detach_disk(request, options = nil)
606
+ # Pass arguments to `detach_disk` via a request object, either of type
607
+ # {::Google::Cloud::Compute::V1::DetachDiskInstanceRequest} or an equivalent Hash.
608
+ #
609
+ # @param request [::Google::Cloud::Compute::V1::DetachDiskInstanceRequest, ::Hash]
610
+ # A request object representing the call parameters. Required. To specify no
611
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
612
+ # @param options [::Gapic::CallOptions, ::Hash]
613
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
614
+ # Note: currently retry functionality is not implemented. While it is possible
615
+ # to set it using ::Gapic::CallOptions, it will not be applied
616
+ #
617
+ # @overload detach_disk(device_name: nil, instance: nil, project: nil, request_id: nil, zone: nil)
618
+ # Pass arguments to `detach_disk` via keyword arguments. Note that at
619
+ # least one keyword argument is required. To specify no parameters, or to keep all
620
+ # the default parameter values, pass an empty Hash as a request object (see above).
621
+ #
622
+ # @param device_name [::String]
623
+ # The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.
624
+ # @param instance [::String]
625
+ # Instance name for this request.
626
+ # @param project [::String]
627
+ # Project ID for this request.
628
+ # @param request_id [::String]
629
+ # 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.
630
+ #
631
+ # 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.
632
+ #
633
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
634
+ # @param zone [::String]
635
+ # The name of the zone for this request.
636
+ # @yield [result, env] Access the result along with the Faraday environment object
637
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
638
+ # @yieldparam response [::Faraday::Response]
639
+ #
640
+ # @return [::Google::Cloud::Compute::V1::Operation]
641
+ #
642
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
643
+ def detach_disk request, options = nil
644
+ raise ::ArgumentError, "request must be provided" if request.nil?
645
+
646
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DetachDiskInstanceRequest
647
+
648
+ # Converts hash and nil to an options object
649
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
650
+
651
+ # Customize the options with defaults
652
+ call_metadata = {}
653
+
654
+ # Set x-goog-api-client header
655
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
656
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
657
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
658
+
659
+ options.apply_defaults timeout: @config.timeout,
660
+ metadata: call_metadata
661
+
662
+ uri, _body, query_string_params = transcode_detach_disk request
663
+ response = @client_stub.make_post_request(
664
+ uri: uri,
665
+ params: query_string_params,
666
+ options: options
667
+ )
668
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
669
+
670
+ yield result, response if block_given?
671
+ result
672
+ rescue ::Faraday::Error => e
673
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
674
+ raise ::Google::Cloud::Error.from_error(gapic_error)
675
+ end
676
+
677
+ ##
678
+ # Returns the specified Instance resource. Gets a list of available instances by making a list() request.
679
+ #
680
+ # @overload get(request, options = nil)
681
+ # Pass arguments to `get` via a request object, either of type
682
+ # {::Google::Cloud::Compute::V1::GetInstanceRequest} or an equivalent Hash.
683
+ #
684
+ # @param request [::Google::Cloud::Compute::V1::GetInstanceRequest, ::Hash]
685
+ # A request object representing the call parameters. Required. To specify no
686
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
687
+ # @param options [::Gapic::CallOptions, ::Hash]
688
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
689
+ # Note: currently retry functionality is not implemented. While it is possible
690
+ # to set it using ::Gapic::CallOptions, it will not be applied
691
+ #
692
+ # @overload get(instance: nil, project: nil, zone: nil)
693
+ # Pass arguments to `get` via keyword arguments. Note that at
694
+ # least one keyword argument is required. To specify no parameters, or to keep all
695
+ # the default parameter values, pass an empty Hash as a request object (see above).
696
+ #
697
+ # @param instance [::String]
698
+ # Name of the instance resource to return.
699
+ # @param project [::String]
700
+ # Project ID for this request.
701
+ # @param zone [::String]
702
+ # The name of the zone for this request.
703
+ # @yield [result, env] Access the result along with the Faraday environment object
704
+ # @yieldparam result [::Google::Cloud::Compute::V1::Instance]
705
+ # @yieldparam response [::Faraday::Response]
706
+ #
707
+ # @return [::Google::Cloud::Compute::V1::Instance]
708
+ #
709
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
710
+ def get request, options = nil
711
+ raise ::ArgumentError, "request must be provided" if request.nil?
712
+
713
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInstanceRequest
714
+
715
+ # Converts hash and nil to an options object
716
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
717
+
718
+ # Customize the options with defaults
719
+ call_metadata = {}
720
+
721
+ # Set x-goog-api-client header
722
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
723
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
724
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
725
+
726
+ options.apply_defaults timeout: @config.timeout,
727
+ metadata: call_metadata
728
+
729
+ uri, _body, _query_string_params = transcode_get request
730
+ response = @client_stub.make_get_request(
731
+ uri: uri,
732
+ options: options
733
+ )
734
+ result = ::Google::Cloud::Compute::V1::Instance.decode_json response.body, ignore_unknown_fields: true
735
+
736
+ yield result, response if block_given?
737
+ result
738
+ rescue ::Faraday::Error => e
739
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
740
+ raise ::Google::Cloud::Error.from_error(gapic_error)
741
+ end
742
+
743
+ ##
744
+ # Returns the specified guest attributes entry.
745
+ #
746
+ # @overload get_guest_attributes(request, options = nil)
747
+ # Pass arguments to `get_guest_attributes` via a request object, either of type
748
+ # {::Google::Cloud::Compute::V1::GetGuestAttributesInstanceRequest} or an equivalent Hash.
749
+ #
750
+ # @param request [::Google::Cloud::Compute::V1::GetGuestAttributesInstanceRequest, ::Hash]
751
+ # A request object representing the call parameters. Required. To specify no
752
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
753
+ # @param options [::Gapic::CallOptions, ::Hash]
754
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
755
+ # Note: currently retry functionality is not implemented. While it is possible
756
+ # to set it using ::Gapic::CallOptions, it will not be applied
757
+ #
758
+ # @overload get_guest_attributes(instance: nil, project: nil, query_path: nil, variable_key: nil, zone: nil)
759
+ # Pass arguments to `get_guest_attributes` via keyword arguments. Note that at
760
+ # least one keyword argument is required. To specify no parameters, or to keep all
761
+ # the default parameter values, pass an empty Hash as a request object (see above).
762
+ #
763
+ # @param instance [::String]
764
+ # Name of the instance scoping this request.
765
+ # @param project [::String]
766
+ # Project ID for this request.
767
+ # @param query_path [::String]
768
+ # Specifies the guest attributes path to be queried.
769
+ # @param variable_key [::String]
770
+ # Specifies the key for the guest attributes entry.
771
+ # @param zone [::String]
772
+ # The name of the zone for this request.
773
+ # @yield [result, env] Access the result along with the Faraday environment object
774
+ # @yieldparam result [::Google::Cloud::Compute::V1::GuestAttributes]
775
+ # @yieldparam response [::Faraday::Response]
776
+ #
777
+ # @return [::Google::Cloud::Compute::V1::GuestAttributes]
778
+ #
779
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
780
+ def get_guest_attributes request, options = nil
781
+ raise ::ArgumentError, "request must be provided" if request.nil?
782
+
783
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetGuestAttributesInstanceRequest
784
+
785
+ # Converts hash and nil to an options object
786
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
787
+
788
+ # Customize the options with defaults
789
+ call_metadata = {}
790
+
791
+ # Set x-goog-api-client header
792
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
793
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
794
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
795
+
796
+ options.apply_defaults timeout: @config.timeout,
797
+ metadata: call_metadata
798
+
799
+ uri, _body, query_string_params = transcode_get_guest_attributes request
800
+ response = @client_stub.make_get_request(
801
+ uri: uri,
802
+ params: query_string_params,
803
+ options: options
804
+ )
805
+ result = ::Google::Cloud::Compute::V1::GuestAttributes.decode_json response.body, ignore_unknown_fields: true
806
+
807
+ yield result, response if block_given?
808
+ result
809
+ rescue ::Faraday::Error => e
810
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
811
+ raise ::Google::Cloud::Error.from_error(gapic_error)
812
+ end
813
+
814
+ ##
815
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
816
+ #
817
+ # @overload get_iam_policy(request, options = nil)
818
+ # Pass arguments to `get_iam_policy` via a request object, either of type
819
+ # {::Google::Cloud::Compute::V1::GetIamPolicyInstanceRequest} or an equivalent Hash.
820
+ #
821
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyInstanceRequest, ::Hash]
822
+ # A request object representing the call parameters. Required. To specify no
823
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
824
+ # @param options [::Gapic::CallOptions, ::Hash]
825
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
826
+ # Note: currently retry functionality is not implemented. While it is possible
827
+ # to set it using ::Gapic::CallOptions, it will not be applied
828
+ #
829
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil, zone: nil)
830
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
831
+ # least one keyword argument is required. To specify no parameters, or to keep all
832
+ # the default parameter values, pass an empty Hash as a request object (see above).
833
+ #
834
+ # @param options_requested_policy_version [::Integer]
835
+ # Requested IAM Policy version.
836
+ # @param project [::String]
837
+ # Project ID for this request.
838
+ # @param resource [::String]
839
+ # Name or id of the resource for this request.
840
+ # @param zone [::String]
841
+ # The name of the zone for this request.
842
+ # @yield [result, env] Access the result along with the Faraday environment object
843
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
844
+ # @yieldparam response [::Faraday::Response]
845
+ #
846
+ # @return [::Google::Cloud::Compute::V1::Policy]
847
+ #
848
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
849
+ def get_iam_policy request, options = nil
850
+ raise ::ArgumentError, "request must be provided" if request.nil?
851
+
852
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyInstanceRequest
853
+
854
+ # Converts hash and nil to an options object
855
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
856
+
857
+ # Customize the options with defaults
858
+ call_metadata = {}
859
+
860
+ # Set x-goog-api-client header
861
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
862
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
863
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
864
+
865
+ options.apply_defaults timeout: @config.timeout,
866
+ metadata: call_metadata
867
+
868
+ uri, _body, query_string_params = transcode_get_iam_policy request
869
+ response = @client_stub.make_get_request(
870
+ uri: uri,
871
+ params: query_string_params,
872
+ options: options
873
+ )
874
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
875
+
876
+ yield result, response if block_given?
877
+ result
878
+ rescue ::Faraday::Error => e
879
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
880
+ raise ::Google::Cloud::Error.from_error(gapic_error)
881
+ end
882
+
883
+ ##
884
+ # Returns the screenshot from the specified instance.
885
+ #
886
+ # @overload get_screenshot(request, options = nil)
887
+ # Pass arguments to `get_screenshot` via a request object, either of type
888
+ # {::Google::Cloud::Compute::V1::GetScreenshotInstanceRequest} or an equivalent Hash.
889
+ #
890
+ # @param request [::Google::Cloud::Compute::V1::GetScreenshotInstanceRequest, ::Hash]
891
+ # A request object representing the call parameters. Required. To specify no
892
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
893
+ # @param options [::Gapic::CallOptions, ::Hash]
894
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
895
+ # Note: currently retry functionality is not implemented. While it is possible
896
+ # to set it using ::Gapic::CallOptions, it will not be applied
897
+ #
898
+ # @overload get_screenshot(instance: nil, project: nil, zone: nil)
899
+ # Pass arguments to `get_screenshot` via keyword arguments. Note that at
900
+ # least one keyword argument is required. To specify no parameters, or to keep all
901
+ # the default parameter values, pass an empty Hash as a request object (see above).
902
+ #
903
+ # @param instance [::String]
904
+ # Name of the instance scoping this request.
905
+ # @param project [::String]
906
+ # Project ID for this request.
907
+ # @param zone [::String]
908
+ # The name of the zone for this request.
909
+ # @yield [result, env] Access the result along with the Faraday environment object
910
+ # @yieldparam result [::Google::Cloud::Compute::V1::Screenshot]
911
+ # @yieldparam response [::Faraday::Response]
912
+ #
913
+ # @return [::Google::Cloud::Compute::V1::Screenshot]
914
+ #
915
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
916
+ def get_screenshot request, options = nil
917
+ raise ::ArgumentError, "request must be provided" if request.nil?
918
+
919
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetScreenshotInstanceRequest
920
+
921
+ # Converts hash and nil to an options object
922
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
923
+
924
+ # Customize the options with defaults
925
+ call_metadata = {}
926
+
927
+ # Set x-goog-api-client header
928
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
929
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
930
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
931
+
932
+ options.apply_defaults timeout: @config.timeout,
933
+ metadata: call_metadata
934
+
935
+ uri, _body, _query_string_params = transcode_get_screenshot request
936
+ response = @client_stub.make_get_request(
937
+ uri: uri,
938
+ options: options
939
+ )
940
+ result = ::Google::Cloud::Compute::V1::Screenshot.decode_json response.body, ignore_unknown_fields: true
941
+
942
+ yield result, response if block_given?
943
+ result
944
+ rescue ::Faraday::Error => e
945
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
946
+ raise ::Google::Cloud::Error.from_error(gapic_error)
947
+ end
948
+
949
+ ##
950
+ # Returns the last 1 MB of serial port output from the specified instance.
951
+ #
952
+ # @overload get_serial_port_output(request, options = nil)
953
+ # Pass arguments to `get_serial_port_output` via a request object, either of type
954
+ # {::Google::Cloud::Compute::V1::GetSerialPortOutputInstanceRequest} or an equivalent Hash.
955
+ #
956
+ # @param request [::Google::Cloud::Compute::V1::GetSerialPortOutputInstanceRequest, ::Hash]
957
+ # A request object representing the call parameters. Required. To specify no
958
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
959
+ # @param options [::Gapic::CallOptions, ::Hash]
960
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
961
+ # Note: currently retry functionality is not implemented. While it is possible
962
+ # to set it using ::Gapic::CallOptions, it will not be applied
963
+ #
964
+ # @overload get_serial_port_output(instance: nil, port: nil, project: nil, start: nil, zone: nil)
965
+ # Pass arguments to `get_serial_port_output` via keyword arguments. Note that at
966
+ # least one keyword argument is required. To specify no parameters, or to keep all
967
+ # the default parameter values, pass an empty Hash as a request object (see above).
968
+ #
969
+ # @param instance [::String]
970
+ # Name of the instance for this request.
971
+ # @param port [::Integer]
972
+ # Specifies which COM or serial port to retrieve data from.
973
+ # @param project [::String]
974
+ # Project ID for this request.
975
+ # @param start [::String]
976
+ # Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`.
977
+ #
978
+ # If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value.
979
+ #
980
+ # You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console.
981
+ # @param zone [::String]
982
+ # The name of the zone for this request.
983
+ # @yield [result, env] Access the result along with the Faraday environment object
984
+ # @yieldparam result [::Google::Cloud::Compute::V1::SerialPortOutput]
985
+ # @yieldparam response [::Faraday::Response]
986
+ #
987
+ # @return [::Google::Cloud::Compute::V1::SerialPortOutput]
988
+ #
989
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
990
+ def get_serial_port_output request, options = nil
991
+ raise ::ArgumentError, "request must be provided" if request.nil?
992
+
993
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetSerialPortOutputInstanceRequest
994
+
995
+ # Converts hash and nil to an options object
996
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
997
+
998
+ # Customize the options with defaults
999
+ call_metadata = {}
1000
+
1001
+ # Set x-goog-api-client header
1002
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1003
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1004
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1005
+
1006
+ options.apply_defaults timeout: @config.timeout,
1007
+ metadata: call_metadata
1008
+
1009
+ uri, _body, query_string_params = transcode_get_serial_port_output request
1010
+ response = @client_stub.make_get_request(
1011
+ uri: uri,
1012
+ params: query_string_params,
1013
+ options: options
1014
+ )
1015
+ result = ::Google::Cloud::Compute::V1::SerialPortOutput.decode_json response.body, ignore_unknown_fields: true
1016
+
1017
+ yield result, response if block_given?
1018
+ result
1019
+ rescue ::Faraday::Error => e
1020
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1021
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1022
+ end
1023
+
1024
+ ##
1025
+ # Returns the Shielded Instance Identity of an instance
1026
+ #
1027
+ # @overload get_shielded_instance_identity(request, options = nil)
1028
+ # Pass arguments to `get_shielded_instance_identity` via a request object, either of type
1029
+ # {::Google::Cloud::Compute::V1::GetShieldedInstanceIdentityInstanceRequest} or an equivalent Hash.
1030
+ #
1031
+ # @param request [::Google::Cloud::Compute::V1::GetShieldedInstanceIdentityInstanceRequest, ::Hash]
1032
+ # A request object representing the call parameters. Required. To specify no
1033
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1034
+ # @param options [::Gapic::CallOptions, ::Hash]
1035
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1036
+ # Note: currently retry functionality is not implemented. While it is possible
1037
+ # to set it using ::Gapic::CallOptions, it will not be applied
1038
+ #
1039
+ # @overload get_shielded_instance_identity(instance: nil, project: nil, zone: nil)
1040
+ # Pass arguments to `get_shielded_instance_identity` via keyword arguments. Note that at
1041
+ # least one keyword argument is required. To specify no parameters, or to keep all
1042
+ # the default parameter values, pass an empty Hash as a request object (see above).
1043
+ #
1044
+ # @param instance [::String]
1045
+ # Name or id of the instance scoping this request.
1046
+ # @param project [::String]
1047
+ # Project ID for this request.
1048
+ # @param zone [::String]
1049
+ # The name of the zone for this request.
1050
+ # @yield [result, env] Access the result along with the Faraday environment object
1051
+ # @yieldparam result [::Google::Cloud::Compute::V1::ShieldedInstanceIdentity]
1052
+ # @yieldparam response [::Faraday::Response]
1053
+ #
1054
+ # @return [::Google::Cloud::Compute::V1::ShieldedInstanceIdentity]
1055
+ #
1056
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1057
+ def get_shielded_instance_identity request, options = nil
1058
+ raise ::ArgumentError, "request must be provided" if request.nil?
1059
+
1060
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetShieldedInstanceIdentityInstanceRequest
1061
+
1062
+ # Converts hash and nil to an options object
1063
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1064
+
1065
+ # Customize the options with defaults
1066
+ call_metadata = {}
1067
+
1068
+ # Set x-goog-api-client header
1069
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1070
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1071
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1072
+
1073
+ options.apply_defaults timeout: @config.timeout,
1074
+ metadata: call_metadata
1075
+
1076
+ uri, _body, _query_string_params = transcode_get_shielded_instance_identity request
1077
+ response = @client_stub.make_get_request(
1078
+ uri: uri,
1079
+ options: options
1080
+ )
1081
+ result = ::Google::Cloud::Compute::V1::ShieldedInstanceIdentity.decode_json response.body, ignore_unknown_fields: true
1082
+
1083
+ yield result, response if block_given?
1084
+ result
1085
+ rescue ::Faraday::Error => e
1086
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1087
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1088
+ end
1089
+
1090
+ ##
1091
+ # Creates an instance resource in the specified project using the data included in the request.
1092
+ #
1093
+ # @overload insert(request, options = nil)
1094
+ # Pass arguments to `insert` via a request object, either of type
1095
+ # {::Google::Cloud::Compute::V1::InsertInstanceRequest} or an equivalent Hash.
1096
+ #
1097
+ # @param request [::Google::Cloud::Compute::V1::InsertInstanceRequest, ::Hash]
1098
+ # A request object representing the call parameters. Required. To specify no
1099
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1100
+ # @param options [::Gapic::CallOptions, ::Hash]
1101
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1102
+ # Note: currently retry functionality is not implemented. While it is possible
1103
+ # to set it using ::Gapic::CallOptions, it will not be applied
1104
+ #
1105
+ # @overload insert(instance_resource: nil, project: nil, request_id: nil, source_instance_template: nil, zone: nil)
1106
+ # Pass arguments to `insert` via keyword arguments. Note that at
1107
+ # least one keyword argument is required. To specify no parameters, or to keep all
1108
+ # the default parameter values, pass an empty Hash as a request object (see above).
1109
+ #
1110
+ # @param instance_resource [::Google::Cloud::Compute::V1::Instance, ::Hash]
1111
+ # The body resource for this request
1112
+ # @param project [::String]
1113
+ # Project ID for this request.
1114
+ # @param request_id [::String]
1115
+ # 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.
1116
+ #
1117
+ # 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.
1118
+ #
1119
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1120
+ # @param source_instance_template [::String]
1121
+ # Specifies instance template to create the instance.
1122
+ #
1123
+ # This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template:
1124
+ # - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
1125
+ # - projects/project/global/instanceTemplates/instanceTemplate
1126
+ # - global/instanceTemplates/instanceTemplate
1127
+ # @param zone [::String]
1128
+ # The name of the zone for this request.
1129
+ # @yield [result, env] Access the result along with the Faraday environment object
1130
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1131
+ # @yieldparam response [::Faraday::Response]
1132
+ #
1133
+ # @return [::Google::Cloud::Compute::V1::Operation]
1134
+ #
1135
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1136
+ def insert request, options = nil
1137
+ raise ::ArgumentError, "request must be provided" if request.nil?
1138
+
1139
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInstanceRequest
1140
+
1141
+ # Converts hash and nil to an options object
1142
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1143
+
1144
+ # Customize the options with defaults
1145
+ call_metadata = {}
1146
+
1147
+ # Set x-goog-api-client header
1148
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1149
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1150
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1151
+
1152
+ options.apply_defaults timeout: @config.timeout,
1153
+ metadata: call_metadata
1154
+
1155
+ uri, body, _query_string_params = transcode_insert request
1156
+ response = @client_stub.make_post_request(
1157
+ uri: uri,
1158
+ body: body,
1159
+ options: options
1160
+ )
1161
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1162
+
1163
+ yield result, response if block_given?
1164
+ result
1165
+ rescue ::Faraday::Error => e
1166
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1167
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1168
+ end
1169
+
1170
+ ##
1171
+ # Retrieves the list of instances contained within the specified zone.
1172
+ #
1173
+ # @overload list(request, options = nil)
1174
+ # Pass arguments to `list` via a request object, either of type
1175
+ # {::Google::Cloud::Compute::V1::ListInstancesRequest} or an equivalent Hash.
1176
+ #
1177
+ # @param request [::Google::Cloud::Compute::V1::ListInstancesRequest, ::Hash]
1178
+ # A request object representing the call parameters. Required. To specify no
1179
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1180
+ # @param options [::Gapic::CallOptions, ::Hash]
1181
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1182
+ # Note: currently retry functionality is not implemented. While it is possible
1183
+ # to set it using ::Gapic::CallOptions, it will not be applied
1184
+ #
1185
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil)
1186
+ # Pass arguments to `list` via keyword arguments. Note that at
1187
+ # least one keyword argument is required. To specify no parameters, or to keep all
1188
+ # the default parameter values, pass an empty Hash as a request object (see above).
1189
+ #
1190
+ # @param filter [::String]
1191
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
1192
+ #
1193
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
1194
+ #
1195
+ # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
1196
+ #
1197
+ # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
1198
+ # @param max_results [::Integer]
1199
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1200
+ # @param order_by [::String]
1201
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1202
+ #
1203
+ # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
1204
+ #
1205
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1206
+ # @param page_token [::String]
1207
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1208
+ # @param project [::String]
1209
+ # Project ID for this request.
1210
+ # @param return_partial_success [::Boolean]
1211
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
1212
+ # @param zone [::String]
1213
+ # The name of the zone for this request.
1214
+ # @yield [result, env] Access the result along with the Faraday environment object
1215
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceList]
1216
+ # @yieldparam response [::Faraday::Response]
1217
+ #
1218
+ # @return [::Google::Cloud::Compute::V1::InstanceList]
1219
+ #
1220
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1221
+ def list request, options = nil
1222
+ raise ::ArgumentError, "request must be provided" if request.nil?
1223
+
1224
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListInstancesRequest
1225
+
1226
+ # Converts hash and nil to an options object
1227
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1228
+
1229
+ # Customize the options with defaults
1230
+ call_metadata = {}
1231
+
1232
+ # Set x-goog-api-client header
1233
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1234
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1235
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1236
+
1237
+ options.apply_defaults timeout: @config.timeout,
1238
+ metadata: call_metadata
1239
+
1240
+ uri, _body, query_string_params = transcode_list request
1241
+ response = @client_stub.make_get_request(
1242
+ uri: uri,
1243
+ params: query_string_params,
1244
+ options: options
1245
+ )
1246
+ result = ::Google::Cloud::Compute::V1::InstanceList.decode_json response.body, ignore_unknown_fields: true
1247
+
1248
+ yield result, response if block_given?
1249
+ result
1250
+ rescue ::Faraday::Error => e
1251
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1252
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1253
+ end
1254
+
1255
+ ##
1256
+ # Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances.
1257
+ #
1258
+ # @overload list_referrers(request, options = nil)
1259
+ # Pass arguments to `list_referrers` via a request object, either of type
1260
+ # {::Google::Cloud::Compute::V1::ListReferrersInstancesRequest} or an equivalent Hash.
1261
+ #
1262
+ # @param request [::Google::Cloud::Compute::V1::ListReferrersInstancesRequest, ::Hash]
1263
+ # A request object representing the call parameters. Required. To specify no
1264
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1265
+ # @param options [::Gapic::CallOptions, ::Hash]
1266
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1267
+ # Note: currently retry functionality is not implemented. While it is possible
1268
+ # to set it using ::Gapic::CallOptions, it will not be applied
1269
+ #
1270
+ # @overload list_referrers(filter: nil, instance: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil)
1271
+ # Pass arguments to `list_referrers` via keyword arguments. Note that at
1272
+ # least one keyword argument is required. To specify no parameters, or to keep all
1273
+ # the default parameter values, pass an empty Hash as a request object (see above).
1274
+ #
1275
+ # @param filter [::String]
1276
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
1277
+ #
1278
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
1279
+ #
1280
+ # You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
1281
+ #
1282
+ # To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
1283
+ # @param instance [::String]
1284
+ # Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.
1285
+ # @param max_results [::Integer]
1286
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1287
+ # @param order_by [::String]
1288
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1289
+ #
1290
+ # You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
1291
+ #
1292
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1293
+ # @param page_token [::String]
1294
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1295
+ # @param project [::String]
1296
+ # Project ID for this request.
1297
+ # @param return_partial_success [::Boolean]
1298
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
1299
+ # @param zone [::String]
1300
+ # The name of the zone for this request.
1301
+ # @yield [result, env] Access the result along with the Faraday environment object
1302
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceListReferrers]
1303
+ # @yieldparam response [::Faraday::Response]
1304
+ #
1305
+ # @return [::Google::Cloud::Compute::V1::InstanceListReferrers]
1306
+ #
1307
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1308
+ def list_referrers request, options = nil
1309
+ raise ::ArgumentError, "request must be provided" if request.nil?
1310
+
1311
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListReferrersInstancesRequest
1312
+
1313
+ # Converts hash and nil to an options object
1314
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1315
+
1316
+ # Customize the options with defaults
1317
+ call_metadata = {}
1318
+
1319
+ # Set x-goog-api-client header
1320
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1321
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1322
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1323
+
1324
+ options.apply_defaults timeout: @config.timeout,
1325
+ metadata: call_metadata
1326
+
1327
+ uri, _body, query_string_params = transcode_list_referrers request
1328
+ response = @client_stub.make_get_request(
1329
+ uri: uri,
1330
+ params: query_string_params,
1331
+ options: options
1332
+ )
1333
+ result = ::Google::Cloud::Compute::V1::InstanceListReferrers.decode_json response.body, ignore_unknown_fields: true
1334
+
1335
+ yield result, response if block_given?
1336
+ result
1337
+ rescue ::Faraday::Error => e
1338
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1339
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1340
+ end
1341
+
1342
+ ##
1343
+ # Removes resource policies from an instance.
1344
+ #
1345
+ # @overload remove_resource_policies(request, options = nil)
1346
+ # Pass arguments to `remove_resource_policies` via a request object, either of type
1347
+ # {::Google::Cloud::Compute::V1::RemoveResourcePoliciesInstanceRequest} or an equivalent Hash.
1348
+ #
1349
+ # @param request [::Google::Cloud::Compute::V1::RemoveResourcePoliciesInstanceRequest, ::Hash]
1350
+ # A request object representing the call parameters. Required. To specify no
1351
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1352
+ # @param options [::Gapic::CallOptions, ::Hash]
1353
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1354
+ # Note: currently retry functionality is not implemented. While it is possible
1355
+ # to set it using ::Gapic::CallOptions, it will not be applied
1356
+ #
1357
+ # @overload remove_resource_policies(instance: nil, instances_remove_resource_policies_request_resource: nil, project: nil, request_id: nil, zone: nil)
1358
+ # Pass arguments to `remove_resource_policies` via keyword arguments. Note that at
1359
+ # least one keyword argument is required. To specify no parameters, or to keep all
1360
+ # the default parameter values, pass an empty Hash as a request object (see above).
1361
+ #
1362
+ # @param instance [::String]
1363
+ # The instance name for this request.
1364
+ # @param instances_remove_resource_policies_request_resource [::Google::Cloud::Compute::V1::InstancesRemoveResourcePoliciesRequest, ::Hash]
1365
+ # The body resource for this request
1366
+ # @param project [::String]
1367
+ # Project ID for this request.
1368
+ # @param request_id [::String]
1369
+ # 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.
1370
+ #
1371
+ # 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.
1372
+ #
1373
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1374
+ # @param zone [::String]
1375
+ # The name of the zone for this request.
1376
+ # @yield [result, env] Access the result along with the Faraday environment object
1377
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1378
+ # @yieldparam response [::Faraday::Response]
1379
+ #
1380
+ # @return [::Google::Cloud::Compute::V1::Operation]
1381
+ #
1382
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1383
+ def remove_resource_policies request, options = nil
1384
+ raise ::ArgumentError, "request must be provided" if request.nil?
1385
+
1386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveResourcePoliciesInstanceRequest
1387
+
1388
+ # Converts hash and nil to an options object
1389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1390
+
1391
+ # Customize the options with defaults
1392
+ call_metadata = {}
1393
+
1394
+ # Set x-goog-api-client header
1395
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1397
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1398
+
1399
+ options.apply_defaults timeout: @config.timeout,
1400
+ metadata: call_metadata
1401
+
1402
+ uri, body, _query_string_params = transcode_remove_resource_policies request
1403
+ response = @client_stub.make_post_request(
1404
+ uri: uri,
1405
+ body: body,
1406
+ options: options
1407
+ )
1408
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1409
+
1410
+ yield result, response if block_given?
1411
+ result
1412
+ rescue ::Faraday::Error => e
1413
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1414
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1415
+ end
1416
+
1417
+ ##
1418
+ # Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.
1419
+ #
1420
+ # @overload reset(request, options = nil)
1421
+ # Pass arguments to `reset` via a request object, either of type
1422
+ # {::Google::Cloud::Compute::V1::ResetInstanceRequest} or an equivalent Hash.
1423
+ #
1424
+ # @param request [::Google::Cloud::Compute::V1::ResetInstanceRequest, ::Hash]
1425
+ # A request object representing the call parameters. Required. To specify no
1426
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1427
+ # @param options [::Gapic::CallOptions, ::Hash]
1428
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1429
+ # Note: currently retry functionality is not implemented. While it is possible
1430
+ # to set it using ::Gapic::CallOptions, it will not be applied
1431
+ #
1432
+ # @overload reset(instance: nil, project: nil, request_id: nil, zone: nil)
1433
+ # Pass arguments to `reset` via keyword arguments. Note that at
1434
+ # least one keyword argument is required. To specify no parameters, or to keep all
1435
+ # the default parameter values, pass an empty Hash as a request object (see above).
1436
+ #
1437
+ # @param instance [::String]
1438
+ # Name of the instance scoping this request.
1439
+ # @param project [::String]
1440
+ # Project ID for this request.
1441
+ # @param request_id [::String]
1442
+ # 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.
1443
+ #
1444
+ # 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.
1445
+ #
1446
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1447
+ # @param zone [::String]
1448
+ # The name of the zone for this request.
1449
+ # @yield [result, env] Access the result along with the Faraday environment object
1450
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1451
+ # @yieldparam response [::Faraday::Response]
1452
+ #
1453
+ # @return [::Google::Cloud::Compute::V1::Operation]
1454
+ #
1455
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1456
+ def reset request, options = nil
1457
+ raise ::ArgumentError, "request must be provided" if request.nil?
1458
+
1459
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResetInstanceRequest
1460
+
1461
+ # Converts hash and nil to an options object
1462
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1463
+
1464
+ # Customize the options with defaults
1465
+ call_metadata = {}
1466
+
1467
+ # Set x-goog-api-client header
1468
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1469
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1470
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1471
+
1472
+ options.apply_defaults timeout: @config.timeout,
1473
+ metadata: call_metadata
1474
+
1475
+ uri, _body, query_string_params = transcode_reset request
1476
+ response = @client_stub.make_post_request(
1477
+ uri: uri,
1478
+ params: query_string_params,
1479
+ options: options
1480
+ )
1481
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1482
+
1483
+ yield result, response if block_given?
1484
+ result
1485
+ rescue ::Faraday::Error => e
1486
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1487
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1488
+ end
1489
+
1490
+ ##
1491
+ # Sets deletion protection on the instance.
1492
+ #
1493
+ # @overload set_deletion_protection(request, options = nil)
1494
+ # Pass arguments to `set_deletion_protection` via a request object, either of type
1495
+ # {::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest} or an equivalent Hash.
1496
+ #
1497
+ # @param request [::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest, ::Hash]
1498
+ # A request object representing the call parameters. Required. To specify no
1499
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1500
+ # @param options [::Gapic::CallOptions, ::Hash]
1501
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1502
+ # Note: currently retry functionality is not implemented. While it is possible
1503
+ # to set it using ::Gapic::CallOptions, it will not be applied
1504
+ #
1505
+ # @overload set_deletion_protection(deletion_protection: nil, project: nil, request_id: nil, resource: nil, zone: nil)
1506
+ # Pass arguments to `set_deletion_protection` via keyword arguments. Note that at
1507
+ # least one keyword argument is required. To specify no parameters, or to keep all
1508
+ # the default parameter values, pass an empty Hash as a request object (see above).
1509
+ #
1510
+ # @param deletion_protection [::Boolean]
1511
+ # Whether the resource should be protected against deletion.
1512
+ # @param project [::String]
1513
+ # Project ID for this request.
1514
+ # @param request_id [::String]
1515
+ # 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.
1516
+ #
1517
+ # 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.
1518
+ #
1519
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1520
+ # @param resource [::String]
1521
+ # Name or id of the resource for this request.
1522
+ # @param zone [::String]
1523
+ # The name of the zone for this request.
1524
+ # @yield [result, env] Access the result along with the Faraday environment object
1525
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1526
+ # @yieldparam response [::Faraday::Response]
1527
+ #
1528
+ # @return [::Google::Cloud::Compute::V1::Operation]
1529
+ #
1530
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1531
+ def set_deletion_protection request, options = nil
1532
+ raise ::ArgumentError, "request must be provided" if request.nil?
1533
+
1534
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest
1535
+
1536
+ # Converts hash and nil to an options object
1537
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1538
+
1539
+ # Customize the options with defaults
1540
+ call_metadata = {}
1541
+
1542
+ # Set x-goog-api-client header
1543
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1544
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1545
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1546
+
1547
+ options.apply_defaults timeout: @config.timeout,
1548
+ metadata: call_metadata
1549
+
1550
+ uri, _body, query_string_params = transcode_set_deletion_protection request
1551
+ response = @client_stub.make_post_request(
1552
+ uri: uri,
1553
+ params: query_string_params,
1554
+ options: options
1555
+ )
1556
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1557
+
1558
+ yield result, response if block_given?
1559
+ result
1560
+ rescue ::Faraday::Error => e
1561
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1562
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1563
+ end
1564
+
1565
+ ##
1566
+ # Sets the auto-delete flag for a disk attached to an instance.
1567
+ #
1568
+ # @overload set_disk_auto_delete(request, options = nil)
1569
+ # Pass arguments to `set_disk_auto_delete` via a request object, either of type
1570
+ # {::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest} or an equivalent Hash.
1571
+ #
1572
+ # @param request [::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest, ::Hash]
1573
+ # A request object representing the call parameters. Required. To specify no
1574
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1575
+ # @param options [::Gapic::CallOptions, ::Hash]
1576
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1577
+ # Note: currently retry functionality is not implemented. While it is possible
1578
+ # to set it using ::Gapic::CallOptions, it will not be applied
1579
+ #
1580
+ # @overload set_disk_auto_delete(auto_delete: nil, device_name: nil, instance: nil, project: nil, request_id: nil, zone: nil)
1581
+ # Pass arguments to `set_disk_auto_delete` via keyword arguments. Note that at
1582
+ # least one keyword argument is required. To specify no parameters, or to keep all
1583
+ # the default parameter values, pass an empty Hash as a request object (see above).
1584
+ #
1585
+ # @param auto_delete [::Boolean]
1586
+ # Whether to auto-delete the disk when the instance is deleted.
1587
+ # @param device_name [::String]
1588
+ # The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.
1589
+ # @param instance [::String]
1590
+ # The instance name for this request.
1591
+ # @param project [::String]
1592
+ # Project ID for this request.
1593
+ # @param request_id [::String]
1594
+ # 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.
1595
+ #
1596
+ # 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.
1597
+ #
1598
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1599
+ # @param zone [::String]
1600
+ # The name of the zone for this request.
1601
+ # @yield [result, env] Access the result along with the Faraday environment object
1602
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1603
+ # @yieldparam response [::Faraday::Response]
1604
+ #
1605
+ # @return [::Google::Cloud::Compute::V1::Operation]
1606
+ #
1607
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1608
+ def set_disk_auto_delete request, options = nil
1609
+ raise ::ArgumentError, "request must be provided" if request.nil?
1610
+
1611
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest
1612
+
1613
+ # Converts hash and nil to an options object
1614
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1615
+
1616
+ # Customize the options with defaults
1617
+ call_metadata = {}
1618
+
1619
+ # Set x-goog-api-client header
1620
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1621
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1622
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1623
+
1624
+ options.apply_defaults timeout: @config.timeout,
1625
+ metadata: call_metadata
1626
+
1627
+ uri, _body, query_string_params = transcode_set_disk_auto_delete request
1628
+ response = @client_stub.make_post_request(
1629
+ uri: uri,
1630
+ params: query_string_params,
1631
+ options: options
1632
+ )
1633
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1634
+
1635
+ yield result, response if block_given?
1636
+ result
1637
+ rescue ::Faraday::Error => e
1638
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1639
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1640
+ end
1641
+
1642
+ ##
1643
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
1644
+ #
1645
+ # @overload set_iam_policy(request, options = nil)
1646
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1647
+ # {::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest} or an equivalent Hash.
1648
+ #
1649
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest, ::Hash]
1650
+ # A request object representing the call parameters. Required. To specify no
1651
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1652
+ # @param options [::Gapic::CallOptions, ::Hash]
1653
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1654
+ # Note: currently retry functionality is not implemented. While it is possible
1655
+ # to set it using ::Gapic::CallOptions, it will not be applied
1656
+ #
1657
+ # @overload set_iam_policy(project: nil, resource: nil, zone: nil, zone_set_policy_request_resource: nil)
1658
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1659
+ # least one keyword argument is required. To specify no parameters, or to keep all
1660
+ # the default parameter values, pass an empty Hash as a request object (see above).
1661
+ #
1662
+ # @param project [::String]
1663
+ # Project ID for this request.
1664
+ # @param resource [::String]
1665
+ # Name or id of the resource for this request.
1666
+ # @param zone [::String]
1667
+ # The name of the zone for this request.
1668
+ # @param zone_set_policy_request_resource [::Google::Cloud::Compute::V1::ZoneSetPolicyRequest, ::Hash]
1669
+ # The body resource for this request
1670
+ # @yield [result, env] Access the result along with the Faraday environment object
1671
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
1672
+ # @yieldparam response [::Faraday::Response]
1673
+ #
1674
+ # @return [::Google::Cloud::Compute::V1::Policy]
1675
+ #
1676
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1677
+ def set_iam_policy request, options = nil
1678
+ raise ::ArgumentError, "request must be provided" if request.nil?
1679
+
1680
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest
1681
+
1682
+ # Converts hash and nil to an options object
1683
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1684
+
1685
+ # Customize the options with defaults
1686
+ call_metadata = {}
1687
+
1688
+ # Set x-goog-api-client header
1689
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1690
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1691
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1692
+
1693
+ options.apply_defaults timeout: @config.timeout,
1694
+ metadata: call_metadata
1695
+
1696
+ uri, body, _query_string_params = transcode_set_iam_policy request
1697
+ response = @client_stub.make_post_request(
1698
+ uri: uri,
1699
+ body: body,
1700
+ options: options
1701
+ )
1702
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
1703
+
1704
+ yield result, response if block_given?
1705
+ result
1706
+ rescue ::Faraday::Error => e
1707
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1708
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1709
+ end
1710
+
1711
+ ##
1712
+ # Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
1713
+ #
1714
+ # @overload set_labels(request, options = nil)
1715
+ # Pass arguments to `set_labels` via a request object, either of type
1716
+ # {::Google::Cloud::Compute::V1::SetLabelsInstanceRequest} or an equivalent Hash.
1717
+ #
1718
+ # @param request [::Google::Cloud::Compute::V1::SetLabelsInstanceRequest, ::Hash]
1719
+ # A request object representing the call parameters. Required. To specify no
1720
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1721
+ # @param options [::Gapic::CallOptions, ::Hash]
1722
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1723
+ # Note: currently retry functionality is not implemented. While it is possible
1724
+ # to set it using ::Gapic::CallOptions, it will not be applied
1725
+ #
1726
+ # @overload set_labels(instance: nil, instances_set_labels_request_resource: nil, project: nil, request_id: nil, zone: nil)
1727
+ # Pass arguments to `set_labels` via keyword arguments. Note that at
1728
+ # least one keyword argument is required. To specify no parameters, or to keep all
1729
+ # the default parameter values, pass an empty Hash as a request object (see above).
1730
+ #
1731
+ # @param instance [::String]
1732
+ # Name of the instance scoping this request.
1733
+ # @param instances_set_labels_request_resource [::Google::Cloud::Compute::V1::InstancesSetLabelsRequest, ::Hash]
1734
+ # The body resource for this request
1735
+ # @param project [::String]
1736
+ # Project ID for this request.
1737
+ # @param request_id [::String]
1738
+ # 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.
1739
+ #
1740
+ # 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.
1741
+ #
1742
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1743
+ # @param zone [::String]
1744
+ # The name of the zone for this request.
1745
+ # @yield [result, env] Access the result along with the Faraday environment object
1746
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1747
+ # @yieldparam response [::Faraday::Response]
1748
+ #
1749
+ # @return [::Google::Cloud::Compute::V1::Operation]
1750
+ #
1751
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1752
+ def set_labels request, options = nil
1753
+ raise ::ArgumentError, "request must be provided" if request.nil?
1754
+
1755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsInstanceRequest
1756
+
1757
+ # Converts hash and nil to an options object
1758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1759
+
1760
+ # Customize the options with defaults
1761
+ call_metadata = {}
1762
+
1763
+ # Set x-goog-api-client header
1764
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1766
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1767
+
1768
+ options.apply_defaults timeout: @config.timeout,
1769
+ metadata: call_metadata
1770
+
1771
+ uri, body, _query_string_params = transcode_set_labels request
1772
+ response = @client_stub.make_post_request(
1773
+ uri: uri,
1774
+ body: body,
1775
+ options: options
1776
+ )
1777
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1778
+
1779
+ yield result, response if block_given?
1780
+ result
1781
+ rescue ::Faraday::Error => e
1782
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1783
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1784
+ end
1785
+
1786
+ ##
1787
+ # Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
1788
+ #
1789
+ # @overload set_machine_resources(request, options = nil)
1790
+ # Pass arguments to `set_machine_resources` via a request object, either of type
1791
+ # {::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest} or an equivalent Hash.
1792
+ #
1793
+ # @param request [::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest, ::Hash]
1794
+ # A request object representing the call parameters. Required. To specify no
1795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1796
+ # @param options [::Gapic::CallOptions, ::Hash]
1797
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1798
+ # Note: currently retry functionality is not implemented. While it is possible
1799
+ # to set it using ::Gapic::CallOptions, it will not be applied
1800
+ #
1801
+ # @overload set_machine_resources(instance: nil, instances_set_machine_resources_request_resource: nil, project: nil, request_id: nil, zone: nil)
1802
+ # Pass arguments to `set_machine_resources` via keyword arguments. Note that at
1803
+ # least one keyword argument is required. To specify no parameters, or to keep all
1804
+ # the default parameter values, pass an empty Hash as a request object (see above).
1805
+ #
1806
+ # @param instance [::String]
1807
+ # Name of the instance scoping this request.
1808
+ # @param instances_set_machine_resources_request_resource [::Google::Cloud::Compute::V1::InstancesSetMachineResourcesRequest, ::Hash]
1809
+ # The body resource for this request
1810
+ # @param project [::String]
1811
+ # Project ID for this request.
1812
+ # @param request_id [::String]
1813
+ # 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.
1814
+ #
1815
+ # 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.
1816
+ #
1817
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1818
+ # @param zone [::String]
1819
+ # The name of the zone for this request.
1820
+ # @yield [result, env] Access the result along with the Faraday environment object
1821
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1822
+ # @yieldparam response [::Faraday::Response]
1823
+ #
1824
+ # @return [::Google::Cloud::Compute::V1::Operation]
1825
+ #
1826
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1827
+ def set_machine_resources request, options = nil
1828
+ raise ::ArgumentError, "request must be provided" if request.nil?
1829
+
1830
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest
1831
+
1832
+ # Converts hash and nil to an options object
1833
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1834
+
1835
+ # Customize the options with defaults
1836
+ call_metadata = {}
1837
+
1838
+ # Set x-goog-api-client header
1839
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1840
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1841
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1842
+
1843
+ options.apply_defaults timeout: @config.timeout,
1844
+ metadata: call_metadata
1845
+
1846
+ uri, body, _query_string_params = transcode_set_machine_resources request
1847
+ response = @client_stub.make_post_request(
1848
+ uri: uri,
1849
+ body: body,
1850
+ options: options
1851
+ )
1852
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1853
+
1854
+ yield result, response if block_given?
1855
+ result
1856
+ rescue ::Faraday::Error => e
1857
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1858
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1859
+ end
1860
+
1861
+ ##
1862
+ # Changes the machine type for a stopped instance to the machine type specified in the request.
1863
+ #
1864
+ # @overload set_machine_type(request, options = nil)
1865
+ # Pass arguments to `set_machine_type` via a request object, either of type
1866
+ # {::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest} or an equivalent Hash.
1867
+ #
1868
+ # @param request [::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest, ::Hash]
1869
+ # A request object representing the call parameters. Required. To specify no
1870
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1871
+ # @param options [::Gapic::CallOptions, ::Hash]
1872
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1873
+ # Note: currently retry functionality is not implemented. While it is possible
1874
+ # to set it using ::Gapic::CallOptions, it will not be applied
1875
+ #
1876
+ # @overload set_machine_type(instance: nil, instances_set_machine_type_request_resource: nil, project: nil, request_id: nil, zone: nil)
1877
+ # Pass arguments to `set_machine_type` via keyword arguments. Note that at
1878
+ # least one keyword argument is required. To specify no parameters, or to keep all
1879
+ # the default parameter values, pass an empty Hash as a request object (see above).
1880
+ #
1881
+ # @param instance [::String]
1882
+ # Name of the instance scoping this request.
1883
+ # @param instances_set_machine_type_request_resource [::Google::Cloud::Compute::V1::InstancesSetMachineTypeRequest, ::Hash]
1884
+ # The body resource for this request
1885
+ # @param project [::String]
1886
+ # Project ID for this request.
1887
+ # @param request_id [::String]
1888
+ # 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.
1889
+ #
1890
+ # 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.
1891
+ #
1892
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1893
+ # @param zone [::String]
1894
+ # The name of the zone for this request.
1895
+ # @yield [result, env] Access the result along with the Faraday environment object
1896
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1897
+ # @yieldparam response [::Faraday::Response]
1898
+ #
1899
+ # @return [::Google::Cloud::Compute::V1::Operation]
1900
+ #
1901
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1902
+ def set_machine_type request, options = nil
1903
+ raise ::ArgumentError, "request must be provided" if request.nil?
1904
+
1905
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest
1906
+
1907
+ # Converts hash and nil to an options object
1908
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1909
+
1910
+ # Customize the options with defaults
1911
+ call_metadata = {}
1912
+
1913
+ # Set x-goog-api-client header
1914
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1915
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1916
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1917
+
1918
+ options.apply_defaults timeout: @config.timeout,
1919
+ metadata: call_metadata
1920
+
1921
+ uri, body, _query_string_params = transcode_set_machine_type request
1922
+ response = @client_stub.make_post_request(
1923
+ uri: uri,
1924
+ body: body,
1925
+ options: options
1926
+ )
1927
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1928
+
1929
+ yield result, response if block_given?
1930
+ result
1931
+ rescue ::Faraday::Error => e
1932
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1933
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1934
+ end
1935
+
1936
+ ##
1937
+ # Sets metadata for the specified instance to the data included in the request.
1938
+ #
1939
+ # @overload set_metadata(request, options = nil)
1940
+ # Pass arguments to `set_metadata` via a request object, either of type
1941
+ # {::Google::Cloud::Compute::V1::SetMetadataInstanceRequest} or an equivalent Hash.
1942
+ #
1943
+ # @param request [::Google::Cloud::Compute::V1::SetMetadataInstanceRequest, ::Hash]
1944
+ # A request object representing the call parameters. Required. To specify no
1945
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1946
+ # @param options [::Gapic::CallOptions, ::Hash]
1947
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1948
+ # Note: currently retry functionality is not implemented. While it is possible
1949
+ # to set it using ::Gapic::CallOptions, it will not be applied
1950
+ #
1951
+ # @overload set_metadata(instance: nil, metadata_resource: nil, project: nil, request_id: nil, zone: nil)
1952
+ # Pass arguments to `set_metadata` via keyword arguments. Note that at
1953
+ # least one keyword argument is required. To specify no parameters, or to keep all
1954
+ # the default parameter values, pass an empty Hash as a request object (see above).
1955
+ #
1956
+ # @param instance [::String]
1957
+ # Name of the instance scoping this request.
1958
+ # @param metadata_resource [::Google::Cloud::Compute::V1::Metadata, ::Hash]
1959
+ # The body resource for this request
1960
+ # @param project [::String]
1961
+ # Project ID for this request.
1962
+ # @param request_id [::String]
1963
+ # 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.
1964
+ #
1965
+ # 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.
1966
+ #
1967
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1968
+ # @param zone [::String]
1969
+ # The name of the zone for this request.
1970
+ # @yield [result, env] Access the result along with the Faraday environment object
1971
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1972
+ # @yieldparam response [::Faraday::Response]
1973
+ #
1974
+ # @return [::Google::Cloud::Compute::V1::Operation]
1975
+ #
1976
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1977
+ def set_metadata request, options = nil
1978
+ raise ::ArgumentError, "request must be provided" if request.nil?
1979
+
1980
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMetadataInstanceRequest
1981
+
1982
+ # Converts hash and nil to an options object
1983
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1984
+
1985
+ # Customize the options with defaults
1986
+ call_metadata = {}
1987
+
1988
+ # Set x-goog-api-client header
1989
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1990
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1991
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
1992
+
1993
+ options.apply_defaults timeout: @config.timeout,
1994
+ metadata: call_metadata
1995
+
1996
+ uri, body, _query_string_params = transcode_set_metadata request
1997
+ response = @client_stub.make_post_request(
1998
+ uri: uri,
1999
+ body: body,
2000
+ options: options
2001
+ )
2002
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2003
+
2004
+ yield result, response if block_given?
2005
+ result
2006
+ rescue ::Faraday::Error => e
2007
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2008
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2009
+ end
2010
+
2011
+ ##
2012
+ # Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.
2013
+ #
2014
+ # @overload set_min_cpu_platform(request, options = nil)
2015
+ # Pass arguments to `set_min_cpu_platform` via a request object, either of type
2016
+ # {::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest} or an equivalent Hash.
2017
+ #
2018
+ # @param request [::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest, ::Hash]
2019
+ # A request object representing the call parameters. Required. To specify no
2020
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2021
+ # @param options [::Gapic::CallOptions, ::Hash]
2022
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2023
+ # Note: currently retry functionality is not implemented. While it is possible
2024
+ # to set it using ::Gapic::CallOptions, it will not be applied
2025
+ #
2026
+ # @overload set_min_cpu_platform(instance: nil, instances_set_min_cpu_platform_request_resource: nil, project: nil, request_id: nil, zone: nil)
2027
+ # Pass arguments to `set_min_cpu_platform` via keyword arguments. Note that at
2028
+ # least one keyword argument is required. To specify no parameters, or to keep all
2029
+ # the default parameter values, pass an empty Hash as a request object (see above).
2030
+ #
2031
+ # @param instance [::String]
2032
+ # Name of the instance scoping this request.
2033
+ # @param instances_set_min_cpu_platform_request_resource [::Google::Cloud::Compute::V1::InstancesSetMinCpuPlatformRequest, ::Hash]
2034
+ # The body resource for this request
2035
+ # @param project [::String]
2036
+ # Project ID for this request.
2037
+ # @param request_id [::String]
2038
+ # 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.
2039
+ #
2040
+ # 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.
2041
+ #
2042
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2043
+ # @param zone [::String]
2044
+ # The name of the zone for this request.
2045
+ # @yield [result, env] Access the result along with the Faraday environment object
2046
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2047
+ # @yieldparam response [::Faraday::Response]
2048
+ #
2049
+ # @return [::Google::Cloud::Compute::V1::Operation]
2050
+ #
2051
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2052
+ def set_min_cpu_platform request, options = nil
2053
+ raise ::ArgumentError, "request must be provided" if request.nil?
2054
+
2055
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest
2056
+
2057
+ # Converts hash and nil to an options object
2058
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2059
+
2060
+ # Customize the options with defaults
2061
+ call_metadata = {}
2062
+
2063
+ # Set x-goog-api-client header
2064
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2065
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2066
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2067
+
2068
+ options.apply_defaults timeout: @config.timeout,
2069
+ metadata: call_metadata
2070
+
2071
+ uri, body, _query_string_params = transcode_set_min_cpu_platform request
2072
+ response = @client_stub.make_post_request(
2073
+ uri: uri,
2074
+ body: body,
2075
+ options: options
2076
+ )
2077
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2078
+
2079
+ yield result, response if block_given?
2080
+ result
2081
+ rescue ::Faraday::Error => e
2082
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2083
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2084
+ end
2085
+
2086
+ ##
2087
+ # Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states.
2088
+ #
2089
+ # @overload set_scheduling(request, options = nil)
2090
+ # Pass arguments to `set_scheduling` via a request object, either of type
2091
+ # {::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest} or an equivalent Hash.
2092
+ #
2093
+ # @param request [::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest, ::Hash]
2094
+ # A request object representing the call parameters. Required. To specify no
2095
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2096
+ # @param options [::Gapic::CallOptions, ::Hash]
2097
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2098
+ # Note: currently retry functionality is not implemented. While it is possible
2099
+ # to set it using ::Gapic::CallOptions, it will not be applied
2100
+ #
2101
+ # @overload set_scheduling(instance: nil, project: nil, request_id: nil, scheduling_resource: nil, zone: nil)
2102
+ # Pass arguments to `set_scheduling` via keyword arguments. Note that at
2103
+ # least one keyword argument is required. To specify no parameters, or to keep all
2104
+ # the default parameter values, pass an empty Hash as a request object (see above).
2105
+ #
2106
+ # @param instance [::String]
2107
+ # Instance name for this request.
2108
+ # @param project [::String]
2109
+ # Project ID for this request.
2110
+ # @param request_id [::String]
2111
+ # 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.
2112
+ #
2113
+ # 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.
2114
+ #
2115
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2116
+ # @param scheduling_resource [::Google::Cloud::Compute::V1::Scheduling, ::Hash]
2117
+ # The body resource for this request
2118
+ # @param zone [::String]
2119
+ # The name of the zone for this request.
2120
+ # @yield [result, env] Access the result along with the Faraday environment object
2121
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2122
+ # @yieldparam response [::Faraday::Response]
2123
+ #
2124
+ # @return [::Google::Cloud::Compute::V1::Operation]
2125
+ #
2126
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2127
+ def set_scheduling request, options = nil
2128
+ raise ::ArgumentError, "request must be provided" if request.nil?
2129
+
2130
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest
2131
+
2132
+ # Converts hash and nil to an options object
2133
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2134
+
2135
+ # Customize the options with defaults
2136
+ call_metadata = {}
2137
+
2138
+ # Set x-goog-api-client header
2139
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2140
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2141
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2142
+
2143
+ options.apply_defaults timeout: @config.timeout,
2144
+ metadata: call_metadata
2145
+
2146
+ uri, body, _query_string_params = transcode_set_scheduling request
2147
+ response = @client_stub.make_post_request(
2148
+ uri: uri,
2149
+ body: body,
2150
+ options: options
2151
+ )
2152
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2153
+
2154
+ yield result, response if block_given?
2155
+ result
2156
+ rescue ::Faraday::Error => e
2157
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2158
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2159
+ end
2160
+
2161
+ ##
2162
+ # Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
2163
+ #
2164
+ # @overload set_service_account(request, options = nil)
2165
+ # Pass arguments to `set_service_account` via a request object, either of type
2166
+ # {::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest} or an equivalent Hash.
2167
+ #
2168
+ # @param request [::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest, ::Hash]
2169
+ # A request object representing the call parameters. Required. To specify no
2170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2171
+ # @param options [::Gapic::CallOptions, ::Hash]
2172
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2173
+ # Note: currently retry functionality is not implemented. While it is possible
2174
+ # to set it using ::Gapic::CallOptions, it will not be applied
2175
+ #
2176
+ # @overload set_service_account(instance: nil, instances_set_service_account_request_resource: nil, project: nil, request_id: nil, zone: nil)
2177
+ # Pass arguments to `set_service_account` via keyword arguments. Note that at
2178
+ # least one keyword argument is required. To specify no parameters, or to keep all
2179
+ # the default parameter values, pass an empty Hash as a request object (see above).
2180
+ #
2181
+ # @param instance [::String]
2182
+ # Name of the instance resource to start.
2183
+ # @param instances_set_service_account_request_resource [::Google::Cloud::Compute::V1::InstancesSetServiceAccountRequest, ::Hash]
2184
+ # The body resource for this request
2185
+ # @param project [::String]
2186
+ # Project ID for this request.
2187
+ # @param request_id [::String]
2188
+ # 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.
2189
+ #
2190
+ # 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.
2191
+ #
2192
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2193
+ # @param zone [::String]
2194
+ # The name of the zone for this request.
2195
+ # @yield [result, env] Access the result along with the Faraday environment object
2196
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2197
+ # @yieldparam response [::Faraday::Response]
2198
+ #
2199
+ # @return [::Google::Cloud::Compute::V1::Operation]
2200
+ #
2201
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2202
+ def set_service_account request, options = nil
2203
+ raise ::ArgumentError, "request must be provided" if request.nil?
2204
+
2205
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest
2206
+
2207
+ # Converts hash and nil to an options object
2208
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2209
+
2210
+ # Customize the options with defaults
2211
+ call_metadata = {}
2212
+
2213
+ # Set x-goog-api-client header
2214
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2215
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2216
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2217
+
2218
+ options.apply_defaults timeout: @config.timeout,
2219
+ metadata: call_metadata
2220
+
2221
+ uri, body, _query_string_params = transcode_set_service_account request
2222
+ response = @client_stub.make_post_request(
2223
+ uri: uri,
2224
+ body: body,
2225
+ options: options
2226
+ )
2227
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2228
+
2229
+ yield result, response if block_given?
2230
+ result
2231
+ rescue ::Faraday::Error => e
2232
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2233
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2234
+ end
2235
+
2236
+ ##
2237
+ # Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
2238
+ #
2239
+ # @overload set_shielded_instance_integrity_policy(request, options = nil)
2240
+ # Pass arguments to `set_shielded_instance_integrity_policy` via a request object, either of type
2241
+ # {::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest} or an equivalent Hash.
2242
+ #
2243
+ # @param request [::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest, ::Hash]
2244
+ # A request object representing the call parameters. Required. To specify no
2245
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2246
+ # @param options [::Gapic::CallOptions, ::Hash]
2247
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2248
+ # Note: currently retry functionality is not implemented. While it is possible
2249
+ # to set it using ::Gapic::CallOptions, it will not be applied
2250
+ #
2251
+ # @overload set_shielded_instance_integrity_policy(instance: nil, project: nil, request_id: nil, shielded_instance_integrity_policy_resource: nil, zone: nil)
2252
+ # Pass arguments to `set_shielded_instance_integrity_policy` via keyword arguments. Note that at
2253
+ # least one keyword argument is required. To specify no parameters, or to keep all
2254
+ # the default parameter values, pass an empty Hash as a request object (see above).
2255
+ #
2256
+ # @param instance [::String]
2257
+ # Name or id of the instance scoping this request.
2258
+ # @param project [::String]
2259
+ # Project ID for this request.
2260
+ # @param request_id [::String]
2261
+ # 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.
2262
+ #
2263
+ # 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.
2264
+ #
2265
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2266
+ # @param shielded_instance_integrity_policy_resource [::Google::Cloud::Compute::V1::ShieldedInstanceIntegrityPolicy, ::Hash]
2267
+ # The body resource for this request
2268
+ # @param zone [::String]
2269
+ # The name of the zone for this request.
2270
+ # @yield [result, env] Access the result along with the Faraday environment object
2271
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2272
+ # @yieldparam response [::Faraday::Response]
2273
+ #
2274
+ # @return [::Google::Cloud::Compute::V1::Operation]
2275
+ #
2276
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2277
+ def set_shielded_instance_integrity_policy request, options = nil
2278
+ raise ::ArgumentError, "request must be provided" if request.nil?
2279
+
2280
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest
2281
+
2282
+ # Converts hash and nil to an options object
2283
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2284
+
2285
+ # Customize the options with defaults
2286
+ call_metadata = {}
2287
+
2288
+ # Set x-goog-api-client header
2289
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2291
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2292
+
2293
+ options.apply_defaults timeout: @config.timeout,
2294
+ metadata: call_metadata
2295
+
2296
+ uri, body, _query_string_params = transcode_set_shielded_instance_integrity_policy request
2297
+ response = @client_stub.make_patch_request(
2298
+ uri: uri,
2299
+ body: body,
2300
+ options: options
2301
+ )
2302
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2303
+
2304
+ yield result, response if block_given?
2305
+ result
2306
+ rescue ::Faraday::Error => e
2307
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2308
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2309
+ end
2310
+
2311
+ ##
2312
+ # Sets network tags for the specified instance to the data included in the request.
2313
+ #
2314
+ # @overload set_tags(request, options = nil)
2315
+ # Pass arguments to `set_tags` via a request object, either of type
2316
+ # {::Google::Cloud::Compute::V1::SetTagsInstanceRequest} or an equivalent Hash.
2317
+ #
2318
+ # @param request [::Google::Cloud::Compute::V1::SetTagsInstanceRequest, ::Hash]
2319
+ # A request object representing the call parameters. Required. To specify no
2320
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2321
+ # @param options [::Gapic::CallOptions, ::Hash]
2322
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2323
+ # Note: currently retry functionality is not implemented. While it is possible
2324
+ # to set it using ::Gapic::CallOptions, it will not be applied
2325
+ #
2326
+ # @overload set_tags(instance: nil, project: nil, request_id: nil, tags_resource: nil, zone: nil)
2327
+ # Pass arguments to `set_tags` via keyword arguments. Note that at
2328
+ # least one keyword argument is required. To specify no parameters, or to keep all
2329
+ # the default parameter values, pass an empty Hash as a request object (see above).
2330
+ #
2331
+ # @param instance [::String]
2332
+ # Name of the instance scoping this request.
2333
+ # @param project [::String]
2334
+ # Project ID for this request.
2335
+ # @param request_id [::String]
2336
+ # 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.
2337
+ #
2338
+ # 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.
2339
+ #
2340
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2341
+ # @param tags_resource [::Google::Cloud::Compute::V1::Tags, ::Hash]
2342
+ # The body resource for this request
2343
+ # @param zone [::String]
2344
+ # The name of the zone for this request.
2345
+ # @yield [result, env] Access the result along with the Faraday environment object
2346
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2347
+ # @yieldparam response [::Faraday::Response]
2348
+ #
2349
+ # @return [::Google::Cloud::Compute::V1::Operation]
2350
+ #
2351
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2352
+ def set_tags request, options = nil
2353
+ raise ::ArgumentError, "request must be provided" if request.nil?
2354
+
2355
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetTagsInstanceRequest
2356
+
2357
+ # Converts hash and nil to an options object
2358
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2359
+
2360
+ # Customize the options with defaults
2361
+ call_metadata = {}
2362
+
2363
+ # Set x-goog-api-client header
2364
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2365
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2366
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2367
+
2368
+ options.apply_defaults timeout: @config.timeout,
2369
+ metadata: call_metadata
2370
+
2371
+ uri, body, _query_string_params = transcode_set_tags request
2372
+ response = @client_stub.make_post_request(
2373
+ uri: uri,
2374
+ body: body,
2375
+ options: options
2376
+ )
2377
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2378
+
2379
+ yield result, response if block_given?
2380
+ result
2381
+ rescue ::Faraday::Error => e
2382
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2383
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2384
+ end
2385
+
2386
+ ##
2387
+ # Simulates a maintenance event on the instance.
2388
+ #
2389
+ # @overload simulate_maintenance_event(request, options = nil)
2390
+ # Pass arguments to `simulate_maintenance_event` via a request object, either of type
2391
+ # {::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest} or an equivalent Hash.
2392
+ #
2393
+ # @param request [::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest, ::Hash]
2394
+ # A request object representing the call parameters. Required. To specify no
2395
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2396
+ # @param options [::Gapic::CallOptions, ::Hash]
2397
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2398
+ # Note: currently retry functionality is not implemented. While it is possible
2399
+ # to set it using ::Gapic::CallOptions, it will not be applied
2400
+ #
2401
+ # @overload simulate_maintenance_event(instance: nil, project: nil, zone: nil)
2402
+ # Pass arguments to `simulate_maintenance_event` via keyword arguments. Note that at
2403
+ # least one keyword argument is required. To specify no parameters, or to keep all
2404
+ # the default parameter values, pass an empty Hash as a request object (see above).
2405
+ #
2406
+ # @param instance [::String]
2407
+ # Name of the instance scoping this request.
2408
+ # @param project [::String]
2409
+ # Project ID for this request.
2410
+ # @param zone [::String]
2411
+ # The name of the zone for this request.
2412
+ # @yield [result, env] Access the result along with the Faraday environment object
2413
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2414
+ # @yieldparam response [::Faraday::Response]
2415
+ #
2416
+ # @return [::Google::Cloud::Compute::V1::Operation]
2417
+ #
2418
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2419
+ def simulate_maintenance_event request, options = nil
2420
+ raise ::ArgumentError, "request must be provided" if request.nil?
2421
+
2422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest
2423
+
2424
+ # Converts hash and nil to an options object
2425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2426
+
2427
+ # Customize the options with defaults
2428
+ call_metadata = {}
2429
+
2430
+ # Set x-goog-api-client header
2431
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2433
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2434
+
2435
+ options.apply_defaults timeout: @config.timeout,
2436
+ metadata: call_metadata
2437
+
2438
+ uri, _body, _query_string_params = transcode_simulate_maintenance_event request
2439
+ response = @client_stub.make_post_request(
2440
+ uri: uri,
2441
+ options: options
2442
+ )
2443
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2444
+
2445
+ yield result, response if block_given?
2446
+ result
2447
+ rescue ::Faraday::Error => e
2448
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2449
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2450
+ end
2451
+
2452
+ ##
2453
+ # Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
2454
+ #
2455
+ # @overload start(request, options = nil)
2456
+ # Pass arguments to `start` via a request object, either of type
2457
+ # {::Google::Cloud::Compute::V1::StartInstanceRequest} or an equivalent Hash.
2458
+ #
2459
+ # @param request [::Google::Cloud::Compute::V1::StartInstanceRequest, ::Hash]
2460
+ # A request object representing the call parameters. Required. To specify no
2461
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2462
+ # @param options [::Gapic::CallOptions, ::Hash]
2463
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2464
+ # Note: currently retry functionality is not implemented. While it is possible
2465
+ # to set it using ::Gapic::CallOptions, it will not be applied
2466
+ #
2467
+ # @overload start(instance: nil, project: nil, request_id: nil, zone: nil)
2468
+ # Pass arguments to `start` via keyword arguments. Note that at
2469
+ # least one keyword argument is required. To specify no parameters, or to keep all
2470
+ # the default parameter values, pass an empty Hash as a request object (see above).
2471
+ #
2472
+ # @param instance [::String]
2473
+ # Name of the instance resource to start.
2474
+ # @param project [::String]
2475
+ # Project ID for this request.
2476
+ # @param request_id [::String]
2477
+ # 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.
2478
+ #
2479
+ # 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.
2480
+ #
2481
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2482
+ # @param zone [::String]
2483
+ # The name of the zone for this request.
2484
+ # @yield [result, env] Access the result along with the Faraday environment object
2485
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2486
+ # @yieldparam response [::Faraday::Response]
2487
+ #
2488
+ # @return [::Google::Cloud::Compute::V1::Operation]
2489
+ #
2490
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2491
+ def start request, options = nil
2492
+ raise ::ArgumentError, "request must be provided" if request.nil?
2493
+
2494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartInstanceRequest
2495
+
2496
+ # Converts hash and nil to an options object
2497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2498
+
2499
+ # Customize the options with defaults
2500
+ call_metadata = {}
2501
+
2502
+ # Set x-goog-api-client header
2503
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2505
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2506
+
2507
+ options.apply_defaults timeout: @config.timeout,
2508
+ metadata: call_metadata
2509
+
2510
+ uri, _body, query_string_params = transcode_start request
2511
+ response = @client_stub.make_post_request(
2512
+ uri: uri,
2513
+ params: query_string_params,
2514
+ options: options
2515
+ )
2516
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2517
+
2518
+ yield result, response if block_given?
2519
+ result
2520
+ rescue ::Faraday::Error => e
2521
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2522
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2523
+ end
2524
+
2525
+ ##
2526
+ # Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
2527
+ #
2528
+ # @overload start_with_encryption_key(request, options = nil)
2529
+ # Pass arguments to `start_with_encryption_key` via a request object, either of type
2530
+ # {::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest} or an equivalent Hash.
2531
+ #
2532
+ # @param request [::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest, ::Hash]
2533
+ # A request object representing the call parameters. Required. To specify no
2534
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2535
+ # @param options [::Gapic::CallOptions, ::Hash]
2536
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2537
+ # Note: currently retry functionality is not implemented. While it is possible
2538
+ # to set it using ::Gapic::CallOptions, it will not be applied
2539
+ #
2540
+ # @overload start_with_encryption_key(instance: nil, instances_start_with_encryption_key_request_resource: nil, project: nil, request_id: nil, zone: nil)
2541
+ # Pass arguments to `start_with_encryption_key` via keyword arguments. Note that at
2542
+ # least one keyword argument is required. To specify no parameters, or to keep all
2543
+ # the default parameter values, pass an empty Hash as a request object (see above).
2544
+ #
2545
+ # @param instance [::String]
2546
+ # Name of the instance resource to start.
2547
+ # @param instances_start_with_encryption_key_request_resource [::Google::Cloud::Compute::V1::InstancesStartWithEncryptionKeyRequest, ::Hash]
2548
+ # The body resource for this request
2549
+ # @param project [::String]
2550
+ # Project ID for this request.
2551
+ # @param request_id [::String]
2552
+ # 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.
2553
+ #
2554
+ # 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.
2555
+ #
2556
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2557
+ # @param zone [::String]
2558
+ # The name of the zone for this request.
2559
+ # @yield [result, env] Access the result along with the Faraday environment object
2560
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2561
+ # @yieldparam response [::Faraday::Response]
2562
+ #
2563
+ # @return [::Google::Cloud::Compute::V1::Operation]
2564
+ #
2565
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2566
+ def start_with_encryption_key request, options = nil
2567
+ raise ::ArgumentError, "request must be provided" if request.nil?
2568
+
2569
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest
2570
+
2571
+ # Converts hash and nil to an options object
2572
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2573
+
2574
+ # Customize the options with defaults
2575
+ call_metadata = {}
2576
+
2577
+ # Set x-goog-api-client header
2578
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2579
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2580
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2581
+
2582
+ options.apply_defaults timeout: @config.timeout,
2583
+ metadata: call_metadata
2584
+
2585
+ uri, body, _query_string_params = transcode_start_with_encryption_key request
2586
+ response = @client_stub.make_post_request(
2587
+ uri: uri,
2588
+ body: body,
2589
+ options: options
2590
+ )
2591
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2592
+
2593
+ yield result, response if block_given?
2594
+ result
2595
+ rescue ::Faraday::Error => e
2596
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2597
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2598
+ end
2599
+
2600
+ ##
2601
+ # Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.
2602
+ #
2603
+ # @overload stop(request, options = nil)
2604
+ # Pass arguments to `stop` via a request object, either of type
2605
+ # {::Google::Cloud::Compute::V1::StopInstanceRequest} or an equivalent Hash.
2606
+ #
2607
+ # @param request [::Google::Cloud::Compute::V1::StopInstanceRequest, ::Hash]
2608
+ # A request object representing the call parameters. Required. To specify no
2609
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2610
+ # @param options [::Gapic::CallOptions, ::Hash]
2611
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2612
+ # Note: currently retry functionality is not implemented. While it is possible
2613
+ # to set it using ::Gapic::CallOptions, it will not be applied
2614
+ #
2615
+ # @overload stop(instance: nil, project: nil, request_id: nil, zone: nil)
2616
+ # Pass arguments to `stop` via keyword arguments. Note that at
2617
+ # least one keyword argument is required. To specify no parameters, or to keep all
2618
+ # the default parameter values, pass an empty Hash as a request object (see above).
2619
+ #
2620
+ # @param instance [::String]
2621
+ # Name of the instance resource to stop.
2622
+ # @param project [::String]
2623
+ # Project ID for this request.
2624
+ # @param request_id [::String]
2625
+ # 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.
2626
+ #
2627
+ # 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.
2628
+ #
2629
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2630
+ # @param zone [::String]
2631
+ # The name of the zone for this request.
2632
+ # @yield [result, env] Access the result along with the Faraday environment object
2633
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2634
+ # @yieldparam response [::Faraday::Response]
2635
+ #
2636
+ # @return [::Google::Cloud::Compute::V1::Operation]
2637
+ #
2638
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2639
+ def stop request, options = nil
2640
+ raise ::ArgumentError, "request must be provided" if request.nil?
2641
+
2642
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StopInstanceRequest
2643
+
2644
+ # Converts hash and nil to an options object
2645
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2646
+
2647
+ # Customize the options with defaults
2648
+ call_metadata = {}
2649
+
2650
+ # Set x-goog-api-client header
2651
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2652
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2653
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2654
+
2655
+ options.apply_defaults timeout: @config.timeout,
2656
+ metadata: call_metadata
2657
+
2658
+ uri, _body, query_string_params = transcode_stop request
2659
+ response = @client_stub.make_post_request(
2660
+ uri: uri,
2661
+ params: query_string_params,
2662
+ options: options
2663
+ )
2664
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2665
+
2666
+ yield result, response if block_given?
2667
+ result
2668
+ rescue ::Faraday::Error => e
2669
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2670
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2671
+ end
2672
+
2673
+ ##
2674
+ # Returns permissions that a caller has on the specified resource.
2675
+ #
2676
+ # @overload test_iam_permissions(request, options = nil)
2677
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
2678
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest} or an equivalent Hash.
2679
+ #
2680
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest, ::Hash]
2681
+ # A request object representing the call parameters. Required. To specify no
2682
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2683
+ # @param options [::Gapic::CallOptions, ::Hash]
2684
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2685
+ # Note: currently retry functionality is not implemented. While it is possible
2686
+ # to set it using ::Gapic::CallOptions, it will not be applied
2687
+ #
2688
+ # @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil)
2689
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
2690
+ # least one keyword argument is required. To specify no parameters, or to keep all
2691
+ # the default parameter values, pass an empty Hash as a request object (see above).
2692
+ #
2693
+ # @param project [::String]
2694
+ # Project ID for this request.
2695
+ # @param resource [::String]
2696
+ # Name or id of the resource for this request.
2697
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
2698
+ # The body resource for this request
2699
+ # @param zone [::String]
2700
+ # The name of the zone for this request.
2701
+ # @yield [result, env] Access the result along with the Faraday environment object
2702
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
2703
+ # @yieldparam response [::Faraday::Response]
2704
+ #
2705
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
2706
+ #
2707
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2708
+ def test_iam_permissions request, options = nil
2709
+ raise ::ArgumentError, "request must be provided" if request.nil?
2710
+
2711
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest
2712
+
2713
+ # Converts hash and nil to an options object
2714
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2715
+
2716
+ # Customize the options with defaults
2717
+ call_metadata = {}
2718
+
2719
+ # Set x-goog-api-client header
2720
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2721
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2722
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2723
+
2724
+ options.apply_defaults timeout: @config.timeout,
2725
+ metadata: call_metadata
2726
+
2727
+ uri, body, _query_string_params = transcode_test_iam_permissions request
2728
+ response = @client_stub.make_post_request(
2729
+ uri: uri,
2730
+ body: body,
2731
+ options: options
2732
+ )
2733
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
2734
+
2735
+ yield result, response if block_given?
2736
+ result
2737
+ rescue ::Faraday::Error => e
2738
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2739
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2740
+ end
2741
+
2742
+ ##
2743
+ # Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.
2744
+ #
2745
+ # @overload update(request, options = nil)
2746
+ # Pass arguments to `update` via a request object, either of type
2747
+ # {::Google::Cloud::Compute::V1::UpdateInstanceRequest} or an equivalent Hash.
2748
+ #
2749
+ # @param request [::Google::Cloud::Compute::V1::UpdateInstanceRequest, ::Hash]
2750
+ # A request object representing the call parameters. Required. To specify no
2751
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2752
+ # @param options [::Gapic::CallOptions, ::Hash]
2753
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2754
+ # Note: currently retry functionality is not implemented. While it is possible
2755
+ # to set it using ::Gapic::CallOptions, it will not be applied
2756
+ #
2757
+ # @overload update(instance: nil, instance_resource: nil, minimal_action: nil, most_disruptive_allowed_action: nil, project: nil, request_id: nil, zone: nil)
2758
+ # Pass arguments to `update` via keyword arguments. Note that at
2759
+ # least one keyword argument is required. To specify no parameters, or to keep all
2760
+ # the default parameter values, pass an empty Hash as a request object (see above).
2761
+ #
2762
+ # @param instance [::String]
2763
+ # Name of the instance resource to update.
2764
+ # @param instance_resource [::Google::Cloud::Compute::V1::Instance, ::Hash]
2765
+ # The body resource for this request
2766
+ # @param minimal_action [::String]
2767
+ # Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require.
2768
+ # @param most_disruptive_allowed_action [::String]
2769
+ # Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART.
2770
+ # @param project [::String]
2771
+ # Project ID for this request.
2772
+ # @param request_id [::String]
2773
+ # 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.
2774
+ #
2775
+ # 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.
2776
+ #
2777
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2778
+ # @param zone [::String]
2779
+ # The name of the zone for this request.
2780
+ # @yield [result, env] Access the result along with the Faraday environment object
2781
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2782
+ # @yieldparam response [::Faraday::Response]
2783
+ #
2784
+ # @return [::Google::Cloud::Compute::V1::Operation]
2785
+ #
2786
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2787
+ def update request, options = nil
2788
+ raise ::ArgumentError, "request must be provided" if request.nil?
2789
+
2790
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateInstanceRequest
2791
+
2792
+ # Converts hash and nil to an options object
2793
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2794
+
2795
+ # Customize the options with defaults
2796
+ call_metadata = {}
2797
+
2798
+ # Set x-goog-api-client header
2799
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2800
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2801
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2802
+
2803
+ options.apply_defaults timeout: @config.timeout,
2804
+ metadata: call_metadata
2805
+
2806
+ uri, body, _query_string_params = transcode_update request
2807
+ response = @client_stub.make_put_request(
2808
+ uri: uri,
2809
+ body: body,
2810
+ options: options
2811
+ )
2812
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2813
+
2814
+ yield result, response if block_given?
2815
+ result
2816
+ rescue ::Faraday::Error => e
2817
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2818
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2819
+ end
2820
+
2821
+ ##
2822
+ # Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
2823
+ #
2824
+ # @overload update_access_config(request, options = nil)
2825
+ # Pass arguments to `update_access_config` via a request object, either of type
2826
+ # {::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest} or an equivalent Hash.
2827
+ #
2828
+ # @param request [::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest, ::Hash]
2829
+ # A request object representing the call parameters. Required. To specify no
2830
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2831
+ # @param options [::Gapic::CallOptions, ::Hash]
2832
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2833
+ # Note: currently retry functionality is not implemented. While it is possible
2834
+ # to set it using ::Gapic::CallOptions, it will not be applied
2835
+ #
2836
+ # @overload update_access_config(access_config_resource: nil, instance: nil, network_interface: nil, project: nil, request_id: nil, zone: nil)
2837
+ # Pass arguments to `update_access_config` via keyword arguments. Note that at
2838
+ # least one keyword argument is required. To specify no parameters, or to keep all
2839
+ # the default parameter values, pass an empty Hash as a request object (see above).
2840
+ #
2841
+ # @param access_config_resource [::Google::Cloud::Compute::V1::AccessConfig, ::Hash]
2842
+ # The body resource for this request
2843
+ # @param instance [::String]
2844
+ # The instance name for this request.
2845
+ # @param network_interface [::String]
2846
+ # The name of the network interface where the access config is attached.
2847
+ # @param project [::String]
2848
+ # Project ID for this request.
2849
+ # @param request_id [::String]
2850
+ # 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.
2851
+ #
2852
+ # 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.
2853
+ #
2854
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2855
+ # @param zone [::String]
2856
+ # The name of the zone for this request.
2857
+ # @yield [result, env] Access the result along with the Faraday environment object
2858
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2859
+ # @yieldparam response [::Faraday::Response]
2860
+ #
2861
+ # @return [::Google::Cloud::Compute::V1::Operation]
2862
+ #
2863
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2864
+ def update_access_config request, options = nil
2865
+ raise ::ArgumentError, "request must be provided" if request.nil?
2866
+
2867
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest
2868
+
2869
+ # Converts hash and nil to an options object
2870
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2871
+
2872
+ # Customize the options with defaults
2873
+ call_metadata = {}
2874
+
2875
+ # Set x-goog-api-client header
2876
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2877
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2878
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2879
+
2880
+ options.apply_defaults timeout: @config.timeout,
2881
+ metadata: call_metadata
2882
+
2883
+ uri, body, _query_string_params = transcode_update_access_config request
2884
+ response = @client_stub.make_post_request(
2885
+ uri: uri,
2886
+ body: body,
2887
+ options: options
2888
+ )
2889
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2890
+
2891
+ yield result, response if block_given?
2892
+ result
2893
+ rescue ::Faraday::Error => e
2894
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2895
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2896
+ end
2897
+
2898
+ ##
2899
+ # Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
2900
+ #
2901
+ # @overload update_display_device(request, options = nil)
2902
+ # Pass arguments to `update_display_device` via a request object, either of type
2903
+ # {::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest} or an equivalent Hash.
2904
+ #
2905
+ # @param request [::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest, ::Hash]
2906
+ # A request object representing the call parameters. Required. To specify no
2907
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2908
+ # @param options [::Gapic::CallOptions, ::Hash]
2909
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2910
+ # Note: currently retry functionality is not implemented. While it is possible
2911
+ # to set it using ::Gapic::CallOptions, it will not be applied
2912
+ #
2913
+ # @overload update_display_device(display_device_resource: nil, instance: nil, project: nil, request_id: nil, zone: nil)
2914
+ # Pass arguments to `update_display_device` via keyword arguments. Note that at
2915
+ # least one keyword argument is required. To specify no parameters, or to keep all
2916
+ # the default parameter values, pass an empty Hash as a request object (see above).
2917
+ #
2918
+ # @param display_device_resource [::Google::Cloud::Compute::V1::DisplayDevice, ::Hash]
2919
+ # The body resource for this request
2920
+ # @param instance [::String]
2921
+ # Name of the instance scoping this request.
2922
+ # @param project [::String]
2923
+ # Project ID for this request.
2924
+ # @param request_id [::String]
2925
+ # 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.
2926
+ #
2927
+ # 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.
2928
+ #
2929
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2930
+ # @param zone [::String]
2931
+ # The name of the zone for this request.
2932
+ # @yield [result, env] Access the result along with the Faraday environment object
2933
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
2934
+ # @yieldparam response [::Faraday::Response]
2935
+ #
2936
+ # @return [::Google::Cloud::Compute::V1::Operation]
2937
+ #
2938
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2939
+ def update_display_device request, options = nil
2940
+ raise ::ArgumentError, "request must be provided" if request.nil?
2941
+
2942
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest
2943
+
2944
+ # Converts hash and nil to an options object
2945
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2946
+
2947
+ # Customize the options with defaults
2948
+ call_metadata = {}
2949
+
2950
+ # Set x-goog-api-client header
2951
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2952
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2953
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
2954
+
2955
+ options.apply_defaults timeout: @config.timeout,
2956
+ metadata: call_metadata
2957
+
2958
+ uri, body, _query_string_params = transcode_update_display_device request
2959
+ response = @client_stub.make_patch_request(
2960
+ uri: uri,
2961
+ body: body,
2962
+ options: options
2963
+ )
2964
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
2965
+
2966
+ yield result, response if block_given?
2967
+ result
2968
+ rescue ::Faraday::Error => e
2969
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
2970
+ raise ::Google::Cloud::Error.from_error(gapic_error)
2971
+ end
2972
+
2973
+ ##
2974
+ # Updates an instance's network interface. This method follows PATCH semantics.
2975
+ #
2976
+ # @overload update_network_interface(request, options = nil)
2977
+ # Pass arguments to `update_network_interface` via a request object, either of type
2978
+ # {::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest} or an equivalent Hash.
2979
+ #
2980
+ # @param request [::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest, ::Hash]
2981
+ # A request object representing the call parameters. Required. To specify no
2982
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2983
+ # @param options [::Gapic::CallOptions, ::Hash]
2984
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2985
+ # Note: currently retry functionality is not implemented. While it is possible
2986
+ # to set it using ::Gapic::CallOptions, it will not be applied
2987
+ #
2988
+ # @overload update_network_interface(instance: nil, network_interface: nil, network_interface_resource: nil, project: nil, request_id: nil, zone: nil)
2989
+ # Pass arguments to `update_network_interface` via keyword arguments. Note that at
2990
+ # least one keyword argument is required. To specify no parameters, or to keep all
2991
+ # the default parameter values, pass an empty Hash as a request object (see above).
2992
+ #
2993
+ # @param instance [::String]
2994
+ # The instance name for this request.
2995
+ # @param network_interface [::String]
2996
+ # The name of the network interface to update.
2997
+ # @param network_interface_resource [::Google::Cloud::Compute::V1::NetworkInterface, ::Hash]
2998
+ # The body resource for this request
2999
+ # @param project [::String]
3000
+ # Project ID for this request.
3001
+ # @param request_id [::String]
3002
+ # 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.
3003
+ #
3004
+ # 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.
3005
+ #
3006
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
3007
+ # @param zone [::String]
3008
+ # The name of the zone for this request.
3009
+ # @yield [result, env] Access the result along with the Faraday environment object
3010
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
3011
+ # @yieldparam response [::Faraday::Response]
3012
+ #
3013
+ # @return [::Google::Cloud::Compute::V1::Operation]
3014
+ #
3015
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3016
+ def update_network_interface request, options = nil
3017
+ raise ::ArgumentError, "request must be provided" if request.nil?
3018
+
3019
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest
3020
+
3021
+ # Converts hash and nil to an options object
3022
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3023
+
3024
+ # Customize the options with defaults
3025
+ call_metadata = {}
3026
+
3027
+ # Set x-goog-api-client header
3028
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3029
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3030
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
3031
+
3032
+ options.apply_defaults timeout: @config.timeout,
3033
+ metadata: call_metadata
3034
+
3035
+ uri, body, _query_string_params = transcode_update_network_interface request
3036
+ response = @client_stub.make_patch_request(
3037
+ uri: uri,
3038
+ body: body,
3039
+ options: options
3040
+ )
3041
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
3042
+
3043
+ yield result, response if block_given?
3044
+ result
3045
+ rescue ::Faraday::Error => e
3046
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
3047
+ raise ::Google::Cloud::Error.from_error(gapic_error)
3048
+ end
3049
+
3050
+ ##
3051
+ # Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
3052
+ #
3053
+ # @overload update_shielded_instance_config(request, options = nil)
3054
+ # Pass arguments to `update_shielded_instance_config` via a request object, either of type
3055
+ # {::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest} or an equivalent Hash.
3056
+ #
3057
+ # @param request [::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest, ::Hash]
3058
+ # A request object representing the call parameters. Required. To specify no
3059
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3060
+ # @param options [::Gapic::CallOptions, ::Hash]
3061
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3062
+ # Note: currently retry functionality is not implemented. While it is possible
3063
+ # to set it using ::Gapic::CallOptions, it will not be applied
3064
+ #
3065
+ # @overload update_shielded_instance_config(instance: nil, project: nil, request_id: nil, shielded_instance_config_resource: nil, zone: nil)
3066
+ # Pass arguments to `update_shielded_instance_config` via keyword arguments. Note that at
3067
+ # least one keyword argument is required. To specify no parameters, or to keep all
3068
+ # the default parameter values, pass an empty Hash as a request object (see above).
3069
+ #
3070
+ # @param instance [::String]
3071
+ # Name or id of the instance scoping this request.
3072
+ # @param project [::String]
3073
+ # Project ID for this request.
3074
+ # @param request_id [::String]
3075
+ # 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.
3076
+ #
3077
+ # 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.
3078
+ #
3079
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
3080
+ # @param shielded_instance_config_resource [::Google::Cloud::Compute::V1::ShieldedInstanceConfig, ::Hash]
3081
+ # The body resource for this request
3082
+ # @param zone [::String]
3083
+ # The name of the zone for this request.
3084
+ # @yield [result, env] Access the result along with the Faraday environment object
3085
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
3086
+ # @yieldparam response [::Faraday::Response]
3087
+ #
3088
+ # @return [::Google::Cloud::Compute::V1::Operation]
3089
+ #
3090
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3091
+ def update_shielded_instance_config request, options = nil
3092
+ raise ::ArgumentError, "request must be provided" if request.nil?
3093
+
3094
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest
3095
+
3096
+ # Converts hash and nil to an options object
3097
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3098
+
3099
+ # Customize the options with defaults
3100
+ call_metadata = {}
3101
+
3102
+ # Set x-goog-api-client header
3103
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3104
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3105
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
3106
+
3107
+ options.apply_defaults timeout: @config.timeout,
3108
+ metadata: call_metadata
3109
+
3110
+ uri, body, _query_string_params = transcode_update_shielded_instance_config request
3111
+ response = @client_stub.make_patch_request(
3112
+ uri: uri,
3113
+ body: body,
3114
+ options: options
3115
+ )
3116
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
3117
+
3118
+ yield result, response if block_given?
3119
+ result
3120
+ rescue ::Faraday::Error => e
3121
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
3122
+ raise ::Google::Cloud::Error.from_error(gapic_error)
3123
+ end
3124
+
3125
+ ##
3126
+ # Configuration class for the Instances REST API.
3127
+ #
3128
+ # This class represents the configuration for Instances REST,
3129
+ # providing control over credentials, timeouts, retry behavior, logging.
3130
+ #
3131
+ # Configuration can be applied globally to all clients, or to a single client
3132
+ # on construction.
3133
+ #
3134
+ # # Examples
3135
+ #
3136
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
3137
+ #
3138
+ # ::Google::Cloud::Compute::V1::Instances::Client.configure do |config|
3139
+ # config.timeout = 10.0
3140
+ # end
3141
+ #
3142
+ # To apply the above configuration only to a new client:
3143
+ #
3144
+ # client = ::Google::Cloud::Compute::V1::Instances::Client.new do |config|
3145
+ # config.timeout = 10.0
3146
+ # end
3147
+ #
3148
+ # @!attribute [rw] endpoint
3149
+ # The hostname or hostname:port of the service endpoint.
3150
+ # Defaults to `"compute.googleapis.com"`.
3151
+ # @return [::String]
3152
+ # @!attribute [rw] credentials
3153
+ # Credentials to send with calls. You may provide any of the following types:
3154
+ # * (`String`) The path to a service account key file in JSON format
3155
+ # * (`Hash`) A service account key as a Hash
3156
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3157
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
3158
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3159
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
3160
+ # * (`nil`) indicating no credentials
3161
+ # @return [::Object]
3162
+ # @!attribute [rw] scope
3163
+ # The OAuth scopes
3164
+ # @return [::Array<::String>]
3165
+ # @!attribute [rw] lib_name
3166
+ # The library name as recorded in instrumentation and logging
3167
+ # @return [::String]
3168
+ # @!attribute [rw] lib_version
3169
+ # The library version as recorded in instrumentation and logging
3170
+ # @return [::String]
3171
+ # @!attribute [rw] timeout
3172
+ # The call timeout in seconds.
3173
+ # @return [::Numeric]
3174
+ #
3175
+ class Configuration
3176
+ extend ::Gapic::Config
3177
+
3178
+ config_attr :endpoint, "compute.googleapis.com", ::String
3179
+ config_attr :credentials, nil do |value|
3180
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3181
+ allowed.any? { |klass| klass === value }
3182
+ end
3183
+ config_attr :scope, nil, ::String, ::Array, nil
3184
+ config_attr :lib_name, nil, ::String, nil
3185
+ config_attr :lib_version, nil, ::String, nil
3186
+ config_attr :timeout, nil, ::Numeric, nil
3187
+
3188
+ # @private
3189
+ def initialize parent_config = nil
3190
+ @parent_config = parent_config unless parent_config.nil?
3191
+
3192
+ yield self if block_given?
3193
+ end
3194
+ end
3195
+ end
3196
+ end
3197
+ end
3198
+ end
3199
+ end
3200
+ end
3201
+ end