azure_mgmt_compute 0.19.1 → 0.19.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (305) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-15/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  3. data/lib/2016-03-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  4. data/lib/2016-04-30-preview/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  5. data/lib/2017-03-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  6. data/lib/2017-09-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  7. data/lib/2017-12-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  8. data/lib/2018-04-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  9. data/lib/2018-06-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  10. data/lib/2018-09-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  11. data/lib/2018-10-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  12. data/lib/2019-03-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  13. data/lib/2019-04-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  14. data/lib/2019-07-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  15. data/lib/2019-11-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  16. data/lib/2019-12-01/generated/azure_mgmt_compute.rb +310 -0
  17. data/lib/2019-12-01/generated/azure_mgmt_compute/availability_sets.rb +916 -0
  18. data/lib/2019-12-01/generated/azure_mgmt_compute/compute_management_client.rb +232 -0
  19. data/lib/2019-12-01/generated/azure_mgmt_compute/dedicated_host_groups.rb +852 -0
  20. data/lib/2019-12-01/generated/azure_mgmt_compute/dedicated_hosts.rb +806 -0
  21. data/lib/2019-12-01/generated/azure_mgmt_compute/galleries.rb +988 -0
  22. data/lib/2019-12-01/generated/azure_mgmt_compute/gallery_application_versions.rb +915 -0
  23. data/lib/2019-12-01/generated/azure_mgmt_compute/gallery_applications.rb +856 -0
  24. data/lib/2019-12-01/generated/azure_mgmt_compute/gallery_image_versions.rb +911 -0
  25. data/lib/2019-12-01/generated/azure_mgmt_compute/gallery_images.rb +856 -0
  26. data/lib/2019-12-01/generated/azure_mgmt_compute/images.rb +975 -0
  27. data/lib/2019-12-01/generated/azure_mgmt_compute/log_analytics.rb +341 -0
  28. data/lib/2019-12-01/generated/azure_mgmt_compute/models/additional_capabilities.rb +51 -0
  29. data/lib/2019-12-01/generated/azure_mgmt_compute/models/additional_unattend_content.rb +93 -0
  30. data/lib/2019-12-01/generated/azure_mgmt_compute/models/aggregated_replication_state.rb +18 -0
  31. data/lib/2019-12-01/generated/azure_mgmt_compute/models/api_entity_reference.rb +47 -0
  32. data/lib/2019-12-01/generated/azure_mgmt_compute/models/api_error.rb +100 -0
  33. data/lib/2019-12-01/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
  34. data/lib/2019-12-01/generated/azure_mgmt_compute/models/automatic_osupgrade_policy.rb +63 -0
  35. data/lib/2019-12-01/generated/azure_mgmt_compute/models/automatic_osupgrade_properties.rb +47 -0
  36. data/lib/2019-12-01/generated/azure_mgmt_compute/models/automatic_repairs_policy.rb +64 -0
  37. data/lib/2019-12-01/generated/azure_mgmt_compute/models/availability_set.rb +189 -0
  38. data/lib/2019-12-01/generated/azure_mgmt_compute/models/availability_set_list_result.rb +100 -0
  39. data/lib/2019-12-01/generated/azure_mgmt_compute/models/availability_set_sku_types.rb +16 -0
  40. data/lib/2019-12-01/generated/azure_mgmt_compute/models/availability_set_update.rb +142 -0
  41. data/lib/2019-12-01/generated/azure_mgmt_compute/models/billing_profile.rb +60 -0
  42. data/lib/2019-12-01/generated/azure_mgmt_compute/models/boot_diagnostics.rb +62 -0
  43. data/lib/2019-12-01/generated/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +74 -0
  44. data/lib/2019-12-01/generated/azure_mgmt_compute/models/caching_types.rb +17 -0
  45. data/lib/2019-12-01/generated/azure_mgmt_compute/models/component_names.rb +15 -0
  46. data/lib/2019-12-01/generated/azure_mgmt_compute/models/compute_operation_list_result.rb +56 -0
  47. data/lib/2019-12-01/generated/azure_mgmt_compute/models/compute_operation_value.rb +108 -0
  48. data/lib/2019-12-01/generated/azure_mgmt_compute/models/data_disk.rb +201 -0
  49. data/lib/2019-12-01/generated/azure_mgmt_compute/models/data_disk_image.rb +49 -0
  50. data/lib/2019-12-01/generated/azure_mgmt_compute/models/data_disk_image_encryption.rb +57 -0
  51. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host.rb +220 -0
  52. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_allocatable_vm.rb +60 -0
  53. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_available_capacity.rb +57 -0
  54. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_group.rb +148 -0
  55. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_group_list_result.rb +100 -0
  56. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_group_update.rb +111 -0
  57. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_instance_view.rb +81 -0
  58. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_license_types.rb +17 -0
  59. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_list_result.rb +100 -0
  60. data/lib/2019-12-01/generated/azure_mgmt_compute/models/dedicated_host_update.rb +172 -0
  61. data/lib/2019-12-01/generated/azure_mgmt_compute/models/diagnostics_profile.rb +52 -0
  62. data/lib/2019-12-01/generated/azure_mgmt_compute/models/diff_disk_options.rb +15 -0
  63. data/lib/2019-12-01/generated/azure_mgmt_compute/models/diff_disk_placement.rb +16 -0
  64. data/lib/2019-12-01/generated/azure_mgmt_compute/models/diff_disk_settings.rb +69 -0
  65. data/lib/2019-12-01/generated/azure_mgmt_compute/models/disallowed.rb +54 -0
  66. data/lib/2019-12-01/generated/azure_mgmt_compute/models/disk_create_option_types.rb +17 -0
  67. data/lib/2019-12-01/generated/azure_mgmt_compute/models/disk_encryption_set_parameters.rb +46 -0
  68. data/lib/2019-12-01/generated/azure_mgmt_compute/models/disk_encryption_settings.rb +73 -0
  69. data/lib/2019-12-01/generated/azure_mgmt_compute/models/disk_image_encryption.rb +47 -0
  70. data/lib/2019-12-01/generated/azure_mgmt_compute/models/disk_instance_view.rb +87 -0
  71. data/lib/2019-12-01/generated/azure_mgmt_compute/models/encryption_images.rb +69 -0
  72. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery.rb +125 -0
  73. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application.rb +161 -0
  74. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_list.rb +100 -0
  75. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_update.rb +153 -0
  76. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_version.rb +127 -0
  77. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_version_list.rb +101 -0
  78. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_version_publishing_profile.rb +130 -0
  79. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_version_update.rb +119 -0
  80. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_artifact_publishing_profile_base.rb +120 -0
  81. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_artifact_source.rb +47 -0
  82. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_artifact_version_source.rb +47 -0
  83. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_data_disk_image.rb +76 -0
  84. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_disk_image.rb +74 -0
  85. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_identifier.rb +48 -0
  86. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image.rb +251 -0
  87. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_identifier.rb +68 -0
  88. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_list.rb +100 -0
  89. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_update.rb +243 -0
  90. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_version.rb +139 -0
  91. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_version_list.rb +100 -0
  92. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_version_publishing_profile.rb +93 -0
  93. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_version_storage_profile.rb +79 -0
  94. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_image_version_update.rb +131 -0
  95. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_list.rb +99 -0
  96. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_osdisk_image.rb +62 -0
  97. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_update.rb +117 -0
  98. data/lib/2019-12-01/generated/azure_mgmt_compute/models/hardware_profile.rb +104 -0
  99. data/lib/2019-12-01/generated/azure_mgmt_compute/models/host_caching.rb +17 -0
  100. data/lib/2019-12-01/generated/azure_mgmt_compute/models/hyper_vgeneration.rb +16 -0
  101. data/lib/2019-12-01/generated/azure_mgmt_compute/models/hyper_vgeneration_type.rb +16 -0
  102. data/lib/2019-12-01/generated/azure_mgmt_compute/models/hyper_vgeneration_types.rb +16 -0
  103. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image.rb +139 -0
  104. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_data_disk.rb +108 -0
  105. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_disk.rb +126 -0
  106. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_list_result.rb +99 -0
  107. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_osdisk.rb +123 -0
  108. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_purchase_plan.rb +69 -0
  109. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_reference.rb +114 -0
  110. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_storage_profile.rb +86 -0
  111. data/lib/2019-12-01/generated/azure_mgmt_compute/models/image_update.rb +102 -0
  112. data/lib/2019-12-01/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
  113. data/lib/2019-12-01/generated/azure_mgmt_compute/models/instance_view_status.rb +93 -0
  114. data/lib/2019-12-01/generated/azure_mgmt_compute/models/instance_view_types.rb +15 -0
  115. data/lib/2019-12-01/generated/azure_mgmt_compute/models/interval_in_mins.rb +18 -0
  116. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ipversion.rb +16 -0
  117. data/lib/2019-12-01/generated/azure_mgmt_compute/models/key_vault_key_reference.rb +59 -0
  118. data/lib/2019-12-01/generated/azure_mgmt_compute/models/key_vault_secret_reference.rb +59 -0
  119. data/lib/2019-12-01/generated/azure_mgmt_compute/models/linux_configuration.rb +81 -0
  120. data/lib/2019-12-01/generated/azure_mgmt_compute/models/list_usages_result.rb +100 -0
  121. data/lib/2019-12-01/generated/azure_mgmt_compute/models/log_analytics_input_base.rb +102 -0
  122. data/lib/2019-12-01/generated/azure_mgmt_compute/models/log_analytics_operation_result.rb +48 -0
  123. data/lib/2019-12-01/generated/azure_mgmt_compute/models/log_analytics_output.rb +47 -0
  124. data/lib/2019-12-01/generated/azure_mgmt_compute/models/maintenance_operation_result_code_types.rb +18 -0
  125. data/lib/2019-12-01/generated/azure_mgmt_compute/models/maintenance_redeploy_status.rb +115 -0
  126. data/lib/2019-12-01/generated/azure_mgmt_compute/models/managed_artifact.rb +46 -0
  127. data/lib/2019-12-01/generated/azure_mgmt_compute/models/managed_disk_parameters.rb +70 -0
  128. data/lib/2019-12-01/generated/azure_mgmt_compute/models/network_interface_reference.rb +55 -0
  129. data/lib/2019-12-01/generated/azure_mgmt_compute/models/network_profile.rb +57 -0
  130. data/lib/2019-12-01/generated/azure_mgmt_compute/models/operating_system_state_types.rb +16 -0
  131. data/lib/2019-12-01/generated/azure_mgmt_compute/models/operating_system_types.rb +16 -0
  132. data/lib/2019-12-01/generated/azure_mgmt_compute/models/orchestration_service_names.rb +16 -0
  133. data/lib/2019-12-01/generated/azure_mgmt_compute/models/orchestration_service_state.rb +17 -0
  134. data/lib/2019-12-01/generated/azure_mgmt_compute/models/orchestration_service_state_action.rb +16 -0
  135. data/lib/2019-12-01/generated/azure_mgmt_compute/models/orchestration_service_state_input.rb +59 -0
  136. data/lib/2019-12-01/generated/azure_mgmt_compute/models/orchestration_service_summary.rb +61 -0
  137. data/lib/2019-12-01/generated/azure_mgmt_compute/models/osdisk.rb +191 -0
  138. data/lib/2019-12-01/generated/azure_mgmt_compute/models/osdisk_image.rb +48 -0
  139. data/lib/2019-12-01/generated/azure_mgmt_compute/models/osdisk_image_encryption.rb +43 -0
  140. data/lib/2019-12-01/generated/azure_mgmt_compute/models/osprofile.rb +202 -0
  141. data/lib/2019-12-01/generated/azure_mgmt_compute/models/pass_names.rb +15 -0
  142. data/lib/2019-12-01/generated/azure_mgmt_compute/models/plan.rb +86 -0
  143. data/lib/2019-12-01/generated/azure_mgmt_compute/models/protocol_types.rb +16 -0
  144. data/lib/2019-12-01/generated/azure_mgmt_compute/models/proximity_placement_group.rb +180 -0
  145. data/lib/2019-12-01/generated/azure_mgmt_compute/models/proximity_placement_group_list_result.rb +100 -0
  146. data/lib/2019-12-01/generated/azure_mgmt_compute/models/proximity_placement_group_type.rb +16 -0
  147. data/lib/2019-12-01/generated/azure_mgmt_compute/models/proximity_placement_group_update.rb +51 -0
  148. data/lib/2019-12-01/generated/azure_mgmt_compute/models/purchase_plan.rb +71 -0
  149. data/lib/2019-12-01/generated/azure_mgmt_compute/models/recommended_machine_configuration.rb +60 -0
  150. data/lib/2019-12-01/generated/azure_mgmt_compute/models/recovery_walk_response.rb +60 -0
  151. data/lib/2019-12-01/generated/azure_mgmt_compute/models/regional_replication_status.rb +86 -0
  152. data/lib/2019-12-01/generated/azure_mgmt_compute/models/replication_state.rb +18 -0
  153. data/lib/2019-12-01/generated/azure_mgmt_compute/models/replication_status.rb +71 -0
  154. data/lib/2019-12-01/generated/azure_mgmt_compute/models/replication_status_types.rb +15 -0
  155. data/lib/2019-12-01/generated/azure_mgmt_compute/models/request_rate_by_interval_input.rb +97 -0
  156. data/lib/2019-12-01/generated/azure_mgmt_compute/models/resource.rb +110 -0
  157. data/lib/2019-12-01/generated/azure_mgmt_compute/models/resource_identity_type.rb +18 -0
  158. data/lib/2019-12-01/generated/azure_mgmt_compute/models/resource_range.rb +57 -0
  159. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rollback_status_info.rb +74 -0
  160. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rolling_upgrade_action_type.rb +16 -0
  161. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rolling_upgrade_policy.rb +108 -0
  162. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rolling_upgrade_progress_info.rb +88 -0
  163. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rolling_upgrade_running_status.rb +88 -0
  164. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rolling_upgrade_status_code.rb +18 -0
  165. data/lib/2019-12-01/generated/azure_mgmt_compute/models/rolling_upgrade_status_info.rb +141 -0
  166. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_document.rb +116 -0
  167. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_document_base.rb +92 -0
  168. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_input.rb +87 -0
  169. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_input_parameter.rb +57 -0
  170. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_list_result.rb +100 -0
  171. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_parameter_definition.rb +81 -0
  172. data/lib/2019-12-01/generated/azure_mgmt_compute/models/run_command_result.rb +56 -0
  173. data/lib/2019-12-01/generated/azure_mgmt_compute/models/scale_in_policy.rb +71 -0
  174. data/lib/2019-12-01/generated/azure_mgmt_compute/models/scheduled_events_profile.rb +49 -0
  175. data/lib/2019-12-01/generated/azure_mgmt_compute/models/setting_names.rb +16 -0
  176. data/lib/2019-12-01/generated/azure_mgmt_compute/models/sku.rb +73 -0
  177. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ssh_configuration.rb +56 -0
  178. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ssh_public_key.rb +64 -0
  179. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ssh_public_key_generate_key_pair_result.rb +73 -0
  180. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ssh_public_key_resource.rb +102 -0
  181. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ssh_public_key_update_resource.rb +67 -0
  182. data/lib/2019-12-01/generated/azure_mgmt_compute/models/ssh_public_keys_group_list_result.rb +100 -0
  183. data/lib/2019-12-01/generated/azure_mgmt_compute/models/status_level_types.rb +17 -0
  184. data/lib/2019-12-01/generated/azure_mgmt_compute/models/storage_account_type.rb +17 -0
  185. data/lib/2019-12-01/generated/azure_mgmt_compute/models/storage_account_types.rb +18 -0
  186. data/lib/2019-12-01/generated/azure_mgmt_compute/models/storage_profile.rb +89 -0
  187. data/lib/2019-12-01/generated/azure_mgmt_compute/models/sub_resource.rb +47 -0
  188. data/lib/2019-12-01/generated/azure_mgmt_compute/models/sub_resource_read_only.rb +48 -0
  189. data/lib/2019-12-01/generated/azure_mgmt_compute/models/sub_resource_with_colocation_status.rb +57 -0
  190. data/lib/2019-12-01/generated/azure_mgmt_compute/models/target_region.rb +83 -0
  191. data/lib/2019-12-01/generated/azure_mgmt_compute/models/terminate_notification_profile.rb +62 -0
  192. data/lib/2019-12-01/generated/azure_mgmt_compute/models/throttled_requests_input.rb +83 -0
  193. data/lib/2019-12-01/generated/azure_mgmt_compute/models/update_resource.rb +54 -0
  194. data/lib/2019-12-01/generated/azure_mgmt_compute/models/update_resource_definition.rb +90 -0
  195. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_mode.rb +17 -0
  196. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_operation_historical_status_info.rb +73 -0
  197. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_operation_historical_status_info_properties.rb +116 -0
  198. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_operation_history_status.rb +74 -0
  199. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_operation_invoker.rb +17 -0
  200. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_policy.rb +79 -0
  201. data/lib/2019-12-01/generated/azure_mgmt_compute/models/upgrade_state.rb +18 -0
  202. data/lib/2019-12-01/generated/azure_mgmt_compute/models/usage.rb +83 -0
  203. data/lib/2019-12-01/generated/azure_mgmt_compute/models/usage_name.rb +57 -0
  204. data/lib/2019-12-01/generated/azure_mgmt_compute/models/user_artifact_source.rb +58 -0
  205. data/lib/2019-12-01/generated/azure_mgmt_compute/models/vault_certificate.rb +72 -0
  206. data/lib/2019-12-01/generated/azure_mgmt_compute/models/vault_secret_group.rb +69 -0
  207. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_hard_disk.rb +46 -0
  208. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine.rb +412 -0
  209. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +87 -0
  210. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +69 -0
  211. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_capture_result.rb +99 -0
  212. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_eviction_policy_types.rb +16 -0
  213. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_extension.rb +195 -0
  214. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +71 -0
  215. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +146 -0
  216. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +109 -0
  217. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +134 -0
  218. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_extensions_list_result.rb +55 -0
  219. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_health_status.rb +48 -0
  220. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_identity.rb +102 -0
  221. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_identity_user_assigned_identities_value.rb +61 -0
  222. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_image.rb +142 -0
  223. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_image_resource.rb +87 -0
  224. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_instance_view.rb +217 -0
  225. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +99 -0
  226. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_priority_types.rb +17 -0
  227. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_reimage_parameters.rb +49 -0
  228. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +318 -0
  229. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_data_disk.rb +153 -0
  230. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +184 -0
  231. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_list_result.rb +103 -0
  232. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +56 -0
  233. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_update.rb +185 -0
  234. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_identity.rb +105 -0
  235. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_identity_user_assigned_identities_value.rb +61 -0
  236. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +113 -0
  237. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +59 -0
  238. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ip_tag.rb +58 -0
  239. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +195 -0
  240. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_osupgrade_history.rb +104 -0
  241. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +100 -0
  242. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +101 -0
  243. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +102 -0
  244. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_managed_disk_parameters.rb +63 -0
  245. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +137 -0
  246. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_dns_settings.rb +56 -0
  247. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +71 -0
  248. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +180 -0
  249. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +167 -0
  250. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_public_ipaddress_configuration.rb +120 -0
  251. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_public_ipaddress_configuration_dns_settings.rb +51 -0
  252. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_reimage_parameters.rb +65 -0
  253. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_scale_in_rules.rb +17 -0
  254. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +74 -0
  255. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +85 -0
  256. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_scale_type.rb +16 -0
  257. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +91 -0
  258. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update.rb +210 -0
  259. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_ipconfiguration.rb +190 -0
  260. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_network_configuration.rb +136 -0
  261. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_network_profile.rb +72 -0
  262. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_osdisk.rb +122 -0
  263. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_osprofile.rb +92 -0
  264. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_public_ipaddress_configuration.rb +72 -0
  265. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_storage_profile.rb +80 -0
  266. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_vmprofile.rb +138 -0
  267. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +384 -0
  268. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +70 -0
  269. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +57 -0
  270. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +55 -0
  271. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +196 -0
  272. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +101 -0
  273. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmnetwork_profile_configuration.rb +57 -0
  274. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +176 -0
  275. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprotection_policy.rb +60 -0
  276. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmreimage_parameters.rb +44 -0
  277. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_size.rb +106 -0
  278. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +55 -0
  279. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_size_types.rb +180 -0
  280. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +61 -0
  281. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_update.rb +355 -0
  282. data/lib/2019-12-01/generated/azure_mgmt_compute/models/vmscale_set_convert_to_single_placement_group_input.rb +52 -0
  283. data/lib/2019-12-01/generated/azure_mgmt_compute/models/win_rmconfiguration.rb +56 -0
  284. data/lib/2019-12-01/generated/azure_mgmt_compute/models/win_rmlistener.rb +67 -0
  285. data/lib/2019-12-01/generated/azure_mgmt_compute/models/windows_configuration.rb +114 -0
  286. data/lib/2019-12-01/generated/azure_mgmt_compute/module_definition.rb +9 -0
  287. data/lib/2019-12-01/generated/azure_mgmt_compute/operations.rb +109 -0
  288. data/lib/2019-12-01/generated/azure_mgmt_compute/proximity_placement_groups.rb +846 -0
  289. data/lib/2019-12-01/generated/azure_mgmt_compute/ssh_public_keys.rb +939 -0
  290. data/lib/2019-12-01/generated/azure_mgmt_compute/usage_operations.rb +241 -0
  291. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_extension_images.rb +360 -0
  292. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_extensions.rb +701 -0
  293. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_images.rb +600 -0
  294. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_run_commands.rb +322 -0
  295. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_extensions.rb +821 -0
  296. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_rolling_upgrades.rb +498 -0
  297. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vmextensions.rb +709 -0
  298. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +2087 -0
  299. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +3288 -0
  300. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_sizes.rb +122 -0
  301. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machines.rb +3050 -0
  302. data/lib/azure_mgmt_compute.rb +12 -11
  303. data/lib/profiles/latest/modules/compute_profile_module.rb +891 -821
  304. data/lib/version.rb +1 -1
  305. metadata +288 -2
@@ -0,0 +1,122 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Compute::Mgmt::V2019_12_01
7
+ #
8
+ # Compute Client
9
+ #
10
+ class VirtualMachineSizes
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VirtualMachineSizes class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ComputeManagementClient] reference to the ComputeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # This API is deprecated. Use [Resources
26
+ # Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list)
27
+ #
28
+ # @param location [String] The location upon which virtual-machine-sizes is
29
+ # queried.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [VirtualMachineSizeListResult] operation results.
34
+ #
35
+ def list(location, custom_headers:nil)
36
+ response = list_async(location, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # This API is deprecated. Use [Resources
42
+ # Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list)
43
+ #
44
+ # @param location [String] The location upon which virtual-machine-sizes is
45
+ # queried.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(location, custom_headers:nil)
52
+ list_async(location, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # This API is deprecated. Use [Resources
57
+ # Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list)
58
+ #
59
+ # @param location [String] The location upon which virtual-machine-sizes is
60
+ # queried.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(location, custom_headers:nil)
67
+ fail ArgumentError, 'location is nil' if location.nil?
68
+ fail ArgumentError, "'location' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !location.nil? && location.match(Regexp.new('^^[-\w\._]+$$')).nil?
69
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+
72
+
73
+ request_headers = {}
74
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
75
+
76
+ # Set Headers
77
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
79
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
86
+ query_params: {'api-version' => @client.api_version},
87
+ headers: request_headers.merge(custom_headers || {}),
88
+ base_url: request_url
89
+ }
90
+ promise = @client.make_request_async(:get, path_template, options)
91
+
92
+ promise = promise.then do |result|
93
+ http_response = result.response
94
+ status_code = http_response.status
95
+ response_content = http_response.body
96
+ unless status_code == 200
97
+ error_model = JSON.load(response_content)
98
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
99
+ end
100
+
101
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
102
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
103
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
104
+ # Deserialize Response
105
+ if status_code == 200
106
+ begin
107
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
108
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineSizeListResult.mapper()
109
+ result.body = @client.deserialize(result_mapper, parsed_response)
110
+ rescue Exception => e
111
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
112
+ end
113
+ end
114
+
115
+ result
116
+ end
117
+
118
+ promise.execute
119
+ end
120
+
121
+ end
122
+ end
@@ -0,0 +1,3050 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Compute::Mgmt::V2019_12_01
7
+ #
8
+ # Compute Client
9
+ #
10
+ class VirtualMachines
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VirtualMachines class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ComputeManagementClient] reference to the ComputeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all the virtual machines under the specified subscription for the
26
+ # specified location.
27
+ #
28
+ # @param location [String] The location for which virtual machines under the
29
+ # subscription are queried.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<VirtualMachine>] operation results.
34
+ #
35
+ def list_by_location(location, custom_headers:nil)
36
+ first_page = list_by_location_as_lazy(location, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets all the virtual machines under the specified subscription for the
42
+ # specified location.
43
+ #
44
+ # @param location [String] The location for which virtual machines under the
45
+ # subscription are queried.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_by_location_with_http_info(location, custom_headers:nil)
52
+ list_by_location_async(location, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets all the virtual machines under the specified subscription for the
57
+ # specified location.
58
+ #
59
+ # @param location [String] The location for which virtual machines under the
60
+ # subscription are queried.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_by_location_async(location, custom_headers:nil)
67
+ fail ArgumentError, 'location is nil' if location.nil?
68
+ fail ArgumentError, "'location' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !location.nil? && location.match(Regexp.new('^^[-\w\._]+$$')).nil?
69
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+
72
+
73
+ request_headers = {}
74
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
75
+
76
+ # Set Headers
77
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
79
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
86
+ query_params: {'api-version' => @client.api_version},
87
+ headers: request_headers.merge(custom_headers || {}),
88
+ base_url: request_url
89
+ }
90
+ promise = @client.make_request_async(:get, path_template, options)
91
+
92
+ promise = promise.then do |result|
93
+ http_response = result.response
94
+ status_code = http_response.status
95
+ response_content = http_response.body
96
+ unless status_code == 200
97
+ error_model = JSON.load(response_content)
98
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
99
+ end
100
+
101
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
102
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
103
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
104
+ # Deserialize Response
105
+ if status_code == 200
106
+ begin
107
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
108
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineListResult.mapper()
109
+ result.body = @client.deserialize(result_mapper, parsed_response)
110
+ rescue Exception => e
111
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
112
+ end
113
+ end
114
+
115
+ result
116
+ end
117
+
118
+ promise.execute
119
+ end
120
+
121
+ #
122
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
123
+ # template that can be used to create similar VMs.
124
+ #
125
+ # @param resource_group_name [String] The name of the resource group.
126
+ # @param vm_name [String] The name of the virtual machine.
127
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
128
+ # the Capture Virtual Machine operation.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [VirtualMachineCaptureResult] operation results.
133
+ #
134
+ def capture(resource_group_name, vm_name, parameters, custom_headers:nil)
135
+ response = capture_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
136
+ response.body unless response.nil?
137
+ end
138
+
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group.
141
+ # @param vm_name [String] The name of the virtual machine.
142
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
143
+ # the Capture Virtual Machine operation.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [Concurrent::Promise] promise which provides async access to http
148
+ # response.
149
+ #
150
+ def capture_async(resource_group_name, vm_name, parameters, custom_headers:nil)
151
+ # Send request
152
+ promise = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers)
153
+
154
+ promise = promise.then do |response|
155
+ # Defining deserialization method.
156
+ deserialize_method = lambda do |parsed_response|
157
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineCaptureResult.mapper()
158
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
159
+ end
160
+
161
+ # Waiting for response.
162
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
163
+ end
164
+
165
+ promise
166
+ end
167
+
168
+ #
169
+ # The operation to create or update a virtual machine. Please note some
170
+ # properties can be set only during virtual machine creation.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group.
173
+ # @param vm_name [String] The name of the virtual machine.
174
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
175
+ # Machine operation.
176
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
177
+ # will be added to the HTTP request.
178
+ #
179
+ # @return [VirtualMachine] operation results.
180
+ #
181
+ def create_or_update(resource_group_name, vm_name, parameters, custom_headers:nil)
182
+ response = create_or_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
183
+ response.body unless response.nil?
184
+ end
185
+
186
+ #
187
+ # @param resource_group_name [String] The name of the resource group.
188
+ # @param vm_name [String] The name of the virtual machine.
189
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
190
+ # Machine operation.
191
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
192
+ # will be added to the HTTP request.
193
+ #
194
+ # @return [Concurrent::Promise] promise which provides async access to http
195
+ # response.
196
+ #
197
+ def create_or_update_async(resource_group_name, vm_name, parameters, custom_headers:nil)
198
+ # Send request
199
+ promise = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers)
200
+
201
+ promise = promise.then do |response|
202
+ # Defining deserialization method.
203
+ deserialize_method = lambda do |parsed_response|
204
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
205
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
206
+ end
207
+
208
+ # Waiting for response.
209
+ @client.get_long_running_operation_result(response, deserialize_method)
210
+ end
211
+
212
+ promise
213
+ end
214
+
215
+ #
216
+ # The operation to update a virtual machine.
217
+ #
218
+ # @param resource_group_name [String] The name of the resource group.
219
+ # @param vm_name [String] The name of the virtual machine.
220
+ # @param parameters [VirtualMachineUpdate] Parameters supplied to the Update
221
+ # Virtual Machine operation.
222
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
223
+ # will be added to the HTTP request.
224
+ #
225
+ # @return [VirtualMachine] operation results.
226
+ #
227
+ def update(resource_group_name, vm_name, parameters, custom_headers:nil)
228
+ response = update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
229
+ response.body unless response.nil?
230
+ end
231
+
232
+ #
233
+ # @param resource_group_name [String] The name of the resource group.
234
+ # @param vm_name [String] The name of the virtual machine.
235
+ # @param parameters [VirtualMachineUpdate] Parameters supplied to the Update
236
+ # Virtual Machine operation.
237
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
238
+ # will be added to the HTTP request.
239
+ #
240
+ # @return [Concurrent::Promise] promise which provides async access to http
241
+ # response.
242
+ #
243
+ def update_async(resource_group_name, vm_name, parameters, custom_headers:nil)
244
+ # Send request
245
+ promise = begin_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers)
246
+
247
+ promise = promise.then do |response|
248
+ # Defining deserialization method.
249
+ deserialize_method = lambda do |parsed_response|
250
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
251
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
252
+ end
253
+
254
+ # Waiting for response.
255
+ @client.get_long_running_operation_result(response, deserialize_method)
256
+ end
257
+
258
+ promise
259
+ end
260
+
261
+ #
262
+ # The operation to delete a virtual machine.
263
+ #
264
+ # @param resource_group_name [String] The name of the resource group.
265
+ # @param vm_name [String] The name of the virtual machine.
266
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
+ # will be added to the HTTP request.
268
+ #
269
+ def delete(resource_group_name, vm_name, custom_headers:nil)
270
+ response = delete_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
271
+ nil
272
+ end
273
+
274
+ #
275
+ # @param resource_group_name [String] The name of the resource group.
276
+ # @param vm_name [String] The name of the virtual machine.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [Concurrent::Promise] promise which provides async access to http
281
+ # response.
282
+ #
283
+ def delete_async(resource_group_name, vm_name, custom_headers:nil)
284
+ # Send request
285
+ promise = begin_delete_async(resource_group_name, vm_name, custom_headers:custom_headers)
286
+
287
+ promise = promise.then do |response|
288
+ # Defining deserialization method.
289
+ deserialize_method = lambda do |parsed_response|
290
+ end
291
+
292
+ # Waiting for response.
293
+ @client.get_long_running_operation_result(response, deserialize_method)
294
+ end
295
+
296
+ promise
297
+ end
298
+
299
+ #
300
+ # Retrieves information about the model view or the instance view of a virtual
301
+ # machine.
302
+ #
303
+ # @param resource_group_name [String] The name of the resource group.
304
+ # @param vm_name [String] The name of the virtual machine.
305
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
306
+ # operation. Possible values include: 'instanceView'
307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
+ # will be added to the HTTP request.
309
+ #
310
+ # @return [VirtualMachine] operation results.
311
+ #
312
+ def get(resource_group_name, vm_name, expand:nil, custom_headers:nil)
313
+ response = get_async(resource_group_name, vm_name, expand:expand, custom_headers:custom_headers).value!
314
+ response.body unless response.nil?
315
+ end
316
+
317
+ #
318
+ # Retrieves information about the model view or the instance view of a virtual
319
+ # machine.
320
+ #
321
+ # @param resource_group_name [String] The name of the resource group.
322
+ # @param vm_name [String] The name of the virtual machine.
323
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
324
+ # operation. Possible values include: 'instanceView'
325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
+ # will be added to the HTTP request.
327
+ #
328
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
329
+ #
330
+ def get_with_http_info(resource_group_name, vm_name, expand:nil, custom_headers:nil)
331
+ get_async(resource_group_name, vm_name, expand:expand, custom_headers:custom_headers).value!
332
+ end
333
+
334
+ #
335
+ # Retrieves information about the model view or the instance view of a virtual
336
+ # machine.
337
+ #
338
+ # @param resource_group_name [String] The name of the resource group.
339
+ # @param vm_name [String] The name of the virtual machine.
340
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
341
+ # operation. Possible values include: 'instanceView'
342
+ # @param [Hash{String => String}] A hash of custom headers that will be added
343
+ # to the HTTP request.
344
+ #
345
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
346
+ #
347
+ def get_async(resource_group_name, vm_name, expand:nil, custom_headers:nil)
348
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
349
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
350
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
351
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
352
+
353
+
354
+ request_headers = {}
355
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
356
+
357
+ # Set Headers
358
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
359
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
360
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
361
+
362
+ request_url = @base_url || @client.base_url
363
+
364
+ options = {
365
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
366
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
367
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
368
+ headers: request_headers.merge(custom_headers || {}),
369
+ base_url: request_url
370
+ }
371
+ promise = @client.make_request_async(:get, path_template, options)
372
+
373
+ promise = promise.then do |result|
374
+ http_response = result.response
375
+ status_code = http_response.status
376
+ response_content = http_response.body
377
+ unless status_code == 200
378
+ error_model = JSON.load(response_content)
379
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
380
+ end
381
+
382
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
383
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
384
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
385
+ # Deserialize Response
386
+ if status_code == 200
387
+ begin
388
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
389
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
390
+ result.body = @client.deserialize(result_mapper, parsed_response)
391
+ rescue Exception => e
392
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
393
+ end
394
+ end
395
+
396
+ result
397
+ end
398
+
399
+ promise.execute
400
+ end
401
+
402
+ #
403
+ # Retrieves information about the run-time state of a virtual machine.
404
+ #
405
+ # @param resource_group_name [String] The name of the resource group.
406
+ # @param vm_name [String] The name of the virtual machine.
407
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
408
+ # will be added to the HTTP request.
409
+ #
410
+ # @return [VirtualMachineInstanceView] operation results.
411
+ #
412
+ def instance_view(resource_group_name, vm_name, custom_headers:nil)
413
+ response = instance_view_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
414
+ response.body unless response.nil?
415
+ end
416
+
417
+ #
418
+ # Retrieves information about the run-time state of a virtual machine.
419
+ #
420
+ # @param resource_group_name [String] The name of the resource group.
421
+ # @param vm_name [String] The name of the virtual machine.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
+ #
427
+ def instance_view_with_http_info(resource_group_name, vm_name, custom_headers:nil)
428
+ instance_view_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
429
+ end
430
+
431
+ #
432
+ # Retrieves information about the run-time state of a virtual machine.
433
+ #
434
+ # @param resource_group_name [String] The name of the resource group.
435
+ # @param vm_name [String] The name of the virtual machine.
436
+ # @param [Hash{String => String}] A hash of custom headers that will be added
437
+ # to the HTTP request.
438
+ #
439
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
440
+ #
441
+ def instance_view_async(resource_group_name, vm_name, custom_headers:nil)
442
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
443
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
444
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
445
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
446
+
447
+
448
+ request_headers = {}
449
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
450
+
451
+ # Set Headers
452
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
453
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
454
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView'
455
+
456
+ request_url = @base_url || @client.base_url
457
+
458
+ options = {
459
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
460
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
461
+ query_params: {'api-version' => @client.api_version},
462
+ headers: request_headers.merge(custom_headers || {}),
463
+ base_url: request_url
464
+ }
465
+ promise = @client.make_request_async(:get, path_template, options)
466
+
467
+ promise = promise.then do |result|
468
+ http_response = result.response
469
+ status_code = http_response.status
470
+ response_content = http_response.body
471
+ unless status_code == 200
472
+ error_model = JSON.load(response_content)
473
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
474
+ end
475
+
476
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
477
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
478
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
479
+ # Deserialize Response
480
+ if status_code == 200
481
+ begin
482
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
483
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineInstanceView.mapper()
484
+ result.body = @client.deserialize(result_mapper, parsed_response)
485
+ rescue Exception => e
486
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
487
+ end
488
+ end
489
+
490
+ result
491
+ end
492
+
493
+ promise.execute
494
+ end
495
+
496
+ #
497
+ # Converts virtual machine disks from blob-based to managed disks. Virtual
498
+ # machine must be stop-deallocated before invoking this operation.
499
+ #
500
+ # @param resource_group_name [String] The name of the resource group.
501
+ # @param vm_name [String] The name of the virtual machine.
502
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
503
+ # will be added to the HTTP request.
504
+ #
505
+ def convert_to_managed_disks(resource_group_name, vm_name, custom_headers:nil)
506
+ response = convert_to_managed_disks_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
507
+ nil
508
+ end
509
+
510
+ #
511
+ # @param resource_group_name [String] The name of the resource group.
512
+ # @param vm_name [String] The name of the virtual machine.
513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
514
+ # will be added to the HTTP request.
515
+ #
516
+ # @return [Concurrent::Promise] promise which provides async access to http
517
+ # response.
518
+ #
519
+ def convert_to_managed_disks_async(resource_group_name, vm_name, custom_headers:nil)
520
+ # Send request
521
+ promise = begin_convert_to_managed_disks_async(resource_group_name, vm_name, custom_headers:custom_headers)
522
+
523
+ promise = promise.then do |response|
524
+ # Defining deserialization method.
525
+ deserialize_method = lambda do |parsed_response|
526
+ end
527
+
528
+ # Waiting for response.
529
+ @client.get_long_running_operation_result(response, deserialize_method)
530
+ end
531
+
532
+ promise
533
+ end
534
+
535
+ #
536
+ # Shuts down the virtual machine and releases the compute resources. You are
537
+ # not billed for the compute resources that this virtual machine uses.
538
+ #
539
+ # @param resource_group_name [String] The name of the resource group.
540
+ # @param vm_name [String] The name of the virtual machine.
541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
542
+ # will be added to the HTTP request.
543
+ #
544
+ def deallocate(resource_group_name, vm_name, custom_headers:nil)
545
+ response = deallocate_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
546
+ nil
547
+ end
548
+
549
+ #
550
+ # @param resource_group_name [String] The name of the resource group.
551
+ # @param vm_name [String] The name of the virtual machine.
552
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
553
+ # will be added to the HTTP request.
554
+ #
555
+ # @return [Concurrent::Promise] promise which provides async access to http
556
+ # response.
557
+ #
558
+ def deallocate_async(resource_group_name, vm_name, custom_headers:nil)
559
+ # Send request
560
+ promise = begin_deallocate_async(resource_group_name, vm_name, custom_headers:custom_headers)
561
+
562
+ promise = promise.then do |response|
563
+ # Defining deserialization method.
564
+ deserialize_method = lambda do |parsed_response|
565
+ end
566
+
567
+ # Waiting for response.
568
+ @client.get_long_running_operation_result(response, deserialize_method)
569
+ end
570
+
571
+ promise
572
+ end
573
+
574
+ #
575
+ # Sets the OS state of the virtual machine to generalized. It is recommended to
576
+ # sysprep the virtual machine before performing this operation. <br>For
577
+ # Windows, please refer to [Create a managed image of a generalized VM in
578
+ # Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For
579
+ # Linux, please refer to [How to create an image of a virtual machine or
580
+ # VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image).
581
+ #
582
+ # @param resource_group_name [String] The name of the resource group.
583
+ # @param vm_name [String] The name of the virtual machine.
584
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
585
+ # will be added to the HTTP request.
586
+ #
587
+ #
588
+ def generalize(resource_group_name, vm_name, custom_headers:nil)
589
+ response = generalize_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
590
+ nil
591
+ end
592
+
593
+ #
594
+ # Sets the OS state of the virtual machine to generalized. It is recommended to
595
+ # sysprep the virtual machine before performing this operation. <br>For
596
+ # Windows, please refer to [Create a managed image of a generalized VM in
597
+ # Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For
598
+ # Linux, please refer to [How to create an image of a virtual machine or
599
+ # VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image).
600
+ #
601
+ # @param resource_group_name [String] The name of the resource group.
602
+ # @param vm_name [String] The name of the virtual machine.
603
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
604
+ # will be added to the HTTP request.
605
+ #
606
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
607
+ #
608
+ def generalize_with_http_info(resource_group_name, vm_name, custom_headers:nil)
609
+ generalize_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
610
+ end
611
+
612
+ #
613
+ # Sets the OS state of the virtual machine to generalized. It is recommended to
614
+ # sysprep the virtual machine before performing this operation. <br>For
615
+ # Windows, please refer to [Create a managed image of a generalized VM in
616
+ # Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For
617
+ # Linux, please refer to [How to create an image of a virtual machine or
618
+ # VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image).
619
+ #
620
+ # @param resource_group_name [String] The name of the resource group.
621
+ # @param vm_name [String] The name of the virtual machine.
622
+ # @param [Hash{String => String}] A hash of custom headers that will be added
623
+ # to the HTTP request.
624
+ #
625
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
626
+ #
627
+ def generalize_async(resource_group_name, vm_name, custom_headers:nil)
628
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
629
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
630
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
631
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
632
+
633
+
634
+ request_headers = {}
635
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
636
+
637
+ # Set Headers
638
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
639
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
640
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'
641
+
642
+ request_url = @base_url || @client.base_url
643
+
644
+ options = {
645
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
646
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
647
+ query_params: {'api-version' => @client.api_version},
648
+ headers: request_headers.merge(custom_headers || {}),
649
+ base_url: request_url
650
+ }
651
+ promise = @client.make_request_async(:post, path_template, options)
652
+
653
+ promise = promise.then do |result|
654
+ http_response = result.response
655
+ status_code = http_response.status
656
+ response_content = http_response.body
657
+ unless status_code == 200
658
+ error_model = JSON.load(response_content)
659
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
660
+ end
661
+
662
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
663
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
664
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
665
+
666
+ result
667
+ end
668
+
669
+ promise.execute
670
+ end
671
+
672
+ #
673
+ # Lists all of the virtual machines in the specified resource group. Use the
674
+ # nextLink property in the response to get the next page of virtual machines.
675
+ #
676
+ # @param resource_group_name [String] The name of the resource group.
677
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
678
+ # will be added to the HTTP request.
679
+ #
680
+ # @return [Array<VirtualMachine>] operation results.
681
+ #
682
+ def list(resource_group_name, custom_headers:nil)
683
+ first_page = list_as_lazy(resource_group_name, custom_headers:custom_headers)
684
+ first_page.get_all_items
685
+ end
686
+
687
+ #
688
+ # Lists all of the virtual machines in the specified resource group. Use the
689
+ # nextLink property in the response to get the next page of virtual machines.
690
+ #
691
+ # @param resource_group_name [String] The name of the resource group.
692
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
693
+ # will be added to the HTTP request.
694
+ #
695
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
696
+ #
697
+ def list_with_http_info(resource_group_name, custom_headers:nil)
698
+ list_async(resource_group_name, custom_headers:custom_headers).value!
699
+ end
700
+
701
+ #
702
+ # Lists all of the virtual machines in the specified resource group. Use the
703
+ # nextLink property in the response to get the next page of virtual machines.
704
+ #
705
+ # @param resource_group_name [String] The name of the resource group.
706
+ # @param [Hash{String => String}] A hash of custom headers that will be added
707
+ # to the HTTP request.
708
+ #
709
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
710
+ #
711
+ def list_async(resource_group_name, custom_headers:nil)
712
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
713
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
714
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
715
+
716
+
717
+ request_headers = {}
718
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
719
+
720
+ # Set Headers
721
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
722
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
723
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'
724
+
725
+ request_url = @base_url || @client.base_url
726
+
727
+ options = {
728
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
729
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
730
+ query_params: {'api-version' => @client.api_version},
731
+ headers: request_headers.merge(custom_headers || {}),
732
+ base_url: request_url
733
+ }
734
+ promise = @client.make_request_async(:get, path_template, options)
735
+
736
+ promise = promise.then do |result|
737
+ http_response = result.response
738
+ status_code = http_response.status
739
+ response_content = http_response.body
740
+ unless status_code == 200
741
+ error_model = JSON.load(response_content)
742
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
743
+ end
744
+
745
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
746
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
747
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
748
+ # Deserialize Response
749
+ if status_code == 200
750
+ begin
751
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
752
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineListResult.mapper()
753
+ result.body = @client.deserialize(result_mapper, parsed_response)
754
+ rescue Exception => e
755
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
756
+ end
757
+ end
758
+
759
+ result
760
+ end
761
+
762
+ promise.execute
763
+ end
764
+
765
+ #
766
+ # Lists all of the virtual machines in the specified subscription. Use the
767
+ # nextLink property in the response to get the next page of virtual machines.
768
+ #
769
+ # @param status_only [String] statusOnly=true enables fetching run time status
770
+ # of all Virtual Machines in the subscription.
771
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
772
+ # will be added to the HTTP request.
773
+ #
774
+ # @return [Array<VirtualMachine>] operation results.
775
+ #
776
+ def list_all(status_only:nil, custom_headers:nil)
777
+ first_page = list_all_as_lazy(status_only:status_only, custom_headers:custom_headers)
778
+ first_page.get_all_items
779
+ end
780
+
781
+ #
782
+ # Lists all of the virtual machines in the specified subscription. Use the
783
+ # nextLink property in the response to get the next page of virtual machines.
784
+ #
785
+ # @param status_only [String] statusOnly=true enables fetching run time status
786
+ # of all Virtual Machines in the subscription.
787
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
788
+ # will be added to the HTTP request.
789
+ #
790
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
791
+ #
792
+ def list_all_with_http_info(status_only:nil, custom_headers:nil)
793
+ list_all_async(status_only:status_only, custom_headers:custom_headers).value!
794
+ end
795
+
796
+ #
797
+ # Lists all of the virtual machines in the specified subscription. Use the
798
+ # nextLink property in the response to get the next page of virtual machines.
799
+ #
800
+ # @param status_only [String] statusOnly=true enables fetching run time status
801
+ # of all Virtual Machines in the subscription.
802
+ # @param [Hash{String => String}] A hash of custom headers that will be added
803
+ # to the HTTP request.
804
+ #
805
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
806
+ #
807
+ def list_all_async(status_only:nil, custom_headers:nil)
808
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
809
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
810
+
811
+
812
+ request_headers = {}
813
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
814
+
815
+ # Set Headers
816
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
817
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
818
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'
819
+
820
+ request_url = @base_url || @client.base_url
821
+
822
+ options = {
823
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
824
+ path_params: {'subscriptionId' => @client.subscription_id},
825
+ query_params: {'api-version' => @client.api_version,'statusOnly' => status_only},
826
+ headers: request_headers.merge(custom_headers || {}),
827
+ base_url: request_url
828
+ }
829
+ promise = @client.make_request_async(:get, path_template, options)
830
+
831
+ promise = promise.then do |result|
832
+ http_response = result.response
833
+ status_code = http_response.status
834
+ response_content = http_response.body
835
+ unless status_code == 200
836
+ error_model = JSON.load(response_content)
837
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
838
+ end
839
+
840
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
841
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
842
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
843
+ # Deserialize Response
844
+ if status_code == 200
845
+ begin
846
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
847
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineListResult.mapper()
848
+ result.body = @client.deserialize(result_mapper, parsed_response)
849
+ rescue Exception => e
850
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
851
+ end
852
+ end
853
+
854
+ result
855
+ end
856
+
857
+ promise.execute
858
+ end
859
+
860
+ #
861
+ # Lists all available virtual machine sizes to which the specified virtual
862
+ # machine can be resized.
863
+ #
864
+ # @param resource_group_name [String] The name of the resource group.
865
+ # @param vm_name [String] The name of the virtual machine.
866
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
867
+ # will be added to the HTTP request.
868
+ #
869
+ # @return [VirtualMachineSizeListResult] operation results.
870
+ #
871
+ def list_available_sizes(resource_group_name, vm_name, custom_headers:nil)
872
+ response = list_available_sizes_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
873
+ response.body unless response.nil?
874
+ end
875
+
876
+ #
877
+ # Lists all available virtual machine sizes to which the specified virtual
878
+ # machine can be resized.
879
+ #
880
+ # @param resource_group_name [String] The name of the resource group.
881
+ # @param vm_name [String] The name of the virtual machine.
882
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
883
+ # will be added to the HTTP request.
884
+ #
885
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
886
+ #
887
+ def list_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers:nil)
888
+ list_available_sizes_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
889
+ end
890
+
891
+ #
892
+ # Lists all available virtual machine sizes to which the specified virtual
893
+ # machine can be resized.
894
+ #
895
+ # @param resource_group_name [String] The name of the resource group.
896
+ # @param vm_name [String] The name of the virtual machine.
897
+ # @param [Hash{String => String}] A hash of custom headers that will be added
898
+ # to the HTTP request.
899
+ #
900
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
901
+ #
902
+ def list_available_sizes_async(resource_group_name, vm_name, custom_headers:nil)
903
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
904
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
905
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
906
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
907
+
908
+
909
+ request_headers = {}
910
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
911
+
912
+ # Set Headers
913
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
914
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
915
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'
916
+
917
+ request_url = @base_url || @client.base_url
918
+
919
+ options = {
920
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
921
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
922
+ query_params: {'api-version' => @client.api_version},
923
+ headers: request_headers.merge(custom_headers || {}),
924
+ base_url: request_url
925
+ }
926
+ promise = @client.make_request_async(:get, path_template, options)
927
+
928
+ promise = promise.then do |result|
929
+ http_response = result.response
930
+ status_code = http_response.status
931
+ response_content = http_response.body
932
+ unless status_code == 200
933
+ error_model = JSON.load(response_content)
934
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
935
+ end
936
+
937
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
938
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
939
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
940
+ # Deserialize Response
941
+ if status_code == 200
942
+ begin
943
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
944
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineSizeListResult.mapper()
945
+ result.body = @client.deserialize(result_mapper, parsed_response)
946
+ rescue Exception => e
947
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
948
+ end
949
+ end
950
+
951
+ result
952
+ end
953
+
954
+ promise.execute
955
+ end
956
+
957
+ #
958
+ # The operation to power off (stop) a virtual machine. The virtual machine can
959
+ # be restarted with the same provisioned resources. You are still charged for
960
+ # this virtual machine.
961
+ #
962
+ # @param resource_group_name [String] The name of the resource group.
963
+ # @param vm_name [String] The name of the virtual machine.
964
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
965
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
966
+ # false indicates otherwise. Default value for this flag is false if not
967
+ # specified
968
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
969
+ # will be added to the HTTP request.
970
+ #
971
+ def power_off(resource_group_name, vm_name, skip_shutdown:false, custom_headers:nil)
972
+ response = power_off_async(resource_group_name, vm_name, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
973
+ nil
974
+ end
975
+
976
+ #
977
+ # @param resource_group_name [String] The name of the resource group.
978
+ # @param vm_name [String] The name of the virtual machine.
979
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
980
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
981
+ # false indicates otherwise. Default value for this flag is false if not
982
+ # specified
983
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
984
+ # will be added to the HTTP request.
985
+ #
986
+ # @return [Concurrent::Promise] promise which provides async access to http
987
+ # response.
988
+ #
989
+ def power_off_async(resource_group_name, vm_name, skip_shutdown:false, custom_headers:nil)
990
+ # Send request
991
+ promise = begin_power_off_async(resource_group_name, vm_name, skip_shutdown:skip_shutdown, custom_headers:custom_headers)
992
+
993
+ promise = promise.then do |response|
994
+ # Defining deserialization method.
995
+ deserialize_method = lambda do |parsed_response|
996
+ end
997
+
998
+ # Waiting for response.
999
+ @client.get_long_running_operation_result(response, deserialize_method)
1000
+ end
1001
+
1002
+ promise
1003
+ end
1004
+
1005
+ #
1006
+ # The operation to reapply a virtual machine's state.
1007
+ #
1008
+ # @param resource_group_name [String] The name of the resource group.
1009
+ # @param vm_name [String] The name of the virtual machine.
1010
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1011
+ # will be added to the HTTP request.
1012
+ #
1013
+ def reapply(resource_group_name, vm_name, custom_headers:nil)
1014
+ response = reapply_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1015
+ nil
1016
+ end
1017
+
1018
+ #
1019
+ # @param resource_group_name [String] The name of the resource group.
1020
+ # @param vm_name [String] The name of the virtual machine.
1021
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1022
+ # will be added to the HTTP request.
1023
+ #
1024
+ # @return [Concurrent::Promise] promise which provides async access to http
1025
+ # response.
1026
+ #
1027
+ def reapply_async(resource_group_name, vm_name, custom_headers:nil)
1028
+ # Send request
1029
+ promise = begin_reapply_async(resource_group_name, vm_name, custom_headers:custom_headers)
1030
+
1031
+ promise = promise.then do |response|
1032
+ # Defining deserialization method.
1033
+ deserialize_method = lambda do |parsed_response|
1034
+ end
1035
+
1036
+ # Waiting for response.
1037
+ @client.get_long_running_operation_result(response, deserialize_method)
1038
+ end
1039
+
1040
+ promise
1041
+ end
1042
+
1043
+ #
1044
+ # The operation to restart a virtual machine.
1045
+ #
1046
+ # @param resource_group_name [String] The name of the resource group.
1047
+ # @param vm_name [String] The name of the virtual machine.
1048
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1049
+ # will be added to the HTTP request.
1050
+ #
1051
+ def restart(resource_group_name, vm_name, custom_headers:nil)
1052
+ response = restart_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1053
+ nil
1054
+ end
1055
+
1056
+ #
1057
+ # @param resource_group_name [String] The name of the resource group.
1058
+ # @param vm_name [String] The name of the virtual machine.
1059
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1060
+ # will be added to the HTTP request.
1061
+ #
1062
+ # @return [Concurrent::Promise] promise which provides async access to http
1063
+ # response.
1064
+ #
1065
+ def restart_async(resource_group_name, vm_name, custom_headers:nil)
1066
+ # Send request
1067
+ promise = begin_restart_async(resource_group_name, vm_name, custom_headers:custom_headers)
1068
+
1069
+ promise = promise.then do |response|
1070
+ # Defining deserialization method.
1071
+ deserialize_method = lambda do |parsed_response|
1072
+ end
1073
+
1074
+ # Waiting for response.
1075
+ @client.get_long_running_operation_result(response, deserialize_method)
1076
+ end
1077
+
1078
+ promise
1079
+ end
1080
+
1081
+ #
1082
+ # The operation to start a virtual machine.
1083
+ #
1084
+ # @param resource_group_name [String] The name of the resource group.
1085
+ # @param vm_name [String] The name of the virtual machine.
1086
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1087
+ # will be added to the HTTP request.
1088
+ #
1089
+ def start(resource_group_name, vm_name, custom_headers:nil)
1090
+ response = start_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1091
+ nil
1092
+ end
1093
+
1094
+ #
1095
+ # @param resource_group_name [String] The name of the resource group.
1096
+ # @param vm_name [String] The name of the virtual machine.
1097
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1098
+ # will be added to the HTTP request.
1099
+ #
1100
+ # @return [Concurrent::Promise] promise which provides async access to http
1101
+ # response.
1102
+ #
1103
+ def start_async(resource_group_name, vm_name, custom_headers:nil)
1104
+ # Send request
1105
+ promise = begin_start_async(resource_group_name, vm_name, custom_headers:custom_headers)
1106
+
1107
+ promise = promise.then do |response|
1108
+ # Defining deserialization method.
1109
+ deserialize_method = lambda do |parsed_response|
1110
+ end
1111
+
1112
+ # Waiting for response.
1113
+ @client.get_long_running_operation_result(response, deserialize_method)
1114
+ end
1115
+
1116
+ promise
1117
+ end
1118
+
1119
+ #
1120
+ # Shuts down the virtual machine, moves it to a new node, and powers it back
1121
+ # on.
1122
+ #
1123
+ # @param resource_group_name [String] The name of the resource group.
1124
+ # @param vm_name [String] The name of the virtual machine.
1125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1126
+ # will be added to the HTTP request.
1127
+ #
1128
+ def redeploy(resource_group_name, vm_name, custom_headers:nil)
1129
+ response = redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1130
+ nil
1131
+ end
1132
+
1133
+ #
1134
+ # @param resource_group_name [String] The name of the resource group.
1135
+ # @param vm_name [String] The name of the virtual machine.
1136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1137
+ # will be added to the HTTP request.
1138
+ #
1139
+ # @return [Concurrent::Promise] promise which provides async access to http
1140
+ # response.
1141
+ #
1142
+ def redeploy_async(resource_group_name, vm_name, custom_headers:nil)
1143
+ # Send request
1144
+ promise = begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers)
1145
+
1146
+ promise = promise.then do |response|
1147
+ # Defining deserialization method.
1148
+ deserialize_method = lambda do |parsed_response|
1149
+ end
1150
+
1151
+ # Waiting for response.
1152
+ @client.get_long_running_operation_result(response, deserialize_method)
1153
+ end
1154
+
1155
+ promise
1156
+ end
1157
+
1158
+ #
1159
+ # Reimages the virtual machine which has an ephemeral OS disk back to its
1160
+ # initial state.
1161
+ #
1162
+ # @param resource_group_name [String] The name of the resource group.
1163
+ # @param vm_name [String] The name of the virtual machine.
1164
+ # @param parameters [VirtualMachineReimageParameters] Parameters supplied to
1165
+ # the Reimage Virtual Machine operation.
1166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1167
+ # will be added to the HTTP request.
1168
+ #
1169
+ def reimage(resource_group_name, vm_name, parameters:nil, custom_headers:nil)
1170
+ response = reimage_async(resource_group_name, vm_name, parameters:parameters, custom_headers:custom_headers).value!
1171
+ nil
1172
+ end
1173
+
1174
+ #
1175
+ # @param resource_group_name [String] The name of the resource group.
1176
+ # @param vm_name [String] The name of the virtual machine.
1177
+ # @param parameters [VirtualMachineReimageParameters] Parameters supplied to
1178
+ # the Reimage Virtual Machine operation.
1179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1180
+ # will be added to the HTTP request.
1181
+ #
1182
+ # @return [Concurrent::Promise] promise which provides async access to http
1183
+ # response.
1184
+ #
1185
+ def reimage_async(resource_group_name, vm_name, parameters:nil, custom_headers:nil)
1186
+ # Send request
1187
+ promise = begin_reimage_async(resource_group_name, vm_name, parameters:parameters, custom_headers:custom_headers)
1188
+
1189
+ promise = promise.then do |response|
1190
+ # Defining deserialization method.
1191
+ deserialize_method = lambda do |parsed_response|
1192
+ end
1193
+
1194
+ # Waiting for response.
1195
+ @client.get_long_running_operation_result(response, deserialize_method)
1196
+ end
1197
+
1198
+ promise
1199
+ end
1200
+
1201
+ #
1202
+ # The operation to perform maintenance on a virtual machine.
1203
+ #
1204
+ # @param resource_group_name [String] The name of the resource group.
1205
+ # @param vm_name [String] The name of the virtual machine.
1206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1207
+ # will be added to the HTTP request.
1208
+ #
1209
+ def perform_maintenance(resource_group_name, vm_name, custom_headers:nil)
1210
+ response = perform_maintenance_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1211
+ nil
1212
+ end
1213
+
1214
+ #
1215
+ # @param resource_group_name [String] The name of the resource group.
1216
+ # @param vm_name [String] The name of the virtual machine.
1217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1218
+ # will be added to the HTTP request.
1219
+ #
1220
+ # @return [Concurrent::Promise] promise which provides async access to http
1221
+ # response.
1222
+ #
1223
+ def perform_maintenance_async(resource_group_name, vm_name, custom_headers:nil)
1224
+ # Send request
1225
+ promise = begin_perform_maintenance_async(resource_group_name, vm_name, custom_headers:custom_headers)
1226
+
1227
+ promise = promise.then do |response|
1228
+ # Defining deserialization method.
1229
+ deserialize_method = lambda do |parsed_response|
1230
+ end
1231
+
1232
+ # Waiting for response.
1233
+ @client.get_long_running_operation_result(response, deserialize_method)
1234
+ end
1235
+
1236
+ promise
1237
+ end
1238
+
1239
+ #
1240
+ # The operation to simulate the eviction of spot virtual machine. The eviction
1241
+ # will occur within 30 minutes of calling the API
1242
+ #
1243
+ # @param resource_group_name [String] The name of the resource group.
1244
+ # @param vm_name [String] The name of the virtual machine.
1245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1246
+ # will be added to the HTTP request.
1247
+ #
1248
+ #
1249
+ def simulate_eviction(resource_group_name, vm_name, custom_headers:nil)
1250
+ response = simulate_eviction_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1251
+ nil
1252
+ end
1253
+
1254
+ #
1255
+ # The operation to simulate the eviction of spot virtual machine. The eviction
1256
+ # will occur within 30 minutes of calling the API
1257
+ #
1258
+ # @param resource_group_name [String] The name of the resource group.
1259
+ # @param vm_name [String] The name of the virtual machine.
1260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1261
+ # will be added to the HTTP request.
1262
+ #
1263
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1264
+ #
1265
+ def simulate_eviction_with_http_info(resource_group_name, vm_name, custom_headers:nil)
1266
+ simulate_eviction_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1267
+ end
1268
+
1269
+ #
1270
+ # The operation to simulate the eviction of spot virtual machine. The eviction
1271
+ # will occur within 30 minutes of calling the API
1272
+ #
1273
+ # @param resource_group_name [String] The name of the resource group.
1274
+ # @param vm_name [String] The name of the virtual machine.
1275
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1276
+ # to the HTTP request.
1277
+ #
1278
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1279
+ #
1280
+ def simulate_eviction_async(resource_group_name, vm_name, custom_headers:nil)
1281
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1282
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1283
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1284
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1285
+
1286
+
1287
+ request_headers = {}
1288
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1289
+
1290
+ # Set Headers
1291
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1292
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1293
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction'
1294
+
1295
+ request_url = @base_url || @client.base_url
1296
+
1297
+ options = {
1298
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1299
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1300
+ query_params: {'api-version' => @client.api_version},
1301
+ headers: request_headers.merge(custom_headers || {}),
1302
+ base_url: request_url
1303
+ }
1304
+ promise = @client.make_request_async(:post, path_template, options)
1305
+
1306
+ promise = promise.then do |result|
1307
+ http_response = result.response
1308
+ status_code = http_response.status
1309
+ response_content = http_response.body
1310
+ unless status_code == 204
1311
+ error_model = JSON.load(response_content)
1312
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1313
+ end
1314
+
1315
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1316
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1317
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1318
+
1319
+ result
1320
+ end
1321
+
1322
+ promise.execute
1323
+ end
1324
+
1325
+ #
1326
+ # Run command on the VM.
1327
+ #
1328
+ # @param resource_group_name [String] The name of the resource group.
1329
+ # @param vm_name [String] The name of the virtual machine.
1330
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
1331
+ # operation.
1332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1333
+ # will be added to the HTTP request.
1334
+ #
1335
+ # @return [RunCommandResult] operation results.
1336
+ #
1337
+ def run_command(resource_group_name, vm_name, parameters, custom_headers:nil)
1338
+ response = run_command_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1339
+ response.body unless response.nil?
1340
+ end
1341
+
1342
+ #
1343
+ # @param resource_group_name [String] The name of the resource group.
1344
+ # @param vm_name [String] The name of the virtual machine.
1345
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
1346
+ # operation.
1347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1348
+ # will be added to the HTTP request.
1349
+ #
1350
+ # @return [Concurrent::Promise] promise which provides async access to http
1351
+ # response.
1352
+ #
1353
+ def run_command_async(resource_group_name, vm_name, parameters, custom_headers:nil)
1354
+ # Send request
1355
+ promise = begin_run_command_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers)
1356
+
1357
+ promise = promise.then do |response|
1358
+ # Defining deserialization method.
1359
+ deserialize_method = lambda do |parsed_response|
1360
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RunCommandResult.mapper()
1361
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1362
+ end
1363
+
1364
+ # Waiting for response.
1365
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
1366
+ end
1367
+
1368
+ promise
1369
+ end
1370
+
1371
+ #
1372
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
1373
+ # template that can be used to create similar VMs.
1374
+ #
1375
+ # @param resource_group_name [String] The name of the resource group.
1376
+ # @param vm_name [String] The name of the virtual machine.
1377
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
1378
+ # the Capture Virtual Machine operation.
1379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1380
+ # will be added to the HTTP request.
1381
+ #
1382
+ # @return [VirtualMachineCaptureResult] operation results.
1383
+ #
1384
+ def begin_capture(resource_group_name, vm_name, parameters, custom_headers:nil)
1385
+ response = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1386
+ response.body unless response.nil?
1387
+ end
1388
+
1389
+ #
1390
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
1391
+ # template that can be used to create similar VMs.
1392
+ #
1393
+ # @param resource_group_name [String] The name of the resource group.
1394
+ # @param vm_name [String] The name of the virtual machine.
1395
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
1396
+ # the Capture Virtual Machine operation.
1397
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1398
+ # will be added to the HTTP request.
1399
+ #
1400
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1401
+ #
1402
+ def begin_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers:nil)
1403
+ begin_capture_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1404
+ end
1405
+
1406
+ #
1407
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
1408
+ # template that can be used to create similar VMs.
1409
+ #
1410
+ # @param resource_group_name [String] The name of the resource group.
1411
+ # @param vm_name [String] The name of the virtual machine.
1412
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
1413
+ # the Capture Virtual Machine operation.
1414
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1415
+ # to the HTTP request.
1416
+ #
1417
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1418
+ #
1419
+ def begin_capture_async(resource_group_name, vm_name, parameters, custom_headers:nil)
1420
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1421
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1422
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1423
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1424
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1425
+
1426
+
1427
+ request_headers = {}
1428
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1429
+
1430
+ # Set Headers
1431
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1432
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1433
+
1434
+ # Serialize Request
1435
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineCaptureParameters.mapper()
1436
+ request_content = @client.serialize(request_mapper, parameters)
1437
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1438
+
1439
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'
1440
+
1441
+ request_url = @base_url || @client.base_url
1442
+
1443
+ options = {
1444
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1445
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1446
+ query_params: {'api-version' => @client.api_version},
1447
+ body: request_content,
1448
+ headers: request_headers.merge(custom_headers || {}),
1449
+ base_url: request_url
1450
+ }
1451
+ promise = @client.make_request_async(:post, path_template, options)
1452
+
1453
+ promise = promise.then do |result|
1454
+ http_response = result.response
1455
+ status_code = http_response.status
1456
+ response_content = http_response.body
1457
+ unless status_code == 200 || status_code == 202
1458
+ error_model = JSON.load(response_content)
1459
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1460
+ end
1461
+
1462
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1463
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1464
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1465
+ # Deserialize Response
1466
+ if status_code == 200
1467
+ begin
1468
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1469
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineCaptureResult.mapper()
1470
+ result.body = @client.deserialize(result_mapper, parsed_response)
1471
+ rescue Exception => e
1472
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1473
+ end
1474
+ end
1475
+
1476
+ result
1477
+ end
1478
+
1479
+ promise.execute
1480
+ end
1481
+
1482
+ #
1483
+ # The operation to create or update a virtual machine. Please note some
1484
+ # properties can be set only during virtual machine creation.
1485
+ #
1486
+ # @param resource_group_name [String] The name of the resource group.
1487
+ # @param vm_name [String] The name of the virtual machine.
1488
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
1489
+ # Machine operation.
1490
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1491
+ # will be added to the HTTP request.
1492
+ #
1493
+ # @return [VirtualMachine] operation results.
1494
+ #
1495
+ def begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers:nil)
1496
+ response = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1497
+ response.body unless response.nil?
1498
+ end
1499
+
1500
+ #
1501
+ # The operation to create or update a virtual machine. Please note some
1502
+ # properties can be set only during virtual machine creation.
1503
+ #
1504
+ # @param resource_group_name [String] The name of the resource group.
1505
+ # @param vm_name [String] The name of the virtual machine.
1506
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
1507
+ # Machine operation.
1508
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1509
+ # will be added to the HTTP request.
1510
+ #
1511
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1512
+ #
1513
+ def begin_create_or_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers:nil)
1514
+ begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1515
+ end
1516
+
1517
+ #
1518
+ # The operation to create or update a virtual machine. Please note some
1519
+ # properties can be set only during virtual machine creation.
1520
+ #
1521
+ # @param resource_group_name [String] The name of the resource group.
1522
+ # @param vm_name [String] The name of the virtual machine.
1523
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
1524
+ # Machine operation.
1525
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1526
+ # to the HTTP request.
1527
+ #
1528
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1529
+ #
1530
+ def begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers:nil)
1531
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1532
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1533
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1534
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1535
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1536
+
1537
+
1538
+ request_headers = {}
1539
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1540
+
1541
+ # Set Headers
1542
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1543
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1544
+
1545
+ # Serialize Request
1546
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
1547
+ request_content = @client.serialize(request_mapper, parameters)
1548
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1549
+
1550
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
1551
+
1552
+ request_url = @base_url || @client.base_url
1553
+
1554
+ options = {
1555
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1556
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1557
+ query_params: {'api-version' => @client.api_version},
1558
+ body: request_content,
1559
+ headers: request_headers.merge(custom_headers || {}),
1560
+ base_url: request_url
1561
+ }
1562
+ promise = @client.make_request_async(:put, path_template, options)
1563
+
1564
+ promise = promise.then do |result|
1565
+ http_response = result.response
1566
+ status_code = http_response.status
1567
+ response_content = http_response.body
1568
+ unless status_code == 200 || status_code == 201
1569
+ error_model = JSON.load(response_content)
1570
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1571
+ end
1572
+
1573
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1574
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1575
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1576
+ # Deserialize Response
1577
+ if status_code == 200
1578
+ begin
1579
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1580
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
1581
+ result.body = @client.deserialize(result_mapper, parsed_response)
1582
+ rescue Exception => e
1583
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1584
+ end
1585
+ end
1586
+ # Deserialize Response
1587
+ if status_code == 201
1588
+ begin
1589
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1590
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
1591
+ result.body = @client.deserialize(result_mapper, parsed_response)
1592
+ rescue Exception => e
1593
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1594
+ end
1595
+ end
1596
+
1597
+ result
1598
+ end
1599
+
1600
+ promise.execute
1601
+ end
1602
+
1603
+ #
1604
+ # The operation to update a virtual machine.
1605
+ #
1606
+ # @param resource_group_name [String] The name of the resource group.
1607
+ # @param vm_name [String] The name of the virtual machine.
1608
+ # @param parameters [VirtualMachineUpdate] Parameters supplied to the Update
1609
+ # Virtual Machine operation.
1610
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1611
+ # will be added to the HTTP request.
1612
+ #
1613
+ # @return [VirtualMachine] operation results.
1614
+ #
1615
+ def begin_update(resource_group_name, vm_name, parameters, custom_headers:nil)
1616
+ response = begin_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1617
+ response.body unless response.nil?
1618
+ end
1619
+
1620
+ #
1621
+ # The operation to update a virtual machine.
1622
+ #
1623
+ # @param resource_group_name [String] The name of the resource group.
1624
+ # @param vm_name [String] The name of the virtual machine.
1625
+ # @param parameters [VirtualMachineUpdate] Parameters supplied to the Update
1626
+ # Virtual Machine operation.
1627
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1628
+ # will be added to the HTTP request.
1629
+ #
1630
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1631
+ #
1632
+ def begin_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers:nil)
1633
+ begin_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
1634
+ end
1635
+
1636
+ #
1637
+ # The operation to update a virtual machine.
1638
+ #
1639
+ # @param resource_group_name [String] The name of the resource group.
1640
+ # @param vm_name [String] The name of the virtual machine.
1641
+ # @param parameters [VirtualMachineUpdate] Parameters supplied to the Update
1642
+ # Virtual Machine operation.
1643
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1644
+ # to the HTTP request.
1645
+ #
1646
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1647
+ #
1648
+ def begin_update_async(resource_group_name, vm_name, parameters, custom_headers:nil)
1649
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1650
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1651
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1652
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1653
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1654
+
1655
+
1656
+ request_headers = {}
1657
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1658
+
1659
+ # Set Headers
1660
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1661
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1662
+
1663
+ # Serialize Request
1664
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineUpdate.mapper()
1665
+ request_content = @client.serialize(request_mapper, parameters)
1666
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1667
+
1668
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
1669
+
1670
+ request_url = @base_url || @client.base_url
1671
+
1672
+ options = {
1673
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1674
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1675
+ query_params: {'api-version' => @client.api_version},
1676
+ body: request_content,
1677
+ headers: request_headers.merge(custom_headers || {}),
1678
+ base_url: request_url
1679
+ }
1680
+ promise = @client.make_request_async(:patch, path_template, options)
1681
+
1682
+ promise = promise.then do |result|
1683
+ http_response = result.response
1684
+ status_code = http_response.status
1685
+ response_content = http_response.body
1686
+ unless status_code == 200 || status_code == 201
1687
+ error_model = JSON.load(response_content)
1688
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1689
+ end
1690
+
1691
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1692
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1693
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1694
+ # Deserialize Response
1695
+ if status_code == 200
1696
+ begin
1697
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1698
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
1699
+ result.body = @client.deserialize(result_mapper, parsed_response)
1700
+ rescue Exception => e
1701
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1702
+ end
1703
+ end
1704
+ # Deserialize Response
1705
+ if status_code == 201
1706
+ begin
1707
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1708
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachine.mapper()
1709
+ result.body = @client.deserialize(result_mapper, parsed_response)
1710
+ rescue Exception => e
1711
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1712
+ end
1713
+ end
1714
+
1715
+ result
1716
+ end
1717
+
1718
+ promise.execute
1719
+ end
1720
+
1721
+ #
1722
+ # The operation to delete a virtual machine.
1723
+ #
1724
+ # @param resource_group_name [String] The name of the resource group.
1725
+ # @param vm_name [String] The name of the virtual machine.
1726
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1727
+ # will be added to the HTTP request.
1728
+ #
1729
+ #
1730
+ def begin_delete(resource_group_name, vm_name, custom_headers:nil)
1731
+ response = begin_delete_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1732
+ nil
1733
+ end
1734
+
1735
+ #
1736
+ # The operation to delete a virtual machine.
1737
+ #
1738
+ # @param resource_group_name [String] The name of the resource group.
1739
+ # @param vm_name [String] The name of the virtual machine.
1740
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1741
+ # will be added to the HTTP request.
1742
+ #
1743
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1744
+ #
1745
+ def begin_delete_with_http_info(resource_group_name, vm_name, custom_headers:nil)
1746
+ begin_delete_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1747
+ end
1748
+
1749
+ #
1750
+ # The operation to delete a virtual machine.
1751
+ #
1752
+ # @param resource_group_name [String] The name of the resource group.
1753
+ # @param vm_name [String] The name of the virtual machine.
1754
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1755
+ # to the HTTP request.
1756
+ #
1757
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1758
+ #
1759
+ def begin_delete_async(resource_group_name, vm_name, custom_headers:nil)
1760
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1761
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1762
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1763
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1764
+
1765
+
1766
+ request_headers = {}
1767
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1768
+
1769
+ # Set Headers
1770
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1771
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1772
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
1773
+
1774
+ request_url = @base_url || @client.base_url
1775
+
1776
+ options = {
1777
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1778
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1779
+ query_params: {'api-version' => @client.api_version},
1780
+ headers: request_headers.merge(custom_headers || {}),
1781
+ base_url: request_url
1782
+ }
1783
+ promise = @client.make_request_async(:delete, path_template, options)
1784
+
1785
+ promise = promise.then do |result|
1786
+ http_response = result.response
1787
+ status_code = http_response.status
1788
+ response_content = http_response.body
1789
+ unless status_code == 200 || status_code == 202 || status_code == 204
1790
+ error_model = JSON.load(response_content)
1791
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1792
+ end
1793
+
1794
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1795
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1796
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1797
+
1798
+ result
1799
+ end
1800
+
1801
+ promise.execute
1802
+ end
1803
+
1804
+ #
1805
+ # Converts virtual machine disks from blob-based to managed disks. Virtual
1806
+ # machine must be stop-deallocated before invoking this operation.
1807
+ #
1808
+ # @param resource_group_name [String] The name of the resource group.
1809
+ # @param vm_name [String] The name of the virtual machine.
1810
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1811
+ # will be added to the HTTP request.
1812
+ #
1813
+ #
1814
+ def begin_convert_to_managed_disks(resource_group_name, vm_name, custom_headers:nil)
1815
+ response = begin_convert_to_managed_disks_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1816
+ nil
1817
+ end
1818
+
1819
+ #
1820
+ # Converts virtual machine disks from blob-based to managed disks. Virtual
1821
+ # machine must be stop-deallocated before invoking this operation.
1822
+ #
1823
+ # @param resource_group_name [String] The name of the resource group.
1824
+ # @param vm_name [String] The name of the virtual machine.
1825
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1826
+ # will be added to the HTTP request.
1827
+ #
1828
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1829
+ #
1830
+ def begin_convert_to_managed_disks_with_http_info(resource_group_name, vm_name, custom_headers:nil)
1831
+ begin_convert_to_managed_disks_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1832
+ end
1833
+
1834
+ #
1835
+ # Converts virtual machine disks from blob-based to managed disks. Virtual
1836
+ # machine must be stop-deallocated before invoking this operation.
1837
+ #
1838
+ # @param resource_group_name [String] The name of the resource group.
1839
+ # @param vm_name [String] The name of the virtual machine.
1840
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1841
+ # to the HTTP request.
1842
+ #
1843
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1844
+ #
1845
+ def begin_convert_to_managed_disks_async(resource_group_name, vm_name, custom_headers:nil)
1846
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1847
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1848
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1849
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1850
+
1851
+
1852
+ request_headers = {}
1853
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1854
+
1855
+ # Set Headers
1856
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1857
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1858
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'
1859
+
1860
+ request_url = @base_url || @client.base_url
1861
+
1862
+ options = {
1863
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1864
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1865
+ query_params: {'api-version' => @client.api_version},
1866
+ headers: request_headers.merge(custom_headers || {}),
1867
+ base_url: request_url
1868
+ }
1869
+ promise = @client.make_request_async(:post, path_template, options)
1870
+
1871
+ promise = promise.then do |result|
1872
+ http_response = result.response
1873
+ status_code = http_response.status
1874
+ response_content = http_response.body
1875
+ unless status_code == 200 || status_code == 202
1876
+ error_model = JSON.load(response_content)
1877
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1878
+ end
1879
+
1880
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1881
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1882
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1883
+
1884
+ result
1885
+ end
1886
+
1887
+ promise.execute
1888
+ end
1889
+
1890
+ #
1891
+ # Shuts down the virtual machine and releases the compute resources. You are
1892
+ # not billed for the compute resources that this virtual machine uses.
1893
+ #
1894
+ # @param resource_group_name [String] The name of the resource group.
1895
+ # @param vm_name [String] The name of the virtual machine.
1896
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1897
+ # will be added to the HTTP request.
1898
+ #
1899
+ #
1900
+ def begin_deallocate(resource_group_name, vm_name, custom_headers:nil)
1901
+ response = begin_deallocate_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1902
+ nil
1903
+ end
1904
+
1905
+ #
1906
+ # Shuts down the virtual machine and releases the compute resources. You are
1907
+ # not billed for the compute resources that this virtual machine uses.
1908
+ #
1909
+ # @param resource_group_name [String] The name of the resource group.
1910
+ # @param vm_name [String] The name of the virtual machine.
1911
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1912
+ # will be added to the HTTP request.
1913
+ #
1914
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1915
+ #
1916
+ def begin_deallocate_with_http_info(resource_group_name, vm_name, custom_headers:nil)
1917
+ begin_deallocate_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
1918
+ end
1919
+
1920
+ #
1921
+ # Shuts down the virtual machine and releases the compute resources. You are
1922
+ # not billed for the compute resources that this virtual machine uses.
1923
+ #
1924
+ # @param resource_group_name [String] The name of the resource group.
1925
+ # @param vm_name [String] The name of the virtual machine.
1926
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1927
+ # to the HTTP request.
1928
+ #
1929
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1930
+ #
1931
+ def begin_deallocate_async(resource_group_name, vm_name, custom_headers:nil)
1932
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1933
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1934
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1935
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1936
+
1937
+
1938
+ request_headers = {}
1939
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1940
+
1941
+ # Set Headers
1942
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1943
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1944
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'
1945
+
1946
+ request_url = @base_url || @client.base_url
1947
+
1948
+ options = {
1949
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1950
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
1951
+ query_params: {'api-version' => @client.api_version},
1952
+ headers: request_headers.merge(custom_headers || {}),
1953
+ base_url: request_url
1954
+ }
1955
+ promise = @client.make_request_async(:post, path_template, options)
1956
+
1957
+ promise = promise.then do |result|
1958
+ http_response = result.response
1959
+ status_code = http_response.status
1960
+ response_content = http_response.body
1961
+ unless status_code == 200 || status_code == 202
1962
+ error_model = JSON.load(response_content)
1963
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1964
+ end
1965
+
1966
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1967
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1968
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1969
+
1970
+ result
1971
+ end
1972
+
1973
+ promise.execute
1974
+ end
1975
+
1976
+ #
1977
+ # The operation to power off (stop) a virtual machine. The virtual machine can
1978
+ # be restarted with the same provisioned resources. You are still charged for
1979
+ # this virtual machine.
1980
+ #
1981
+ # @param resource_group_name [String] The name of the resource group.
1982
+ # @param vm_name [String] The name of the virtual machine.
1983
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1984
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1985
+ # false indicates otherwise. Default value for this flag is false if not
1986
+ # specified
1987
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1988
+ # will be added to the HTTP request.
1989
+ #
1990
+ #
1991
+ def begin_power_off(resource_group_name, vm_name, skip_shutdown:false, custom_headers:nil)
1992
+ response = begin_power_off_async(resource_group_name, vm_name, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
1993
+ nil
1994
+ end
1995
+
1996
+ #
1997
+ # The operation to power off (stop) a virtual machine. The virtual machine can
1998
+ # be restarted with the same provisioned resources. You are still charged for
1999
+ # this virtual machine.
2000
+ #
2001
+ # @param resource_group_name [String] The name of the resource group.
2002
+ # @param vm_name [String] The name of the virtual machine.
2003
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
2004
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
2005
+ # false indicates otherwise. Default value for this flag is false if not
2006
+ # specified
2007
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2008
+ # will be added to the HTTP request.
2009
+ #
2010
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2011
+ #
2012
+ def begin_power_off_with_http_info(resource_group_name, vm_name, skip_shutdown:false, custom_headers:nil)
2013
+ begin_power_off_async(resource_group_name, vm_name, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
2014
+ end
2015
+
2016
+ #
2017
+ # The operation to power off (stop) a virtual machine. The virtual machine can
2018
+ # be restarted with the same provisioned resources. You are still charged for
2019
+ # this virtual machine.
2020
+ #
2021
+ # @param resource_group_name [String] The name of the resource group.
2022
+ # @param vm_name [String] The name of the virtual machine.
2023
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
2024
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
2025
+ # false indicates otherwise. Default value for this flag is false if not
2026
+ # specified
2027
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2028
+ # to the HTTP request.
2029
+ #
2030
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2031
+ #
2032
+ def begin_power_off_async(resource_group_name, vm_name, skip_shutdown:false, custom_headers:nil)
2033
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2034
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2035
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2036
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2037
+
2038
+
2039
+ request_headers = {}
2040
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2041
+
2042
+ # Set Headers
2043
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2044
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2045
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'
2046
+
2047
+ request_url = @base_url || @client.base_url
2048
+
2049
+ options = {
2050
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2051
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2052
+ query_params: {'skipShutdown' => skip_shutdown,'api-version' => @client.api_version},
2053
+ headers: request_headers.merge(custom_headers || {}),
2054
+ base_url: request_url
2055
+ }
2056
+ promise = @client.make_request_async(:post, path_template, options)
2057
+
2058
+ promise = promise.then do |result|
2059
+ http_response = result.response
2060
+ status_code = http_response.status
2061
+ response_content = http_response.body
2062
+ unless status_code == 200 || status_code == 202
2063
+ error_model = JSON.load(response_content)
2064
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2065
+ end
2066
+
2067
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2068
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2069
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2070
+
2071
+ result
2072
+ end
2073
+
2074
+ promise.execute
2075
+ end
2076
+
2077
+ #
2078
+ # The operation to reapply a virtual machine's state.
2079
+ #
2080
+ # @param resource_group_name [String] The name of the resource group.
2081
+ # @param vm_name [String] The name of the virtual machine.
2082
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2083
+ # will be added to the HTTP request.
2084
+ #
2085
+ #
2086
+ def begin_reapply(resource_group_name, vm_name, custom_headers:nil)
2087
+ response = begin_reapply_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2088
+ nil
2089
+ end
2090
+
2091
+ #
2092
+ # The operation to reapply a virtual machine's state.
2093
+ #
2094
+ # @param resource_group_name [String] The name of the resource group.
2095
+ # @param vm_name [String] The name of the virtual machine.
2096
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2097
+ # will be added to the HTTP request.
2098
+ #
2099
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2100
+ #
2101
+ def begin_reapply_with_http_info(resource_group_name, vm_name, custom_headers:nil)
2102
+ begin_reapply_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2103
+ end
2104
+
2105
+ #
2106
+ # The operation to reapply a virtual machine's state.
2107
+ #
2108
+ # @param resource_group_name [String] The name of the resource group.
2109
+ # @param vm_name [String] The name of the virtual machine.
2110
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2111
+ # to the HTTP request.
2112
+ #
2113
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2114
+ #
2115
+ def begin_reapply_async(resource_group_name, vm_name, custom_headers:nil)
2116
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2117
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2118
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2119
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2120
+
2121
+
2122
+ request_headers = {}
2123
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2124
+
2125
+ # Set Headers
2126
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2127
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2128
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply'
2129
+
2130
+ request_url = @base_url || @client.base_url
2131
+
2132
+ options = {
2133
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2134
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2135
+ query_params: {'api-version' => @client.api_version},
2136
+ headers: request_headers.merge(custom_headers || {}),
2137
+ base_url: request_url
2138
+ }
2139
+ promise = @client.make_request_async(:post, path_template, options)
2140
+
2141
+ promise = promise.then do |result|
2142
+ http_response = result.response
2143
+ status_code = http_response.status
2144
+ response_content = http_response.body
2145
+ unless status_code == 200 || status_code == 202
2146
+ error_model = JSON.load(response_content)
2147
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2148
+ end
2149
+
2150
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2151
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2152
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2153
+
2154
+ result
2155
+ end
2156
+
2157
+ promise.execute
2158
+ end
2159
+
2160
+ #
2161
+ # The operation to restart a virtual machine.
2162
+ #
2163
+ # @param resource_group_name [String] The name of the resource group.
2164
+ # @param vm_name [String] The name of the virtual machine.
2165
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2166
+ # will be added to the HTTP request.
2167
+ #
2168
+ #
2169
+ def begin_restart(resource_group_name, vm_name, custom_headers:nil)
2170
+ response = begin_restart_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2171
+ nil
2172
+ end
2173
+
2174
+ #
2175
+ # The operation to restart a virtual machine.
2176
+ #
2177
+ # @param resource_group_name [String] The name of the resource group.
2178
+ # @param vm_name [String] The name of the virtual machine.
2179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2180
+ # will be added to the HTTP request.
2181
+ #
2182
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2183
+ #
2184
+ def begin_restart_with_http_info(resource_group_name, vm_name, custom_headers:nil)
2185
+ begin_restart_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2186
+ end
2187
+
2188
+ #
2189
+ # The operation to restart a virtual machine.
2190
+ #
2191
+ # @param resource_group_name [String] The name of the resource group.
2192
+ # @param vm_name [String] The name of the virtual machine.
2193
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2194
+ # to the HTTP request.
2195
+ #
2196
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2197
+ #
2198
+ def begin_restart_async(resource_group_name, vm_name, custom_headers:nil)
2199
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2200
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2201
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2202
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2203
+
2204
+
2205
+ request_headers = {}
2206
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2207
+
2208
+ # Set Headers
2209
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2210
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2211
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'
2212
+
2213
+ request_url = @base_url || @client.base_url
2214
+
2215
+ options = {
2216
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2217
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2218
+ query_params: {'api-version' => @client.api_version},
2219
+ headers: request_headers.merge(custom_headers || {}),
2220
+ base_url: request_url
2221
+ }
2222
+ promise = @client.make_request_async(:post, path_template, options)
2223
+
2224
+ promise = promise.then do |result|
2225
+ http_response = result.response
2226
+ status_code = http_response.status
2227
+ response_content = http_response.body
2228
+ unless status_code == 200 || status_code == 202
2229
+ error_model = JSON.load(response_content)
2230
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2231
+ end
2232
+
2233
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2234
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2235
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2236
+
2237
+ result
2238
+ end
2239
+
2240
+ promise.execute
2241
+ end
2242
+
2243
+ #
2244
+ # The operation to start a virtual machine.
2245
+ #
2246
+ # @param resource_group_name [String] The name of the resource group.
2247
+ # @param vm_name [String] The name of the virtual machine.
2248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2249
+ # will be added to the HTTP request.
2250
+ #
2251
+ #
2252
+ def begin_start(resource_group_name, vm_name, custom_headers:nil)
2253
+ response = begin_start_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2254
+ nil
2255
+ end
2256
+
2257
+ #
2258
+ # The operation to start a virtual machine.
2259
+ #
2260
+ # @param resource_group_name [String] The name of the resource group.
2261
+ # @param vm_name [String] The name of the virtual machine.
2262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2263
+ # will be added to the HTTP request.
2264
+ #
2265
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2266
+ #
2267
+ def begin_start_with_http_info(resource_group_name, vm_name, custom_headers:nil)
2268
+ begin_start_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2269
+ end
2270
+
2271
+ #
2272
+ # The operation to start a virtual machine.
2273
+ #
2274
+ # @param resource_group_name [String] The name of the resource group.
2275
+ # @param vm_name [String] The name of the virtual machine.
2276
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2277
+ # to the HTTP request.
2278
+ #
2279
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2280
+ #
2281
+ def begin_start_async(resource_group_name, vm_name, custom_headers:nil)
2282
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2283
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2284
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2285
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2286
+
2287
+
2288
+ request_headers = {}
2289
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2290
+
2291
+ # Set Headers
2292
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2293
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2294
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'
2295
+
2296
+ request_url = @base_url || @client.base_url
2297
+
2298
+ options = {
2299
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2300
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2301
+ query_params: {'api-version' => @client.api_version},
2302
+ headers: request_headers.merge(custom_headers || {}),
2303
+ base_url: request_url
2304
+ }
2305
+ promise = @client.make_request_async(:post, path_template, options)
2306
+
2307
+ promise = promise.then do |result|
2308
+ http_response = result.response
2309
+ status_code = http_response.status
2310
+ response_content = http_response.body
2311
+ unless status_code == 200 || status_code == 202
2312
+ error_model = JSON.load(response_content)
2313
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2314
+ end
2315
+
2316
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2317
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2318
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2319
+
2320
+ result
2321
+ end
2322
+
2323
+ promise.execute
2324
+ end
2325
+
2326
+ #
2327
+ # Shuts down the virtual machine, moves it to a new node, and powers it back
2328
+ # on.
2329
+ #
2330
+ # @param resource_group_name [String] The name of the resource group.
2331
+ # @param vm_name [String] The name of the virtual machine.
2332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2333
+ # will be added to the HTTP request.
2334
+ #
2335
+ #
2336
+ def begin_redeploy(resource_group_name, vm_name, custom_headers:nil)
2337
+ response = begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2338
+ nil
2339
+ end
2340
+
2341
+ #
2342
+ # Shuts down the virtual machine, moves it to a new node, and powers it back
2343
+ # on.
2344
+ #
2345
+ # @param resource_group_name [String] The name of the resource group.
2346
+ # @param vm_name [String] The name of the virtual machine.
2347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2348
+ # will be added to the HTTP request.
2349
+ #
2350
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2351
+ #
2352
+ def begin_redeploy_with_http_info(resource_group_name, vm_name, custom_headers:nil)
2353
+ begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2354
+ end
2355
+
2356
+ #
2357
+ # Shuts down the virtual machine, moves it to a new node, and powers it back
2358
+ # on.
2359
+ #
2360
+ # @param resource_group_name [String] The name of the resource group.
2361
+ # @param vm_name [String] The name of the virtual machine.
2362
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2363
+ # to the HTTP request.
2364
+ #
2365
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2366
+ #
2367
+ def begin_redeploy_async(resource_group_name, vm_name, custom_headers:nil)
2368
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2369
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2370
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2371
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2372
+
2373
+
2374
+ request_headers = {}
2375
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2376
+
2377
+ # Set Headers
2378
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2379
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2380
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'
2381
+
2382
+ request_url = @base_url || @client.base_url
2383
+
2384
+ options = {
2385
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2386
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2387
+ query_params: {'api-version' => @client.api_version},
2388
+ headers: request_headers.merge(custom_headers || {}),
2389
+ base_url: request_url
2390
+ }
2391
+ promise = @client.make_request_async(:post, path_template, options)
2392
+
2393
+ promise = promise.then do |result|
2394
+ http_response = result.response
2395
+ status_code = http_response.status
2396
+ response_content = http_response.body
2397
+ unless status_code == 200 || status_code == 202
2398
+ error_model = JSON.load(response_content)
2399
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2400
+ end
2401
+
2402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2403
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2404
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2405
+
2406
+ result
2407
+ end
2408
+
2409
+ promise.execute
2410
+ end
2411
+
2412
+ #
2413
+ # Reimages the virtual machine which has an ephemeral OS disk back to its
2414
+ # initial state.
2415
+ #
2416
+ # @param resource_group_name [String] The name of the resource group.
2417
+ # @param vm_name [String] The name of the virtual machine.
2418
+ # @param parameters [VirtualMachineReimageParameters] Parameters supplied to
2419
+ # the Reimage Virtual Machine operation.
2420
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2421
+ # will be added to the HTTP request.
2422
+ #
2423
+ #
2424
+ def begin_reimage(resource_group_name, vm_name, parameters:nil, custom_headers:nil)
2425
+ response = begin_reimage_async(resource_group_name, vm_name, parameters:parameters, custom_headers:custom_headers).value!
2426
+ nil
2427
+ end
2428
+
2429
+ #
2430
+ # Reimages the virtual machine which has an ephemeral OS disk back to its
2431
+ # initial state.
2432
+ #
2433
+ # @param resource_group_name [String] The name of the resource group.
2434
+ # @param vm_name [String] The name of the virtual machine.
2435
+ # @param parameters [VirtualMachineReimageParameters] Parameters supplied to
2436
+ # the Reimage Virtual Machine operation.
2437
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2438
+ # will be added to the HTTP request.
2439
+ #
2440
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2441
+ #
2442
+ def begin_reimage_with_http_info(resource_group_name, vm_name, parameters:nil, custom_headers:nil)
2443
+ begin_reimage_async(resource_group_name, vm_name, parameters:parameters, custom_headers:custom_headers).value!
2444
+ end
2445
+
2446
+ #
2447
+ # Reimages the virtual machine which has an ephemeral OS disk back to its
2448
+ # initial state.
2449
+ #
2450
+ # @param resource_group_name [String] The name of the resource group.
2451
+ # @param vm_name [String] The name of the virtual machine.
2452
+ # @param parameters [VirtualMachineReimageParameters] Parameters supplied to
2453
+ # the Reimage Virtual Machine operation.
2454
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2455
+ # to the HTTP request.
2456
+ #
2457
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2458
+ #
2459
+ def begin_reimage_async(resource_group_name, vm_name, parameters:nil, custom_headers:nil)
2460
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2461
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2462
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2463
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2464
+
2465
+
2466
+ request_headers = {}
2467
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2468
+
2469
+ # Set Headers
2470
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2471
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2472
+
2473
+ # Serialize Request
2474
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineReimageParameters.mapper()
2475
+ request_content = @client.serialize(request_mapper, parameters)
2476
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2477
+
2478
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage'
2479
+
2480
+ request_url = @base_url || @client.base_url
2481
+
2482
+ options = {
2483
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2484
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2485
+ query_params: {'api-version' => @client.api_version},
2486
+ body: request_content,
2487
+ headers: request_headers.merge(custom_headers || {}),
2488
+ base_url: request_url
2489
+ }
2490
+ promise = @client.make_request_async(:post, path_template, options)
2491
+
2492
+ promise = promise.then do |result|
2493
+ http_response = result.response
2494
+ status_code = http_response.status
2495
+ response_content = http_response.body
2496
+ unless status_code == 200 || status_code == 202
2497
+ error_model = JSON.load(response_content)
2498
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2499
+ end
2500
+
2501
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2502
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2503
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2504
+
2505
+ result
2506
+ end
2507
+
2508
+ promise.execute
2509
+ end
2510
+
2511
+ #
2512
+ # The operation to perform maintenance on a virtual machine.
2513
+ #
2514
+ # @param resource_group_name [String] The name of the resource group.
2515
+ # @param vm_name [String] The name of the virtual machine.
2516
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2517
+ # will be added to the HTTP request.
2518
+ #
2519
+ #
2520
+ def begin_perform_maintenance(resource_group_name, vm_name, custom_headers:nil)
2521
+ response = begin_perform_maintenance_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2522
+ nil
2523
+ end
2524
+
2525
+ #
2526
+ # The operation to perform maintenance on a virtual machine.
2527
+ #
2528
+ # @param resource_group_name [String] The name of the resource group.
2529
+ # @param vm_name [String] The name of the virtual machine.
2530
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2531
+ # will be added to the HTTP request.
2532
+ #
2533
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2534
+ #
2535
+ def begin_perform_maintenance_with_http_info(resource_group_name, vm_name, custom_headers:nil)
2536
+ begin_perform_maintenance_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
2537
+ end
2538
+
2539
+ #
2540
+ # The operation to perform maintenance on a virtual machine.
2541
+ #
2542
+ # @param resource_group_name [String] The name of the resource group.
2543
+ # @param vm_name [String] The name of the virtual machine.
2544
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2545
+ # to the HTTP request.
2546
+ #
2547
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2548
+ #
2549
+ def begin_perform_maintenance_async(resource_group_name, vm_name, custom_headers:nil)
2550
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2551
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2552
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2553
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2554
+
2555
+
2556
+ request_headers = {}
2557
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2558
+
2559
+ # Set Headers
2560
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2561
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2562
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'
2563
+
2564
+ request_url = @base_url || @client.base_url
2565
+
2566
+ options = {
2567
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2568
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2569
+ query_params: {'api-version' => @client.api_version},
2570
+ headers: request_headers.merge(custom_headers || {}),
2571
+ base_url: request_url
2572
+ }
2573
+ promise = @client.make_request_async(:post, path_template, options)
2574
+
2575
+ promise = promise.then do |result|
2576
+ http_response = result.response
2577
+ status_code = http_response.status
2578
+ response_content = http_response.body
2579
+ unless status_code == 200 || status_code == 202
2580
+ error_model = JSON.load(response_content)
2581
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2582
+ end
2583
+
2584
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2585
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2586
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2587
+
2588
+ result
2589
+ end
2590
+
2591
+ promise.execute
2592
+ end
2593
+
2594
+ #
2595
+ # Run command on the VM.
2596
+ #
2597
+ # @param resource_group_name [String] The name of the resource group.
2598
+ # @param vm_name [String] The name of the virtual machine.
2599
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
2600
+ # operation.
2601
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2602
+ # will be added to the HTTP request.
2603
+ #
2604
+ # @return [RunCommandResult] operation results.
2605
+ #
2606
+ def begin_run_command(resource_group_name, vm_name, parameters, custom_headers:nil)
2607
+ response = begin_run_command_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
2608
+ response.body unless response.nil?
2609
+ end
2610
+
2611
+ #
2612
+ # Run command on the VM.
2613
+ #
2614
+ # @param resource_group_name [String] The name of the resource group.
2615
+ # @param vm_name [String] The name of the virtual machine.
2616
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
2617
+ # operation.
2618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2619
+ # will be added to the HTTP request.
2620
+ #
2621
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2622
+ #
2623
+ def begin_run_command_with_http_info(resource_group_name, vm_name, parameters, custom_headers:nil)
2624
+ begin_run_command_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
2625
+ end
2626
+
2627
+ #
2628
+ # Run command on the VM.
2629
+ #
2630
+ # @param resource_group_name [String] The name of the resource group.
2631
+ # @param vm_name [String] The name of the virtual machine.
2632
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
2633
+ # operation.
2634
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2635
+ # to the HTTP request.
2636
+ #
2637
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2638
+ #
2639
+ def begin_run_command_async(resource_group_name, vm_name, parameters, custom_headers:nil)
2640
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2641
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
2642
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2643
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2644
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2645
+
2646
+
2647
+ request_headers = {}
2648
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2649
+
2650
+ # Set Headers
2651
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2652
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2653
+
2654
+ # Serialize Request
2655
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RunCommandInput.mapper()
2656
+ request_content = @client.serialize(request_mapper, parameters)
2657
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2658
+
2659
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'
2660
+
2661
+ request_url = @base_url || @client.base_url
2662
+
2663
+ options = {
2664
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2665
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
2666
+ query_params: {'api-version' => @client.api_version},
2667
+ body: request_content,
2668
+ headers: request_headers.merge(custom_headers || {}),
2669
+ base_url: request_url
2670
+ }
2671
+ promise = @client.make_request_async(:post, path_template, options)
2672
+
2673
+ promise = promise.then do |result|
2674
+ http_response = result.response
2675
+ status_code = http_response.status
2676
+ response_content = http_response.body
2677
+ unless status_code == 200 || status_code == 202
2678
+ error_model = JSON.load(response_content)
2679
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2680
+ end
2681
+
2682
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2683
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2684
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2685
+ # Deserialize Response
2686
+ if status_code == 200
2687
+ begin
2688
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2689
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RunCommandResult.mapper()
2690
+ result.body = @client.deserialize(result_mapper, parsed_response)
2691
+ rescue Exception => e
2692
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2693
+ end
2694
+ end
2695
+
2696
+ result
2697
+ end
2698
+
2699
+ promise.execute
2700
+ end
2701
+
2702
+ #
2703
+ # Gets all the virtual machines under the specified subscription for the
2704
+ # specified location.
2705
+ #
2706
+ # @param next_page_link [String] The NextLink from the previous successful call
2707
+ # to List operation.
2708
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2709
+ # will be added to the HTTP request.
2710
+ #
2711
+ # @return [VirtualMachineListResult] operation results.
2712
+ #
2713
+ def list_by_location_next(next_page_link, custom_headers:nil)
2714
+ response = list_by_location_next_async(next_page_link, custom_headers:custom_headers).value!
2715
+ response.body unless response.nil?
2716
+ end
2717
+
2718
+ #
2719
+ # Gets all the virtual machines under the specified subscription for the
2720
+ # specified location.
2721
+ #
2722
+ # @param next_page_link [String] The NextLink from the previous successful call
2723
+ # to List operation.
2724
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2725
+ # will be added to the HTTP request.
2726
+ #
2727
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2728
+ #
2729
+ def list_by_location_next_with_http_info(next_page_link, custom_headers:nil)
2730
+ list_by_location_next_async(next_page_link, custom_headers:custom_headers).value!
2731
+ end
2732
+
2733
+ #
2734
+ # Gets all the virtual machines under the specified subscription for the
2735
+ # specified location.
2736
+ #
2737
+ # @param next_page_link [String] The NextLink from the previous successful call
2738
+ # to List operation.
2739
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2740
+ # to the HTTP request.
2741
+ #
2742
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2743
+ #
2744
+ def list_by_location_next_async(next_page_link, custom_headers:nil)
2745
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2746
+
2747
+
2748
+ request_headers = {}
2749
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2750
+
2751
+ # Set Headers
2752
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2753
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2754
+ path_template = '{nextLink}'
2755
+
2756
+ request_url = @base_url || @client.base_url
2757
+
2758
+ options = {
2759
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2760
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2761
+ headers: request_headers.merge(custom_headers || {}),
2762
+ base_url: request_url
2763
+ }
2764
+ promise = @client.make_request_async(:get, path_template, options)
2765
+
2766
+ promise = promise.then do |result|
2767
+ http_response = result.response
2768
+ status_code = http_response.status
2769
+ response_content = http_response.body
2770
+ unless status_code == 200
2771
+ error_model = JSON.load(response_content)
2772
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2773
+ end
2774
+
2775
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2776
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2777
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2778
+ # Deserialize Response
2779
+ if status_code == 200
2780
+ begin
2781
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2782
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineListResult.mapper()
2783
+ result.body = @client.deserialize(result_mapper, parsed_response)
2784
+ rescue Exception => e
2785
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2786
+ end
2787
+ end
2788
+
2789
+ result
2790
+ end
2791
+
2792
+ promise.execute
2793
+ end
2794
+
2795
+ #
2796
+ # Lists all of the virtual machines in the specified resource group. Use the
2797
+ # nextLink property in the response to get the next page of virtual machines.
2798
+ #
2799
+ # @param next_page_link [String] The NextLink from the previous successful call
2800
+ # to List operation.
2801
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2802
+ # will be added to the HTTP request.
2803
+ #
2804
+ # @return [VirtualMachineListResult] operation results.
2805
+ #
2806
+ def list_next(next_page_link, custom_headers:nil)
2807
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2808
+ response.body unless response.nil?
2809
+ end
2810
+
2811
+ #
2812
+ # Lists all of the virtual machines in the specified resource group. Use the
2813
+ # nextLink property in the response to get the next page of virtual machines.
2814
+ #
2815
+ # @param next_page_link [String] The NextLink from the previous successful call
2816
+ # to List operation.
2817
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2818
+ # will be added to the HTTP request.
2819
+ #
2820
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2821
+ #
2822
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2823
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2824
+ end
2825
+
2826
+ #
2827
+ # Lists all of the virtual machines in the specified resource group. Use the
2828
+ # nextLink property in the response to get the next page of virtual machines.
2829
+ #
2830
+ # @param next_page_link [String] The NextLink from the previous successful call
2831
+ # to List operation.
2832
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2833
+ # to the HTTP request.
2834
+ #
2835
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2836
+ #
2837
+ def list_next_async(next_page_link, custom_headers:nil)
2838
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2839
+
2840
+
2841
+ request_headers = {}
2842
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2843
+
2844
+ # Set Headers
2845
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2846
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2847
+ path_template = '{nextLink}'
2848
+
2849
+ request_url = @base_url || @client.base_url
2850
+
2851
+ options = {
2852
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2853
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2854
+ headers: request_headers.merge(custom_headers || {}),
2855
+ base_url: request_url
2856
+ }
2857
+ promise = @client.make_request_async(:get, path_template, options)
2858
+
2859
+ promise = promise.then do |result|
2860
+ http_response = result.response
2861
+ status_code = http_response.status
2862
+ response_content = http_response.body
2863
+ unless status_code == 200
2864
+ error_model = JSON.load(response_content)
2865
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2866
+ end
2867
+
2868
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2869
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2870
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2871
+ # Deserialize Response
2872
+ if status_code == 200
2873
+ begin
2874
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2875
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineListResult.mapper()
2876
+ result.body = @client.deserialize(result_mapper, parsed_response)
2877
+ rescue Exception => e
2878
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2879
+ end
2880
+ end
2881
+
2882
+ result
2883
+ end
2884
+
2885
+ promise.execute
2886
+ end
2887
+
2888
+ #
2889
+ # Lists all of the virtual machines in the specified subscription. Use the
2890
+ # nextLink property in the response to get the next page of virtual machines.
2891
+ #
2892
+ # @param next_page_link [String] The NextLink from the previous successful call
2893
+ # to List operation.
2894
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2895
+ # will be added to the HTTP request.
2896
+ #
2897
+ # @return [VirtualMachineListResult] operation results.
2898
+ #
2899
+ def list_all_next(next_page_link, custom_headers:nil)
2900
+ response = list_all_next_async(next_page_link, custom_headers:custom_headers).value!
2901
+ response.body unless response.nil?
2902
+ end
2903
+
2904
+ #
2905
+ # Lists all of the virtual machines in the specified subscription. Use the
2906
+ # nextLink property in the response to get the next page of virtual machines.
2907
+ #
2908
+ # @param next_page_link [String] The NextLink from the previous successful call
2909
+ # to List operation.
2910
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2911
+ # will be added to the HTTP request.
2912
+ #
2913
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2914
+ #
2915
+ def list_all_next_with_http_info(next_page_link, custom_headers:nil)
2916
+ list_all_next_async(next_page_link, custom_headers:custom_headers).value!
2917
+ end
2918
+
2919
+ #
2920
+ # Lists all of the virtual machines in the specified subscription. Use the
2921
+ # nextLink property in the response to get the next page of virtual machines.
2922
+ #
2923
+ # @param next_page_link [String] The NextLink from the previous successful call
2924
+ # to List operation.
2925
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2926
+ # to the HTTP request.
2927
+ #
2928
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2929
+ #
2930
+ def list_all_next_async(next_page_link, custom_headers:nil)
2931
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2932
+
2933
+
2934
+ request_headers = {}
2935
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2936
+
2937
+ # Set Headers
2938
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2939
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2940
+ path_template = '{nextLink}'
2941
+
2942
+ request_url = @base_url || @client.base_url
2943
+
2944
+ options = {
2945
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2946
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2947
+ headers: request_headers.merge(custom_headers || {}),
2948
+ base_url: request_url
2949
+ }
2950
+ promise = @client.make_request_async(:get, path_template, options)
2951
+
2952
+ promise = promise.then do |result|
2953
+ http_response = result.response
2954
+ status_code = http_response.status
2955
+ response_content = http_response.body
2956
+ unless status_code == 200
2957
+ error_model = JSON.load(response_content)
2958
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2959
+ end
2960
+
2961
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2962
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2963
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2964
+ # Deserialize Response
2965
+ if status_code == 200
2966
+ begin
2967
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2968
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineListResult.mapper()
2969
+ result.body = @client.deserialize(result_mapper, parsed_response)
2970
+ rescue Exception => e
2971
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2972
+ end
2973
+ end
2974
+
2975
+ result
2976
+ end
2977
+
2978
+ promise.execute
2979
+ end
2980
+
2981
+ #
2982
+ # Gets all the virtual machines under the specified subscription for the
2983
+ # specified location.
2984
+ #
2985
+ # @param location [String] The location for which virtual machines under the
2986
+ # subscription are queried.
2987
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2988
+ # will be added to the HTTP request.
2989
+ #
2990
+ # @return [VirtualMachineListResult] which provide lazy access to pages of the
2991
+ # response.
2992
+ #
2993
+ def list_by_location_as_lazy(location, custom_headers:nil)
2994
+ response = list_by_location_async(location, custom_headers:custom_headers).value!
2995
+ unless response.nil?
2996
+ page = response.body
2997
+ page.next_method = Proc.new do |next_page_link|
2998
+ list_by_location_next_async(next_page_link, custom_headers:custom_headers)
2999
+ end
3000
+ page
3001
+ end
3002
+ end
3003
+
3004
+ #
3005
+ # Lists all of the virtual machines in the specified resource group. Use the
3006
+ # nextLink property in the response to get the next page of virtual machines.
3007
+ #
3008
+ # @param resource_group_name [String] The name of the resource group.
3009
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3010
+ # will be added to the HTTP request.
3011
+ #
3012
+ # @return [VirtualMachineListResult] which provide lazy access to pages of the
3013
+ # response.
3014
+ #
3015
+ def list_as_lazy(resource_group_name, custom_headers:nil)
3016
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
3017
+ unless response.nil?
3018
+ page = response.body
3019
+ page.next_method = Proc.new do |next_page_link|
3020
+ list_next_async(next_page_link, custom_headers:custom_headers)
3021
+ end
3022
+ page
3023
+ end
3024
+ end
3025
+
3026
+ #
3027
+ # Lists all of the virtual machines in the specified subscription. Use the
3028
+ # nextLink property in the response to get the next page of virtual machines.
3029
+ #
3030
+ # @param status_only [String] statusOnly=true enables fetching run time status
3031
+ # of all Virtual Machines in the subscription.
3032
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3033
+ # will be added to the HTTP request.
3034
+ #
3035
+ # @return [VirtualMachineListResult] which provide lazy access to pages of the
3036
+ # response.
3037
+ #
3038
+ def list_all_as_lazy(status_only:nil, custom_headers:nil)
3039
+ response = list_all_async(status_only:status_only, custom_headers:custom_headers).value!
3040
+ unless response.nil?
3041
+ page = response.body
3042
+ page.next_method = Proc.new do |next_page_link|
3043
+ list_all_next_async(next_page_link, custom_headers:custom_headers)
3044
+ end
3045
+ page
3046
+ end
3047
+ end
3048
+
3049
+ end
3050
+ end