azure_mgmt_compute 0.19.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,2087 @@
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 VirtualMachineScaleSetVMs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VirtualMachineScaleSetVMs 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
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
26
+ # scale set.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param vm_scale_set_name [String] The name of the VM scale set.
30
+ # @param instance_id [String] The instance ID of the virtual machine.
31
+ # @param vm_scale_set_vmreimage_input
32
+ # [VirtualMachineScaleSetVMReimageParameters] Parameters for the Reimaging
33
+ # Virtual machine in ScaleSet.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ def reimage(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
38
+ response = reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers).value!
39
+ nil
40
+ end
41
+
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group.
44
+ # @param vm_scale_set_name [String] The name of the VM scale set.
45
+ # @param instance_id [String] The instance ID of the virtual machine.
46
+ # @param vm_scale_set_vmreimage_input
47
+ # [VirtualMachineScaleSetVMReimageParameters] Parameters for the Reimaging
48
+ # Virtual machine in ScaleSet.
49
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
+ # will be added to the HTTP request.
51
+ #
52
+ # @return [Concurrent::Promise] promise which provides async access to http
53
+ # response.
54
+ #
55
+ def reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
56
+ # Send request
57
+ promise = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers)
58
+
59
+ promise = promise.then do |response|
60
+ # Defining deserialization method.
61
+ deserialize_method = lambda do |parsed_response|
62
+ end
63
+
64
+ # Waiting for response.
65
+ @client.get_long_running_operation_result(response, deserialize_method)
66
+ end
67
+
68
+ promise
69
+ end
70
+
71
+ #
72
+ # Allows you to re-image all the disks ( including data disks ) in the a VM
73
+ # scale set instance. This operation is only supported for managed disks.
74
+ #
75
+ # @param resource_group_name [String] The name of the resource group.
76
+ # @param vm_scale_set_name [String] The name of the VM scale set.
77
+ # @param instance_id [String] The instance ID of the virtual machine.
78
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
79
+ # will be added to the HTTP request.
80
+ #
81
+ def reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
82
+ response = reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
83
+ nil
84
+ end
85
+
86
+ #
87
+ # @param resource_group_name [String] The name of the resource group.
88
+ # @param vm_scale_set_name [String] The name of the VM scale set.
89
+ # @param instance_id [String] The instance ID of the virtual machine.
90
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
91
+ # will be added to the HTTP request.
92
+ #
93
+ # @return [Concurrent::Promise] promise which provides async access to http
94
+ # response.
95
+ #
96
+ def reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
97
+ # Send request
98
+ promise = begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
99
+
100
+ promise = promise.then do |response|
101
+ # Defining deserialization method.
102
+ deserialize_method = lambda do |parsed_response|
103
+ end
104
+
105
+ # Waiting for response.
106
+ @client.get_long_running_operation_result(response, deserialize_method)
107
+ end
108
+
109
+ promise
110
+ end
111
+
112
+ #
113
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
114
+ # virtual machine and releases the compute resources it uses. You are not
115
+ # billed for the compute resources of this virtual machine once it is
116
+ # deallocated.
117
+ #
118
+ # @param resource_group_name [String] The name of the resource group.
119
+ # @param vm_scale_set_name [String] The name of the VM scale set.
120
+ # @param instance_id [String] The instance ID of the virtual machine.
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ def deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
125
+ response = deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
126
+ nil
127
+ end
128
+
129
+ #
130
+ # @param resource_group_name [String] The name of the resource group.
131
+ # @param vm_scale_set_name [String] The name of the VM scale set.
132
+ # @param instance_id [String] The instance ID of the virtual machine.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [Concurrent::Promise] promise which provides async access to http
137
+ # response.
138
+ #
139
+ def deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
140
+ # Send request
141
+ promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
142
+
143
+ promise = promise.then do |response|
144
+ # Defining deserialization method.
145
+ deserialize_method = lambda do |parsed_response|
146
+ end
147
+
148
+ # Waiting for response.
149
+ @client.get_long_running_operation_result(response, deserialize_method)
150
+ end
151
+
152
+ promise
153
+ end
154
+
155
+ #
156
+ # Updates a virtual machine of a VM scale set.
157
+ #
158
+ # @param resource_group_name [String] The name of the resource group.
159
+ # @param vm_scale_set_name [String] The name of the VM scale set where the
160
+ # extension should be create or updated.
161
+ # @param instance_id [String] The instance ID of the virtual machine.
162
+ # @param parameters [VirtualMachineScaleSetVM] Parameters supplied to the
163
+ # Update Virtual Machine Scale Sets VM operation.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ # @return [VirtualMachineScaleSetVM] operation results.
168
+ #
169
+ def update(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
170
+ response = update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
171
+ response.body unless response.nil?
172
+ end
173
+
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group.
176
+ # @param vm_scale_set_name [String] The name of the VM scale set where the
177
+ # extension should be create or updated.
178
+ # @param instance_id [String] The instance ID of the virtual machine.
179
+ # @param parameters [VirtualMachineScaleSetVM] Parameters supplied to the
180
+ # Update Virtual Machine Scale Sets VM operation.
181
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
182
+ # will be added to the HTTP request.
183
+ #
184
+ # @return [Concurrent::Promise] promise which provides async access to http
185
+ # response.
186
+ #
187
+ def update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
188
+ # Send request
189
+ promise = begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers)
190
+
191
+ promise = promise.then do |response|
192
+ # Defining deserialization method.
193
+ deserialize_method = lambda do |parsed_response|
194
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVM.mapper()
195
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
196
+ end
197
+
198
+ # Waiting for response.
199
+ @client.get_long_running_operation_result(response, deserialize_method)
200
+ end
201
+
202
+ promise
203
+ end
204
+
205
+ #
206
+ # Deletes a virtual machine from a VM scale set.
207
+ #
208
+ # @param resource_group_name [String] The name of the resource group.
209
+ # @param vm_scale_set_name [String] The name of the VM scale set.
210
+ # @param instance_id [String] The instance ID of the virtual machine.
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
213
+ #
214
+ def delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
215
+ response = delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
216
+ nil
217
+ end
218
+
219
+ #
220
+ # @param resource_group_name [String] The name of the resource group.
221
+ # @param vm_scale_set_name [String] The name of the VM scale set.
222
+ # @param instance_id [String] The instance ID of the virtual machine.
223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
+ # will be added to the HTTP request.
225
+ #
226
+ # @return [Concurrent::Promise] promise which provides async access to http
227
+ # response.
228
+ #
229
+ def delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
230
+ # Send request
231
+ promise = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
232
+
233
+ promise = promise.then do |response|
234
+ # Defining deserialization method.
235
+ deserialize_method = lambda do |parsed_response|
236
+ end
237
+
238
+ # Waiting for response.
239
+ @client.get_long_running_operation_result(response, deserialize_method)
240
+ end
241
+
242
+ promise
243
+ end
244
+
245
+ #
246
+ # Gets a virtual machine from a VM scale set.
247
+ #
248
+ # @param resource_group_name [String] The name of the resource group.
249
+ # @param vm_scale_set_name [String] The name of the VM scale set.
250
+ # @param instance_id [String] The instance ID of the virtual machine.
251
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
252
+ # operation. Possible values include: 'instanceView'
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [VirtualMachineScaleSetVM] operation results.
257
+ #
258
+ def get(resource_group_name, vm_scale_set_name, instance_id, expand:nil, custom_headers:nil)
259
+ response = get_async(resource_group_name, vm_scale_set_name, instance_id, expand:expand, custom_headers:custom_headers).value!
260
+ response.body unless response.nil?
261
+ end
262
+
263
+ #
264
+ # Gets a virtual machine from a VM scale set.
265
+ #
266
+ # @param resource_group_name [String] The name of the resource group.
267
+ # @param vm_scale_set_name [String] The name of the VM scale set.
268
+ # @param instance_id [String] The instance ID of the virtual machine.
269
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
270
+ # operation. Possible values include: 'instanceView'
271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
272
+ # will be added to the HTTP request.
273
+ #
274
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
275
+ #
276
+ def get_with_http_info(resource_group_name, vm_scale_set_name, instance_id, expand:nil, custom_headers:nil)
277
+ get_async(resource_group_name, vm_scale_set_name, instance_id, expand:expand, custom_headers:custom_headers).value!
278
+ end
279
+
280
+ #
281
+ # Gets a virtual machine from a VM scale set.
282
+ #
283
+ # @param resource_group_name [String] The name of the resource group.
284
+ # @param vm_scale_set_name [String] The name of the VM scale set.
285
+ # @param instance_id [String] The instance ID of the virtual machine.
286
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
287
+ # operation. Possible values include: 'instanceView'
288
+ # @param [Hash{String => String}] A hash of custom headers that will be added
289
+ # to the HTTP request.
290
+ #
291
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
292
+ #
293
+ def get_async(resource_group_name, vm_scale_set_name, instance_id, expand:nil, custom_headers:nil)
294
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
295
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
296
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
297
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
298
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
299
+
300
+
301
+ request_headers = {}
302
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
303
+
304
+ # Set Headers
305
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
306
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
307
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
308
+
309
+ request_url = @base_url || @client.base_url
310
+
311
+ options = {
312
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
313
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
314
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
315
+ headers: request_headers.merge(custom_headers || {}),
316
+ base_url: request_url
317
+ }
318
+ promise = @client.make_request_async(:get, path_template, options)
319
+
320
+ promise = promise.then do |result|
321
+ http_response = result.response
322
+ status_code = http_response.status
323
+ response_content = http_response.body
324
+ unless status_code == 200
325
+ error_model = JSON.load(response_content)
326
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
327
+ end
328
+
329
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
330
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
331
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
332
+ # Deserialize Response
333
+ if status_code == 200
334
+ begin
335
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
336
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVM.mapper()
337
+ result.body = @client.deserialize(result_mapper, parsed_response)
338
+ rescue Exception => e
339
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
340
+ end
341
+ end
342
+
343
+ result
344
+ end
345
+
346
+ promise.execute
347
+ end
348
+
349
+ #
350
+ # Gets the status of a virtual machine from a VM scale set.
351
+ #
352
+ # @param resource_group_name [String] The name of the resource group.
353
+ # @param vm_scale_set_name [String] The name of the VM scale set.
354
+ # @param instance_id [String] The instance ID of the virtual machine.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [VirtualMachineScaleSetVMInstanceView] operation results.
359
+ #
360
+ def get_instance_view(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
361
+ response = get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
362
+ response.body unless response.nil?
363
+ end
364
+
365
+ #
366
+ # Gets the status of a virtual machine from a VM scale set.
367
+ #
368
+ # @param resource_group_name [String] The name of the resource group.
369
+ # @param vm_scale_set_name [String] The name of the VM scale set.
370
+ # @param instance_id [String] The instance ID of the virtual machine.
371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
+ # will be added to the HTTP request.
373
+ #
374
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
375
+ #
376
+ def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
377
+ get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
378
+ end
379
+
380
+ #
381
+ # Gets the status of a virtual machine from a VM scale set.
382
+ #
383
+ # @param resource_group_name [String] The name of the resource group.
384
+ # @param vm_scale_set_name [String] The name of the VM scale set.
385
+ # @param instance_id [String] The instance ID of the virtual machine.
386
+ # @param [Hash{String => String}] A hash of custom headers that will be added
387
+ # to the HTTP request.
388
+ #
389
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
390
+ #
391
+ def get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
392
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
393
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
394
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
395
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
396
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
397
+
398
+
399
+ request_headers = {}
400
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
401
+
402
+ # Set Headers
403
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
404
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
405
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'
406
+
407
+ request_url = @base_url || @client.base_url
408
+
409
+ options = {
410
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
411
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
412
+ query_params: {'api-version' => @client.api_version},
413
+ headers: request_headers.merge(custom_headers || {}),
414
+ base_url: request_url
415
+ }
416
+ promise = @client.make_request_async(:get, path_template, options)
417
+
418
+ promise = promise.then do |result|
419
+ http_response = result.response
420
+ status_code = http_response.status
421
+ response_content = http_response.body
422
+ unless status_code == 200
423
+ error_model = JSON.load(response_content)
424
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
425
+ end
426
+
427
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
428
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
429
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
430
+ # Deserialize Response
431
+ if status_code == 200
432
+ begin
433
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
434
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceView.mapper()
435
+ result.body = @client.deserialize(result_mapper, parsed_response)
436
+ rescue Exception => e
437
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
438
+ end
439
+ end
440
+
441
+ result
442
+ end
443
+
444
+ promise.execute
445
+ end
446
+
447
+ #
448
+ # Gets a list of all virtual machines in a VM scale sets.
449
+ #
450
+ # @param resource_group_name [String] The name of the resource group.
451
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
452
+ # @param filter [String] The filter to apply to the operation.
453
+ # @param select [String] The list parameters.
454
+ # @param expand [String] The expand expression to apply to the operation.
455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
456
+ # will be added to the HTTP request.
457
+ #
458
+ # @return [Array<VirtualMachineScaleSetVM>] operation results.
459
+ #
460
+ def list(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
461
+ first_page = list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter:filter, select:select, expand:expand, custom_headers:custom_headers)
462
+ first_page.get_all_items
463
+ end
464
+
465
+ #
466
+ # Gets a list of all virtual machines in a VM scale sets.
467
+ #
468
+ # @param resource_group_name [String] The name of the resource group.
469
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
470
+ # @param filter [String] The filter to apply to the operation.
471
+ # @param select [String] The list parameters.
472
+ # @param expand [String] The expand expression to apply to the operation.
473
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
474
+ # will be added to the HTTP request.
475
+ #
476
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
477
+ #
478
+ def list_with_http_info(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
479
+ list_async(resource_group_name, virtual_machine_scale_set_name, filter:filter, select:select, expand:expand, custom_headers:custom_headers).value!
480
+ end
481
+
482
+ #
483
+ # Gets a list of all virtual machines in a VM scale sets.
484
+ #
485
+ # @param resource_group_name [String] The name of the resource group.
486
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
487
+ # @param filter [String] The filter to apply to the operation.
488
+ # @param select [String] The list parameters.
489
+ # @param expand [String] The expand expression to apply to the operation.
490
+ # @param [Hash{String => String}] A hash of custom headers that will be added
491
+ # to the HTTP request.
492
+ #
493
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
494
+ #
495
+ def list_async(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
496
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
497
+ fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
498
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
499
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
500
+
501
+
502
+ request_headers = {}
503
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
504
+
505
+ # Set Headers
506
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
507
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
508
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'
509
+
510
+ request_url = @base_url || @client.base_url
511
+
512
+ options = {
513
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
514
+ path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'subscriptionId' => @client.subscription_id},
515
+ query_params: {'$filter' => filter,'$select' => select,'$expand' => expand,'api-version' => @client.api_version},
516
+ headers: request_headers.merge(custom_headers || {}),
517
+ base_url: request_url
518
+ }
519
+ promise = @client.make_request_async(:get, path_template, options)
520
+
521
+ promise = promise.then do |result|
522
+ http_response = result.response
523
+ status_code = http_response.status
524
+ response_content = http_response.body
525
+ unless status_code == 200
526
+ error_model = JSON.load(response_content)
527
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
528
+ end
529
+
530
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
531
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
532
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
533
+ # Deserialize Response
534
+ if status_code == 200
535
+ begin
536
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
537
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMListResult.mapper()
538
+ result.body = @client.deserialize(result_mapper, parsed_response)
539
+ rescue Exception => e
540
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
541
+ end
542
+ end
543
+
544
+ result
545
+ end
546
+
547
+ promise.execute
548
+ end
549
+
550
+ #
551
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
552
+ # still attached and you are getting charged for the resources. Instead, use
553
+ # deallocate to release resources and avoid charges.
554
+ #
555
+ # @param resource_group_name [String] The name of the resource group.
556
+ # @param vm_scale_set_name [String] The name of the VM scale set.
557
+ # @param instance_id [String] The instance ID of the virtual machine.
558
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
559
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
560
+ # false indicates otherwise. Default value for this flag is false if not
561
+ # specified
562
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
+ # will be added to the HTTP request.
564
+ #
565
+ def power_off(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
566
+ response = power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
567
+ nil
568
+ end
569
+
570
+ #
571
+ # @param resource_group_name [String] The name of the resource group.
572
+ # @param vm_scale_set_name [String] The name of the VM scale set.
573
+ # @param instance_id [String] The instance ID of the virtual machine.
574
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
575
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
576
+ # false indicates otherwise. Default value for this flag is false if not
577
+ # specified
578
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
579
+ # will be added to the HTTP request.
580
+ #
581
+ # @return [Concurrent::Promise] promise which provides async access to http
582
+ # response.
583
+ #
584
+ def power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
585
+ # Send request
586
+ promise = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers)
587
+
588
+ promise = promise.then do |response|
589
+ # Defining deserialization method.
590
+ deserialize_method = lambda do |parsed_response|
591
+ end
592
+
593
+ # Waiting for response.
594
+ @client.get_long_running_operation_result(response, deserialize_method)
595
+ end
596
+
597
+ promise
598
+ end
599
+
600
+ #
601
+ # Restarts a virtual machine in a VM scale set.
602
+ #
603
+ # @param resource_group_name [String] The name of the resource group.
604
+ # @param vm_scale_set_name [String] The name of the VM scale set.
605
+ # @param instance_id [String] The instance ID of the virtual machine.
606
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
607
+ # will be added to the HTTP request.
608
+ #
609
+ def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
610
+ response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
611
+ nil
612
+ end
613
+
614
+ #
615
+ # @param resource_group_name [String] The name of the resource group.
616
+ # @param vm_scale_set_name [String] The name of the VM scale set.
617
+ # @param instance_id [String] The instance ID of the virtual machine.
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [Concurrent::Promise] promise which provides async access to http
622
+ # response.
623
+ #
624
+ def restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
625
+ # Send request
626
+ promise = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
627
+
628
+ promise = promise.then do |response|
629
+ # Defining deserialization method.
630
+ deserialize_method = lambda do |parsed_response|
631
+ end
632
+
633
+ # Waiting for response.
634
+ @client.get_long_running_operation_result(response, deserialize_method)
635
+ end
636
+
637
+ promise
638
+ end
639
+
640
+ #
641
+ # Starts a virtual machine in a VM scale set.
642
+ #
643
+ # @param resource_group_name [String] The name of the resource group.
644
+ # @param vm_scale_set_name [String] The name of the VM scale set.
645
+ # @param instance_id [String] The instance ID of the virtual machine.
646
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
647
+ # will be added to the HTTP request.
648
+ #
649
+ def start(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
650
+ response = start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
651
+ nil
652
+ end
653
+
654
+ #
655
+ # @param resource_group_name [String] The name of the resource group.
656
+ # @param vm_scale_set_name [String] The name of the VM scale set.
657
+ # @param instance_id [String] The instance ID of the virtual machine.
658
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
659
+ # will be added to the HTTP request.
660
+ #
661
+ # @return [Concurrent::Promise] promise which provides async access to http
662
+ # response.
663
+ #
664
+ def start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
665
+ # Send request
666
+ promise = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
667
+
668
+ promise = promise.then do |response|
669
+ # Defining deserialization method.
670
+ deserialize_method = lambda do |parsed_response|
671
+ end
672
+
673
+ # Waiting for response.
674
+ @client.get_long_running_operation_result(response, deserialize_method)
675
+ end
676
+
677
+ promise
678
+ end
679
+
680
+ #
681
+ # Shuts down the virtual machine in the virtual machine scale set, moves it to
682
+ # a new node, and powers it back on.
683
+ #
684
+ # @param resource_group_name [String] The name of the resource group.
685
+ # @param vm_scale_set_name [String] The name of the VM scale set.
686
+ # @param instance_id [String] The instance ID of the virtual machine.
687
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
688
+ # will be added to the HTTP request.
689
+ #
690
+ def redeploy(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
691
+ response = redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
692
+ nil
693
+ end
694
+
695
+ #
696
+ # @param resource_group_name [String] The name of the resource group.
697
+ # @param vm_scale_set_name [String] The name of the VM scale set.
698
+ # @param instance_id [String] The instance ID of the virtual machine.
699
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
700
+ # will be added to the HTTP request.
701
+ #
702
+ # @return [Concurrent::Promise] promise which provides async access to http
703
+ # response.
704
+ #
705
+ def redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
706
+ # Send request
707
+ promise = begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
708
+
709
+ promise = promise.then do |response|
710
+ # Defining deserialization method.
711
+ deserialize_method = lambda do |parsed_response|
712
+ end
713
+
714
+ # Waiting for response.
715
+ @client.get_long_running_operation_result(response, deserialize_method)
716
+ end
717
+
718
+ promise
719
+ end
720
+
721
+ #
722
+ # Performs maintenance on a virtual machine in a VM scale set.
723
+ #
724
+ # @param resource_group_name [String] The name of the resource group.
725
+ # @param vm_scale_set_name [String] The name of the VM scale set.
726
+ # @param instance_id [String] The instance ID of the virtual machine.
727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
+ # will be added to the HTTP request.
729
+ #
730
+ def perform_maintenance(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
731
+ response = perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
732
+ nil
733
+ end
734
+
735
+ #
736
+ # @param resource_group_name [String] The name of the resource group.
737
+ # @param vm_scale_set_name [String] The name of the VM scale set.
738
+ # @param instance_id [String] The instance ID of the virtual machine.
739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
+ # will be added to the HTTP request.
741
+ #
742
+ # @return [Concurrent::Promise] promise which provides async access to http
743
+ # response.
744
+ #
745
+ def perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
746
+ # Send request
747
+ promise = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)
748
+
749
+ promise = promise.then do |response|
750
+ # Defining deserialization method.
751
+ deserialize_method = lambda do |parsed_response|
752
+ end
753
+
754
+ # Waiting for response.
755
+ @client.get_long_running_operation_result(response, deserialize_method)
756
+ end
757
+
758
+ promise
759
+ end
760
+
761
+ #
762
+ # The operation to simulate the eviction of spot virtual machine in a VM scale
763
+ # set. The eviction will occur within 30 minutes of calling the API
764
+ #
765
+ # @param resource_group_name [String] The name of the resource group.
766
+ # @param vm_scale_set_name [String] The name of the VM scale set.
767
+ # @param instance_id [String] The instance ID of the virtual machine.
768
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
769
+ # will be added to the HTTP request.
770
+ #
771
+ #
772
+ def simulate_eviction(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
773
+ response = simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
774
+ nil
775
+ end
776
+
777
+ #
778
+ # The operation to simulate the eviction of spot virtual machine in a VM scale
779
+ # set. The eviction will occur within 30 minutes of calling the API
780
+ #
781
+ # @param resource_group_name [String] The name of the resource group.
782
+ # @param vm_scale_set_name [String] The name of the VM scale set.
783
+ # @param instance_id [String] The instance ID of the virtual machine.
784
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
785
+ # will be added to the HTTP request.
786
+ #
787
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
788
+ #
789
+ def simulate_eviction_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
790
+ simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
791
+ end
792
+
793
+ #
794
+ # The operation to simulate the eviction of spot virtual machine in a VM scale
795
+ # set. The eviction will occur within 30 minutes of calling the API
796
+ #
797
+ # @param resource_group_name [String] The name of the resource group.
798
+ # @param vm_scale_set_name [String] The name of the VM scale set.
799
+ # @param instance_id [String] The instance ID of the virtual machine.
800
+ # @param [Hash{String => String}] A hash of custom headers that will be added
801
+ # to the HTTP request.
802
+ #
803
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
804
+ #
805
+ def simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
806
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
807
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
808
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
809
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
810
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
811
+
812
+
813
+ request_headers = {}
814
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
815
+
816
+ # Set Headers
817
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
818
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
819
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction'
820
+
821
+ request_url = @base_url || @client.base_url
822
+
823
+ options = {
824
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
825
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
826
+ query_params: {'api-version' => @client.api_version},
827
+ headers: request_headers.merge(custom_headers || {}),
828
+ base_url: request_url
829
+ }
830
+ promise = @client.make_request_async(:post, path_template, options)
831
+
832
+ promise = promise.then do |result|
833
+ http_response = result.response
834
+ status_code = http_response.status
835
+ response_content = http_response.body
836
+ unless status_code == 204
837
+ error_model = JSON.load(response_content)
838
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
839
+ end
840
+
841
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
842
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
843
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
844
+
845
+ result
846
+ end
847
+
848
+ promise.execute
849
+ end
850
+
851
+ #
852
+ # Run command on a virtual machine in a VM scale set.
853
+ #
854
+ # @param resource_group_name [String] The name of the resource group.
855
+ # @param vm_scale_set_name [String] The name of the VM scale set.
856
+ # @param instance_id [String] The instance ID of the virtual machine.
857
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
858
+ # operation.
859
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
860
+ # will be added to the HTTP request.
861
+ #
862
+ # @return [RunCommandResult] operation results.
863
+ #
864
+ def run_command(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
865
+ response = run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
866
+ response.body unless response.nil?
867
+ end
868
+
869
+ #
870
+ # @param resource_group_name [String] The name of the resource group.
871
+ # @param vm_scale_set_name [String] The name of the VM scale set.
872
+ # @param instance_id [String] The instance ID of the virtual machine.
873
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
874
+ # operation.
875
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
876
+ # will be added to the HTTP request.
877
+ #
878
+ # @return [Concurrent::Promise] promise which provides async access to http
879
+ # response.
880
+ #
881
+ def run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
882
+ # Send request
883
+ promise = begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers)
884
+
885
+ promise = promise.then do |response|
886
+ # Defining deserialization method.
887
+ deserialize_method = lambda do |parsed_response|
888
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RunCommandResult.mapper()
889
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
890
+ end
891
+
892
+ # Waiting for response.
893
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
894
+ end
895
+
896
+ promise
897
+ end
898
+
899
+ #
900
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
901
+ # scale set.
902
+ #
903
+ # @param resource_group_name [String] The name of the resource group.
904
+ # @param vm_scale_set_name [String] The name of the VM scale set.
905
+ # @param instance_id [String] The instance ID of the virtual machine.
906
+ # @param vm_scale_set_vmreimage_input
907
+ # [VirtualMachineScaleSetVMReimageParameters] Parameters for the Reimaging
908
+ # Virtual machine in ScaleSet.
909
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
910
+ # will be added to the HTTP request.
911
+ #
912
+ #
913
+ def begin_reimage(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
914
+ response = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers).value!
915
+ nil
916
+ end
917
+
918
+ #
919
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
920
+ # scale set.
921
+ #
922
+ # @param resource_group_name [String] The name of the resource group.
923
+ # @param vm_scale_set_name [String] The name of the VM scale set.
924
+ # @param instance_id [String] The instance ID of the virtual machine.
925
+ # @param vm_scale_set_vmreimage_input
926
+ # [VirtualMachineScaleSetVMReimageParameters] Parameters for the Reimaging
927
+ # Virtual machine in ScaleSet.
928
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
929
+ # will be added to the HTTP request.
930
+ #
931
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
932
+ #
933
+ def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
934
+ begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers).value!
935
+ end
936
+
937
+ #
938
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
939
+ # scale set.
940
+ #
941
+ # @param resource_group_name [String] The name of the resource group.
942
+ # @param vm_scale_set_name [String] The name of the VM scale set.
943
+ # @param instance_id [String] The instance ID of the virtual machine.
944
+ # @param vm_scale_set_vmreimage_input
945
+ # [VirtualMachineScaleSetVMReimageParameters] Parameters for the Reimaging
946
+ # Virtual machine in ScaleSet.
947
+ # @param [Hash{String => String}] A hash of custom headers that will be added
948
+ # to the HTTP request.
949
+ #
950
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
951
+ #
952
+ def begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
953
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
954
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
955
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
956
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
957
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
958
+
959
+
960
+ request_headers = {}
961
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
962
+
963
+ # Set Headers
964
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
965
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
966
+
967
+ # Serialize Request
968
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMReimageParameters.mapper()
969
+ request_content = @client.serialize(request_mapper, vm_scale_set_vmreimage_input)
970
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
971
+
972
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'
973
+
974
+ request_url = @base_url || @client.base_url
975
+
976
+ options = {
977
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
978
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
979
+ query_params: {'api-version' => @client.api_version},
980
+ body: request_content,
981
+ headers: request_headers.merge(custom_headers || {}),
982
+ base_url: request_url
983
+ }
984
+ promise = @client.make_request_async(:post, path_template, options)
985
+
986
+ promise = promise.then do |result|
987
+ http_response = result.response
988
+ status_code = http_response.status
989
+ response_content = http_response.body
990
+ unless status_code == 200 || status_code == 202
991
+ error_model = JSON.load(response_content)
992
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
993
+ end
994
+
995
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
996
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
997
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
998
+
999
+ result
1000
+ end
1001
+
1002
+ promise.execute
1003
+ end
1004
+
1005
+ #
1006
+ # Allows you to re-image all the disks ( including data disks ) in the a VM
1007
+ # scale set instance. This operation is only supported for managed disks.
1008
+ #
1009
+ # @param resource_group_name [String] The name of the resource group.
1010
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1011
+ # @param instance_id [String] The instance ID of the virtual machine.
1012
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1013
+ # will be added to the HTTP request.
1014
+ #
1015
+ #
1016
+ def begin_reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1017
+ response = begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1018
+ nil
1019
+ end
1020
+
1021
+ #
1022
+ # Allows you to re-image all the disks ( including data disks ) in the a VM
1023
+ # scale set instance. This operation is only supported for managed disks.
1024
+ #
1025
+ # @param resource_group_name [String] The name of the resource group.
1026
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1027
+ # @param instance_id [String] The instance ID of the virtual machine.
1028
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1029
+ # will be added to the HTTP request.
1030
+ #
1031
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1032
+ #
1033
+ def begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1034
+ begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1035
+ end
1036
+
1037
+ #
1038
+ # Allows you to re-image all the disks ( including data disks ) in the a VM
1039
+ # scale set instance. This operation is only supported for managed disks.
1040
+ #
1041
+ # @param resource_group_name [String] The name of the resource group.
1042
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1043
+ # @param instance_id [String] The instance ID of the virtual machine.
1044
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1045
+ # to the HTTP request.
1046
+ #
1047
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1048
+ #
1049
+ def begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1050
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1051
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1052
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1053
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1054
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1055
+
1056
+
1057
+ request_headers = {}
1058
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1059
+
1060
+ # Set Headers
1061
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1062
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1063
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'
1064
+
1065
+ request_url = @base_url || @client.base_url
1066
+
1067
+ options = {
1068
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1069
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1070
+ query_params: {'api-version' => @client.api_version},
1071
+ headers: request_headers.merge(custom_headers || {}),
1072
+ base_url: request_url
1073
+ }
1074
+ promise = @client.make_request_async(:post, path_template, options)
1075
+
1076
+ promise = promise.then do |result|
1077
+ http_response = result.response
1078
+ status_code = http_response.status
1079
+ response_content = http_response.body
1080
+ unless status_code == 200 || status_code == 202
1081
+ error_model = JSON.load(response_content)
1082
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1083
+ end
1084
+
1085
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1086
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1087
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1088
+
1089
+ result
1090
+ end
1091
+
1092
+ promise.execute
1093
+ end
1094
+
1095
+ #
1096
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
1097
+ # virtual machine and releases the compute resources it uses. You are not
1098
+ # billed for the compute resources of this virtual machine once it is
1099
+ # deallocated.
1100
+ #
1101
+ # @param resource_group_name [String] The name of the resource group.
1102
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1103
+ # @param instance_id [String] The instance ID of the virtual machine.
1104
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1105
+ # will be added to the HTTP request.
1106
+ #
1107
+ #
1108
+ def begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1109
+ response = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1110
+ nil
1111
+ end
1112
+
1113
+ #
1114
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
1115
+ # virtual machine and releases the compute resources it uses. You are not
1116
+ # billed for the compute resources of this virtual machine once it is
1117
+ # deallocated.
1118
+ #
1119
+ # @param resource_group_name [String] The name of the resource group.
1120
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1121
+ # @param instance_id [String] The instance ID of the virtual machine.
1122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1123
+ # will be added to the HTTP request.
1124
+ #
1125
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1126
+ #
1127
+ def begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1128
+ begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1129
+ end
1130
+
1131
+ #
1132
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
1133
+ # virtual machine and releases the compute resources it uses. You are not
1134
+ # billed for the compute resources of this virtual machine once it is
1135
+ # deallocated.
1136
+ #
1137
+ # @param resource_group_name [String] The name of the resource group.
1138
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1139
+ # @param instance_id [String] The instance ID of the virtual machine.
1140
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1141
+ # to the HTTP request.
1142
+ #
1143
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1144
+ #
1145
+ def begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1146
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1147
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1148
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1149
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1150
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1151
+
1152
+
1153
+ request_headers = {}
1154
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1155
+
1156
+ # Set Headers
1157
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1158
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1159
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'
1160
+
1161
+ request_url = @base_url || @client.base_url
1162
+
1163
+ options = {
1164
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1165
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1166
+ query_params: {'api-version' => @client.api_version},
1167
+ headers: request_headers.merge(custom_headers || {}),
1168
+ base_url: request_url
1169
+ }
1170
+ promise = @client.make_request_async(:post, path_template, options)
1171
+
1172
+ promise = promise.then do |result|
1173
+ http_response = result.response
1174
+ status_code = http_response.status
1175
+ response_content = http_response.body
1176
+ unless status_code == 200 || status_code == 202
1177
+ error_model = JSON.load(response_content)
1178
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1179
+ end
1180
+
1181
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1182
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1183
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1184
+
1185
+ result
1186
+ end
1187
+
1188
+ promise.execute
1189
+ end
1190
+
1191
+ #
1192
+ # Updates a virtual machine of a VM scale set.
1193
+ #
1194
+ # @param resource_group_name [String] The name of the resource group.
1195
+ # @param vm_scale_set_name [String] The name of the VM scale set where the
1196
+ # extension should be create or updated.
1197
+ # @param instance_id [String] The instance ID of the virtual machine.
1198
+ # @param parameters [VirtualMachineScaleSetVM] Parameters supplied to the
1199
+ # Update Virtual Machine Scale Sets VM operation.
1200
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1201
+ # will be added to the HTTP request.
1202
+ #
1203
+ # @return [VirtualMachineScaleSetVM] operation results.
1204
+ #
1205
+ def begin_update(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
1206
+ response = begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
1207
+ response.body unless response.nil?
1208
+ end
1209
+
1210
+ #
1211
+ # Updates a virtual machine of a VM scale set.
1212
+ #
1213
+ # @param resource_group_name [String] The name of the resource group.
1214
+ # @param vm_scale_set_name [String] The name of the VM scale set where the
1215
+ # extension should be create or updated.
1216
+ # @param instance_id [String] The instance ID of the virtual machine.
1217
+ # @param parameters [VirtualMachineScaleSetVM] Parameters supplied to the
1218
+ # Update Virtual Machine Scale Sets VM operation.
1219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1220
+ # will be added to the HTTP request.
1221
+ #
1222
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1223
+ #
1224
+ def begin_update_with_http_info(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
1225
+ begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
1226
+ end
1227
+
1228
+ #
1229
+ # Updates a virtual machine of a VM scale set.
1230
+ #
1231
+ # @param resource_group_name [String] The name of the resource group.
1232
+ # @param vm_scale_set_name [String] The name of the VM scale set where the
1233
+ # extension should be create or updated.
1234
+ # @param instance_id [String] The instance ID of the virtual machine.
1235
+ # @param parameters [VirtualMachineScaleSetVM] Parameters supplied to the
1236
+ # Update Virtual Machine Scale Sets VM operation.
1237
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1238
+ # to the HTTP request.
1239
+ #
1240
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1241
+ #
1242
+ def begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
1243
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1244
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1245
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1246
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1247
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1248
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1249
+
1250
+
1251
+ request_headers = {}
1252
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1253
+
1254
+ # Set Headers
1255
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1256
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1257
+
1258
+ # Serialize Request
1259
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVM.mapper()
1260
+ request_content = @client.serialize(request_mapper, parameters)
1261
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1262
+
1263
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
1264
+
1265
+ request_url = @base_url || @client.base_url
1266
+
1267
+ options = {
1268
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1269
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1270
+ query_params: {'api-version' => @client.api_version},
1271
+ body: request_content,
1272
+ headers: request_headers.merge(custom_headers || {}),
1273
+ base_url: request_url
1274
+ }
1275
+ promise = @client.make_request_async(:put, path_template, options)
1276
+
1277
+ promise = promise.then do |result|
1278
+ http_response = result.response
1279
+ status_code = http_response.status
1280
+ response_content = http_response.body
1281
+ unless status_code == 200 || status_code == 202
1282
+ error_model = JSON.load(response_content)
1283
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1284
+ end
1285
+
1286
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1287
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1288
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1289
+ # Deserialize Response
1290
+ if status_code == 200
1291
+ begin
1292
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1293
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVM.mapper()
1294
+ result.body = @client.deserialize(result_mapper, parsed_response)
1295
+ rescue Exception => e
1296
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1297
+ end
1298
+ end
1299
+ # Deserialize Response
1300
+ if status_code == 202
1301
+ begin
1302
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1303
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVM.mapper()
1304
+ result.body = @client.deserialize(result_mapper, parsed_response)
1305
+ rescue Exception => e
1306
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1307
+ end
1308
+ end
1309
+
1310
+ result
1311
+ end
1312
+
1313
+ promise.execute
1314
+ end
1315
+
1316
+ #
1317
+ # Deletes a virtual machine from a VM scale set.
1318
+ #
1319
+ # @param resource_group_name [String] The name of the resource group.
1320
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1321
+ # @param instance_id [String] The instance ID of the virtual machine.
1322
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1323
+ # will be added to the HTTP request.
1324
+ #
1325
+ #
1326
+ def begin_delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1327
+ response = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1328
+ nil
1329
+ end
1330
+
1331
+ #
1332
+ # Deletes a virtual machine from a VM scale set.
1333
+ #
1334
+ # @param resource_group_name [String] The name of the resource group.
1335
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1336
+ # @param instance_id [String] The instance ID of the virtual machine.
1337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1338
+ # will be added to the HTTP request.
1339
+ #
1340
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1341
+ #
1342
+ def begin_delete_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1343
+ begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1344
+ end
1345
+
1346
+ #
1347
+ # Deletes a virtual machine from a VM scale set.
1348
+ #
1349
+ # @param resource_group_name [String] The name of the resource group.
1350
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1351
+ # @param instance_id [String] The instance ID of the virtual machine.
1352
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1353
+ # to the HTTP request.
1354
+ #
1355
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1356
+ #
1357
+ def begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1358
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1359
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1360
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1361
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1362
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1363
+
1364
+
1365
+ request_headers = {}
1366
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1367
+
1368
+ # Set Headers
1369
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1370
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1371
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
1372
+
1373
+ request_url = @base_url || @client.base_url
1374
+
1375
+ options = {
1376
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1377
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1378
+ query_params: {'api-version' => @client.api_version},
1379
+ headers: request_headers.merge(custom_headers || {}),
1380
+ base_url: request_url
1381
+ }
1382
+ promise = @client.make_request_async(:delete, path_template, options)
1383
+
1384
+ promise = promise.then do |result|
1385
+ http_response = result.response
1386
+ status_code = http_response.status
1387
+ response_content = http_response.body
1388
+ unless status_code == 200 || status_code == 202 || status_code == 204
1389
+ error_model = JSON.load(response_content)
1390
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1391
+ end
1392
+
1393
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1394
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1395
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1396
+
1397
+ result
1398
+ end
1399
+
1400
+ promise.execute
1401
+ end
1402
+
1403
+ #
1404
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
1405
+ # still attached and you are getting charged for the resources. Instead, use
1406
+ # deallocate to release resources and avoid charges.
1407
+ #
1408
+ # @param resource_group_name [String] The name of the resource group.
1409
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1410
+ # @param instance_id [String] The instance ID of the virtual machine.
1411
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1412
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1413
+ # false indicates otherwise. Default value for this flag is false if not
1414
+ # specified
1415
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1416
+ # will be added to the HTTP request.
1417
+ #
1418
+ #
1419
+ def begin_power_off(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
1420
+ response = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
1421
+ nil
1422
+ end
1423
+
1424
+ #
1425
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
1426
+ # still attached and you are getting charged for the resources. Instead, use
1427
+ # deallocate to release resources and avoid charges.
1428
+ #
1429
+ # @param resource_group_name [String] The name of the resource group.
1430
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1431
+ # @param instance_id [String] The instance ID of the virtual machine.
1432
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1433
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1434
+ # false indicates otherwise. Default value for this flag is false if not
1435
+ # specified
1436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1437
+ # will be added to the HTTP request.
1438
+ #
1439
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1440
+ #
1441
+ def begin_power_off_with_http_info(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
1442
+ begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
1443
+ end
1444
+
1445
+ #
1446
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
1447
+ # still attached and you are getting charged for the resources. Instead, use
1448
+ # deallocate to release resources and avoid charges.
1449
+ #
1450
+ # @param resource_group_name [String] The name of the resource group.
1451
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1452
+ # @param instance_id [String] The instance ID of the virtual machine.
1453
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1454
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1455
+ # false indicates otherwise. Default value for this flag is false if not
1456
+ # specified
1457
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1458
+ # to the HTTP request.
1459
+ #
1460
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1461
+ #
1462
+ def begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
1463
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1464
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1465
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1466
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1467
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1468
+
1469
+
1470
+ request_headers = {}
1471
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1472
+
1473
+ # Set Headers
1474
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1475
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1476
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'
1477
+
1478
+ request_url = @base_url || @client.base_url
1479
+
1480
+ options = {
1481
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1482
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1483
+ query_params: {'skipShutdown' => skip_shutdown,'api-version' => @client.api_version},
1484
+ headers: request_headers.merge(custom_headers || {}),
1485
+ base_url: request_url
1486
+ }
1487
+ promise = @client.make_request_async(:post, path_template, options)
1488
+
1489
+ promise = promise.then do |result|
1490
+ http_response = result.response
1491
+ status_code = http_response.status
1492
+ response_content = http_response.body
1493
+ unless status_code == 200 || status_code == 202
1494
+ error_model = JSON.load(response_content)
1495
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1496
+ end
1497
+
1498
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1499
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1500
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1501
+
1502
+ result
1503
+ end
1504
+
1505
+ promise.execute
1506
+ end
1507
+
1508
+ #
1509
+ # Restarts a virtual machine in a VM scale set.
1510
+ #
1511
+ # @param resource_group_name [String] The name of the resource group.
1512
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1513
+ # @param instance_id [String] The instance ID of the virtual machine.
1514
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1515
+ # will be added to the HTTP request.
1516
+ #
1517
+ #
1518
+ def begin_restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1519
+ response = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1520
+ nil
1521
+ end
1522
+
1523
+ #
1524
+ # Restarts a virtual machine in a VM scale set.
1525
+ #
1526
+ # @param resource_group_name [String] The name of the resource group.
1527
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1528
+ # @param instance_id [String] The instance ID of the virtual machine.
1529
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1530
+ # will be added to the HTTP request.
1531
+ #
1532
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1533
+ #
1534
+ def begin_restart_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1535
+ begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1536
+ end
1537
+
1538
+ #
1539
+ # Restarts a virtual machine in a VM scale set.
1540
+ #
1541
+ # @param resource_group_name [String] The name of the resource group.
1542
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1543
+ # @param instance_id [String] The instance ID of the virtual machine.
1544
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1545
+ # to the HTTP request.
1546
+ #
1547
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1548
+ #
1549
+ def begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1550
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1551
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1552
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1553
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1554
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1555
+
1556
+
1557
+ request_headers = {}
1558
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1559
+
1560
+ # Set Headers
1561
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1562
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1563
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'
1564
+
1565
+ request_url = @base_url || @client.base_url
1566
+
1567
+ options = {
1568
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1569
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1570
+ query_params: {'api-version' => @client.api_version},
1571
+ headers: request_headers.merge(custom_headers || {}),
1572
+ base_url: request_url
1573
+ }
1574
+ promise = @client.make_request_async(:post, path_template, options)
1575
+
1576
+ promise = promise.then do |result|
1577
+ http_response = result.response
1578
+ status_code = http_response.status
1579
+ response_content = http_response.body
1580
+ unless status_code == 200 || status_code == 202
1581
+ error_model = JSON.load(response_content)
1582
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1583
+ end
1584
+
1585
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1586
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1587
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1588
+
1589
+ result
1590
+ end
1591
+
1592
+ promise.execute
1593
+ end
1594
+
1595
+ #
1596
+ # Starts a virtual machine in a VM scale set.
1597
+ #
1598
+ # @param resource_group_name [String] The name of the resource group.
1599
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1600
+ # @param instance_id [String] The instance ID of the virtual machine.
1601
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1602
+ # will be added to the HTTP request.
1603
+ #
1604
+ #
1605
+ def begin_start(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1606
+ response = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1607
+ nil
1608
+ end
1609
+
1610
+ #
1611
+ # Starts a virtual machine in a VM scale set.
1612
+ #
1613
+ # @param resource_group_name [String] The name of the resource group.
1614
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1615
+ # @param instance_id [String] The instance ID of the virtual machine.
1616
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1617
+ # will be added to the HTTP request.
1618
+ #
1619
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1620
+ #
1621
+ def begin_start_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1622
+ begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1623
+ end
1624
+
1625
+ #
1626
+ # Starts a virtual machine in a VM scale set.
1627
+ #
1628
+ # @param resource_group_name [String] The name of the resource group.
1629
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1630
+ # @param instance_id [String] The instance ID of the virtual machine.
1631
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1632
+ # to the HTTP request.
1633
+ #
1634
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1635
+ #
1636
+ def begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1637
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1638
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1639
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1640
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1641
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1642
+
1643
+
1644
+ request_headers = {}
1645
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1646
+
1647
+ # Set Headers
1648
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1649
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1650
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'
1651
+
1652
+ request_url = @base_url || @client.base_url
1653
+
1654
+ options = {
1655
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1656
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1657
+ query_params: {'api-version' => @client.api_version},
1658
+ headers: request_headers.merge(custom_headers || {}),
1659
+ base_url: request_url
1660
+ }
1661
+ promise = @client.make_request_async(:post, path_template, options)
1662
+
1663
+ promise = promise.then do |result|
1664
+ http_response = result.response
1665
+ status_code = http_response.status
1666
+ response_content = http_response.body
1667
+ unless status_code == 200 || status_code == 202
1668
+ error_model = JSON.load(response_content)
1669
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1670
+ end
1671
+
1672
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1673
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1674
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1675
+
1676
+ result
1677
+ end
1678
+
1679
+ promise.execute
1680
+ end
1681
+
1682
+ #
1683
+ # Shuts down the virtual machine in the virtual machine scale set, moves it to
1684
+ # a new node, and powers it back on.
1685
+ #
1686
+ # @param resource_group_name [String] The name of the resource group.
1687
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1688
+ # @param instance_id [String] The instance ID of the virtual machine.
1689
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1690
+ # will be added to the HTTP request.
1691
+ #
1692
+ #
1693
+ def begin_redeploy(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1694
+ response = begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1695
+ nil
1696
+ end
1697
+
1698
+ #
1699
+ # Shuts down the virtual machine in the virtual machine scale set, moves it to
1700
+ # a new node, and powers it back on.
1701
+ #
1702
+ # @param resource_group_name [String] The name of the resource group.
1703
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1704
+ # @param instance_id [String] The instance ID of the virtual machine.
1705
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1706
+ # will be added to the HTTP request.
1707
+ #
1708
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1709
+ #
1710
+ def begin_redeploy_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1711
+ begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1712
+ end
1713
+
1714
+ #
1715
+ # Shuts down the virtual machine in the virtual machine scale set, moves it to
1716
+ # a new node, and powers it back on.
1717
+ #
1718
+ # @param resource_group_name [String] The name of the resource group.
1719
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1720
+ # @param instance_id [String] The instance ID of the virtual machine.
1721
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1722
+ # to the HTTP request.
1723
+ #
1724
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1725
+ #
1726
+ def begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1727
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1728
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1729
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1730
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1731
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1732
+
1733
+
1734
+ request_headers = {}
1735
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1736
+
1737
+ # Set Headers
1738
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1739
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1740
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'
1741
+
1742
+ request_url = @base_url || @client.base_url
1743
+
1744
+ options = {
1745
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1746
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1747
+ query_params: {'api-version' => @client.api_version},
1748
+ headers: request_headers.merge(custom_headers || {}),
1749
+ base_url: request_url
1750
+ }
1751
+ promise = @client.make_request_async(:post, path_template, options)
1752
+
1753
+ promise = promise.then do |result|
1754
+ http_response = result.response
1755
+ status_code = http_response.status
1756
+ response_content = http_response.body
1757
+ unless status_code == 200 || status_code == 202
1758
+ error_model = JSON.load(response_content)
1759
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1760
+ end
1761
+
1762
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1763
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1764
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1765
+
1766
+ result
1767
+ end
1768
+
1769
+ promise.execute
1770
+ end
1771
+
1772
+ #
1773
+ # Performs maintenance on a virtual machine in a VM scale set.
1774
+ #
1775
+ # @param resource_group_name [String] The name of the resource group.
1776
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1777
+ # @param instance_id [String] The instance ID of the virtual machine.
1778
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1779
+ # will be added to the HTTP request.
1780
+ #
1781
+ #
1782
+ def begin_perform_maintenance(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1783
+ response = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1784
+ nil
1785
+ end
1786
+
1787
+ #
1788
+ # Performs maintenance on a virtual machine in a VM scale set.
1789
+ #
1790
+ # @param resource_group_name [String] The name of the resource group.
1791
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1792
+ # @param instance_id [String] The instance ID of the virtual machine.
1793
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1794
+ # will be added to the HTTP request.
1795
+ #
1796
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1797
+ #
1798
+ def begin_perform_maintenance_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1799
+ begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
1800
+ end
1801
+
1802
+ #
1803
+ # Performs maintenance on a virtual machine in a VM scale set.
1804
+ #
1805
+ # @param resource_group_name [String] The name of the resource group.
1806
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1807
+ # @param instance_id [String] The instance ID of the virtual machine.
1808
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1809
+ # to the HTTP request.
1810
+ #
1811
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1812
+ #
1813
+ def begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
1814
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1815
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1816
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1817
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1818
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1819
+
1820
+
1821
+ request_headers = {}
1822
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1823
+
1824
+ # Set Headers
1825
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1826
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1827
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'
1828
+
1829
+ request_url = @base_url || @client.base_url
1830
+
1831
+ options = {
1832
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1833
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1834
+ query_params: {'api-version' => @client.api_version},
1835
+ headers: request_headers.merge(custom_headers || {}),
1836
+ base_url: request_url
1837
+ }
1838
+ promise = @client.make_request_async(:post, path_template, options)
1839
+
1840
+ promise = promise.then do |result|
1841
+ http_response = result.response
1842
+ status_code = http_response.status
1843
+ response_content = http_response.body
1844
+ unless status_code == 200 || status_code == 202
1845
+ error_model = JSON.load(response_content)
1846
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1847
+ end
1848
+
1849
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1850
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1851
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1852
+
1853
+ result
1854
+ end
1855
+
1856
+ promise.execute
1857
+ end
1858
+
1859
+ #
1860
+ # Run command on a virtual machine in a VM scale set.
1861
+ #
1862
+ # @param resource_group_name [String] The name of the resource group.
1863
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1864
+ # @param instance_id [String] The instance ID of the virtual machine.
1865
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
1866
+ # operation.
1867
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1868
+ # will be added to the HTTP request.
1869
+ #
1870
+ # @return [RunCommandResult] operation results.
1871
+ #
1872
+ def begin_run_command(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
1873
+ response = begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
1874
+ response.body unless response.nil?
1875
+ end
1876
+
1877
+ #
1878
+ # Run command on a virtual machine in a VM scale set.
1879
+ #
1880
+ # @param resource_group_name [String] The name of the resource group.
1881
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1882
+ # @param instance_id [String] The instance ID of the virtual machine.
1883
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
1884
+ # operation.
1885
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1886
+ # will be added to the HTTP request.
1887
+ #
1888
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1889
+ #
1890
+ def begin_run_command_with_http_info(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
1891
+ begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
1892
+ end
1893
+
1894
+ #
1895
+ # Run command on a virtual machine in a VM scale set.
1896
+ #
1897
+ # @param resource_group_name [String] The name of the resource group.
1898
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1899
+ # @param instance_id [String] The instance ID of the virtual machine.
1900
+ # @param parameters [RunCommandInput] Parameters supplied to the Run command
1901
+ # operation.
1902
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1903
+ # to the HTTP request.
1904
+ #
1905
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1906
+ #
1907
+ def begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
1908
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1909
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1910
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
1911
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1912
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1913
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1914
+
1915
+
1916
+ request_headers = {}
1917
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1918
+
1919
+ # Set Headers
1920
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1921
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1922
+
1923
+ # Serialize Request
1924
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RunCommandInput.mapper()
1925
+ request_content = @client.serialize(request_mapper, parameters)
1926
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1927
+
1928
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'
1929
+
1930
+ request_url = @base_url || @client.base_url
1931
+
1932
+ options = {
1933
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1934
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
1935
+ query_params: {'api-version' => @client.api_version},
1936
+ body: request_content,
1937
+ headers: request_headers.merge(custom_headers || {}),
1938
+ base_url: request_url
1939
+ }
1940
+ promise = @client.make_request_async(:post, path_template, options)
1941
+
1942
+ promise = promise.then do |result|
1943
+ http_response = result.response
1944
+ status_code = http_response.status
1945
+ response_content = http_response.body
1946
+ unless status_code == 200 || status_code == 202
1947
+ error_model = JSON.load(response_content)
1948
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1949
+ end
1950
+
1951
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1952
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1953
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1954
+ # Deserialize Response
1955
+ if status_code == 200
1956
+ begin
1957
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1958
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RunCommandResult.mapper()
1959
+ result.body = @client.deserialize(result_mapper, parsed_response)
1960
+ rescue Exception => e
1961
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1962
+ end
1963
+ end
1964
+
1965
+ result
1966
+ end
1967
+
1968
+ promise.execute
1969
+ end
1970
+
1971
+ #
1972
+ # Gets a list of all virtual machines in a VM scale sets.
1973
+ #
1974
+ # @param next_page_link [String] The NextLink from the previous successful call
1975
+ # to List operation.
1976
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1977
+ # will be added to the HTTP request.
1978
+ #
1979
+ # @return [VirtualMachineScaleSetVMListResult] operation results.
1980
+ #
1981
+ def list_next(next_page_link, custom_headers:nil)
1982
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1983
+ response.body unless response.nil?
1984
+ end
1985
+
1986
+ #
1987
+ # Gets a list of all virtual machines in a VM scale sets.
1988
+ #
1989
+ # @param next_page_link [String] The NextLink from the previous successful call
1990
+ # to List operation.
1991
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1992
+ # will be added to the HTTP request.
1993
+ #
1994
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1995
+ #
1996
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1997
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1998
+ end
1999
+
2000
+ #
2001
+ # Gets a list of all virtual machines in a VM scale sets.
2002
+ #
2003
+ # @param next_page_link [String] The NextLink from the previous successful call
2004
+ # to List operation.
2005
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2006
+ # to the HTTP request.
2007
+ #
2008
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2009
+ #
2010
+ def list_next_async(next_page_link, custom_headers:nil)
2011
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2012
+
2013
+
2014
+ request_headers = {}
2015
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2016
+
2017
+ # Set Headers
2018
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2019
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2020
+ path_template = '{nextLink}'
2021
+
2022
+ request_url = @base_url || @client.base_url
2023
+
2024
+ options = {
2025
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2026
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2027
+ headers: request_headers.merge(custom_headers || {}),
2028
+ base_url: request_url
2029
+ }
2030
+ promise = @client.make_request_async(:get, path_template, options)
2031
+
2032
+ promise = promise.then do |result|
2033
+ http_response = result.response
2034
+ status_code = http_response.status
2035
+ response_content = http_response.body
2036
+ unless status_code == 200
2037
+ error_model = JSON.load(response_content)
2038
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2039
+ end
2040
+
2041
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2042
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2043
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2044
+ # Deserialize Response
2045
+ if status_code == 200
2046
+ begin
2047
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2048
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMListResult.mapper()
2049
+ result.body = @client.deserialize(result_mapper, parsed_response)
2050
+ rescue Exception => e
2051
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2052
+ end
2053
+ end
2054
+
2055
+ result
2056
+ end
2057
+
2058
+ promise.execute
2059
+ end
2060
+
2061
+ #
2062
+ # Gets a list of all virtual machines in a VM scale sets.
2063
+ #
2064
+ # @param resource_group_name [String] The name of the resource group.
2065
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
2066
+ # @param filter [String] The filter to apply to the operation.
2067
+ # @param select [String] The list parameters.
2068
+ # @param expand [String] The expand expression to apply to the operation.
2069
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2070
+ # will be added to the HTTP request.
2071
+ #
2072
+ # @return [VirtualMachineScaleSetVMListResult] which provide lazy access to
2073
+ # pages of the response.
2074
+ #
2075
+ def list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
2076
+ response = list_async(resource_group_name, virtual_machine_scale_set_name, filter:filter, select:select, expand:expand, custom_headers:custom_headers).value!
2077
+ unless response.nil?
2078
+ page = response.body
2079
+ page.next_method = Proc.new do |next_page_link|
2080
+ list_next_async(next_page_link, custom_headers:custom_headers)
2081
+ end
2082
+ page
2083
+ end
2084
+ end
2085
+
2086
+ end
2087
+ end