azure_mgmt_compute 0.19.3 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (337) 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-04-01/generated/azure_mgmt_compute/resource_skus.rb +8 -4
  15. data/lib/2019-07-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  16. data/lib/2019-11-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  17. data/lib/2019-12-01/generated/azure_mgmt_compute/availability_sets.rb +4 -0
  18. data/lib/2019-12-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  19. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_artifact_version_source.rb +1 -1
  20. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine.rb +2 -2
  21. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +2 -2
  22. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +2 -2
  23. data/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine_update.rb +2 -2
  24. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +28 -8
  25. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +8 -6
  26. data/lib/2020-06-01/generated/azure_mgmt_compute.rb +276 -0
  27. data/lib/2020-06-01/generated/azure_mgmt_compute/availability_sets.rb +920 -0
  28. data/lib/2020-06-01/generated/azure_mgmt_compute/compute_management_client.rb +212 -0
  29. data/lib/2020-06-01/generated/azure_mgmt_compute/dedicated_host_groups.rb +861 -0
  30. data/lib/2020-06-01/generated/azure_mgmt_compute/dedicated_hosts.rb +806 -0
  31. data/lib/2020-06-01/generated/azure_mgmt_compute/images.rb +975 -0
  32. data/lib/2020-06-01/generated/azure_mgmt_compute/log_analytics.rb +341 -0
  33. data/lib/2020-06-01/generated/azure_mgmt_compute/models/additional_capabilities.rb +51 -0
  34. data/lib/2020-06-01/generated/azure_mgmt_compute/models/additional_unattend_content.rb +93 -0
  35. data/lib/2020-06-01/generated/azure_mgmt_compute/models/api_entity_reference.rb +47 -0
  36. data/lib/2020-06-01/generated/azure_mgmt_compute/models/api_error.rb +100 -0
  37. data/lib/2020-06-01/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
  38. data/lib/2020-06-01/generated/azure_mgmt_compute/models/automatic_osupgrade_policy.rb +63 -0
  39. data/lib/2020-06-01/generated/azure_mgmt_compute/models/automatic_osupgrade_properties.rb +47 -0
  40. data/lib/2020-06-01/generated/azure_mgmt_compute/models/automatic_repairs_policy.rb +64 -0
  41. data/lib/2020-06-01/generated/azure_mgmt_compute/models/availability_set.rb +189 -0
  42. data/lib/2020-06-01/generated/azure_mgmt_compute/models/availability_set_list_result.rb +100 -0
  43. data/lib/2020-06-01/generated/azure_mgmt_compute/models/availability_set_sku_types.rb +16 -0
  44. data/lib/2020-06-01/generated/azure_mgmt_compute/models/availability_set_update.rb +142 -0
  45. data/lib/2020-06-01/generated/azure_mgmt_compute/models/available_patch_summary.rb +143 -0
  46. data/lib/2020-06-01/generated/azure_mgmt_compute/models/billing_profile.rb +60 -0
  47. data/lib/2020-06-01/generated/azure_mgmt_compute/models/boot_diagnostics.rb +63 -0
  48. data/lib/2020-06-01/generated/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +78 -0
  49. data/lib/2020-06-01/generated/azure_mgmt_compute/models/caching_types.rb +17 -0
  50. data/lib/2020-06-01/generated/azure_mgmt_compute/models/component_names.rb +15 -0
  51. data/lib/2020-06-01/generated/azure_mgmt_compute/models/compute_operation_list_result.rb +56 -0
  52. data/lib/2020-06-01/generated/azure_mgmt_compute/models/compute_operation_value.rb +108 -0
  53. data/lib/2020-06-01/generated/azure_mgmt_compute/models/data_disk.rb +201 -0
  54. data/lib/2020-06-01/generated/azure_mgmt_compute/models/data_disk_image.rb +49 -0
  55. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host.rb +219 -0
  56. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_allocatable_vm.rb +60 -0
  57. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_available_capacity.rb +57 -0
  58. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_group.rb +178 -0
  59. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_group_instance_view.rb +57 -0
  60. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_group_list_result.rb +100 -0
  61. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_group_update.rb +141 -0
  62. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_instance_view.rb +81 -0
  63. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_instance_view_with_name.rb +84 -0
  64. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_license_types.rb +17 -0
  65. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_list_result.rb +100 -0
  66. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_update.rb +171 -0
  67. data/lib/2020-06-01/generated/azure_mgmt_compute/models/diagnostics_profile.rb +52 -0
  68. data/lib/2020-06-01/generated/azure_mgmt_compute/models/diff_disk_options.rb +15 -0
  69. data/lib/2020-06-01/generated/azure_mgmt_compute/models/diff_disk_placement.rb +16 -0
  70. data/lib/2020-06-01/generated/azure_mgmt_compute/models/diff_disk_settings.rb +69 -0
  71. data/lib/2020-06-01/generated/azure_mgmt_compute/models/disallowed_configuration.rb +47 -0
  72. data/lib/2020-06-01/generated/azure_mgmt_compute/models/disk_create_option_types.rb +17 -0
  73. data/lib/2020-06-01/generated/azure_mgmt_compute/models/disk_encryption_set_parameters.rb +46 -0
  74. data/lib/2020-06-01/generated/azure_mgmt_compute/models/disk_encryption_settings.rb +73 -0
  75. data/lib/2020-06-01/generated/azure_mgmt_compute/models/disk_instance_view.rb +87 -0
  76. data/lib/2020-06-01/generated/azure_mgmt_compute/models/hardware_profile.rb +104 -0
  77. data/lib/2020-06-01/generated/azure_mgmt_compute/models/hyper_vgeneration_type.rb +16 -0
  78. data/lib/2020-06-01/generated/azure_mgmt_compute/models/hyper_vgeneration_types.rb +16 -0
  79. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image.rb +139 -0
  80. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_data_disk.rb +108 -0
  81. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_disk.rb +126 -0
  82. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_list_result.rb +99 -0
  83. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_osdisk.rb +123 -0
  84. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_reference.rb +114 -0
  85. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_storage_profile.rb +86 -0
  86. data/lib/2020-06-01/generated/azure_mgmt_compute/models/image_update.rb +102 -0
  87. data/lib/2020-06-01/generated/azure_mgmt_compute/models/in_guest_patch_mode.rb +17 -0
  88. data/lib/2020-06-01/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
  89. data/lib/2020-06-01/generated/azure_mgmt_compute/models/instance_view_status.rb +93 -0
  90. data/lib/2020-06-01/generated/azure_mgmt_compute/models/instance_view_types.rb +15 -0
  91. data/lib/2020-06-01/generated/azure_mgmt_compute/models/interval_in_mins.rb +18 -0
  92. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ipversion.rb +16 -0
  93. data/lib/2020-06-01/generated/azure_mgmt_compute/models/key_vault_key_reference.rb +59 -0
  94. data/lib/2020-06-01/generated/azure_mgmt_compute/models/key_vault_secret_reference.rb +59 -0
  95. data/lib/2020-06-01/generated/azure_mgmt_compute/models/last_patch_installation_summary.rb +211 -0
  96. data/lib/2020-06-01/generated/azure_mgmt_compute/models/linux_configuration.rb +81 -0
  97. data/lib/2020-06-01/generated/azure_mgmt_compute/models/list_usages_result.rb +100 -0
  98. data/lib/2020-06-01/generated/azure_mgmt_compute/models/log_analytics_input_base.rb +102 -0
  99. data/lib/2020-06-01/generated/azure_mgmt_compute/models/log_analytics_operation_result.rb +48 -0
  100. data/lib/2020-06-01/generated/azure_mgmt_compute/models/log_analytics_output.rb +47 -0
  101. data/lib/2020-06-01/generated/azure_mgmt_compute/models/maintenance_operation_result_code_types.rb +18 -0
  102. data/lib/2020-06-01/generated/azure_mgmt_compute/models/maintenance_redeploy_status.rb +115 -0
  103. data/lib/2020-06-01/generated/azure_mgmt_compute/models/managed_disk_parameters.rb +70 -0
  104. data/lib/2020-06-01/generated/azure_mgmt_compute/models/network_interface_reference.rb +55 -0
  105. data/lib/2020-06-01/generated/azure_mgmt_compute/models/network_profile.rb +57 -0
  106. data/lib/2020-06-01/generated/azure_mgmt_compute/models/operating_system_state_types.rb +16 -0
  107. data/lib/2020-06-01/generated/azure_mgmt_compute/models/operating_system_types.rb +16 -0
  108. data/lib/2020-06-01/generated/azure_mgmt_compute/models/orchestration_service_names.rb +16 -0
  109. data/lib/2020-06-01/generated/azure_mgmt_compute/models/orchestration_service_state.rb +17 -0
  110. data/lib/2020-06-01/generated/azure_mgmt_compute/models/orchestration_service_state_action.rb +16 -0
  111. data/lib/2020-06-01/generated/azure_mgmt_compute/models/orchestration_service_state_input.rb +59 -0
  112. data/lib/2020-06-01/generated/azure_mgmt_compute/models/orchestration_service_summary.rb +61 -0
  113. data/lib/2020-06-01/generated/azure_mgmt_compute/models/osdisk.rb +191 -0
  114. data/lib/2020-06-01/generated/azure_mgmt_compute/models/osdisk_image.rb +48 -0
  115. data/lib/2020-06-01/generated/azure_mgmt_compute/models/osprofile.rb +204 -0
  116. data/lib/2020-06-01/generated/azure_mgmt_compute/models/pass_names.rb +15 -0
  117. data/lib/2020-06-01/generated/azure_mgmt_compute/models/patch_assessment_state.rb +20 -0
  118. data/lib/2020-06-01/generated/azure_mgmt_compute/models/patch_operation_status.rb +18 -0
  119. data/lib/2020-06-01/generated/azure_mgmt_compute/models/patch_settings.rb +59 -0
  120. data/lib/2020-06-01/generated/azure_mgmt_compute/models/plan.rb +86 -0
  121. data/lib/2020-06-01/generated/azure_mgmt_compute/models/protocol_types.rb +16 -0
  122. data/lib/2020-06-01/generated/azure_mgmt_compute/models/proximity_placement_group.rb +180 -0
  123. data/lib/2020-06-01/generated/azure_mgmt_compute/models/proximity_placement_group_list_result.rb +100 -0
  124. data/lib/2020-06-01/generated/azure_mgmt_compute/models/proximity_placement_group_type.rb +16 -0
  125. data/lib/2020-06-01/generated/azure_mgmt_compute/models/proximity_placement_group_update.rb +51 -0
  126. data/lib/2020-06-01/generated/azure_mgmt_compute/models/purchase_plan.rb +71 -0
  127. data/lib/2020-06-01/generated/azure_mgmt_compute/models/reboot_status.rb +19 -0
  128. data/lib/2020-06-01/generated/azure_mgmt_compute/models/recovery_walk_response.rb +60 -0
  129. data/lib/2020-06-01/generated/azure_mgmt_compute/models/request_rate_by_interval_input.rb +97 -0
  130. data/lib/2020-06-01/generated/azure_mgmt_compute/models/resource.rb +110 -0
  131. data/lib/2020-06-01/generated/azure_mgmt_compute/models/resource_identity_type.rb +18 -0
  132. data/lib/2020-06-01/generated/azure_mgmt_compute/models/retrieve_boot_diagnostics_data_result.rb +59 -0
  133. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rollback_status_info.rb +74 -0
  134. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rolling_upgrade_action_type.rb +16 -0
  135. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rolling_upgrade_policy.rb +108 -0
  136. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rolling_upgrade_progress_info.rb +88 -0
  137. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rolling_upgrade_running_status.rb +88 -0
  138. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rolling_upgrade_status_code.rb +18 -0
  139. data/lib/2020-06-01/generated/azure_mgmt_compute/models/rolling_upgrade_status_info.rb +141 -0
  140. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_document.rb +116 -0
  141. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_document_base.rb +92 -0
  142. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_input.rb +87 -0
  143. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_input_parameter.rb +57 -0
  144. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_list_result.rb +100 -0
  145. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_parameter_definition.rb +81 -0
  146. data/lib/2020-06-01/generated/azure_mgmt_compute/models/run_command_result.rb +56 -0
  147. data/lib/2020-06-01/generated/azure_mgmt_compute/models/scale_in_policy.rb +71 -0
  148. data/lib/2020-06-01/generated/azure_mgmt_compute/models/scheduled_events_profile.rb +49 -0
  149. data/lib/2020-06-01/generated/azure_mgmt_compute/models/security_profile.rb +52 -0
  150. data/lib/2020-06-01/generated/azure_mgmt_compute/models/setting_names.rb +16 -0
  151. data/lib/2020-06-01/generated/azure_mgmt_compute/models/sku.rb +73 -0
  152. data/lib/2020-06-01/generated/azure_mgmt_compute/models/software_update_reboot_behavior.rb +17 -0
  153. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_configuration.rb +56 -0
  154. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_public_key.rb +64 -0
  155. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_public_key_generate_key_pair_result.rb +73 -0
  156. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_public_key_resource.rb +102 -0
  157. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_public_key_update_resource.rb +67 -0
  158. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_public_keys_group_list_result.rb +100 -0
  159. data/lib/2020-06-01/generated/azure_mgmt_compute/models/status_level_types.rb +17 -0
  160. data/lib/2020-06-01/generated/azure_mgmt_compute/models/storage_account_types.rb +18 -0
  161. data/lib/2020-06-01/generated/azure_mgmt_compute/models/storage_profile.rb +89 -0
  162. data/lib/2020-06-01/generated/azure_mgmt_compute/models/sub_resource.rb +47 -0
  163. data/lib/2020-06-01/generated/azure_mgmt_compute/models/sub_resource_read_only.rb +48 -0
  164. data/lib/2020-06-01/generated/azure_mgmt_compute/models/sub_resource_with_colocation_status.rb +57 -0
  165. data/lib/2020-06-01/generated/azure_mgmt_compute/models/terminate_notification_profile.rb +62 -0
  166. data/lib/2020-06-01/generated/azure_mgmt_compute/models/throttled_requests_input.rb +83 -0
  167. data/lib/2020-06-01/generated/azure_mgmt_compute/models/update_resource.rb +54 -0
  168. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_mode.rb +17 -0
  169. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_operation_historical_status_info.rb +73 -0
  170. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_operation_historical_status_info_properties.rb +116 -0
  171. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_operation_history_status.rb +74 -0
  172. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_operation_invoker.rb +17 -0
  173. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_policy.rb +79 -0
  174. data/lib/2020-06-01/generated/azure_mgmt_compute/models/upgrade_state.rb +18 -0
  175. data/lib/2020-06-01/generated/azure_mgmt_compute/models/usage.rb +83 -0
  176. data/lib/2020-06-01/generated/azure_mgmt_compute/models/usage_name.rb +57 -0
  177. data/lib/2020-06-01/generated/azure_mgmt_compute/models/vault_certificate.rb +72 -0
  178. data/lib/2020-06-01/generated/azure_mgmt_compute/models/vault_secret_group.rb +69 -0
  179. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_hard_disk.rb +46 -0
  180. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine.rb +454 -0
  181. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +87 -0
  182. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_assess_patches_result.rb +152 -0
  183. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +69 -0
  184. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_capture_result.rb +99 -0
  185. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_eviction_policy_types.rb +16 -0
  186. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_extension.rb +208 -0
  187. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +71 -0
  188. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +146 -0
  189. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +109 -0
  190. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +147 -0
  191. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_extensions_list_result.rb +55 -0
  192. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_health_status.rb +48 -0
  193. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_identity.rb +102 -0
  194. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_identity_user_assigned_identities_value.rb +61 -0
  195. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_image.rb +155 -0
  196. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_image_resource.rb +87 -0
  197. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_instance_view.rb +258 -0
  198. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +99 -0
  199. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_patch_status.rb +61 -0
  200. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_priority_types.rb +17 -0
  201. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_reimage_parameters.rb +49 -0
  202. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +332 -0
  203. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_data_disk.rb +153 -0
  204. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +197 -0
  205. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_list_result.rb +103 -0
  206. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +70 -0
  207. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_update.rb +198 -0
  208. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_identity.rb +105 -0
  209. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_identity_user_assigned_identities_value.rb +61 -0
  210. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +113 -0
  211. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +59 -0
  212. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ip_tag.rb +58 -0
  213. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +195 -0
  214. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_osupgrade_history.rb +104 -0
  215. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +100 -0
  216. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +101 -0
  217. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +102 -0
  218. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_managed_disk_parameters.rb +63 -0
  219. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +137 -0
  220. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_dns_settings.rb +56 -0
  221. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +71 -0
  222. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +180 -0
  223. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +167 -0
  224. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_public_ipaddress_configuration.rb +120 -0
  225. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_public_ipaddress_configuration_dns_settings.rb +51 -0
  226. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_reimage_parameters.rb +65 -0
  227. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_scale_in_rules.rb +17 -0
  228. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +74 -0
  229. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +85 -0
  230. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_scale_type.rb +16 -0
  231. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +91 -0
  232. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update.rb +210 -0
  233. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_ipconfiguration.rb +190 -0
  234. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_network_configuration.rb +136 -0
  235. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_network_profile.rb +72 -0
  236. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_osdisk.rb +122 -0
  237. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_osprofile.rb +92 -0
  238. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_public_ipaddress_configuration.rb +72 -0
  239. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_storage_profile.rb +80 -0
  240. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_vmprofile.rb +151 -0
  241. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +397 -0
  242. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +70 -0
  243. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +57 -0
  244. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +55 -0
  245. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +211 -0
  246. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +101 -0
  247. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmnetwork_profile_configuration.rb +57 -0
  248. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +189 -0
  249. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprotection_policy.rb +60 -0
  250. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmreimage_parameters.rb +44 -0
  251. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_size.rb +106 -0
  252. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +55 -0
  253. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_size_types.rb +180 -0
  254. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_software_patch_properties.rb +173 -0
  255. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +61 -0
  256. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_update.rb +397 -0
  257. data/lib/2020-06-01/generated/azure_mgmt_compute/models/vm_disk_types.rb +16 -0
  258. data/lib/2020-06-01/generated/azure_mgmt_compute/models/vmscale_set_convert_to_single_placement_group_input.rb +52 -0
  259. data/lib/2020-06-01/generated/azure_mgmt_compute/models/win_rmconfiguration.rb +56 -0
  260. data/lib/2020-06-01/generated/azure_mgmt_compute/models/win_rmlistener.rb +67 -0
  261. data/lib/2020-06-01/generated/azure_mgmt_compute/models/windows_configuration.rb +127 -0
  262. data/lib/2020-06-01/generated/azure_mgmt_compute/module_definition.rb +9 -0
  263. data/lib/2020-06-01/generated/azure_mgmt_compute/operations.rb +109 -0
  264. data/lib/2020-06-01/generated/azure_mgmt_compute/proximity_placement_groups.rb +846 -0
  265. data/lib/2020-06-01/generated/azure_mgmt_compute/ssh_public_keys.rb +939 -0
  266. data/lib/2020-06-01/generated/azure_mgmt_compute/usage_operations.rb +241 -0
  267. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_extension_images.rb +360 -0
  268. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_extensions.rb +701 -0
  269. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_images.rb +600 -0
  270. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_run_commands.rb +322 -0
  271. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_set_extensions.rb +821 -0
  272. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_set_rolling_upgrades.rb +498 -0
  273. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vmextensions.rb +709 -0
  274. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +2220 -0
  275. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +3290 -0
  276. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_sizes.rb +122 -0
  277. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machines.rb +3302 -0
  278. data/lib/2020-06-30/generated/azure_mgmt_compute.rb +80 -0
  279. data/lib/2020-06-30/generated/azure_mgmt_compute/compute_management_client.rb +145 -0
  280. data/lib/2020-06-30/generated/azure_mgmt_compute/disk_accesses.rb +1120 -0
  281. data/lib/2020-06-30/generated/azure_mgmt_compute/disk_encryption_sets.rb +1236 -0
  282. data/lib/2020-06-30/generated/azure_mgmt_compute/disks.rb +1294 -0
  283. data/lib/2020-06-30/generated/azure_mgmt_compute/models/access_level.rb +17 -0
  284. data/lib/2020-06-30/generated/azure_mgmt_compute/models/access_uri.rb +47 -0
  285. data/lib/2020-06-30/generated/azure_mgmt_compute/models/api_error.rb +100 -0
  286. data/lib/2020-06-30/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
  287. data/lib/2020-06-30/generated/azure_mgmt_compute/models/creation_data.rb +150 -0
  288. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk.rb +422 -0
  289. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_access.rb +133 -0
  290. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_access_list.rb +100 -0
  291. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_access_update.rb +54 -0
  292. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_create_option.rb +21 -0
  293. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_encryption_set.rb +160 -0
  294. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_encryption_set_identity_type.rb +15 -0
  295. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_encryption_set_list.rb +100 -0
  296. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_encryption_set_type.rb +16 -0
  297. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_encryption_set_update.rb +79 -0
  298. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_list.rb +99 -0
  299. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_sku.rb +61 -0
  300. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_state.rb +20 -0
  301. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_storage_account_types.rb +18 -0
  302. data/lib/2020-06-30/generated/azure_mgmt_compute/models/disk_update.rb +225 -0
  303. data/lib/2020-06-30/generated/azure_mgmt_compute/models/encryption.rb +60 -0
  304. data/lib/2020-06-30/generated/azure_mgmt_compute/models/encryption_set_identity.rb +78 -0
  305. data/lib/2020-06-30/generated/azure_mgmt_compute/models/encryption_settings_collection.rb +85 -0
  306. data/lib/2020-06-30/generated/azure_mgmt_compute/models/encryption_settings_element.rb +62 -0
  307. data/lib/2020-06-30/generated/azure_mgmt_compute/models/encryption_type.rb +17 -0
  308. data/lib/2020-06-30/generated/azure_mgmt_compute/models/grant_access_data.rb +58 -0
  309. data/lib/2020-06-30/generated/azure_mgmt_compute/models/hyper_vgeneration.rb +16 -0
  310. data/lib/2020-06-30/generated/azure_mgmt_compute/models/image_disk_reference.rb +60 -0
  311. data/lib/2020-06-30/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
  312. data/lib/2020-06-30/generated/azure_mgmt_compute/models/key_vault_and_key_reference.rb +60 -0
  313. data/lib/2020-06-30/generated/azure_mgmt_compute/models/key_vault_and_secret_reference.rb +59 -0
  314. data/lib/2020-06-30/generated/azure_mgmt_compute/models/network_access_policy.rb +17 -0
  315. data/lib/2020-06-30/generated/azure_mgmt_compute/models/operating_system_types.rb +16 -0
  316. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_endpoint.rb +47 -0
  317. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_endpoint_connection.rb +110 -0
  318. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_endpoint_connection_provisioning_state.rb +18 -0
  319. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_endpoint_service_connection_status.rb +17 -0
  320. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_link_resource.rb +123 -0
  321. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_link_resource_list_result.rb +55 -0
  322. data/lib/2020-06-30/generated/azure_mgmt_compute/models/private_link_service_connection_state.rb +72 -0
  323. data/lib/2020-06-30/generated/azure_mgmt_compute/models/resource.rb +110 -0
  324. data/lib/2020-06-30/generated/azure_mgmt_compute/models/resource_uri_list.rb +100 -0
  325. data/lib/2020-06-30/generated/azure_mgmt_compute/models/share_info_element.rb +49 -0
  326. data/lib/2020-06-30/generated/azure_mgmt_compute/models/snapshot.rb +290 -0
  327. data/lib/2020-06-30/generated/azure_mgmt_compute/models/snapshot_list.rb +99 -0
  328. data/lib/2020-06-30/generated/azure_mgmt_compute/models/snapshot_sku.rb +60 -0
  329. data/lib/2020-06-30/generated/azure_mgmt_compute/models/snapshot_storage_account_types.rb +17 -0
  330. data/lib/2020-06-30/generated/azure_mgmt_compute/models/snapshot_update.rb +145 -0
  331. data/lib/2020-06-30/generated/azure_mgmt_compute/models/source_vault.rb +47 -0
  332. data/lib/2020-06-30/generated/azure_mgmt_compute/module_definition.rb +9 -0
  333. data/lib/2020-06-30/generated/azure_mgmt_compute/snapshots.rb +1294 -0
  334. data/lib/azure_mgmt_compute.rb +15 -13
  335. data/lib/profiles/latest/modules/compute_profile_module.rb +961 -805
  336. data/lib/version.rb +1 -1
  337. metadata +311 -3
@@ -0,0 +1,3290 @@
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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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::V2020_06_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.api_version is nil' if @client.api_version.nil?
1317
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1318
+
1319
+
1320
+ request_headers = {}
1321
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1322
+
1323
+ # Set Headers
1324
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1325
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1326
+
1327
+ # Serialize Request
1328
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VMScaleSetConvertToSinglePlacementGroupInput.mapper()
1329
+ request_content = @client.serialize(request_mapper, parameters)
1330
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1331
+
1332
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup'
1333
+
1334
+ request_url = @base_url || @client.base_url
1335
+
1336
+ options = {
1337
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1338
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1339
+ query_params: {'api-version' => @client.api_version},
1340
+ body: request_content,
1341
+ headers: request_headers.merge(custom_headers || {}),
1342
+ base_url: request_url
1343
+ }
1344
+ promise = @client.make_request_async(:post, path_template, options)
1345
+
1346
+ promise = promise.then do |result|
1347
+ http_response = result.response
1348
+ status_code = http_response.status
1349
+ response_content = http_response.body
1350
+ unless status_code == 200
1351
+ error_model = JSON.load(response_content)
1352
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1353
+ end
1354
+
1355
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1356
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1357
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1358
+
1359
+ result
1360
+ end
1361
+
1362
+ promise.execute
1363
+ end
1364
+
1365
+ #
1366
+ # Changes ServiceState property for a given service
1367
+ #
1368
+ # @param resource_group_name [String] The name of the resource group.
1369
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1370
+ # to create or update.
1371
+ # @param parameters [OrchestrationServiceStateInput] The input object for
1372
+ # SetOrchestrationServiceState API.
1373
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1374
+ # will be added to the HTTP request.
1375
+ #
1376
+ def set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1377
+ response = set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1378
+ nil
1379
+ end
1380
+
1381
+ #
1382
+ # @param resource_group_name [String] The name of the resource group.
1383
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
1384
+ # to create or update.
1385
+ # @param parameters [OrchestrationServiceStateInput] The input object for
1386
+ # SetOrchestrationServiceState API.
1387
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1388
+ # will be added to the HTTP request.
1389
+ #
1390
+ # @return [Concurrent::Promise] promise which provides async access to http
1391
+ # response.
1392
+ #
1393
+ def set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1394
+ # Send request
1395
+ promise = begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers)
1396
+
1397
+ promise = promise.then do |response|
1398
+ # Defining deserialization method.
1399
+ deserialize_method = lambda do |parsed_response|
1400
+ end
1401
+
1402
+ # Waiting for response.
1403
+ @client.get_long_running_operation_result(response, deserialize_method)
1404
+ end
1405
+
1406
+ promise
1407
+ end
1408
+
1409
+ #
1410
+ # Create or update a VM scale set.
1411
+ #
1412
+ # @param resource_group_name [String] The name of the resource group.
1413
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1414
+ # update.
1415
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
1416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1417
+ # will be added to the HTTP request.
1418
+ #
1419
+ # @return [VirtualMachineScaleSet] operation results.
1420
+ #
1421
+ def begin_create_or_update(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1422
+ response = begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1423
+ response.body unless response.nil?
1424
+ end
1425
+
1426
+ #
1427
+ # Create or update a VM scale set.
1428
+ #
1429
+ # @param resource_group_name [String] The name of the resource group.
1430
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1431
+ # update.
1432
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
1433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1434
+ # will be added to the HTTP request.
1435
+ #
1436
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1437
+ #
1438
+ def begin_create_or_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1439
+ begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1440
+ end
1441
+
1442
+ #
1443
+ # Create or update a VM scale set.
1444
+ #
1445
+ # @param resource_group_name [String] The name of the resource group.
1446
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1447
+ # update.
1448
+ # @param parameters [VirtualMachineScaleSet] The scale set object.
1449
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1450
+ # to the HTTP request.
1451
+ #
1452
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1453
+ #
1454
+ def begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1455
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1456
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1457
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1458
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1459
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1460
+
1461
+
1462
+ request_headers = {}
1463
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1464
+
1465
+ # Set Headers
1466
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1467
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1468
+
1469
+ # Serialize Request
1470
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSet.mapper()
1471
+ request_content = @client.serialize(request_mapper, parameters)
1472
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1473
+
1474
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
1475
+
1476
+ request_url = @base_url || @client.base_url
1477
+
1478
+ options = {
1479
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1480
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1481
+ query_params: {'api-version' => @client.api_version},
1482
+ body: request_content,
1483
+ headers: request_headers.merge(custom_headers || {}),
1484
+ base_url: request_url
1485
+ }
1486
+ promise = @client.make_request_async(:put, path_template, options)
1487
+
1488
+ promise = promise.then do |result|
1489
+ http_response = result.response
1490
+ status_code = http_response.status
1491
+ response_content = http_response.body
1492
+ unless status_code == 200 || status_code == 201
1493
+ error_model = JSON.load(response_content)
1494
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1495
+ end
1496
+
1497
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1498
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1499
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1500
+ # Deserialize Response
1501
+ if status_code == 200
1502
+ begin
1503
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1504
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSet.mapper()
1505
+ result.body = @client.deserialize(result_mapper, parsed_response)
1506
+ rescue Exception => e
1507
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1508
+ end
1509
+ end
1510
+ # Deserialize Response
1511
+ if status_code == 201
1512
+ begin
1513
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1514
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSet.mapper()
1515
+ result.body = @client.deserialize(result_mapper, parsed_response)
1516
+ rescue Exception => e
1517
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1518
+ end
1519
+ end
1520
+
1521
+ result
1522
+ end
1523
+
1524
+ promise.execute
1525
+ end
1526
+
1527
+ #
1528
+ # Update a VM scale set.
1529
+ #
1530
+ # @param resource_group_name [String] The name of the resource group.
1531
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1532
+ # update.
1533
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
1534
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1535
+ # will be added to the HTTP request.
1536
+ #
1537
+ # @return [VirtualMachineScaleSet] operation results.
1538
+ #
1539
+ def begin_update(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1540
+ response = begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1541
+ response.body unless response.nil?
1542
+ end
1543
+
1544
+ #
1545
+ # Update a VM scale set.
1546
+ #
1547
+ # @param resource_group_name [String] The name of the resource group.
1548
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1549
+ # update.
1550
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
1551
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1552
+ # will be added to the HTTP request.
1553
+ #
1554
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1555
+ #
1556
+ def begin_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1557
+ begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
1558
+ end
1559
+
1560
+ #
1561
+ # Update a VM scale set.
1562
+ #
1563
+ # @param resource_group_name [String] The name of the resource group.
1564
+ # @param vm_scale_set_name [String] The name of the VM scale set to create or
1565
+ # update.
1566
+ # @param parameters [VirtualMachineScaleSetUpdate] The scale set object.
1567
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1568
+ # to the HTTP request.
1569
+ #
1570
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1571
+ #
1572
+ def begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
1573
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1574
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1575
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1576
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1577
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1578
+
1579
+
1580
+ request_headers = {}
1581
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1582
+
1583
+ # Set Headers
1584
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1585
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1586
+
1587
+ # Serialize Request
1588
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetUpdate.mapper()
1589
+ request_content = @client.serialize(request_mapper, parameters)
1590
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1591
+
1592
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
1593
+
1594
+ request_url = @base_url || @client.base_url
1595
+
1596
+ options = {
1597
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1598
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1599
+ query_params: {'api-version' => @client.api_version},
1600
+ body: request_content,
1601
+ headers: request_headers.merge(custom_headers || {}),
1602
+ base_url: request_url
1603
+ }
1604
+ promise = @client.make_request_async(:patch, path_template, options)
1605
+
1606
+ promise = promise.then do |result|
1607
+ http_response = result.response
1608
+ status_code = http_response.status
1609
+ response_content = http_response.body
1610
+ unless status_code == 200
1611
+ error_model = JSON.load(response_content)
1612
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1613
+ end
1614
+
1615
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1616
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1617
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1618
+ # Deserialize Response
1619
+ if status_code == 200
1620
+ begin
1621
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1622
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSet.mapper()
1623
+ result.body = @client.deserialize(result_mapper, parsed_response)
1624
+ rescue Exception => e
1625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1626
+ end
1627
+ end
1628
+
1629
+ result
1630
+ end
1631
+
1632
+ promise.execute
1633
+ end
1634
+
1635
+ #
1636
+ # Deletes a VM scale set.
1637
+ #
1638
+ # @param resource_group_name [String] The name of the resource group.
1639
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1640
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1641
+ # will be added to the HTTP request.
1642
+ #
1643
+ #
1644
+ def begin_delete(resource_group_name, vm_scale_set_name, custom_headers:nil)
1645
+ response = begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
1646
+ nil
1647
+ end
1648
+
1649
+ #
1650
+ # Deletes a VM scale set.
1651
+ #
1652
+ # @param resource_group_name [String] The name of the resource group.
1653
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1654
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1655
+ # will be added to the HTTP request.
1656
+ #
1657
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1658
+ #
1659
+ def begin_delete_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
1660
+ begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
1661
+ end
1662
+
1663
+ #
1664
+ # Deletes a VM scale set.
1665
+ #
1666
+ # @param resource_group_name [String] The name of the resource group.
1667
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1668
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1669
+ # to the HTTP request.
1670
+ #
1671
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1672
+ #
1673
+ def begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
1674
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1675
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1676
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1677
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1678
+
1679
+
1680
+ request_headers = {}
1681
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1682
+
1683
+ # Set Headers
1684
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1685
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1686
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'
1687
+
1688
+ request_url = @base_url || @client.base_url
1689
+
1690
+ options = {
1691
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1692
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1693
+ query_params: {'api-version' => @client.api_version},
1694
+ headers: request_headers.merge(custom_headers || {}),
1695
+ base_url: request_url
1696
+ }
1697
+ promise = @client.make_request_async(:delete, path_template, options)
1698
+
1699
+ promise = promise.then do |result|
1700
+ http_response = result.response
1701
+ status_code = http_response.status
1702
+ response_content = http_response.body
1703
+ unless status_code == 200 || status_code == 202 || status_code == 204
1704
+ error_model = JSON.load(response_content)
1705
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1706
+ end
1707
+
1708
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1709
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1710
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1711
+
1712
+ result
1713
+ end
1714
+
1715
+ promise.execute
1716
+ end
1717
+
1718
+ #
1719
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
1720
+ # virtual machines and releases the compute resources. You are not billed for
1721
+ # the compute resources that this virtual machine scale set deallocates.
1722
+ #
1723
+ # @param resource_group_name [String] The name of the resource group.
1724
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1725
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1726
+ # virtual machine instance IDs from the VM scale set.
1727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1728
+ # will be added to the HTTP request.
1729
+ #
1730
+ #
1731
+ def begin_deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1732
+ response = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
1733
+ nil
1734
+ end
1735
+
1736
+ #
1737
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
1738
+ # virtual machines and releases the compute resources. You are not billed for
1739
+ # the compute resources that this virtual machine scale set deallocates.
1740
+ #
1741
+ # @param resource_group_name [String] The name of the resource group.
1742
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1743
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1744
+ # virtual machine instance IDs from the VM scale set.
1745
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1746
+ # will be added to the HTTP request.
1747
+ #
1748
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1749
+ #
1750
+ def begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1751
+ begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
1752
+ end
1753
+
1754
+ #
1755
+ # Deallocates specific virtual machines in a VM scale set. Shuts down the
1756
+ # virtual machines and releases the compute resources. You are not billed for
1757
+ # the compute resources that this virtual machine scale set deallocates.
1758
+ #
1759
+ # @param resource_group_name [String] The name of the resource group.
1760
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1761
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1762
+ # virtual machine instance IDs from the VM scale set.
1763
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1764
+ # to the HTTP request.
1765
+ #
1766
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1767
+ #
1768
+ def begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
1769
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1770
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1771
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1772
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1773
+
1774
+
1775
+ request_headers = {}
1776
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1777
+
1778
+ # Set Headers
1779
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1780
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1781
+
1782
+ # Serialize Request
1783
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
1784
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
1785
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1786
+
1787
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'
1788
+
1789
+ request_url = @base_url || @client.base_url
1790
+
1791
+ options = {
1792
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1793
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1794
+ query_params: {'api-version' => @client.api_version},
1795
+ body: request_content,
1796
+ headers: request_headers.merge(custom_headers || {}),
1797
+ base_url: request_url
1798
+ }
1799
+ promise = @client.make_request_async(:post, path_template, options)
1800
+
1801
+ promise = promise.then do |result|
1802
+ http_response = result.response
1803
+ status_code = http_response.status
1804
+ response_content = http_response.body
1805
+ unless status_code == 200 || status_code == 202
1806
+ error_model = JSON.load(response_content)
1807
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1808
+ end
1809
+
1810
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1811
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1812
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1813
+
1814
+ result
1815
+ end
1816
+
1817
+ promise.execute
1818
+ end
1819
+
1820
+ #
1821
+ # Deletes virtual machines in a VM scale set.
1822
+ #
1823
+ # @param resource_group_name [String] The name of the resource group.
1824
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1825
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1826
+ # of virtual machine instance IDs from the VM scale set.
1827
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1828
+ # will be added to the HTTP request.
1829
+ #
1830
+ #
1831
+ def begin_delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1832
+ response = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
1833
+ nil
1834
+ end
1835
+
1836
+ #
1837
+ # Deletes virtual machines in a VM scale set.
1838
+ #
1839
+ # @param resource_group_name [String] The name of the resource group.
1840
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1841
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1842
+ # of virtual machine instance IDs from the VM scale set.
1843
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1844
+ # will be added to the HTTP request.
1845
+ #
1846
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1847
+ #
1848
+ def begin_delete_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1849
+ begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
1850
+ end
1851
+
1852
+ #
1853
+ # Deletes virtual machines in a VM scale set.
1854
+ #
1855
+ # @param resource_group_name [String] The name of the resource group.
1856
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1857
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
1858
+ # of virtual machine instance IDs from the VM scale set.
1859
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1860
+ # to the HTTP request.
1861
+ #
1862
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1863
+ #
1864
+ def begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
1865
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1866
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1867
+ fail ArgumentError, 'vm_instance_ids is nil' if vm_instance_ids.nil?
1868
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1869
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1870
+
1871
+
1872
+ request_headers = {}
1873
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1874
+
1875
+ # Set Headers
1876
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1877
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1878
+
1879
+ # Serialize Request
1880
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
1881
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
1882
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1883
+
1884
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'
1885
+
1886
+ request_url = @base_url || @client.base_url
1887
+
1888
+ options = {
1889
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1890
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
1891
+ query_params: {'api-version' => @client.api_version},
1892
+ body: request_content,
1893
+ headers: request_headers.merge(custom_headers || {}),
1894
+ base_url: request_url
1895
+ }
1896
+ promise = @client.make_request_async(:post, path_template, options)
1897
+
1898
+ promise = promise.then do |result|
1899
+ http_response = result.response
1900
+ status_code = http_response.status
1901
+ response_content = http_response.body
1902
+ unless status_code == 200 || status_code == 202
1903
+ error_model = JSON.load(response_content)
1904
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1905
+ end
1906
+
1907
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1908
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1909
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1910
+
1911
+ result
1912
+ end
1913
+
1914
+ promise.execute
1915
+ end
1916
+
1917
+ #
1918
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
1919
+ # resources are still attached and you are getting charged for the resources.
1920
+ # Instead, use deallocate to release resources and avoid charges.
1921
+ #
1922
+ # @param resource_group_name [String] The name of the resource group.
1923
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1924
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1925
+ # virtual machine instance IDs from the VM scale set.
1926
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1927
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1928
+ # false indicates otherwise. Default value for this flag is false if not
1929
+ # specified
1930
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1931
+ # will be added to the HTTP request.
1932
+ #
1933
+ #
1934
+ def begin_power_off(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
1935
+ 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!
1936
+ nil
1937
+ end
1938
+
1939
+ #
1940
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
1941
+ # resources are still attached and you are getting charged for the resources.
1942
+ # Instead, use deallocate to release resources and avoid charges.
1943
+ #
1944
+ # @param resource_group_name [String] The name of the resource group.
1945
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1946
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1947
+ # virtual machine instance IDs from the VM scale set.
1948
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1949
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1950
+ # false indicates otherwise. Default value for this flag is false if not
1951
+ # specified
1952
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1953
+ # will be added to the HTTP request.
1954
+ #
1955
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1956
+ #
1957
+ def begin_power_off_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
1958
+ 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!
1959
+ end
1960
+
1961
+ #
1962
+ # Power off (stop) one or more virtual machines in a VM scale set. Note that
1963
+ # resources are still attached and you are getting charged for the resources.
1964
+ # Instead, use deallocate to release resources and avoid charges.
1965
+ #
1966
+ # @param resource_group_name [String] The name of the resource group.
1967
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1968
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
1969
+ # virtual machine instance IDs from the VM scale set.
1970
+ # @param skip_shutdown [Boolean] The parameter to request non-graceful VM
1971
+ # shutdown. True value for this flag indicates non-graceful shutdown whereas
1972
+ # false indicates otherwise. Default value for this flag is false if not
1973
+ # specified
1974
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1975
+ # to the HTTP request.
1976
+ #
1977
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1978
+ #
1979
+ def begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, skip_shutdown:false, custom_headers:nil)
1980
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1981
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1982
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1983
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1984
+
1985
+
1986
+ request_headers = {}
1987
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1988
+
1989
+ # Set Headers
1990
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1991
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1992
+
1993
+ # Serialize Request
1994
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
1995
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
1996
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1997
+
1998
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'
1999
+
2000
+ request_url = @base_url || @client.base_url
2001
+
2002
+ options = {
2003
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2004
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2005
+ query_params: {'skipShutdown' => skip_shutdown,'api-version' => @client.api_version},
2006
+ body: request_content,
2007
+ headers: request_headers.merge(custom_headers || {}),
2008
+ base_url: request_url
2009
+ }
2010
+ promise = @client.make_request_async(:post, path_template, options)
2011
+
2012
+ promise = promise.then do |result|
2013
+ http_response = result.response
2014
+ status_code = http_response.status
2015
+ response_content = http_response.body
2016
+ unless status_code == 200 || status_code == 202
2017
+ error_model = JSON.load(response_content)
2018
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2019
+ end
2020
+
2021
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2022
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2023
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2024
+
2025
+ result
2026
+ end
2027
+
2028
+ promise.execute
2029
+ end
2030
+
2031
+ #
2032
+ # Restarts one or more virtual machines in a VM scale set.
2033
+ #
2034
+ # @param resource_group_name [String] The name of the resource group.
2035
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2036
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2037
+ # virtual machine instance IDs from the VM scale set.
2038
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2039
+ # will be added to the HTTP request.
2040
+ #
2041
+ #
2042
+ def begin_restart(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2043
+ response = begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2044
+ nil
2045
+ end
2046
+
2047
+ #
2048
+ # Restarts one or more virtual machines in a VM scale set.
2049
+ #
2050
+ # @param resource_group_name [String] The name of the resource group.
2051
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2052
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2053
+ # virtual machine instance IDs from the VM scale set.
2054
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2055
+ # will be added to the HTTP request.
2056
+ #
2057
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2058
+ #
2059
+ def begin_restart_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2060
+ begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2061
+ end
2062
+
2063
+ #
2064
+ # Restarts one or more virtual machines in a VM scale set.
2065
+ #
2066
+ # @param resource_group_name [String] The name of the resource group.
2067
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2068
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2069
+ # virtual machine instance IDs from the VM scale set.
2070
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2071
+ # to the HTTP request.
2072
+ #
2073
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2074
+ #
2075
+ def begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2076
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2077
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2078
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2079
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2080
+
2081
+
2082
+ request_headers = {}
2083
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2084
+
2085
+ # Set Headers
2086
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2087
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2088
+
2089
+ # Serialize Request
2090
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2091
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2092
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2093
+
2094
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'
2095
+
2096
+ request_url = @base_url || @client.base_url
2097
+
2098
+ options = {
2099
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2100
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2101
+ query_params: {'api-version' => @client.api_version},
2102
+ body: request_content,
2103
+ headers: request_headers.merge(custom_headers || {}),
2104
+ base_url: request_url
2105
+ }
2106
+ promise = @client.make_request_async(:post, path_template, options)
2107
+
2108
+ promise = promise.then do |result|
2109
+ http_response = result.response
2110
+ status_code = http_response.status
2111
+ response_content = http_response.body
2112
+ unless status_code == 200 || status_code == 202
2113
+ error_model = JSON.load(response_content)
2114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2115
+ end
2116
+
2117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2118
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2119
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2120
+
2121
+ result
2122
+ end
2123
+
2124
+ promise.execute
2125
+ end
2126
+
2127
+ #
2128
+ # Starts one or more virtual machines in a VM scale set.
2129
+ #
2130
+ # @param resource_group_name [String] The name of the resource group.
2131
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2132
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2133
+ # virtual machine instance IDs from the VM scale set.
2134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2135
+ # will be added to the HTTP request.
2136
+ #
2137
+ #
2138
+ def begin_start(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2139
+ response = begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2140
+ nil
2141
+ end
2142
+
2143
+ #
2144
+ # Starts one or more virtual machines in a VM scale set.
2145
+ #
2146
+ # @param resource_group_name [String] The name of the resource group.
2147
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2148
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2149
+ # virtual machine instance IDs from the VM scale set.
2150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2151
+ # will be added to the HTTP request.
2152
+ #
2153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2154
+ #
2155
+ def begin_start_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2156
+ begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2157
+ end
2158
+
2159
+ #
2160
+ # Starts one or more virtual machines in a VM scale set.
2161
+ #
2162
+ # @param resource_group_name [String] The name of the resource group.
2163
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2164
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2165
+ # virtual machine instance IDs from the VM scale set.
2166
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2167
+ # to the HTTP request.
2168
+ #
2169
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2170
+ #
2171
+ def begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2172
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2173
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2174
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2175
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2176
+
2177
+
2178
+ request_headers = {}
2179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2180
+
2181
+ # Set Headers
2182
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2183
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2184
+
2185
+ # Serialize Request
2186
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2187
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2188
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2189
+
2190
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'
2191
+
2192
+ request_url = @base_url || @client.base_url
2193
+
2194
+ options = {
2195
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2196
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2197
+ query_params: {'api-version' => @client.api_version},
2198
+ body: request_content,
2199
+ headers: request_headers.merge(custom_headers || {}),
2200
+ base_url: request_url
2201
+ }
2202
+ promise = @client.make_request_async(:post, path_template, options)
2203
+
2204
+ promise = promise.then do |result|
2205
+ http_response = result.response
2206
+ status_code = http_response.status
2207
+ response_content = http_response.body
2208
+ unless status_code == 200 || status_code == 202
2209
+ error_model = JSON.load(response_content)
2210
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2211
+ end
2212
+
2213
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2214
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2215
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2216
+
2217
+ result
2218
+ end
2219
+
2220
+ promise.execute
2221
+ end
2222
+
2223
+ #
2224
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
2225
+ # them to a new node, and powers them back on.
2226
+ #
2227
+ # @param resource_group_name [String] The name of the resource group.
2228
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2229
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2230
+ # virtual machine instance IDs from the VM scale set.
2231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2232
+ # will be added to the HTTP request.
2233
+ #
2234
+ #
2235
+ def begin_redeploy(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2236
+ response = begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2237
+ nil
2238
+ end
2239
+
2240
+ #
2241
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
2242
+ # them to a new node, and powers them back on.
2243
+ #
2244
+ # @param resource_group_name [String] The name of the resource group.
2245
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2246
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2247
+ # virtual machine instance IDs from the VM scale set.
2248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2249
+ # will be added to the HTTP request.
2250
+ #
2251
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2252
+ #
2253
+ def begin_redeploy_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2254
+ begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2255
+ end
2256
+
2257
+ #
2258
+ # Shuts down all the virtual machines in the virtual machine scale set, moves
2259
+ # them to a new node, and powers them back on.
2260
+ #
2261
+ # @param resource_group_name [String] The name of the resource group.
2262
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2263
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2264
+ # virtual machine instance IDs from the VM scale set.
2265
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2266
+ # to the HTTP request.
2267
+ #
2268
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2269
+ #
2270
+ def begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2271
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2272
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2273
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2274
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2275
+
2276
+
2277
+ request_headers = {}
2278
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2279
+
2280
+ # Set Headers
2281
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2282
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2283
+
2284
+ # Serialize Request
2285
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2286
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2287
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2288
+
2289
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'
2290
+
2291
+ request_url = @base_url || @client.base_url
2292
+
2293
+ options = {
2294
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2295
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2296
+ query_params: {'api-version' => @client.api_version},
2297
+ body: request_content,
2298
+ headers: request_headers.merge(custom_headers || {}),
2299
+ base_url: request_url
2300
+ }
2301
+ promise = @client.make_request_async(:post, path_template, options)
2302
+
2303
+ promise = promise.then do |result|
2304
+ http_response = result.response
2305
+ status_code = http_response.status
2306
+ response_content = http_response.body
2307
+ unless status_code == 200 || status_code == 202
2308
+ error_model = JSON.load(response_content)
2309
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2310
+ end
2311
+
2312
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2313
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2314
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2315
+
2316
+ result
2317
+ end
2318
+
2319
+ promise.execute
2320
+ end
2321
+
2322
+ #
2323
+ # Perform maintenance on one or more virtual machines in a VM scale set.
2324
+ # Operation on instances which are not eligible for perform maintenance will be
2325
+ # failed. Please refer to best practices for more details:
2326
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
2327
+ #
2328
+ # @param resource_group_name [String] The name of the resource group.
2329
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2330
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2331
+ # virtual machine instance IDs from the VM scale set.
2332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2333
+ # will be added to the HTTP request.
2334
+ #
2335
+ #
2336
+ def begin_perform_maintenance(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2337
+ response = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2338
+ nil
2339
+ end
2340
+
2341
+ #
2342
+ # Perform maintenance on one or more virtual machines in a VM scale set.
2343
+ # Operation on instances which are not eligible for perform maintenance will be
2344
+ # failed. Please refer to best practices for more details:
2345
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
2346
+ #
2347
+ # @param resource_group_name [String] The name of the resource group.
2348
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2349
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2350
+ # virtual machine instance IDs from the VM scale set.
2351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2352
+ # will be added to the HTTP request.
2353
+ #
2354
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2355
+ #
2356
+ def begin_perform_maintenance_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2357
+ begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2358
+ end
2359
+
2360
+ #
2361
+ # Perform maintenance on one or more virtual machines in a VM scale set.
2362
+ # Operation on instances which are not eligible for perform maintenance will be
2363
+ # failed. Please refer to best practices for more details:
2364
+ # https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
2365
+ #
2366
+ # @param resource_group_name [String] The name of the resource group.
2367
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2368
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2369
+ # virtual machine instance IDs from the VM scale set.
2370
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2371
+ # to the HTTP request.
2372
+ #
2373
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2374
+ #
2375
+ def begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2376
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2377
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2378
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2379
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2380
+
2381
+
2382
+ request_headers = {}
2383
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2384
+
2385
+ # Set Headers
2386
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2387
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2388
+
2389
+ # Serialize Request
2390
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2391
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2392
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2393
+
2394
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'
2395
+
2396
+ request_url = @base_url || @client.base_url
2397
+
2398
+ options = {
2399
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2400
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2401
+ query_params: {'api-version' => @client.api_version},
2402
+ body: request_content,
2403
+ headers: request_headers.merge(custom_headers || {}),
2404
+ base_url: request_url
2405
+ }
2406
+ promise = @client.make_request_async(:post, path_template, options)
2407
+
2408
+ promise = promise.then do |result|
2409
+ http_response = result.response
2410
+ status_code = http_response.status
2411
+ response_content = http_response.body
2412
+ unless status_code == 200 || status_code == 202
2413
+ error_model = JSON.load(response_content)
2414
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2415
+ end
2416
+
2417
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2418
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2419
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2420
+
2421
+ result
2422
+ end
2423
+
2424
+ promise.execute
2425
+ end
2426
+
2427
+ #
2428
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
2429
+ # set model.
2430
+ #
2431
+ # @param resource_group_name [String] The name of the resource group.
2432
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2433
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
2434
+ # of virtual machine instance IDs from the VM scale set.
2435
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2436
+ # will be added to the HTTP request.
2437
+ #
2438
+ #
2439
+ def begin_update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
2440
+ response = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
2441
+ nil
2442
+ end
2443
+
2444
+ #
2445
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
2446
+ # set model.
2447
+ #
2448
+ # @param resource_group_name [String] The name of the resource group.
2449
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2450
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
2451
+ # of virtual machine instance IDs from the VM scale set.
2452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2453
+ # will be added to the HTTP request.
2454
+ #
2455
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2456
+ #
2457
+ def begin_update_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
2458
+ begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
2459
+ end
2460
+
2461
+ #
2462
+ # Upgrades one or more virtual machines to the latest SKU set in the VM scale
2463
+ # set model.
2464
+ #
2465
+ # @param resource_group_name [String] The name of the resource group.
2466
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2467
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
2468
+ # of virtual machine instance IDs from the VM scale set.
2469
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2470
+ # to the HTTP request.
2471
+ #
2472
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2473
+ #
2474
+ def begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
2475
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2476
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2477
+ fail ArgumentError, 'vm_instance_ids is nil' if vm_instance_ids.nil?
2478
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2479
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2480
+
2481
+
2482
+ request_headers = {}
2483
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2484
+
2485
+ # Set Headers
2486
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2487
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2488
+
2489
+ # Serialize Request
2490
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
2491
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2492
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2493
+
2494
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'
2495
+
2496
+ request_url = @base_url || @client.base_url
2497
+
2498
+ options = {
2499
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2500
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2501
+ query_params: {'api-version' => @client.api_version},
2502
+ body: request_content,
2503
+ headers: request_headers.merge(custom_headers || {}),
2504
+ base_url: request_url
2505
+ }
2506
+ promise = @client.make_request_async(:post, path_template, options)
2507
+
2508
+ promise = promise.then do |result|
2509
+ http_response = result.response
2510
+ status_code = http_response.status
2511
+ response_content = http_response.body
2512
+ unless status_code == 200 || status_code == 202
2513
+ error_model = JSON.load(response_content)
2514
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2515
+ end
2516
+
2517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2518
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2519
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2520
+
2521
+ result
2522
+ end
2523
+
2524
+ promise.execute
2525
+ end
2526
+
2527
+ #
2528
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
2529
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
2530
+ # a ephemeral OS disk the virtual machine is reset to initial state.
2531
+ #
2532
+ # @param resource_group_name [String] The name of the resource group.
2533
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2534
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
2535
+ # Parameters for Reimaging VM ScaleSet.
2536
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2537
+ # will be added to the HTTP request.
2538
+ #
2539
+ #
2540
+ def begin_reimage(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
2541
+ 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!
2542
+ nil
2543
+ end
2544
+
2545
+ #
2546
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
2547
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
2548
+ # a ephemeral OS disk the virtual machine is reset to initial state.
2549
+ #
2550
+ # @param resource_group_name [String] The name of the resource group.
2551
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2552
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
2553
+ # Parameters for Reimaging VM ScaleSet.
2554
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2555
+ # will be added to the HTTP request.
2556
+ #
2557
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2558
+ #
2559
+ def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
2560
+ 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!
2561
+ end
2562
+
2563
+ #
2564
+ # Reimages (upgrade the operating system) one or more virtual machines in a VM
2565
+ # scale set which don't have a ephemeral OS disk, for virtual machines who have
2566
+ # a ephemeral OS disk the virtual machine is reset to initial state.
2567
+ #
2568
+ # @param resource_group_name [String] The name of the resource group.
2569
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2570
+ # @param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
2571
+ # Parameters for Reimaging VM ScaleSet.
2572
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2573
+ # to the HTTP request.
2574
+ #
2575
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2576
+ #
2577
+ def begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
2578
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2579
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2580
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2581
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2582
+
2583
+
2584
+ request_headers = {}
2585
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2586
+
2587
+ # Set Headers
2588
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2589
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2590
+
2591
+ # Serialize Request
2592
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetReimageParameters.mapper()
2593
+ request_content = @client.serialize(request_mapper, vm_scale_set_reimage_input)
2594
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2595
+
2596
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'
2597
+
2598
+ request_url = @base_url || @client.base_url
2599
+
2600
+ options = {
2601
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2602
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2603
+ query_params: {'api-version' => @client.api_version},
2604
+ body: request_content,
2605
+ headers: request_headers.merge(custom_headers || {}),
2606
+ base_url: request_url
2607
+ }
2608
+ promise = @client.make_request_async(:post, path_template, options)
2609
+
2610
+ promise = promise.then do |result|
2611
+ http_response = result.response
2612
+ status_code = http_response.status
2613
+ response_content = http_response.body
2614
+ unless status_code == 200 || status_code == 202
2615
+ error_model = JSON.load(response_content)
2616
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2617
+ end
2618
+
2619
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2620
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2621
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2622
+
2623
+ result
2624
+ end
2625
+
2626
+ promise.execute
2627
+ end
2628
+
2629
+ #
2630
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
2631
+ # VM scale set. This operation is only supported for managed disks.
2632
+ #
2633
+ # @param resource_group_name [String] The name of the resource group.
2634
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2635
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2636
+ # virtual machine instance IDs from the VM scale set.
2637
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2638
+ # will be added to the HTTP request.
2639
+ #
2640
+ #
2641
+ def begin_reimage_all(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2642
+ response = begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2643
+ nil
2644
+ end
2645
+
2646
+ #
2647
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
2648
+ # VM scale set. This operation is only supported for managed disks.
2649
+ #
2650
+ # @param resource_group_name [String] The name of the resource group.
2651
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2652
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2653
+ # virtual machine instance IDs from the VM scale set.
2654
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2655
+ # will be added to the HTTP request.
2656
+ #
2657
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2658
+ #
2659
+ def begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2660
+ begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
2661
+ end
2662
+
2663
+ #
2664
+ # Reimages all the disks ( including data disks ) in the virtual machines in a
2665
+ # VM scale set. This operation is only supported for managed disks.
2666
+ #
2667
+ # @param resource_group_name [String] The name of the resource group.
2668
+ # @param vm_scale_set_name [String] The name of the VM scale set.
2669
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
2670
+ # virtual machine instance IDs from the VM scale set.
2671
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2672
+ # to the HTTP request.
2673
+ #
2674
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2675
+ #
2676
+ def begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
2677
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2678
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2679
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2680
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2681
+
2682
+
2683
+ request_headers = {}
2684
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2685
+
2686
+ # Set Headers
2687
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2688
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2689
+
2690
+ # Serialize Request
2691
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
2692
+ request_content = @client.serialize(request_mapper, vm_instance_ids)
2693
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2694
+
2695
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'
2696
+
2697
+ request_url = @base_url || @client.base_url
2698
+
2699
+ options = {
2700
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2701
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2702
+ query_params: {'api-version' => @client.api_version},
2703
+ body: request_content,
2704
+ headers: request_headers.merge(custom_headers || {}),
2705
+ base_url: request_url
2706
+ }
2707
+ promise = @client.make_request_async(:post, path_template, options)
2708
+
2709
+ promise = promise.then do |result|
2710
+ http_response = result.response
2711
+ status_code = http_response.status
2712
+ response_content = http_response.body
2713
+ unless status_code == 200 || status_code == 202
2714
+ error_model = JSON.load(response_content)
2715
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2716
+ end
2717
+
2718
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2719
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2720
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2721
+
2722
+ result
2723
+ end
2724
+
2725
+ promise.execute
2726
+ end
2727
+
2728
+ #
2729
+ # Changes ServiceState property for a given service
2730
+ #
2731
+ # @param resource_group_name [String] The name of the resource group.
2732
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
2733
+ # to create or update.
2734
+ # @param parameters [OrchestrationServiceStateInput] The input object for
2735
+ # SetOrchestrationServiceState API.
2736
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2737
+ # will be added to the HTTP request.
2738
+ #
2739
+ #
2740
+ def begin_set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
2741
+ response = begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
2742
+ nil
2743
+ end
2744
+
2745
+ #
2746
+ # Changes ServiceState property for a given service
2747
+ #
2748
+ # @param resource_group_name [String] The name of the resource group.
2749
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
2750
+ # to create or update.
2751
+ # @param parameters [OrchestrationServiceStateInput] The input object for
2752
+ # SetOrchestrationServiceState API.
2753
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2754
+ # will be added to the HTTP request.
2755
+ #
2756
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2757
+ #
2758
+ def begin_set_orchestration_service_state_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
2759
+ begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
2760
+ end
2761
+
2762
+ #
2763
+ # Changes ServiceState property for a given service
2764
+ #
2765
+ # @param resource_group_name [String] The name of the resource group.
2766
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set
2767
+ # to create or update.
2768
+ # @param parameters [OrchestrationServiceStateInput] The input object for
2769
+ # SetOrchestrationServiceState API.
2770
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2771
+ # to the HTTP request.
2772
+ #
2773
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2774
+ #
2775
+ def begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
2776
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2777
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
2778
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2779
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2780
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2781
+
2782
+
2783
+ request_headers = {}
2784
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2785
+
2786
+ # Set Headers
2787
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2788
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2789
+
2790
+ # Serialize Request
2791
+ request_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::OrchestrationServiceStateInput.mapper()
2792
+ request_content = @client.serialize(request_mapper, parameters)
2793
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2794
+
2795
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState'
2796
+
2797
+ request_url = @base_url || @client.base_url
2798
+
2799
+ options = {
2800
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2801
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
2802
+ query_params: {'api-version' => @client.api_version},
2803
+ body: request_content,
2804
+ headers: request_headers.merge(custom_headers || {}),
2805
+ base_url: request_url
2806
+ }
2807
+ promise = @client.make_request_async(:post, path_template, options)
2808
+
2809
+ promise = promise.then do |result|
2810
+ http_response = result.response
2811
+ status_code = http_response.status
2812
+ response_content = http_response.body
2813
+ unless status_code == 200 || status_code == 202
2814
+ error_model = JSON.load(response_content)
2815
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2816
+ end
2817
+
2818
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2819
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2820
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2821
+
2822
+ result
2823
+ end
2824
+
2825
+ promise.execute
2826
+ end
2827
+
2828
+ #
2829
+ # Gets a list of all VM scale sets under a resource group.
2830
+ #
2831
+ # @param next_page_link [String] The NextLink from the previous successful call
2832
+ # to List operation.
2833
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2834
+ # will be added to the HTTP request.
2835
+ #
2836
+ # @return [VirtualMachineScaleSetListResult] operation results.
2837
+ #
2838
+ def list_next(next_page_link, custom_headers:nil)
2839
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2840
+ response.body unless response.nil?
2841
+ end
2842
+
2843
+ #
2844
+ # Gets a list of all VM scale sets under a resource group.
2845
+ #
2846
+ # @param next_page_link [String] The NextLink from the previous successful call
2847
+ # to List operation.
2848
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2849
+ # will be added to the HTTP request.
2850
+ #
2851
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2852
+ #
2853
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2854
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2855
+ end
2856
+
2857
+ #
2858
+ # Gets a list of all VM scale sets under a resource group.
2859
+ #
2860
+ # @param next_page_link [String] The NextLink from the previous successful call
2861
+ # to List operation.
2862
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2863
+ # to the HTTP request.
2864
+ #
2865
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2866
+ #
2867
+ def list_next_async(next_page_link, custom_headers:nil)
2868
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2869
+
2870
+
2871
+ request_headers = {}
2872
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2873
+
2874
+ # Set Headers
2875
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2876
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2877
+ path_template = '{nextLink}'
2878
+
2879
+ request_url = @base_url || @client.base_url
2880
+
2881
+ options = {
2882
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2883
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2884
+ headers: request_headers.merge(custom_headers || {}),
2885
+ base_url: request_url
2886
+ }
2887
+ promise = @client.make_request_async(:get, path_template, options)
2888
+
2889
+ promise = promise.then do |result|
2890
+ http_response = result.response
2891
+ status_code = http_response.status
2892
+ response_content = http_response.body
2893
+ unless status_code == 200
2894
+ error_model = JSON.load(response_content)
2895
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2896
+ end
2897
+
2898
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2899
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2900
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2901
+ # Deserialize Response
2902
+ if status_code == 200
2903
+ begin
2904
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2905
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetListResult.mapper()
2906
+ result.body = @client.deserialize(result_mapper, parsed_response)
2907
+ rescue Exception => e
2908
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2909
+ end
2910
+ end
2911
+
2912
+ result
2913
+ end
2914
+
2915
+ promise.execute
2916
+ end
2917
+
2918
+ #
2919
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
2920
+ # associated resource group. Use nextLink property in the response to get the
2921
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
2922
+ # Scale Sets.
2923
+ #
2924
+ # @param next_page_link [String] The NextLink from the previous successful call
2925
+ # to List operation.
2926
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2927
+ # will be added to the HTTP request.
2928
+ #
2929
+ # @return [VirtualMachineScaleSetListWithLinkResult] operation results.
2930
+ #
2931
+ def list_all_next(next_page_link, custom_headers:nil)
2932
+ response = list_all_next_async(next_page_link, custom_headers:custom_headers).value!
2933
+ response.body unless response.nil?
2934
+ end
2935
+
2936
+ #
2937
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
2938
+ # associated resource group. Use nextLink property in the response to get the
2939
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
2940
+ # Scale Sets.
2941
+ #
2942
+ # @param next_page_link [String] The NextLink from the previous successful call
2943
+ # to List operation.
2944
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2945
+ # will be added to the HTTP request.
2946
+ #
2947
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2948
+ #
2949
+ def list_all_next_with_http_info(next_page_link, custom_headers:nil)
2950
+ list_all_next_async(next_page_link, custom_headers:custom_headers).value!
2951
+ end
2952
+
2953
+ #
2954
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
2955
+ # associated resource group. Use nextLink property in the response to get the
2956
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
2957
+ # Scale Sets.
2958
+ #
2959
+ # @param next_page_link [String] The NextLink from the previous successful call
2960
+ # to List operation.
2961
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2962
+ # to the HTTP request.
2963
+ #
2964
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2965
+ #
2966
+ def list_all_next_async(next_page_link, custom_headers:nil)
2967
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2968
+
2969
+
2970
+ request_headers = {}
2971
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2972
+
2973
+ # Set Headers
2974
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2975
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2976
+ path_template = '{nextLink}'
2977
+
2978
+ request_url = @base_url || @client.base_url
2979
+
2980
+ options = {
2981
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2982
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2983
+ headers: request_headers.merge(custom_headers || {}),
2984
+ base_url: request_url
2985
+ }
2986
+ promise = @client.make_request_async(:get, path_template, options)
2987
+
2988
+ promise = promise.then do |result|
2989
+ http_response = result.response
2990
+ status_code = http_response.status
2991
+ response_content = http_response.body
2992
+ unless status_code == 200
2993
+ error_model = JSON.load(response_content)
2994
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2995
+ end
2996
+
2997
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2998
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2999
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3000
+ # Deserialize Response
3001
+ if status_code == 200
3002
+ begin
3003
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3004
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetListWithLinkResult.mapper()
3005
+ result.body = @client.deserialize(result_mapper, parsed_response)
3006
+ rescue Exception => e
3007
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3008
+ end
3009
+ end
3010
+
3011
+ result
3012
+ end
3013
+
3014
+ promise.execute
3015
+ end
3016
+
3017
+ #
3018
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3019
+ # and maximum VM instances allowed for each SKU.
3020
+ #
3021
+ # @param next_page_link [String] The NextLink from the previous successful call
3022
+ # to List operation.
3023
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3024
+ # will be added to the HTTP request.
3025
+ #
3026
+ # @return [VirtualMachineScaleSetListSkusResult] operation results.
3027
+ #
3028
+ def list_skus_next(next_page_link, custom_headers:nil)
3029
+ response = list_skus_next_async(next_page_link, custom_headers:custom_headers).value!
3030
+ response.body unless response.nil?
3031
+ end
3032
+
3033
+ #
3034
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3035
+ # and maximum VM instances allowed for each SKU.
3036
+ #
3037
+ # @param next_page_link [String] The NextLink from the previous successful call
3038
+ # to List operation.
3039
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3040
+ # will be added to the HTTP request.
3041
+ #
3042
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3043
+ #
3044
+ def list_skus_next_with_http_info(next_page_link, custom_headers:nil)
3045
+ list_skus_next_async(next_page_link, custom_headers:custom_headers).value!
3046
+ end
3047
+
3048
+ #
3049
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3050
+ # and maximum VM instances allowed for each SKU.
3051
+ #
3052
+ # @param next_page_link [String] The NextLink from the previous successful call
3053
+ # to List operation.
3054
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3055
+ # to the HTTP request.
3056
+ #
3057
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3058
+ #
3059
+ def list_skus_next_async(next_page_link, custom_headers:nil)
3060
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3061
+
3062
+
3063
+ request_headers = {}
3064
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3065
+
3066
+ # Set Headers
3067
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3068
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3069
+ path_template = '{nextLink}'
3070
+
3071
+ request_url = @base_url || @client.base_url
3072
+
3073
+ options = {
3074
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3075
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3076
+ headers: request_headers.merge(custom_headers || {}),
3077
+ base_url: request_url
3078
+ }
3079
+ promise = @client.make_request_async(:get, path_template, options)
3080
+
3081
+ promise = promise.then do |result|
3082
+ http_response = result.response
3083
+ status_code = http_response.status
3084
+ response_content = http_response.body
3085
+ unless status_code == 200
3086
+ error_model = JSON.load(response_content)
3087
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3088
+ end
3089
+
3090
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3091
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3092
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3093
+ # Deserialize Response
3094
+ if status_code == 200
3095
+ begin
3096
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3097
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetListSkusResult.mapper()
3098
+ result.body = @client.deserialize(result_mapper, parsed_response)
3099
+ rescue Exception => e
3100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3101
+ end
3102
+ end
3103
+
3104
+ result
3105
+ end
3106
+
3107
+ promise.execute
3108
+ end
3109
+
3110
+ #
3111
+ # Gets list of OS upgrades on a VM scale set instance.
3112
+ #
3113
+ # @param next_page_link [String] The NextLink from the previous successful call
3114
+ # to List operation.
3115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3116
+ # will be added to the HTTP request.
3117
+ #
3118
+ # @return [VirtualMachineScaleSetListOSUpgradeHistory] operation results.
3119
+ #
3120
+ def get_osupgrade_history_next(next_page_link, custom_headers:nil)
3121
+ response = get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
3122
+ response.body unless response.nil?
3123
+ end
3124
+
3125
+ #
3126
+ # Gets list of OS upgrades on a VM scale set instance.
3127
+ #
3128
+ # @param next_page_link [String] The NextLink from the previous successful call
3129
+ # to List operation.
3130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3131
+ # will be added to the HTTP request.
3132
+ #
3133
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3134
+ #
3135
+ def get_osupgrade_history_next_with_http_info(next_page_link, custom_headers:nil)
3136
+ get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
3137
+ end
3138
+
3139
+ #
3140
+ # Gets list of OS upgrades on a VM scale set instance.
3141
+ #
3142
+ # @param next_page_link [String] The NextLink from the previous successful call
3143
+ # to List operation.
3144
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3145
+ # to the HTTP request.
3146
+ #
3147
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3148
+ #
3149
+ def get_osupgrade_history_next_async(next_page_link, custom_headers:nil)
3150
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3151
+
3152
+
3153
+ request_headers = {}
3154
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3155
+
3156
+ # Set Headers
3157
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3158
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3159
+ path_template = '{nextLink}'
3160
+
3161
+ request_url = @base_url || @client.base_url
3162
+
3163
+ options = {
3164
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3165
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3166
+ headers: request_headers.merge(custom_headers || {}),
3167
+ base_url: request_url
3168
+ }
3169
+ promise = @client.make_request_async(:get, path_template, options)
3170
+
3171
+ promise = promise.then do |result|
3172
+ http_response = result.response
3173
+ status_code = http_response.status
3174
+ response_content = http_response.body
3175
+ unless status_code == 200
3176
+ error_model = JSON.load(response_content)
3177
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3178
+ end
3179
+
3180
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3181
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3182
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3183
+ # Deserialize Response
3184
+ if status_code == 200
3185
+ begin
3186
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3187
+ result_mapper = Azure::Compute::Mgmt::V2020_06_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.mapper()
3188
+ result.body = @client.deserialize(result_mapper, parsed_response)
3189
+ rescue Exception => e
3190
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3191
+ end
3192
+ end
3193
+
3194
+ result
3195
+ end
3196
+
3197
+ promise.execute
3198
+ end
3199
+
3200
+ #
3201
+ # Gets a list of all VM scale sets under a resource group.
3202
+ #
3203
+ # @param resource_group_name [String] The name of the resource group.
3204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3205
+ # will be added to the HTTP request.
3206
+ #
3207
+ # @return [VirtualMachineScaleSetListResult] which provide lazy access to pages
3208
+ # of the response.
3209
+ #
3210
+ def list_as_lazy(resource_group_name, custom_headers:nil)
3211
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
3212
+ unless response.nil?
3213
+ page = response.body
3214
+ page.next_method = Proc.new do |next_page_link|
3215
+ list_next_async(next_page_link, custom_headers:custom_headers)
3216
+ end
3217
+ page
3218
+ end
3219
+ end
3220
+
3221
+ #
3222
+ # Gets a list of all VM Scale Sets in the subscription, regardless of the
3223
+ # associated resource group. Use nextLink property in the response to get the
3224
+ # next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM
3225
+ # Scale Sets.
3226
+ #
3227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3228
+ # will be added to the HTTP request.
3229
+ #
3230
+ # @return [VirtualMachineScaleSetListWithLinkResult] which provide lazy access
3231
+ # to pages of the response.
3232
+ #
3233
+ def list_all_as_lazy(custom_headers:nil)
3234
+ response = list_all_async(custom_headers:custom_headers).value!
3235
+ unless response.nil?
3236
+ page = response.body
3237
+ page.next_method = Proc.new do |next_page_link|
3238
+ list_all_next_async(next_page_link, custom_headers:custom_headers)
3239
+ end
3240
+ page
3241
+ end
3242
+ end
3243
+
3244
+ #
3245
+ # Gets a list of SKUs available for your VM scale set, including the minimum
3246
+ # and maximum VM instances allowed for each SKU.
3247
+ #
3248
+ # @param resource_group_name [String] The name of the resource group.
3249
+ # @param vm_scale_set_name [String] The name of the VM scale set.
3250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3251
+ # will be added to the HTTP request.
3252
+ #
3253
+ # @return [VirtualMachineScaleSetListSkusResult] which provide lazy access to
3254
+ # pages of the response.
3255
+ #
3256
+ def list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
3257
+ response = list_skus_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
3258
+ unless response.nil?
3259
+ page = response.body
3260
+ page.next_method = Proc.new do |next_page_link|
3261
+ list_skus_next_async(next_page_link, custom_headers:custom_headers)
3262
+ end
3263
+ page
3264
+ end
3265
+ end
3266
+
3267
+ #
3268
+ # Gets list of OS upgrades on a VM scale set instance.
3269
+ #
3270
+ # @param resource_group_name [String] The name of the resource group.
3271
+ # @param vm_scale_set_name [String] The name of the VM scale set.
3272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3273
+ # will be added to the HTTP request.
3274
+ #
3275
+ # @return [VirtualMachineScaleSetListOSUpgradeHistory] which provide lazy
3276
+ # access to pages of the response.
3277
+ #
3278
+ def get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
3279
+ response = get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
3280
+ unless response.nil?
3281
+ page = response.body
3282
+ page.next_method = Proc.new do |next_page_link|
3283
+ get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers)
3284
+ end
3285
+ page
3286
+ end
3287
+ end
3288
+
3289
+ end
3290
+ end