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,3288 @@
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 VirtualMachineScaleSets
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VirtualMachineScaleSets 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
+ # Create or update a VM scale set.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
29
+ # update.
30
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [VirtualMachineScaleSet] operation results.
35
+ #
36
+ def create_or_update(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
37
+ response = create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group.
43
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
44
+ # update.
45
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [Concurrent::Promise] promise which provides async access to http
50
+ # response.
51
+ #
52
+ def create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
53
+ # Send request
54
+ promise = begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers)
55
+
56
+ promise = promise.then do |response|
57
+ # Defining deserialization method.
58
+ deserialize_method = lambda do |parsed_response|
59
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
60
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
61
+ end
62
+
63
+ # Waiting for response.
64
+ @client.get_long_running_operation_result(response, deserialize_method)
65
+ end
66
+
67
+ promise
68
+ end
69
+
70
+ #
71
+ # Update a VM scale set.
72
+ #
73
+ # @param resource_group_name [String] The name of the resource group.
74
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
75
+ # update.
76
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
77
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
78
+ # will be added to the HTTP request.
79
+ #
80
+ # @return [VirtualMachineScaleSet] operation results.
81
+ #
82
+ def update(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
83
+ response = update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
84
+ response.body unless response.nil?
85
+ end
86
+
87
+ #
88
+ # @param resource_group_name [String] The name of the resource group.
89
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
90
+ # update.
91
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
92
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
93
+ # will be added to the HTTP request.
94
+ #
95
+ # @return [Concurrent::Promise] promise which provides async access to http
96
+ # response.
97
+ #
98
+ def update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
99
+ # Send request
100
+ promise = begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers)
101
+
102
+ promise = promise.then do |response|
103
+ # Defining deserialization method.
104
+ deserialize_method = lambda do |parsed_response|
105
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
106
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
107
+ end
108
+
109
+ # Waiting for response.
110
+ @client.get_long_running_operation_result(response, deserialize_method)
111
+ end
112
+
113
+ promise
114
+ end
115
+
116
+ #
117
+ # Deletes a VM scale set.
118
+ #
119
+ # @param resource_group_name [String] The name of the resource group.
120
+ # @param vm_scale_set_name [String] The name of the VM scale set.
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ def delete(resource_group_name, vm_scale_set_name, custom_headers:nil)
125
+ response = delete_async(resource_group_name, vm_scale_set_name, 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 custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [Concurrent::Promise] promise which provides async access to http
136
+ # response.
137
+ #
138
+ def delete_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
139
+ # Send request
140
+ promise = begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers)
141
+
142
+ promise = promise.then do |response|
143
+ # Defining deserialization method.
144
+ deserialize_method = lambda do |parsed_response|
145
+ end
146
+
147
+ # Waiting for response.
148
+ @client.get_long_running_operation_result(response, deserialize_method)
149
+ end
150
+
151
+ promise
152
+ end
153
+
154
+ #
155
+ # Display information about a virtual machine scale set.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group.
158
+ # @param vm_scale_set_name [String] The name of the VM scale set.
159
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
160
+ # will be added to the HTTP request.
161
+ #
162
+ # @return [VirtualMachineScaleSet] operation results.
163
+ #
164
+ def get(resource_group_name, vm_scale_set_name, custom_headers:nil)
165
+ response = get_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
166
+ response.body unless response.nil?
167
+ end
168
+
169
+ #
170
+ # Display information about a virtual machine scale set.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group.
173
+ # @param vm_scale_set_name [String] The name of the VM scale set.
174
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
175
+ # will be added to the HTTP request.
176
+ #
177
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
178
+ #
179
+ def get_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
180
+ get_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
181
+ end
182
+
183
+ #
184
+ # Display information about a virtual machine scale set.
185
+ #
186
+ # @param resource_group_name [String] The name of the resource group.
187
+ # @param vm_scale_set_name [String] The name of the VM scale set.
188
+ # @param [Hash{String => String}] A hash of custom headers that will be added
189
+ # to the HTTP request.
190
+ #
191
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
192
+ #
193
+ def get_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
194
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
195
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
196
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
197
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
198
+
199
+
200
+ request_headers = {}
201
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
202
+
203
+ # Set Headers
204
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
205
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
206
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
207
+
208
+ request_url = @base_url || @client.base_url
209
+
210
+ options = {
211
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
212
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
213
+ query_params: {'api-version' => @client.api_version},
214
+ headers: request_headers.merge(custom_headers || {}),
215
+ base_url: request_url
216
+ }
217
+ promise = @client.make_request_async(:get, path_template, options)
218
+
219
+ promise = promise.then do |result|
220
+ http_response = result.response
221
+ status_code = http_response.status
222
+ response_content = http_response.body
223
+ unless status_code == 200
224
+ error_model = JSON.load(response_content)
225
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
226
+ end
227
+
228
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
229
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
230
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
231
+ # Deserialize Response
232
+ if status_code == 200
233
+ begin
234
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
235
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
236
+ result.body = @client.deserialize(result_mapper, parsed_response)
237
+ rescue Exception => e
238
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
239
+ end
240
+ end
241
+
242
+ result
243
+ end
244
+
245
+ promise.execute
246
+ end
247
+
248
+ #
249
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
250
+ # virtual machines and releases the compute resources. You are not billed for
251
+ # the compute resources that this virtual machine scale set deallocates.
252
+ #
253
+ # @param resource_group_name [String] The name of the resource group.
254
+ # @param vm_scale_set_name [String] The name of the VM scale set.
255
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
256
+ # virtual machine instance IDs from the VM scale set.
257
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
258
+ # will be added to the HTTP request.
259
+ #
260
+ def deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
261
+ response = deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
262
+ nil
263
+ end
264
+
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 vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
269
+ # virtual machine instance IDs from the VM scale set.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [Concurrent::Promise] promise which provides async access to http
274
+ # response.
275
+ #
276
+ def deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
277
+ # Send request
278
+ promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
279
+
280
+ promise = promise.then do |response|
281
+ # Defining deserialization method.
282
+ deserialize_method = lambda do |parsed_response|
283
+ end
284
+
285
+ # Waiting for response.
286
+ @client.get_long_running_operation_result(response, deserialize_method)
287
+ end
288
+
289
+ promise
290
+ end
291
+
292
+ #
293
+ # Deletes virtual machines in a VM scale set.
294
+ #
295
+ # @param resource_group_name [String] The name of the resource group.
296
+ # @param vm_scale_set_name [String] The name of the VM scale set.
297
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
298
+ # of virtual machine instance IDs from the VM scale set.
299
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
300
+ # will be added to the HTTP request.
301
+ #
302
+ def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
303
+ response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
304
+ nil
305
+ end
306
+
307
+ #
308
+ # @param resource_group_name [String] The name of the resource group.
309
+ # @param vm_scale_set_name [String] The name of the VM scale set.
310
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
311
+ # of virtual machine instance IDs from the VM scale set.
312
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
313
+ # will be added to the HTTP request.
314
+ #
315
+ # @return [Concurrent::Promise] promise which provides async access to http
316
+ # response.
317
+ #
318
+ def delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
319
+ # Send request
320
+ promise = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers)
321
+
322
+ promise = promise.then do |response|
323
+ # Defining deserialization method.
324
+ deserialize_method = lambda do |parsed_response|
325
+ end
326
+
327
+ # Waiting for response.
328
+ @client.get_long_running_operation_result(response, deserialize_method)
329
+ end
330
+
331
+ promise
332
+ end
333
+
334
+ #
335
+ # Gets the status of a VM scale set instance.
336
+ #
337
+ # @param resource_group_name [String] The name of the resource group.
338
+ # @param vm_scale_set_name [String] The name of the VM scale set.
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [VirtualMachineScaleSetInstanceView] operation results.
343
+ #
344
+ def get_instance_view(resource_group_name, vm_scale_set_name, custom_headers:nil)
345
+ response = get_instance_view_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
346
+ response.body unless response.nil?
347
+ end
348
+
349
+ #
350
+ # Gets the status of a VM scale set instance.
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 custom_headers [Hash{String => String}] A hash of custom headers that
355
+ # will be added to the HTTP request.
356
+ #
357
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
358
+ #
359
+ def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
360
+ get_instance_view_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
361
+ end
362
+
363
+ #
364
+ # Gets the status of a VM scale set instance.
365
+ #
366
+ # @param resource_group_name [String] The name of the resource group.
367
+ # @param vm_scale_set_name [String] The name of the VM scale set.
368
+ # @param [Hash{String => String}] A hash of custom headers that will be added
369
+ # to the HTTP request.
370
+ #
371
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
372
+ #
373
+ def get_instance_view_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
374
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
375
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
376
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
377
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
378
+
379
+
380
+ request_headers = {}
381
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
382
+
383
+ # Set Headers
384
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
385
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
386
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'
387
+
388
+ request_url = @base_url || @client.base_url
389
+
390
+ options = {
391
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
392
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
393
+ query_params: {'api-version' => @client.api_version},
394
+ headers: request_headers.merge(custom_headers || {}),
395
+ base_url: request_url
396
+ }
397
+ promise = @client.make_request_async(:get, path_template, options)
398
+
399
+ promise = promise.then do |result|
400
+ http_response = result.response
401
+ status_code = http_response.status
402
+ response_content = http_response.body
403
+ unless status_code == 200
404
+ error_model = JSON.load(response_content)
405
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
406
+ end
407
+
408
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
409
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
410
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
411
+ # Deserialize Response
412
+ if status_code == 200
413
+ begin
414
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
415
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetInstanceView.mapper()
416
+ result.body = @client.deserialize(result_mapper, parsed_response)
417
+ rescue Exception => e
418
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
419
+ end
420
+ end
421
+
422
+ result
423
+ end
424
+
425
+ promise.execute
426
+ end
427
+
428
+ #
429
+ # Gets a list of all VM scale sets under a resource group.
430
+ #
431
+ # @param resource_group_name [String] The name of the resource group.
432
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
433
+ # will be added to the HTTP request.
434
+ #
435
+ # @return [Array<VirtualMachineScaleSet>] operation results.
436
+ #
437
+ def list(resource_group_name, custom_headers:nil)
438
+ first_page = list_as_lazy(resource_group_name, custom_headers:custom_headers)
439
+ first_page.get_all_items
440
+ end
441
+
442
+ #
443
+ # Gets a list of all VM scale sets under a resource group.
444
+ #
445
+ # @param resource_group_name [String] The name of the resource group.
446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
447
+ # will be added to the HTTP request.
448
+ #
449
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
450
+ #
451
+ def list_with_http_info(resource_group_name, custom_headers:nil)
452
+ list_async(resource_group_name, custom_headers:custom_headers).value!
453
+ end
454
+
455
+ #
456
+ # Gets a list of all VM scale sets under a resource group.
457
+ #
458
+ # @param resource_group_name [String] The name of the resource group.
459
+ # @param [Hash{String => String}] A hash of custom headers that will be added
460
+ # to the HTTP request.
461
+ #
462
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
463
+ #
464
+ def list_async(resource_group_name, custom_headers:nil)
465
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
466
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
467
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
468
+
469
+
470
+ request_headers = {}
471
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
472
+
473
+ # Set Headers
474
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
475
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
476
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'
477
+
478
+ request_url = @base_url || @client.base_url
479
+
480
+ options = {
481
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
482
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
483
+ query_params: {'api-version' => @client.api_version},
484
+ headers: request_headers.merge(custom_headers || {}),
485
+ base_url: request_url
486
+ }
487
+ promise = @client.make_request_async(:get, path_template, options)
488
+
489
+ promise = promise.then do |result|
490
+ http_response = result.response
491
+ status_code = http_response.status
492
+ response_content = http_response.body
493
+ unless status_code == 200
494
+ error_model = JSON.load(response_content)
495
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
496
+ end
497
+
498
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
499
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
500
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
501
+ # Deserialize Response
502
+ if status_code == 200
503
+ begin
504
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
505
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListResult.mapper()
506
+ result.body = @client.deserialize(result_mapper, parsed_response)
507
+ rescue Exception => e
508
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
509
+ end
510
+ end
511
+
512
+ result
513
+ end
514
+
515
+ promise.execute
516
+ end
517
+
518
+ #
519
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
520
+ # associated resource group. Use nextLink property in the response to get the
521
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
522
+ # Scale Sets.
523
+ #
524
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
525
+ # will be added to the HTTP request.
526
+ #
527
+ # @return [Array<VirtualMachineScaleSet>] operation results.
528
+ #
529
+ def list_all(custom_headers:nil)
530
+ first_page = list_all_as_lazy(custom_headers:custom_headers)
531
+ first_page.get_all_items
532
+ end
533
+
534
+ #
535
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
536
+ # associated resource group. Use nextLink property in the response to get the
537
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
538
+ # Scale Sets.
539
+ #
540
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
541
+ # will be added to the HTTP request.
542
+ #
543
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
544
+ #
545
+ def list_all_with_http_info(custom_headers:nil)
546
+ list_all_async(custom_headers:custom_headers).value!
547
+ end
548
+
549
+ #
550
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
551
+ # associated resource group. Use nextLink property in the response to get the
552
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
553
+ # Scale Sets.
554
+ #
555
+ # @param [Hash{String => String}] A hash of custom headers that will be added
556
+ # to the HTTP request.
557
+ #
558
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
559
+ #
560
+ def list_all_async(custom_headers:nil)
561
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
562
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
563
+
564
+
565
+ request_headers = {}
566
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
567
+
568
+ # Set Headers
569
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
570
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
571
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'
572
+
573
+ request_url = @base_url || @client.base_url
574
+
575
+ options = {
576
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
577
+ path_params: {'subscriptionId' => @client.subscription_id},
578
+ query_params: {'api-version' => @client.api_version},
579
+ headers: request_headers.merge(custom_headers || {}),
580
+ base_url: request_url
581
+ }
582
+ promise = @client.make_request_async(:get, path_template, options)
583
+
584
+ promise = promise.then do |result|
585
+ http_response = result.response
586
+ status_code = http_response.status
587
+ response_content = http_response.body
588
+ unless status_code == 200
589
+ error_model = JSON.load(response_content)
590
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
591
+ end
592
+
593
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
594
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
595
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
596
+ # Deserialize Response
597
+ if status_code == 200
598
+ begin
599
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
600
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListWithLinkResult.mapper()
601
+ result.body = @client.deserialize(result_mapper, parsed_response)
602
+ rescue Exception => e
603
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
604
+ end
605
+ end
606
+
607
+ result
608
+ end
609
+
610
+ promise.execute
611
+ end
612
+
613
+ #
614
+ # Gets a list of SKUs available for your VM scale set, including the minimum
615
+ # and maximum VM instances allowed for each SKU.
616
+ #
617
+ # @param resource_group_name [String] The name of the resource group.
618
+ # @param vm_scale_set_name [String] The name of the VM scale set.
619
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
620
+ # will be added to the HTTP request.
621
+ #
622
+ # @return [Array<VirtualMachineScaleSetSku>] operation results.
623
+ #
624
+ def list_skus(resource_group_name, vm_scale_set_name, custom_headers:nil)
625
+ first_page = list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:custom_headers)
626
+ first_page.get_all_items
627
+ end
628
+
629
+ #
630
+ # Gets a list of SKUs available for your VM scale set, including the minimum
631
+ # and maximum VM instances allowed for each SKU.
632
+ #
633
+ # @param resource_group_name [String] The name of the resource group.
634
+ # @param vm_scale_set_name [String] The name of the VM scale set.
635
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
636
+ # will be added to the HTTP request.
637
+ #
638
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
639
+ #
640
+ def list_skus_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
641
+ list_skus_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
642
+ end
643
+
644
+ #
645
+ # Gets a list of SKUs available for your VM scale set, including the minimum
646
+ # and maximum VM instances allowed for each SKU.
647
+ #
648
+ # @param resource_group_name [String] The name of the resource group.
649
+ # @param vm_scale_set_name [String] The name of the VM scale set.
650
+ # @param [Hash{String => String}] A hash of custom headers that will be added
651
+ # to the HTTP request.
652
+ #
653
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
654
+ #
655
+ def list_skus_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
656
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
657
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
658
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
659
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
660
+
661
+
662
+ request_headers = {}
663
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
664
+
665
+ # Set Headers
666
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
667
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
668
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'
669
+
670
+ request_url = @base_url || @client.base_url
671
+
672
+ options = {
673
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
674
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
675
+ query_params: {'api-version' => @client.api_version},
676
+ headers: request_headers.merge(custom_headers || {}),
677
+ base_url: request_url
678
+ }
679
+ promise = @client.make_request_async(:get, path_template, options)
680
+
681
+ promise = promise.then do |result|
682
+ http_response = result.response
683
+ status_code = http_response.status
684
+ response_content = http_response.body
685
+ unless status_code == 200
686
+ error_model = JSON.load(response_content)
687
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
688
+ end
689
+
690
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
691
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
692
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
693
+ # Deserialize Response
694
+ if status_code == 200
695
+ begin
696
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
697
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListSkusResult.mapper()
698
+ result.body = @client.deserialize(result_mapper, parsed_response)
699
+ rescue Exception => e
700
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
701
+ end
702
+ end
703
+
704
+ result
705
+ end
706
+
707
+ promise.execute
708
+ end
709
+
710
+ #
711
+ # Gets list of OS upgrades on a VM scale set instance.
712
+ #
713
+ # @param resource_group_name [String] The name of the resource group.
714
+ # @param vm_scale_set_name [String] The name of the VM scale set.
715
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
716
+ # will be added to the HTTP request.
717
+ #
718
+ # @return [Array<UpgradeOperationHistoricalStatusInfo>] operation results.
719
+ #
720
+ def get_osupgrade_history(resource_group_name, vm_scale_set_name, custom_headers:nil)
721
+ first_page = get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:custom_headers)
722
+ first_page.get_all_items
723
+ end
724
+
725
+ #
726
+ # Gets list of OS upgrades on a VM scale set instance.
727
+ #
728
+ # @param resource_group_name [String] The name of the resource group.
729
+ # @param vm_scale_set_name [String] The name of the VM scale set.
730
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
731
+ # will be added to the HTTP request.
732
+ #
733
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
734
+ #
735
+ def get_osupgrade_history_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
736
+ get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
737
+ end
738
+
739
+ #
740
+ # Gets list of OS upgrades on a VM scale set instance.
741
+ #
742
+ # @param resource_group_name [String] The name of the resource group.
743
+ # @param vm_scale_set_name [String] The name of the VM scale set.
744
+ # @param [Hash{String => String}] A hash of custom headers that will be added
745
+ # to the HTTP request.
746
+ #
747
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
748
+ #
749
+ def get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
750
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
751
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
752
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
753
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
754
+
755
+
756
+ request_headers = {}
757
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
758
+
759
+ # Set Headers
760
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
761
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
762
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'
763
+
764
+ request_url = @base_url || @client.base_url
765
+
766
+ options = {
767
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
768
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
769
+ query_params: {'api-version' => @client.api_version},
770
+ headers: request_headers.merge(custom_headers || {}),
771
+ base_url: request_url
772
+ }
773
+ promise = @client.make_request_async(:get, path_template, options)
774
+
775
+ promise = promise.then do |result|
776
+ http_response = result.response
777
+ status_code = http_response.status
778
+ response_content = http_response.body
779
+ unless status_code == 200
780
+ error_model = JSON.load(response_content)
781
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
782
+ end
783
+
784
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
785
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
786
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
787
+ # Deserialize Response
788
+ if status_code == 200
789
+ begin
790
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
791
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.mapper()
792
+ result.body = @client.deserialize(result_mapper, parsed_response)
793
+ rescue Exception => e
794
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
795
+ end
796
+ end
797
+
798
+ result
799
+ end
800
+
801
+ promise.execute
802
+ end
803
+
804
+ #
805
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
806
+ # resources are still attached and you are getting charged for the resources.
807
+ # Instead, use deallocate to release resources and avoid charges.
808
+ #
809
+ # @param resource_group_name [String] The name of the resource group.
810
+ # @param vm_scale_set_name [String] The name of the VM scale set.
811
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
812
+ # virtual machine instance IDs from the VM scale set.
813
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
814
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
815
+ # false indicates otherwise. Default value for this flag is false if not
816
+ # specified
817
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
818
+ # will be added to the HTTP request.
819
+ #
820
+ def power_off(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
821
+ response = power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
822
+ nil
823
+ end
824
+
825
+ #
826
+ # @param resource_group_name [String] The name of the resource group.
827
+ # @param vm_scale_set_name [String] The name of the VM scale set.
828
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
829
+ # virtual machine instance IDs from the VM scale set.
830
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
831
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
832
+ # false indicates otherwise. Default value for this flag is false if not
833
+ # specified
834
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
835
+ # will be added to the HTTP request.
836
+ #
837
+ # @return [Concurrent::Promise] promise which provides async access to http
838
+ # response.
839
+ #
840
+ def power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
841
+ # Send request
842
+ promise = begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, skip_shutdown:skip_shutdown, custom_headers:custom_headers)
843
+
844
+ promise = promise.then do |response|
845
+ # Defining deserialization method.
846
+ deserialize_method = lambda do |parsed_response|
847
+ end
848
+
849
+ # Waiting for response.
850
+ @client.get_long_running_operation_result(response, deserialize_method)
851
+ end
852
+
853
+ promise
854
+ end
855
+
856
+ #
857
+ # Restarts one or more virtual machines in a VM scale set.
858
+ #
859
+ # @param resource_group_name [String] The name of the resource group.
860
+ # @param vm_scale_set_name [String] The name of the VM scale set.
861
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
862
+ # virtual machine instance IDs from the VM scale set.
863
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
864
+ # will be added to the HTTP request.
865
+ #
866
+ def restart(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
867
+ response = restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
868
+ nil
869
+ end
870
+
871
+ #
872
+ # @param resource_group_name [String] The name of the resource group.
873
+ # @param vm_scale_set_name [String] The name of the VM scale set.
874
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
875
+ # virtual machine instance IDs from the VM scale set.
876
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
877
+ # will be added to the HTTP request.
878
+ #
879
+ # @return [Concurrent::Promise] promise which provides async access to http
880
+ # response.
881
+ #
882
+ def restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
883
+ # Send request
884
+ promise = begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
885
+
886
+ promise = promise.then do |response|
887
+ # Defining deserialization method.
888
+ deserialize_method = lambda do |parsed_response|
889
+ end
890
+
891
+ # Waiting for response.
892
+ @client.get_long_running_operation_result(response, deserialize_method)
893
+ end
894
+
895
+ promise
896
+ end
897
+
898
+ #
899
+ # Starts one or more virtual machines in a VM scale set.
900
+ #
901
+ # @param resource_group_name [String] The name of the resource group.
902
+ # @param vm_scale_set_name [String] The name of the VM scale set.
903
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
904
+ # virtual machine instance IDs from the VM scale set.
905
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
906
+ # will be added to the HTTP request.
907
+ #
908
+ def start(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
909
+ response = start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
910
+ nil
911
+ end
912
+
913
+ #
914
+ # @param resource_group_name [String] The name of the resource group.
915
+ # @param vm_scale_set_name [String] The name of the VM scale set.
916
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
917
+ # virtual machine instance IDs from the VM scale set.
918
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
919
+ # will be added to the HTTP request.
920
+ #
921
+ # @return [Concurrent::Promise] promise which provides async access to http
922
+ # response.
923
+ #
924
+ def start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
925
+ # Send request
926
+ promise = begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
927
+
928
+ promise = promise.then do |response|
929
+ # Defining deserialization method.
930
+ deserialize_method = lambda do |parsed_response|
931
+ end
932
+
933
+ # Waiting for response.
934
+ @client.get_long_running_operation_result(response, deserialize_method)
935
+ end
936
+
937
+ promise
938
+ end
939
+
940
+ #
941
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
942
+ # them to a new node, and powers them back on.
943
+ #
944
+ # @param resource_group_name [String] The name of the resource group.
945
+ # @param vm_scale_set_name [String] The name of the VM scale set.
946
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
947
+ # virtual machine instance IDs from the VM scale set.
948
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
949
+ # will be added to the HTTP request.
950
+ #
951
+ def redeploy(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
952
+ response = redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
953
+ nil
954
+ end
955
+
956
+ #
957
+ # @param resource_group_name [String] The name of the resource group.
958
+ # @param vm_scale_set_name [String] The name of the VM scale set.
959
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
960
+ # virtual machine instance IDs from the VM scale set.
961
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
962
+ # will be added to the HTTP request.
963
+ #
964
+ # @return [Concurrent::Promise] promise which provides async access to http
965
+ # response.
966
+ #
967
+ def redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
968
+ # Send request
969
+ promise = begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
970
+
971
+ promise = promise.then do |response|
972
+ # Defining deserialization method.
973
+ deserialize_method = lambda do |parsed_response|
974
+ end
975
+
976
+ # Waiting for response.
977
+ @client.get_long_running_operation_result(response, deserialize_method)
978
+ end
979
+
980
+ promise
981
+ end
982
+
983
+ #
984
+ # Perform maintenance on one or more virtual machines in a VM scale set.
985
+ # Operation on instances which are not eligible for perform maintenance will be
986
+ # failed. Please refer to best practices for more details:
987
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
988
+ #
989
+ # @param resource_group_name [String] The name of the resource group.
990
+ # @param vm_scale_set_name [String] The name of the VM scale set.
991
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
992
+ # virtual machine instance IDs from the VM scale set.
993
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
994
+ # will be added to the HTTP request.
995
+ #
996
+ def perform_maintenance(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
997
+ response = perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
998
+ nil
999
+ end
1000
+
1001
+ #
1002
+ # @param resource_group_name [String] The name of the resource group.
1003
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1004
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1005
+ # virtual machine instance IDs from the VM scale set.
1006
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1007
+ # will be added to the HTTP request.
1008
+ #
1009
+ # @return [Concurrent::Promise] promise which provides async access to http
1010
+ # response.
1011
+ #
1012
+ def perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1013
+ # Send request
1014
+ promise = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
1015
+
1016
+ promise = promise.then do |response|
1017
+ # Defining deserialization method.
1018
+ deserialize_method = lambda do |parsed_response|
1019
+ end
1020
+
1021
+ # Waiting for response.
1022
+ @client.get_long_running_operation_result(response, deserialize_method)
1023
+ end
1024
+
1025
+ promise
1026
+ end
1027
+
1028
+ #
1029
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
1030
+ # set model.
1031
+ #
1032
+ # @param resource_group_name [String] The name of the resource group.
1033
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1034
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1035
+ # of virtual machine instance IDs from the VM scale set.
1036
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1037
+ # will be added to the HTTP request.
1038
+ #
1039
+ def update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1040
+ response = update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
1041
+ nil
1042
+ end
1043
+
1044
+ #
1045
+ # @param resource_group_name [String] The name of the resource group.
1046
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1047
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1048
+ # of virtual machine instance IDs from the VM scale set.
1049
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1050
+ # will be added to the HTTP request.
1051
+ #
1052
+ # @return [Concurrent::Promise] promise which provides async access to http
1053
+ # response.
1054
+ #
1055
+ def update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1056
+ # Send request
1057
+ promise = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers)
1058
+
1059
+ promise = promise.then do |response|
1060
+ # Defining deserialization method.
1061
+ deserialize_method = lambda do |parsed_response|
1062
+ end
1063
+
1064
+ # Waiting for response.
1065
+ @client.get_long_running_operation_result(response, deserialize_method)
1066
+ end
1067
+
1068
+ promise
1069
+ end
1070
+
1071
+ #
1072
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
1073
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
1074
+ # a ephemeral OS disk the virtual machine is reset to initial state.
1075
+ #
1076
+ # @param resource_group_name [String] The name of the resource group.
1077
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1078
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
1079
+ # Parameters for Reimaging VM ScaleSet.
1080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1081
+ # will be added to the HTTP request.
1082
+ #
1083
+ def reimage(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
1084
+ response = reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
1085
+ nil
1086
+ end
1087
+
1088
+ #
1089
+ # @param resource_group_name [String] The name of the resource group.
1090
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1091
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
1092
+ # Parameters for Reimaging VM ScaleSet.
1093
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1094
+ # will be added to the HTTP request.
1095
+ #
1096
+ # @return [Concurrent::Promise] promise which provides async access to http
1097
+ # response.
1098
+ #
1099
+ def reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
1100
+ # Send request
1101
+ promise = begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers)
1102
+
1103
+ promise = promise.then do |response|
1104
+ # Defining deserialization method.
1105
+ deserialize_method = lambda do |parsed_response|
1106
+ end
1107
+
1108
+ # Waiting for response.
1109
+ @client.get_long_running_operation_result(response, deserialize_method)
1110
+ end
1111
+
1112
+ promise
1113
+ end
1114
+
1115
+ #
1116
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
1117
+ # VM scale set. This operation is only supported for managed disks.
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 vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1122
+ # virtual machine instance IDs from the VM scale set.
1123
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1124
+ # will be added to the HTTP request.
1125
+ #
1126
+ def reimage_all(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1127
+ response = reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
1128
+ nil
1129
+ end
1130
+
1131
+ #
1132
+ # @param resource_group_name [String] The name of the resource group.
1133
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1134
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1135
+ # virtual machine instance IDs from the VM scale set.
1136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1137
+ # will be added to the HTTP request.
1138
+ #
1139
+ # @return [Concurrent::Promise] promise which provides async access to http
1140
+ # response.
1141
+ #
1142
+ def reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1143
+ # Send request
1144
+ promise = begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
1145
+
1146
+ promise = promise.then do |response|
1147
+ # Defining deserialization method.
1148
+ deserialize_method = lambda do |parsed_response|
1149
+ end
1150
+
1151
+ # Waiting for response.
1152
+ @client.get_long_running_operation_result(response, deserialize_method)
1153
+ end
1154
+
1155
+ promise
1156
+ end
1157
+
1158
+ #
1159
+ # Manual platform update domain walk to update virtual machines in a service
1160
+ # fabric virtual machine scale set.
1161
+ #
1162
+ # @param resource_group_name [String] The name of the resource group.
1163
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1164
+ # @param platform_update_domain [Integer] The platform update domain for which
1165
+ # a manual recovery walk is requested
1166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1167
+ # will be added to the HTTP request.
1168
+ #
1169
+ # @return [RecoveryWalkResponse] operation results.
1170
+ #
1171
+ def force_recovery_service_fabric_platform_update_domain_walk(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
1172
+ response = force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:custom_headers).value!
1173
+ response.body unless response.nil?
1174
+ end
1175
+
1176
+ #
1177
+ # Manual platform update domain walk to update virtual machines in a service
1178
+ # fabric virtual machine scale set.
1179
+ #
1180
+ # @param resource_group_name [String] The name of the resource group.
1181
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1182
+ # @param platform_update_domain [Integer] The platform update domain for which
1183
+ # a manual recovery walk is requested
1184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1185
+ # will be added to the HTTP request.
1186
+ #
1187
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1188
+ #
1189
+ def force_recovery_service_fabric_platform_update_domain_walk_with_http_info(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
1190
+ force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:custom_headers).value!
1191
+ end
1192
+
1193
+ #
1194
+ # Manual platform update domain walk to update virtual machines in a service
1195
+ # fabric virtual machine scale set.
1196
+ #
1197
+ # @param resource_group_name [String] The name of the resource group.
1198
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1199
+ # @param platform_update_domain [Integer] The platform update domain for which
1200
+ # a manual recovery walk is requested
1201
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1202
+ # to the HTTP request.
1203
+ #
1204
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1205
+ #
1206
+ def force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
1207
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1208
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1209
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1210
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1211
+ fail ArgumentError, 'platform_update_domain is nil' if platform_update_domain.nil?
1212
+
1213
+
1214
+ request_headers = {}
1215
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1216
+
1217
+ # Set Headers
1218
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1219
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1220
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'
1221
+
1222
+ request_url = @base_url || @client.base_url
1223
+
1224
+ options = {
1225
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1226
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1227
+ query_params: {'api-version' => @client.api_version,'platformUpdateDomain' => platform_update_domain},
1228
+ headers: request_headers.merge(custom_headers || {}),
1229
+ base_url: request_url
1230
+ }
1231
+ promise = @client.make_request_async(:post, path_template, options)
1232
+
1233
+ promise = promise.then do |result|
1234
+ http_response = result.response
1235
+ status_code = http_response.status
1236
+ response_content = http_response.body
1237
+ unless status_code == 200
1238
+ error_model = JSON.load(response_content)
1239
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1240
+ end
1241
+
1242
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1243
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1244
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1245
+ # Deserialize Response
1246
+ if status_code == 200
1247
+ begin
1248
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1249
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::RecoveryWalkResponse.mapper()
1250
+ result.body = @client.deserialize(result_mapper, parsed_response)
1251
+ rescue Exception => e
1252
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1253
+ end
1254
+ end
1255
+
1256
+ result
1257
+ end
1258
+
1259
+ promise.execute
1260
+ end
1261
+
1262
+ #
1263
+ # Converts SinglePlacementGroup property to false for a existing virtual
1264
+ # machine scale set.
1265
+ #
1266
+ # @param resource_group_name [String] The name of the resource group.
1267
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1268
+ # to create or update.
1269
+ # @param parameters [VMScaleSetConvertToSinglePlacementGroupInput] The input
1270
+ # object for ConvertToSinglePlacementGroup API.
1271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1272
+ # will be added to the HTTP request.
1273
+ #
1274
+ #
1275
+ def convert_to_single_placement_group(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1276
+ response = convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1277
+ nil
1278
+ end
1279
+
1280
+ #
1281
+ # Converts SinglePlacementGroup property to false for a existing virtual
1282
+ # machine scale set.
1283
+ #
1284
+ # @param resource_group_name [String] The name of the resource group.
1285
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1286
+ # to create or update.
1287
+ # @param parameters [VMScaleSetConvertToSinglePlacementGroupInput] The input
1288
+ # object for ConvertToSinglePlacementGroup API.
1289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1290
+ # will be added to the HTTP request.
1291
+ #
1292
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1293
+ #
1294
+ def convert_to_single_placement_group_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1295
+ convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1296
+ end
1297
+
1298
+ #
1299
+ # Converts SinglePlacementGroup property to false for a existing virtual
1300
+ # machine scale set.
1301
+ #
1302
+ # @param resource_group_name [String] The name of the resource group.
1303
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1304
+ # to create or update.
1305
+ # @param parameters [VMScaleSetConvertToSinglePlacementGroupInput] The input
1306
+ # object for ConvertToSinglePlacementGroup API.
1307
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1308
+ # to the HTTP request.
1309
+ #
1310
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1311
+ #
1312
+ def convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1313
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1314
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1315
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1316
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1317
+
1318
+
1319
+ request_headers = {}
1320
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1321
+
1322
+ # Set Headers
1323
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1324
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1325
+
1326
+ # Serialize Request
1327
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VMScaleSetConvertToSinglePlacementGroupInput.mapper()
1328
+ request_content = @client.serialize(request_mapper, parameters)
1329
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1330
+
1331
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup'
1332
+
1333
+ request_url = @base_url || @client.base_url
1334
+
1335
+ options = {
1336
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1337
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1338
+ body: request_content,
1339
+ headers: request_headers.merge(custom_headers || {}),
1340
+ base_url: request_url
1341
+ }
1342
+ promise = @client.make_request_async(:post, path_template, options)
1343
+
1344
+ promise = promise.then do |result|
1345
+ http_response = result.response
1346
+ status_code = http_response.status
1347
+ response_content = http_response.body
1348
+ unless status_code == 200
1349
+ error_model = JSON.load(response_content)
1350
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1351
+ end
1352
+
1353
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1354
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1355
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1356
+
1357
+ result
1358
+ end
1359
+
1360
+ promise.execute
1361
+ end
1362
+
1363
+ #
1364
+ # Changes ServiceState property for a given service
1365
+ #
1366
+ # @param resource_group_name [String] The name of the resource group.
1367
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1368
+ # to create or update.
1369
+ # @param parameters [OrchestrationServiceStateInput] The input object for
1370
+ # SetOrchestrationServiceState API.
1371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1372
+ # will be added to the HTTP request.
1373
+ #
1374
+ def set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1375
+ response = set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1376
+ nil
1377
+ end
1378
+
1379
+ #
1380
+ # @param resource_group_name [String] The name of the resource group.
1381
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1382
+ # to create or update.
1383
+ # @param parameters [OrchestrationServiceStateInput] The input object for
1384
+ # SetOrchestrationServiceState API.
1385
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1386
+ # will be added to the HTTP request.
1387
+ #
1388
+ # @return [Concurrent::Promise] promise which provides async access to http
1389
+ # response.
1390
+ #
1391
+ def set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1392
+ # Send request
1393
+ promise = begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers)
1394
+
1395
+ promise = promise.then do |response|
1396
+ # Defining deserialization method.
1397
+ deserialize_method = lambda do |parsed_response|
1398
+ end
1399
+
1400
+ # Waiting for response.
1401
+ @client.get_long_running_operation_result(response, deserialize_method)
1402
+ end
1403
+
1404
+ promise
1405
+ end
1406
+
1407
+ #
1408
+ # Create or update a VM scale set.
1409
+ #
1410
+ # @param resource_group_name [String] The name of the resource group.
1411
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1412
+ # update.
1413
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
1414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1415
+ # will be added to the HTTP request.
1416
+ #
1417
+ # @return [VirtualMachineScaleSet] operation results.
1418
+ #
1419
+ def begin_create_or_update(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1420
+ response = begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1421
+ response.body unless response.nil?
1422
+ end
1423
+
1424
+ #
1425
+ # Create or update a VM scale set.
1426
+ #
1427
+ # @param resource_group_name [String] The name of the resource group.
1428
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1429
+ # update.
1430
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
1431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1432
+ # will be added to the HTTP request.
1433
+ #
1434
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1435
+ #
1436
+ def begin_create_or_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1437
+ begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1438
+ end
1439
+
1440
+ #
1441
+ # Create or update a VM scale set.
1442
+ #
1443
+ # @param resource_group_name [String] The name of the resource group.
1444
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1445
+ # update.
1446
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
1447
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1448
+ # to the HTTP request.
1449
+ #
1450
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1451
+ #
1452
+ def begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1453
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1454
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1455
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1456
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1457
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1458
+
1459
+
1460
+ request_headers = {}
1461
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1462
+
1463
+ # Set Headers
1464
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1465
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1466
+
1467
+ # Serialize Request
1468
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
1469
+ request_content = @client.serialize(request_mapper, parameters)
1470
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1471
+
1472
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
1473
+
1474
+ request_url = @base_url || @client.base_url
1475
+
1476
+ options = {
1477
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1478
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1479
+ query_params: {'api-version' => @client.api_version},
1480
+ body: request_content,
1481
+ headers: request_headers.merge(custom_headers || {}),
1482
+ base_url: request_url
1483
+ }
1484
+ promise = @client.make_request_async(:put, path_template, options)
1485
+
1486
+ promise = promise.then do |result|
1487
+ http_response = result.response
1488
+ status_code = http_response.status
1489
+ response_content = http_response.body
1490
+ unless status_code == 200 || status_code == 201
1491
+ error_model = JSON.load(response_content)
1492
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1493
+ end
1494
+
1495
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1496
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1497
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1498
+ # Deserialize Response
1499
+ if status_code == 200
1500
+ begin
1501
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1502
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
1503
+ result.body = @client.deserialize(result_mapper, parsed_response)
1504
+ rescue Exception => e
1505
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1506
+ end
1507
+ end
1508
+ # Deserialize Response
1509
+ if status_code == 201
1510
+ begin
1511
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1512
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
1513
+ result.body = @client.deserialize(result_mapper, parsed_response)
1514
+ rescue Exception => e
1515
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1516
+ end
1517
+ end
1518
+
1519
+ result
1520
+ end
1521
+
1522
+ promise.execute
1523
+ end
1524
+
1525
+ #
1526
+ # Update a VM scale set.
1527
+ #
1528
+ # @param resource_group_name [String] The name of the resource group.
1529
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1530
+ # update.
1531
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
1532
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1533
+ # will be added to the HTTP request.
1534
+ #
1535
+ # @return [VirtualMachineScaleSet] operation results.
1536
+ #
1537
+ def begin_update(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1538
+ response = begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1539
+ response.body unless response.nil?
1540
+ end
1541
+
1542
+ #
1543
+ # Update a VM scale set.
1544
+ #
1545
+ # @param resource_group_name [String] The name of the resource group.
1546
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1547
+ # update.
1548
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
1549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1550
+ # will be added to the HTTP request.
1551
+ #
1552
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1553
+ #
1554
+ def begin_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1555
+ begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1556
+ end
1557
+
1558
+ #
1559
+ # Update a VM scale set.
1560
+ #
1561
+ # @param resource_group_name [String] The name of the resource group.
1562
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1563
+ # update.
1564
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
1565
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1566
+ # to the HTTP request.
1567
+ #
1568
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1569
+ #
1570
+ def begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1571
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1572
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1573
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1574
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1575
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1576
+
1577
+
1578
+ request_headers = {}
1579
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1580
+
1581
+ # Set Headers
1582
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1583
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1584
+
1585
+ # Serialize Request
1586
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetUpdate.mapper()
1587
+ request_content = @client.serialize(request_mapper, parameters)
1588
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1589
+
1590
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
1591
+
1592
+ request_url = @base_url || @client.base_url
1593
+
1594
+ options = {
1595
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1596
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1597
+ query_params: {'api-version' => @client.api_version},
1598
+ body: request_content,
1599
+ headers: request_headers.merge(custom_headers || {}),
1600
+ base_url: request_url
1601
+ }
1602
+ promise = @client.make_request_async(:patch, path_template, options)
1603
+
1604
+ promise = promise.then do |result|
1605
+ http_response = result.response
1606
+ status_code = http_response.status
1607
+ response_content = http_response.body
1608
+ unless status_code == 200
1609
+ error_model = JSON.load(response_content)
1610
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1611
+ end
1612
+
1613
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1614
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1615
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1616
+ # Deserialize Response
1617
+ if status_code == 200
1618
+ begin
1619
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1620
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSet.mapper()
1621
+ result.body = @client.deserialize(result_mapper, parsed_response)
1622
+ rescue Exception => e
1623
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1624
+ end
1625
+ end
1626
+
1627
+ result
1628
+ end
1629
+
1630
+ promise.execute
1631
+ end
1632
+
1633
+ #
1634
+ # Deletes a VM scale set.
1635
+ #
1636
+ # @param resource_group_name [String] The name of the resource group.
1637
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1638
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1639
+ # will be added to the HTTP request.
1640
+ #
1641
+ #
1642
+ def begin_delete(resource_group_name, vm_scale_set_name, custom_headers:nil)
1643
+ response = begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
1644
+ nil
1645
+ end
1646
+
1647
+ #
1648
+ # Deletes a VM scale set.
1649
+ #
1650
+ # @param resource_group_name [String] The name of the resource group.
1651
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1653
+ # will be added to the HTTP request.
1654
+ #
1655
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1656
+ #
1657
+ def begin_delete_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
1658
+ begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
1659
+ end
1660
+
1661
+ #
1662
+ # Deletes a VM scale set.
1663
+ #
1664
+ # @param resource_group_name [String] The name of the resource group.
1665
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1666
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1667
+ # to the HTTP request.
1668
+ #
1669
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1670
+ #
1671
+ def begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
1672
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1673
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1674
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1675
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1676
+
1677
+
1678
+ request_headers = {}
1679
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1680
+
1681
+ # Set Headers
1682
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1683
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1684
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
1685
+
1686
+ request_url = @base_url || @client.base_url
1687
+
1688
+ options = {
1689
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1690
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1691
+ query_params: {'api-version' => @client.api_version},
1692
+ headers: request_headers.merge(custom_headers || {}),
1693
+ base_url: request_url
1694
+ }
1695
+ promise = @client.make_request_async(:delete, path_template, options)
1696
+
1697
+ promise = promise.then do |result|
1698
+ http_response = result.response
1699
+ status_code = http_response.status
1700
+ response_content = http_response.body
1701
+ unless status_code == 200 || status_code == 202 || status_code == 204
1702
+ error_model = JSON.load(response_content)
1703
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1704
+ end
1705
+
1706
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1707
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1708
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1709
+
1710
+ result
1711
+ end
1712
+
1713
+ promise.execute
1714
+ end
1715
+
1716
+ #
1717
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
1718
+ # virtual machines and releases the compute resources. You are not billed for
1719
+ # the compute resources that this virtual machine scale set deallocates.
1720
+ #
1721
+ # @param resource_group_name [String] The name of the resource group.
1722
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1723
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1724
+ # virtual machine instance IDs from the VM scale set.
1725
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1726
+ # will be added to the HTTP request.
1727
+ #
1728
+ #
1729
+ def begin_deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1730
+ response = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
1731
+ nil
1732
+ end
1733
+
1734
+ #
1735
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
1736
+ # virtual machines and releases the compute resources. You are not billed for
1737
+ # the compute resources that this virtual machine scale set deallocates.
1738
+ #
1739
+ # @param resource_group_name [String] The name of the resource group.
1740
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1741
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1742
+ # virtual machine instance IDs from the VM scale set.
1743
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1744
+ # will be added to the HTTP request.
1745
+ #
1746
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1747
+ #
1748
+ def begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1749
+ begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
1750
+ end
1751
+
1752
+ #
1753
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
1754
+ # virtual machines and releases the compute resources. You are not billed for
1755
+ # the compute resources that this virtual machine scale set deallocates.
1756
+ #
1757
+ # @param resource_group_name [String] The name of the resource group.
1758
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1759
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1760
+ # virtual machine instance IDs from the VM scale set.
1761
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1762
+ # to the HTTP request.
1763
+ #
1764
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1765
+ #
1766
+ def begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1767
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1768
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1769
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1770
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1771
+
1772
+
1773
+ request_headers = {}
1774
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1775
+
1776
+ # Set Headers
1777
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1778
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1779
+
1780
+ # Serialize Request
1781
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
1782
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
1783
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1784
+
1785
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'
1786
+
1787
+ request_url = @base_url || @client.base_url
1788
+
1789
+ options = {
1790
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1791
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1792
+ query_params: {'api-version' => @client.api_version},
1793
+ body: request_content,
1794
+ headers: request_headers.merge(custom_headers || {}),
1795
+ base_url: request_url
1796
+ }
1797
+ promise = @client.make_request_async(:post, path_template, options)
1798
+
1799
+ promise = promise.then do |result|
1800
+ http_response = result.response
1801
+ status_code = http_response.status
1802
+ response_content = http_response.body
1803
+ unless status_code == 200 || status_code == 202
1804
+ error_model = JSON.load(response_content)
1805
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1806
+ end
1807
+
1808
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1809
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1810
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1811
+
1812
+ result
1813
+ end
1814
+
1815
+ promise.execute
1816
+ end
1817
+
1818
+ #
1819
+ # Deletes virtual machines in a VM scale set.
1820
+ #
1821
+ # @param resource_group_name [String] The name of the resource group.
1822
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1823
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1824
+ # of virtual machine instance IDs from the VM scale set.
1825
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1826
+ # will be added to the HTTP request.
1827
+ #
1828
+ #
1829
+ def begin_delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1830
+ response = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
1831
+ nil
1832
+ end
1833
+
1834
+ #
1835
+ # Deletes virtual machines in a VM scale set.
1836
+ #
1837
+ # @param resource_group_name [String] The name of the resource group.
1838
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1839
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1840
+ # of virtual machine instance IDs from the VM scale set.
1841
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1842
+ # will be added to the HTTP request.
1843
+ #
1844
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1845
+ #
1846
+ def begin_delete_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1847
+ begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
1848
+ end
1849
+
1850
+ #
1851
+ # Deletes virtual machines in a VM scale set.
1852
+ #
1853
+ # @param resource_group_name [String] The name of the resource group.
1854
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1855
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1856
+ # of virtual machine instance IDs from the VM scale set.
1857
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1858
+ # to the HTTP request.
1859
+ #
1860
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1861
+ #
1862
+ def begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1863
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1864
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1865
+ fail ArgumentError, 'vm_instance_ids is nil' if vm_instance_ids.nil?
1866
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1867
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1868
+
1869
+
1870
+ request_headers = {}
1871
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1872
+
1873
+ # Set Headers
1874
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1875
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1876
+
1877
+ # Serialize Request
1878
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
1879
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
1880
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1881
+
1882
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'
1883
+
1884
+ request_url = @base_url || @client.base_url
1885
+
1886
+ options = {
1887
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1888
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1889
+ query_params: {'api-version' => @client.api_version},
1890
+ body: request_content,
1891
+ headers: request_headers.merge(custom_headers || {}),
1892
+ base_url: request_url
1893
+ }
1894
+ promise = @client.make_request_async(:post, path_template, options)
1895
+
1896
+ promise = promise.then do |result|
1897
+ http_response = result.response
1898
+ status_code = http_response.status
1899
+ response_content = http_response.body
1900
+ unless status_code == 200 || status_code == 202
1901
+ error_model = JSON.load(response_content)
1902
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1903
+ end
1904
+
1905
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1906
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1907
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1908
+
1909
+ result
1910
+ end
1911
+
1912
+ promise.execute
1913
+ end
1914
+
1915
+ #
1916
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
1917
+ # resources are still attached and you are getting charged for the resources.
1918
+ # Instead, use deallocate to release resources and avoid charges.
1919
+ #
1920
+ # @param resource_group_name [String] The name of the resource group.
1921
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1922
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1923
+ # virtual machine instance IDs from the VM scale set.
1924
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1925
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1926
+ # false indicates otherwise. Default value for this flag is false if not
1927
+ # specified
1928
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1929
+ # will be added to the HTTP request.
1930
+ #
1931
+ #
1932
+ def begin_power_off(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
1933
+ response = begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
1934
+ nil
1935
+ end
1936
+
1937
+ #
1938
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
1939
+ # resources are still attached and you are getting charged for the resources.
1940
+ # Instead, use deallocate to release resources and avoid charges.
1941
+ #
1942
+ # @param resource_group_name [String] The name of the resource group.
1943
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1944
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1945
+ # virtual machine instance IDs from the VM scale set.
1946
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1947
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1948
+ # false indicates otherwise. Default value for this flag is false if not
1949
+ # specified
1950
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1951
+ # will be added to the HTTP request.
1952
+ #
1953
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1954
+ #
1955
+ def begin_power_off_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
1956
+ begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
1957
+ end
1958
+
1959
+ #
1960
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
1961
+ # resources are still attached and you are getting charged for the resources.
1962
+ # Instead, use deallocate to release resources and avoid charges.
1963
+ #
1964
+ # @param resource_group_name [String] The name of the resource group.
1965
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1966
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1967
+ # virtual machine instance IDs from the VM scale set.
1968
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1969
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1970
+ # false indicates otherwise. Default value for this flag is false if not
1971
+ # specified
1972
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1973
+ # to the HTTP request.
1974
+ #
1975
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1976
+ #
1977
+ def begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
1978
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1979
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1980
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1981
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1982
+
1983
+
1984
+ request_headers = {}
1985
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1986
+
1987
+ # Set Headers
1988
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1989
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1990
+
1991
+ # Serialize Request
1992
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
1993
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
1994
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1995
+
1996
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'
1997
+
1998
+ request_url = @base_url || @client.base_url
1999
+
2000
+ options = {
2001
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2002
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2003
+ query_params: {'skipShutdown' => skip_shutdown,'api-version' => @client.api_version},
2004
+ body: request_content,
2005
+ headers: request_headers.merge(custom_headers || {}),
2006
+ base_url: request_url
2007
+ }
2008
+ promise = @client.make_request_async(:post, path_template, options)
2009
+
2010
+ promise = promise.then do |result|
2011
+ http_response = result.response
2012
+ status_code = http_response.status
2013
+ response_content = http_response.body
2014
+ unless status_code == 200 || status_code == 202
2015
+ error_model = JSON.load(response_content)
2016
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2017
+ end
2018
+
2019
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2020
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2021
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2022
+
2023
+ result
2024
+ end
2025
+
2026
+ promise.execute
2027
+ end
2028
+
2029
+ #
2030
+ # Restarts one or more virtual machines in a VM scale set.
2031
+ #
2032
+ # @param resource_group_name [String] The name of the resource group.
2033
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2034
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2035
+ # virtual machine instance IDs from the VM scale set.
2036
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2037
+ # will be added to the HTTP request.
2038
+ #
2039
+ #
2040
+ def begin_restart(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2041
+ response = begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2042
+ nil
2043
+ end
2044
+
2045
+ #
2046
+ # Restarts one or more virtual machines in a VM scale set.
2047
+ #
2048
+ # @param resource_group_name [String] The name of the resource group.
2049
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2050
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2051
+ # virtual machine instance IDs from the VM scale set.
2052
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2053
+ # will be added to the HTTP request.
2054
+ #
2055
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2056
+ #
2057
+ def begin_restart_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2058
+ begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2059
+ end
2060
+
2061
+ #
2062
+ # Restarts one or more virtual machines in a VM scale set.
2063
+ #
2064
+ # @param resource_group_name [String] The name of the resource group.
2065
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2066
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2067
+ # virtual machine instance IDs from the VM scale set.
2068
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2069
+ # to the HTTP request.
2070
+ #
2071
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2072
+ #
2073
+ def begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2074
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2075
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2076
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2077
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2078
+
2079
+
2080
+ request_headers = {}
2081
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2082
+
2083
+ # Set Headers
2084
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2085
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2086
+
2087
+ # Serialize Request
2088
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2089
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2090
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2091
+
2092
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'
2093
+
2094
+ request_url = @base_url || @client.base_url
2095
+
2096
+ options = {
2097
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2098
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2099
+ query_params: {'api-version' => @client.api_version},
2100
+ body: request_content,
2101
+ headers: request_headers.merge(custom_headers || {}),
2102
+ base_url: request_url
2103
+ }
2104
+ promise = @client.make_request_async(:post, path_template, options)
2105
+
2106
+ promise = promise.then do |result|
2107
+ http_response = result.response
2108
+ status_code = http_response.status
2109
+ response_content = http_response.body
2110
+ unless status_code == 200 || status_code == 202
2111
+ error_model = JSON.load(response_content)
2112
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2113
+ end
2114
+
2115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2116
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2117
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2118
+
2119
+ result
2120
+ end
2121
+
2122
+ promise.execute
2123
+ end
2124
+
2125
+ #
2126
+ # Starts one or more virtual machines in a VM scale set.
2127
+ #
2128
+ # @param resource_group_name [String] The name of the resource group.
2129
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2130
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2131
+ # virtual machine instance IDs from the VM scale set.
2132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2133
+ # will be added to the HTTP request.
2134
+ #
2135
+ #
2136
+ def begin_start(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2137
+ response = begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2138
+ nil
2139
+ end
2140
+
2141
+ #
2142
+ # Starts one or more virtual machines in a VM scale set.
2143
+ #
2144
+ # @param resource_group_name [String] The name of the resource group.
2145
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2146
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2147
+ # virtual machine instance IDs from the VM scale set.
2148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2149
+ # will be added to the HTTP request.
2150
+ #
2151
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2152
+ #
2153
+ def begin_start_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2154
+ begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2155
+ end
2156
+
2157
+ #
2158
+ # Starts one or more virtual machines in a VM scale set.
2159
+ #
2160
+ # @param resource_group_name [String] The name of the resource group.
2161
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2162
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2163
+ # virtual machine instance IDs from the VM scale set.
2164
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2165
+ # to the HTTP request.
2166
+ #
2167
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2168
+ #
2169
+ def begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2171
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2172
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2174
+
2175
+
2176
+ request_headers = {}
2177
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2178
+
2179
+ # Set Headers
2180
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2181
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2182
+
2183
+ # Serialize Request
2184
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2185
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2186
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2187
+
2188
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'
2189
+
2190
+ request_url = @base_url || @client.base_url
2191
+
2192
+ options = {
2193
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2194
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2195
+ query_params: {'api-version' => @client.api_version},
2196
+ body: request_content,
2197
+ headers: request_headers.merge(custom_headers || {}),
2198
+ base_url: request_url
2199
+ }
2200
+ promise = @client.make_request_async(:post, path_template, options)
2201
+
2202
+ promise = promise.then do |result|
2203
+ http_response = result.response
2204
+ status_code = http_response.status
2205
+ response_content = http_response.body
2206
+ unless status_code == 200 || status_code == 202
2207
+ error_model = JSON.load(response_content)
2208
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2209
+ end
2210
+
2211
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2212
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2213
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2214
+
2215
+ result
2216
+ end
2217
+
2218
+ promise.execute
2219
+ end
2220
+
2221
+ #
2222
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
2223
+ # them to a new node, and powers them back on.
2224
+ #
2225
+ # @param resource_group_name [String] The name of the resource group.
2226
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2227
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2228
+ # virtual machine instance IDs from the VM scale set.
2229
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2230
+ # will be added to the HTTP request.
2231
+ #
2232
+ #
2233
+ def begin_redeploy(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2234
+ response = begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2235
+ nil
2236
+ end
2237
+
2238
+ #
2239
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
2240
+ # them to a new node, and powers them back on.
2241
+ #
2242
+ # @param resource_group_name [String] The name of the resource group.
2243
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2244
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2245
+ # virtual machine instance IDs from the VM scale set.
2246
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2247
+ # will be added to the HTTP request.
2248
+ #
2249
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2250
+ #
2251
+ def begin_redeploy_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2252
+ begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2253
+ end
2254
+
2255
+ #
2256
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
2257
+ # them to a new node, and powers them back on.
2258
+ #
2259
+ # @param resource_group_name [String] The name of the resource group.
2260
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2261
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2262
+ # virtual machine instance IDs from the VM scale set.
2263
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2264
+ # to the HTTP request.
2265
+ #
2266
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2267
+ #
2268
+ def begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2269
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2270
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2271
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2272
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2273
+
2274
+
2275
+ request_headers = {}
2276
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2277
+
2278
+ # Set Headers
2279
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2280
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2281
+
2282
+ # Serialize Request
2283
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2284
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2285
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2286
+
2287
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'
2288
+
2289
+ request_url = @base_url || @client.base_url
2290
+
2291
+ options = {
2292
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2293
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2294
+ query_params: {'api-version' => @client.api_version},
2295
+ body: request_content,
2296
+ headers: request_headers.merge(custom_headers || {}),
2297
+ base_url: request_url
2298
+ }
2299
+ promise = @client.make_request_async(:post, path_template, options)
2300
+
2301
+ promise = promise.then do |result|
2302
+ http_response = result.response
2303
+ status_code = http_response.status
2304
+ response_content = http_response.body
2305
+ unless status_code == 200 || status_code == 202
2306
+ error_model = JSON.load(response_content)
2307
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2308
+ end
2309
+
2310
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2311
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2312
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2313
+
2314
+ result
2315
+ end
2316
+
2317
+ promise.execute
2318
+ end
2319
+
2320
+ #
2321
+ # Perform maintenance on one or more virtual machines in a VM scale set.
2322
+ # Operation on instances which are not eligible for perform maintenance will be
2323
+ # failed. Please refer to best practices for more details:
2324
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
2325
+ #
2326
+ # @param resource_group_name [String] The name of the resource group.
2327
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2328
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2329
+ # virtual machine instance IDs from the VM scale set.
2330
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2331
+ # will be added to the HTTP request.
2332
+ #
2333
+ #
2334
+ def begin_perform_maintenance(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2335
+ response = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2336
+ nil
2337
+ end
2338
+
2339
+ #
2340
+ # Perform maintenance on one or more virtual machines in a VM scale set.
2341
+ # Operation on instances which are not eligible for perform maintenance will be
2342
+ # failed. Please refer to best practices for more details:
2343
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
2344
+ #
2345
+ # @param resource_group_name [String] The name of the resource group.
2346
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2347
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2348
+ # virtual machine instance IDs from the VM scale set.
2349
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2350
+ # will be added to the HTTP request.
2351
+ #
2352
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2353
+ #
2354
+ def begin_perform_maintenance_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2355
+ begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2356
+ end
2357
+
2358
+ #
2359
+ # Perform maintenance on one or more virtual machines in a VM scale set.
2360
+ # Operation on instances which are not eligible for perform maintenance will be
2361
+ # failed. Please refer to best practices for more details:
2362
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
2363
+ #
2364
+ # @param resource_group_name [String] The name of the resource group.
2365
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2366
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2367
+ # virtual machine instance IDs from the VM scale set.
2368
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2369
+ # to the HTTP request.
2370
+ #
2371
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2372
+ #
2373
+ def begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2374
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2375
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2376
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2377
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2378
+
2379
+
2380
+ request_headers = {}
2381
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2382
+
2383
+ # Set Headers
2384
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2385
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2386
+
2387
+ # Serialize Request
2388
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2389
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2390
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2391
+
2392
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'
2393
+
2394
+ request_url = @base_url || @client.base_url
2395
+
2396
+ options = {
2397
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2398
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2399
+ query_params: {'api-version' => @client.api_version},
2400
+ body: request_content,
2401
+ headers: request_headers.merge(custom_headers || {}),
2402
+ base_url: request_url
2403
+ }
2404
+ promise = @client.make_request_async(:post, path_template, options)
2405
+
2406
+ promise = promise.then do |result|
2407
+ http_response = result.response
2408
+ status_code = http_response.status
2409
+ response_content = http_response.body
2410
+ unless status_code == 200 || status_code == 202
2411
+ error_model = JSON.load(response_content)
2412
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2413
+ end
2414
+
2415
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2416
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2417
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2418
+
2419
+ result
2420
+ end
2421
+
2422
+ promise.execute
2423
+ end
2424
+
2425
+ #
2426
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
2427
+ # set model.
2428
+ #
2429
+ # @param resource_group_name [String] The name of the resource group.
2430
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2431
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
2432
+ # of virtual machine instance IDs from the VM scale set.
2433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2434
+ # will be added to the HTTP request.
2435
+ #
2436
+ #
2437
+ def begin_update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
2438
+ response = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
2439
+ nil
2440
+ end
2441
+
2442
+ #
2443
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
2444
+ # set model.
2445
+ #
2446
+ # @param resource_group_name [String] The name of the resource group.
2447
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2448
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
2449
+ # of virtual machine instance IDs from the VM scale set.
2450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2451
+ # will be added to the HTTP request.
2452
+ #
2453
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2454
+ #
2455
+ def begin_update_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
2456
+ begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
2457
+ end
2458
+
2459
+ #
2460
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
2461
+ # set model.
2462
+ #
2463
+ # @param resource_group_name [String] The name of the resource group.
2464
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2465
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
2466
+ # of virtual machine instance IDs from the VM scale set.
2467
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2468
+ # to the HTTP request.
2469
+ #
2470
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2471
+ #
2472
+ def begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
2473
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2474
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2475
+ fail ArgumentError, 'vm_instance_ids is nil' if vm_instance_ids.nil?
2476
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2477
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2478
+
2479
+
2480
+ request_headers = {}
2481
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2482
+
2483
+ # Set Headers
2484
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2485
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2486
+
2487
+ # Serialize Request
2488
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
2489
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2490
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2491
+
2492
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'
2493
+
2494
+ request_url = @base_url || @client.base_url
2495
+
2496
+ options = {
2497
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2498
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2499
+ query_params: {'api-version' => @client.api_version},
2500
+ body: request_content,
2501
+ headers: request_headers.merge(custom_headers || {}),
2502
+ base_url: request_url
2503
+ }
2504
+ promise = @client.make_request_async(:post, path_template, options)
2505
+
2506
+ promise = promise.then do |result|
2507
+ http_response = result.response
2508
+ status_code = http_response.status
2509
+ response_content = http_response.body
2510
+ unless status_code == 200 || status_code == 202
2511
+ error_model = JSON.load(response_content)
2512
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2513
+ end
2514
+
2515
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2516
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2517
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2518
+
2519
+ result
2520
+ end
2521
+
2522
+ promise.execute
2523
+ end
2524
+
2525
+ #
2526
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
2527
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
2528
+ # a ephemeral OS disk the virtual machine is reset to initial state.
2529
+ #
2530
+ # @param resource_group_name [String] The name of the resource group.
2531
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2532
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
2533
+ # Parameters for Reimaging VM ScaleSet.
2534
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2535
+ # will be added to the HTTP request.
2536
+ #
2537
+ #
2538
+ def begin_reimage(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
2539
+ response = begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
2540
+ nil
2541
+ end
2542
+
2543
+ #
2544
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
2545
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
2546
+ # a ephemeral OS disk the virtual machine is reset to initial state.
2547
+ #
2548
+ # @param resource_group_name [String] The name of the resource group.
2549
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2550
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
2551
+ # Parameters for Reimaging VM ScaleSet.
2552
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2553
+ # will be added to the HTTP request.
2554
+ #
2555
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2556
+ #
2557
+ def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
2558
+ begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
2559
+ end
2560
+
2561
+ #
2562
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
2563
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
2564
+ # a ephemeral OS disk the virtual machine is reset to initial state.
2565
+ #
2566
+ # @param resource_group_name [String] The name of the resource group.
2567
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2568
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
2569
+ # Parameters for Reimaging VM ScaleSet.
2570
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2571
+ # to the HTTP request.
2572
+ #
2573
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2574
+ #
2575
+ def begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
2576
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2577
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2578
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2579
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2580
+
2581
+
2582
+ request_headers = {}
2583
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2584
+
2585
+ # Set Headers
2586
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2587
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2588
+
2589
+ # Serialize Request
2590
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetReimageParameters.mapper()
2591
+ request_content = @client.serialize(request_mapper, vm_scale_set_reimage_input)
2592
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2593
+
2594
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'
2595
+
2596
+ request_url = @base_url || @client.base_url
2597
+
2598
+ options = {
2599
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2600
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2601
+ query_params: {'api-version' => @client.api_version},
2602
+ body: request_content,
2603
+ headers: request_headers.merge(custom_headers || {}),
2604
+ base_url: request_url
2605
+ }
2606
+ promise = @client.make_request_async(:post, path_template, options)
2607
+
2608
+ promise = promise.then do |result|
2609
+ http_response = result.response
2610
+ status_code = http_response.status
2611
+ response_content = http_response.body
2612
+ unless status_code == 200 || status_code == 202
2613
+ error_model = JSON.load(response_content)
2614
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2615
+ end
2616
+
2617
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2618
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2619
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2620
+
2621
+ result
2622
+ end
2623
+
2624
+ promise.execute
2625
+ end
2626
+
2627
+ #
2628
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
2629
+ # VM scale set. This operation is only supported for managed disks.
2630
+ #
2631
+ # @param resource_group_name [String] The name of the resource group.
2632
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2633
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2634
+ # virtual machine instance IDs from the VM scale set.
2635
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2636
+ # will be added to the HTTP request.
2637
+ #
2638
+ #
2639
+ def begin_reimage_all(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2640
+ response = begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2641
+ nil
2642
+ end
2643
+
2644
+ #
2645
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
2646
+ # VM scale set. This operation is only supported for managed disks.
2647
+ #
2648
+ # @param resource_group_name [String] The name of the resource group.
2649
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2650
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2651
+ # virtual machine instance IDs from the VM scale set.
2652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2653
+ # will be added to the HTTP request.
2654
+ #
2655
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2656
+ #
2657
+ def begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2658
+ begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2659
+ end
2660
+
2661
+ #
2662
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
2663
+ # VM scale set. This operation is only supported for managed disks.
2664
+ #
2665
+ # @param resource_group_name [String] The name of the resource group.
2666
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2667
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2668
+ # virtual machine instance IDs from the VM scale set.
2669
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2670
+ # to the HTTP request.
2671
+ #
2672
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2673
+ #
2674
+ def begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2675
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2676
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2677
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2678
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2679
+
2680
+
2681
+ request_headers = {}
2682
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2683
+
2684
+ # Set Headers
2685
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2686
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2687
+
2688
+ # Serialize Request
2689
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2690
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2691
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2692
+
2693
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'
2694
+
2695
+ request_url = @base_url || @client.base_url
2696
+
2697
+ options = {
2698
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2699
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2700
+ query_params: {'api-version' => @client.api_version},
2701
+ body: request_content,
2702
+ headers: request_headers.merge(custom_headers || {}),
2703
+ base_url: request_url
2704
+ }
2705
+ promise = @client.make_request_async(:post, path_template, options)
2706
+
2707
+ promise = promise.then do |result|
2708
+ http_response = result.response
2709
+ status_code = http_response.status
2710
+ response_content = http_response.body
2711
+ unless status_code == 200 || status_code == 202
2712
+ error_model = JSON.load(response_content)
2713
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2714
+ end
2715
+
2716
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2717
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2718
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2719
+
2720
+ result
2721
+ end
2722
+
2723
+ promise.execute
2724
+ end
2725
+
2726
+ #
2727
+ # Changes ServiceState property for a given service
2728
+ #
2729
+ # @param resource_group_name [String] The name of the resource group.
2730
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
2731
+ # to create or update.
2732
+ # @param parameters [OrchestrationServiceStateInput] The input object for
2733
+ # SetOrchestrationServiceState API.
2734
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2735
+ # will be added to the HTTP request.
2736
+ #
2737
+ #
2738
+ def begin_set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
2739
+ response = begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
2740
+ nil
2741
+ end
2742
+
2743
+ #
2744
+ # Changes ServiceState property for a given service
2745
+ #
2746
+ # @param resource_group_name [String] The name of the resource group.
2747
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
2748
+ # to create or update.
2749
+ # @param parameters [OrchestrationServiceStateInput] The input object for
2750
+ # SetOrchestrationServiceState API.
2751
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2752
+ # will be added to the HTTP request.
2753
+ #
2754
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2755
+ #
2756
+ def begin_set_orchestration_service_state_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
2757
+ begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
2758
+ end
2759
+
2760
+ #
2761
+ # Changes ServiceState property for a given service
2762
+ #
2763
+ # @param resource_group_name [String] The name of the resource group.
2764
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
2765
+ # to create or update.
2766
+ # @param parameters [OrchestrationServiceStateInput] The input object for
2767
+ # SetOrchestrationServiceState API.
2768
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2769
+ # to the HTTP request.
2770
+ #
2771
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2772
+ #
2773
+ def begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
2774
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2775
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2776
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2777
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2778
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2779
+
2780
+
2781
+ request_headers = {}
2782
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2783
+
2784
+ # Set Headers
2785
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2786
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2787
+
2788
+ # Serialize Request
2789
+ request_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::OrchestrationServiceStateInput.mapper()
2790
+ request_content = @client.serialize(request_mapper, parameters)
2791
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2792
+
2793
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState'
2794
+
2795
+ request_url = @base_url || @client.base_url
2796
+
2797
+ options = {
2798
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2799
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2800
+ query_params: {'api-version' => @client.api_version},
2801
+ body: request_content,
2802
+ headers: request_headers.merge(custom_headers || {}),
2803
+ base_url: request_url
2804
+ }
2805
+ promise = @client.make_request_async(:post, path_template, options)
2806
+
2807
+ promise = promise.then do |result|
2808
+ http_response = result.response
2809
+ status_code = http_response.status
2810
+ response_content = http_response.body
2811
+ unless status_code == 200 || status_code == 202
2812
+ error_model = JSON.load(response_content)
2813
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2814
+ end
2815
+
2816
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2817
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2818
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2819
+
2820
+ result
2821
+ end
2822
+
2823
+ promise.execute
2824
+ end
2825
+
2826
+ #
2827
+ # Gets a list of all VM scale sets under a resource group.
2828
+ #
2829
+ # @param next_page_link [String] The NextLink from the previous successful call
2830
+ # to List operation.
2831
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2832
+ # will be added to the HTTP request.
2833
+ #
2834
+ # @return [VirtualMachineScaleSetListResult] operation results.
2835
+ #
2836
+ def list_next(next_page_link, custom_headers:nil)
2837
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2838
+ response.body unless response.nil?
2839
+ end
2840
+
2841
+ #
2842
+ # Gets a list of all VM scale sets under a resource group.
2843
+ #
2844
+ # @param next_page_link [String] The NextLink from the previous successful call
2845
+ # to List operation.
2846
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2847
+ # will be added to the HTTP request.
2848
+ #
2849
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2850
+ #
2851
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2852
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2853
+ end
2854
+
2855
+ #
2856
+ # Gets a list of all VM scale sets under a resource group.
2857
+ #
2858
+ # @param next_page_link [String] The NextLink from the previous successful call
2859
+ # to List operation.
2860
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2861
+ # to the HTTP request.
2862
+ #
2863
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2864
+ #
2865
+ def list_next_async(next_page_link, custom_headers:nil)
2866
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2867
+
2868
+
2869
+ request_headers = {}
2870
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2871
+
2872
+ # Set Headers
2873
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2874
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2875
+ path_template = '{nextLink}'
2876
+
2877
+ request_url = @base_url || @client.base_url
2878
+
2879
+ options = {
2880
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2881
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2882
+ headers: request_headers.merge(custom_headers || {}),
2883
+ base_url: request_url
2884
+ }
2885
+ promise = @client.make_request_async(:get, path_template, options)
2886
+
2887
+ promise = promise.then do |result|
2888
+ http_response = result.response
2889
+ status_code = http_response.status
2890
+ response_content = http_response.body
2891
+ unless status_code == 200
2892
+ error_model = JSON.load(response_content)
2893
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2894
+ end
2895
+
2896
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2897
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2898
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2899
+ # Deserialize Response
2900
+ if status_code == 200
2901
+ begin
2902
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2903
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListResult.mapper()
2904
+ result.body = @client.deserialize(result_mapper, parsed_response)
2905
+ rescue Exception => e
2906
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2907
+ end
2908
+ end
2909
+
2910
+ result
2911
+ end
2912
+
2913
+ promise.execute
2914
+ end
2915
+
2916
+ #
2917
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
2918
+ # associated resource group. Use nextLink property in the response to get the
2919
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
2920
+ # Scale Sets.
2921
+ #
2922
+ # @param next_page_link [String] The NextLink from the previous successful call
2923
+ # to List operation.
2924
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2925
+ # will be added to the HTTP request.
2926
+ #
2927
+ # @return [VirtualMachineScaleSetListWithLinkResult] operation results.
2928
+ #
2929
+ def list_all_next(next_page_link, custom_headers:nil)
2930
+ response = list_all_next_async(next_page_link, custom_headers:custom_headers).value!
2931
+ response.body unless response.nil?
2932
+ end
2933
+
2934
+ #
2935
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
2936
+ # associated resource group. Use nextLink property in the response to get the
2937
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
2938
+ # Scale Sets.
2939
+ #
2940
+ # @param next_page_link [String] The NextLink from the previous successful call
2941
+ # to List operation.
2942
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2943
+ # will be added to the HTTP request.
2944
+ #
2945
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2946
+ #
2947
+ def list_all_next_with_http_info(next_page_link, custom_headers:nil)
2948
+ list_all_next_async(next_page_link, custom_headers:custom_headers).value!
2949
+ end
2950
+
2951
+ #
2952
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
2953
+ # associated resource group. Use nextLink property in the response to get the
2954
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
2955
+ # Scale Sets.
2956
+ #
2957
+ # @param next_page_link [String] The NextLink from the previous successful call
2958
+ # to List operation.
2959
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2960
+ # to the HTTP request.
2961
+ #
2962
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2963
+ #
2964
+ def list_all_next_async(next_page_link, custom_headers:nil)
2965
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2966
+
2967
+
2968
+ request_headers = {}
2969
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2970
+
2971
+ # Set Headers
2972
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2973
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2974
+ path_template = '{nextLink}'
2975
+
2976
+ request_url = @base_url || @client.base_url
2977
+
2978
+ options = {
2979
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2980
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2981
+ headers: request_headers.merge(custom_headers || {}),
2982
+ base_url: request_url
2983
+ }
2984
+ promise = @client.make_request_async(:get, path_template, options)
2985
+
2986
+ promise = promise.then do |result|
2987
+ http_response = result.response
2988
+ status_code = http_response.status
2989
+ response_content = http_response.body
2990
+ unless status_code == 200
2991
+ error_model = JSON.load(response_content)
2992
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2993
+ end
2994
+
2995
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2996
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2997
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2998
+ # Deserialize Response
2999
+ if status_code == 200
3000
+ begin
3001
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3002
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListWithLinkResult.mapper()
3003
+ result.body = @client.deserialize(result_mapper, parsed_response)
3004
+ rescue Exception => e
3005
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3006
+ end
3007
+ end
3008
+
3009
+ result
3010
+ end
3011
+
3012
+ promise.execute
3013
+ end
3014
+
3015
+ #
3016
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3017
+ # and maximum VM instances allowed for each SKU.
3018
+ #
3019
+ # @param next_page_link [String] The NextLink from the previous successful call
3020
+ # to List operation.
3021
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3022
+ # will be added to the HTTP request.
3023
+ #
3024
+ # @return [VirtualMachineScaleSetListSkusResult] operation results.
3025
+ #
3026
+ def list_skus_next(next_page_link, custom_headers:nil)
3027
+ response = list_skus_next_async(next_page_link, custom_headers:custom_headers).value!
3028
+ response.body unless response.nil?
3029
+ end
3030
+
3031
+ #
3032
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3033
+ # and maximum VM instances allowed for each SKU.
3034
+ #
3035
+ # @param next_page_link [String] The NextLink from the previous successful call
3036
+ # to List operation.
3037
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3038
+ # will be added to the HTTP request.
3039
+ #
3040
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3041
+ #
3042
+ def list_skus_next_with_http_info(next_page_link, custom_headers:nil)
3043
+ list_skus_next_async(next_page_link, custom_headers:custom_headers).value!
3044
+ end
3045
+
3046
+ #
3047
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3048
+ # and maximum VM instances allowed for each SKU.
3049
+ #
3050
+ # @param next_page_link [String] The NextLink from the previous successful call
3051
+ # to List operation.
3052
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3053
+ # to the HTTP request.
3054
+ #
3055
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3056
+ #
3057
+ def list_skus_next_async(next_page_link, custom_headers:nil)
3058
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3059
+
3060
+
3061
+ request_headers = {}
3062
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3063
+
3064
+ # Set Headers
3065
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3066
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3067
+ path_template = '{nextLink}'
3068
+
3069
+ request_url = @base_url || @client.base_url
3070
+
3071
+ options = {
3072
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3073
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3074
+ headers: request_headers.merge(custom_headers || {}),
3075
+ base_url: request_url
3076
+ }
3077
+ promise = @client.make_request_async(:get, path_template, options)
3078
+
3079
+ promise = promise.then do |result|
3080
+ http_response = result.response
3081
+ status_code = http_response.status
3082
+ response_content = http_response.body
3083
+ unless status_code == 200
3084
+ error_model = JSON.load(response_content)
3085
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3086
+ end
3087
+
3088
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3089
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3090
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3091
+ # Deserialize Response
3092
+ if status_code == 200
3093
+ begin
3094
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3095
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListSkusResult.mapper()
3096
+ result.body = @client.deserialize(result_mapper, parsed_response)
3097
+ rescue Exception => e
3098
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3099
+ end
3100
+ end
3101
+
3102
+ result
3103
+ end
3104
+
3105
+ promise.execute
3106
+ end
3107
+
3108
+ #
3109
+ # Gets list of OS upgrades on a VM scale set instance.
3110
+ #
3111
+ # @param next_page_link [String] The NextLink from the previous successful call
3112
+ # to List operation.
3113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3114
+ # will be added to the HTTP request.
3115
+ #
3116
+ # @return [VirtualMachineScaleSetListOSUpgradeHistory] operation results.
3117
+ #
3118
+ def get_osupgrade_history_next(next_page_link, custom_headers:nil)
3119
+ response = get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
3120
+ response.body unless response.nil?
3121
+ end
3122
+
3123
+ #
3124
+ # Gets list of OS upgrades on a VM scale set instance.
3125
+ #
3126
+ # @param next_page_link [String] The NextLink from the previous successful call
3127
+ # to List operation.
3128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3129
+ # will be added to the HTTP request.
3130
+ #
3131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3132
+ #
3133
+ def get_osupgrade_history_next_with_http_info(next_page_link, custom_headers:nil)
3134
+ get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
3135
+ end
3136
+
3137
+ #
3138
+ # Gets list of OS upgrades on a VM scale set instance.
3139
+ #
3140
+ # @param next_page_link [String] The NextLink from the previous successful call
3141
+ # to List operation.
3142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3143
+ # to the HTTP request.
3144
+ #
3145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3146
+ #
3147
+ def get_osupgrade_history_next_async(next_page_link, custom_headers:nil)
3148
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3149
+
3150
+
3151
+ request_headers = {}
3152
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3153
+
3154
+ # Set Headers
3155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3157
+ path_template = '{nextLink}'
3158
+
3159
+ request_url = @base_url || @client.base_url
3160
+
3161
+ options = {
3162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3163
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3164
+ headers: request_headers.merge(custom_headers || {}),
3165
+ base_url: request_url
3166
+ }
3167
+ promise = @client.make_request_async(:get, path_template, options)
3168
+
3169
+ promise = promise.then do |result|
3170
+ http_response = result.response
3171
+ status_code = http_response.status
3172
+ response_content = http_response.body
3173
+ unless status_code == 200
3174
+ error_model = JSON.load(response_content)
3175
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3176
+ end
3177
+
3178
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3179
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3180
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3181
+ # Deserialize Response
3182
+ if status_code == 200
3183
+ begin
3184
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3185
+ result_mapper = Azure::Compute::Mgmt::V2019_12_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.mapper()
3186
+ result.body = @client.deserialize(result_mapper, parsed_response)
3187
+ rescue Exception => e
3188
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3189
+ end
3190
+ end
3191
+
3192
+ result
3193
+ end
3194
+
3195
+ promise.execute
3196
+ end
3197
+
3198
+ #
3199
+ # Gets a list of all VM scale sets under a resource group.
3200
+ #
3201
+ # @param resource_group_name [String] The name of the resource group.
3202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3203
+ # will be added to the HTTP request.
3204
+ #
3205
+ # @return [VirtualMachineScaleSetListResult] which provide lazy access to pages
3206
+ # of the response.
3207
+ #
3208
+ def list_as_lazy(resource_group_name, custom_headers:nil)
3209
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
3210
+ unless response.nil?
3211
+ page = response.body
3212
+ page.next_method = Proc.new do |next_page_link|
3213
+ list_next_async(next_page_link, custom_headers:custom_headers)
3214
+ end
3215
+ page
3216
+ end
3217
+ end
3218
+
3219
+ #
3220
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
3221
+ # associated resource group. Use nextLink property in the response to get the
3222
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
3223
+ # Scale Sets.
3224
+ #
3225
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3226
+ # will be added to the HTTP request.
3227
+ #
3228
+ # @return [VirtualMachineScaleSetListWithLinkResult] which provide lazy access
3229
+ # to pages of the response.
3230
+ #
3231
+ def list_all_as_lazy(custom_headers:nil)
3232
+ response = list_all_async(custom_headers:custom_headers).value!
3233
+ unless response.nil?
3234
+ page = response.body
3235
+ page.next_method = Proc.new do |next_page_link|
3236
+ list_all_next_async(next_page_link, custom_headers:custom_headers)
3237
+ end
3238
+ page
3239
+ end
3240
+ end
3241
+
3242
+ #
3243
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3244
+ # and maximum VM instances allowed for each SKU.
3245
+ #
3246
+ # @param resource_group_name [String] The name of the resource group.
3247
+ # @param vm_scale_set_name [String] The name of the VM scale set.
3248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3249
+ # will be added to the HTTP request.
3250
+ #
3251
+ # @return [VirtualMachineScaleSetListSkusResult] which provide lazy access to
3252
+ # pages of the response.
3253
+ #
3254
+ def list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
3255
+ response = list_skus_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
3256
+ unless response.nil?
3257
+ page = response.body
3258
+ page.next_method = Proc.new do |next_page_link|
3259
+ list_skus_next_async(next_page_link, custom_headers:custom_headers)
3260
+ end
3261
+ page
3262
+ end
3263
+ end
3264
+
3265
+ #
3266
+ # Gets list of OS upgrades on a VM scale set instance.
3267
+ #
3268
+ # @param resource_group_name [String] The name of the resource group.
3269
+ # @param vm_scale_set_name [String] The name of the VM scale set.
3270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3271
+ # will be added to the HTTP request.
3272
+ #
3273
+ # @return [VirtualMachineScaleSetListOSUpgradeHistory] which provide lazy
3274
+ # access to pages of the response.
3275
+ #
3276
+ def get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
3277
+ response = get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
3278
+ unless response.nil?
3279
+ page = response.body
3280
+ page.next_method = Proc.new do |next_page_link|
3281
+ get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers)
3282
+ end
3283
+ page
3284
+ end
3285
+ end
3286
+
3287
+ end
3288
+ end