azure_mgmt_devtestlabs 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +1 -1
  3. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +1 -1
  4. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/disk.rb +1 -1
  5. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +1 -1
  6. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/notification_channels.rb +16 -16
  7. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs.rb +241 -0
  8. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/arm_templates.rb +369 -0
  9. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifact_sources.rb +673 -0
  10. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifacts.rb +486 -0
  11. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/costs.rb +244 -0
  12. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/custom_images.rb +759 -0
  13. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +227 -0
  14. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/disks.rb +1090 -0
  15. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/environments.rb +793 -0
  16. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/formulas.rb +727 -0
  17. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/gallery_images.rb +259 -0
  18. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/global_schedules.rb +1131 -0
  19. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/labs.rb +1820 -0
  20. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb +113 -0
  21. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb +78 -0
  22. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +56 -0
  23. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template.rb +194 -0
  24. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +57 -0
  25. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_list.rb +98 -0
  26. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb +57 -0
  27. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties_fragment.rb +57 -0
  28. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact.rb +182 -0
  29. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +70 -0
  30. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb +71 -0
  31. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +123 -0
  32. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb +123 -0
  33. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_list.rb +98 -0
  34. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +57 -0
  35. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb +57 -0
  36. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +215 -0
  37. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb +144 -0
  38. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_list.rb +98 -0
  39. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb +47 -0
  40. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +69 -0
  41. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options_fragment.rb +69 -0
  42. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb +46 -0
  43. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters_fragment.rb +46 -0
  44. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb +80 -0
  45. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb +80 -0
  46. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb +68 -0
  47. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb +68 -0
  48. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb +141 -0
  49. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb +141 -0
  50. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb +97 -0
  51. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb +16 -0
  52. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_type.rb +17 -0
  53. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image.rb +238 -0
  54. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_fragment.rb +167 -0
  55. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_list.rb +98 -0
  56. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb +17 -0
  57. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +69 -0
  58. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom_fragment.rb +69 -0
  59. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan.rb +70 -0
  60. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan_fragment.rb +70 -0
  61. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +70 -0
  62. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm_fragment.rb +70 -0
  63. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb +73 -0
  64. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties_fragment.rb +73 -0
  65. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info.rb +58 -0
  66. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info_fragment.rb +58 -0
  67. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details.rb +46 -0
  68. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details_fragment.rb +46 -0
  69. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb +47 -0
  70. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb +47 -0
  71. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk.rb +204 -0
  72. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_fragment.rb +133 -0
  73. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_list.rb +98 -0
  74. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb +160 -0
  75. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_fragment.rb +76 -0
  76. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_list.rb +98 -0
  77. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/enable_status.rb +16 -0
  78. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb +67 -0
  79. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties_fragment.rb +67 -0
  80. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_permission.rb +16 -0
  81. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +79 -0
  82. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +55 -0
  83. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +55 -0
  84. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event.rb +48 -0
  85. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event_fragment.rb +48 -0
  86. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb +60 -0
  87. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet.rb +57 -0
  88. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb +57 -0
  89. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb +16 -0
  90. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula.rb +182 -0
  91. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_fragment.rb +111 -0
  92. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_list.rb +98 -0
  93. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +47 -0
  94. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm_fragment.rb +47 -0
  95. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +178 -0
  96. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_list.rb +98 -0
  97. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +90 -0
  98. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb +90 -0
  99. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +90 -0
  100. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +46 -0
  101. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +46 -0
  102. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb +17 -0
  103. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details.rb +46 -0
  104. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb +46 -0
  105. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/http_status_code.rb +56 -0
  106. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb +79 -0
  107. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/import_lab_virtual_machine_request.rb +59 -0
  108. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb +73 -0
  109. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb +73 -0
  110. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab.rb +363 -0
  111. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties.rb +117 -0
  112. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties_fragment.rb +93 -0
  113. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost.rb +224 -0
  114. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_details_properties.rb +69 -0
  115. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb +46 -0
  116. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb +181 -0
  117. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_list.rb +98 -0
  118. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_resource_cost_properties.rb +136 -0
  119. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties.rb +59 -0
  120. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties_fragment.rb +59 -0
  121. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +46 -0
  122. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd_list.rb +98 -0
  123. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +526 -0
  124. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb +478 -0
  125. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter_fragment.rb +480 -0
  126. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb +441 -0
  127. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_list.rb +98 -0
  128. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +49 -0
  129. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info_fragment.rb +49 -0
  130. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb +17 -0
  131. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb +139 -0
  132. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb +139 -0
  133. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel.rb +189 -0
  134. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb +16 -0
  135. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_fragment.rb +118 -0
  136. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_list.rb +98 -0
  137. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings.rb +96 -0
  138. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb +96 -0
  139. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb +58 -0
  140. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_error.rb +57 -0
  141. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata.rb +59 -0
  142. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata_display.rb +80 -0
  143. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_result.rb +82 -0
  144. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +57 -0
  145. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb +57 -0
  146. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb +46 -0
  147. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy.rb +197 -0
  148. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb +16 -0
  149. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb +24 -0
  150. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb +126 -0
  151. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_list.rb +98 -0
  152. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +67 -0
  153. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_status.rb +16 -0
  154. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +57 -0
  155. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port.rb +58 -0
  156. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port_fragment.rb +58 -0
  157. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb +16 -0
  158. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/provider_operation_result.rb +101 -0
  159. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/rdp_connection.rb +46 -0
  160. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb +16 -0
  161. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resize_lab_virtual_machine_properties.rb +46 -0
  162. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resource.rb +110 -0
  163. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb +59 -0
  164. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule.rb +219 -0
  165. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter.rb +173 -0
  166. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter_fragment.rb +173 -0
  167. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb +148 -0
  168. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_list.rb +98 -0
  169. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret.rb +121 -0
  170. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_fragment.rb +62 -0
  171. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_list.rb +98 -0
  172. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric.rb +147 -0
  173. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_fragment.rb +74 -0
  174. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_list.rb +98 -0
  175. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner.rb +98 -0
  176. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner_list.rb +98 -0
  177. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb +56 -0
  178. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb +57 -0
  179. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb +180 -0
  180. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/source_control_type.rb +16 -0
  181. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/storage_type.rb +16 -0
  182. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet.rb +70 -0
  183. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb +70 -0
  184. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +107 -0
  185. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb +107 -0
  186. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb +56 -0
  187. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb +57 -0
  188. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb +112 -0
  189. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb +16 -0
  190. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb +16 -0
  191. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/update_resource.rb +54 -0
  192. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb +17 -0
  193. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user.rb +146 -0
  194. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_fragment.rb +75 -0
  195. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity.rb +96 -0
  196. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb +96 -0
  197. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_list.rb +98 -0
  198. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb +57 -0
  199. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb +57 -0
  200. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb +16 -0
  201. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +207 -0
  202. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb +116 -0
  203. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_list.rb +98 -0
  204. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details.rb +66 -0
  205. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb +66 -0
  206. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +48 -0
  207. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info_fragment.rb +48 -0
  208. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb +17 -0
  209. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/module_definition.rb +9 -0
  210. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/notification_channels.rb +769 -0
  211. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/operations.rb +117 -0
  212. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policies.rb +690 -0
  213. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policy_sets.rb +135 -0
  214. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/provider_operations.rb +215 -0
  215. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/schedules.rb +1000 -0
  216. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/secrets.rb +742 -0
  217. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabric_schedules.rb +848 -0
  218. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabrics.rb +1147 -0
  219. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_runners.rb +552 -0
  220. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/users.rb +759 -0
  221. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb +821 -0
  222. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb +2431 -0
  223. data/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb +760 -0
  224. data/lib/azure_mgmt_devtestlabs.rb +1 -0
  225. data/lib/profiles/latest/modules/devtestlabs_profile_module.rb +566 -430
  226. data/lib/version.rb +1 -1
  227. metadata +219 -2
@@ -0,0 +1,2431 @@
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::DevTestLabs::Mgmt::V2018_09_15
7
+ #
8
+ # The DevTest Labs Client.
9
+ #
10
+ class VirtualMachines
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VirtualMachines class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DevTestLabsClient] reference to the DevTestLabsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List virtual machines in a given lab.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param lab_name [String] The name of the lab.
29
+ # @param expand [String] Specify the $expand query. Example:
30
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
31
+ # @param filter [String] The filter to apply to the operation. Example:
32
+ # '$filter=contains(name,'myName')
33
+ # @param top [Integer] The maximum number of resources to return from the
34
+ # operation. Example: '$top=10'
35
+ # @param orderby [String] The ordering expression for the results, using OData
36
+ # notation. Example: '$orderby=name desc'
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [Array<LabVirtualMachine>] operation results.
41
+ #
42
+ def list(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
43
+ first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
44
+ first_page.get_all_items
45
+ end
46
+
47
+ #
48
+ # List virtual machines in a given lab.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group.
51
+ # @param lab_name [String] The name of the lab.
52
+ # @param expand [String] Specify the $expand query. Example:
53
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
54
+ # @param filter [String] The filter to apply to the operation. Example:
55
+ # '$filter=contains(name,'myName')
56
+ # @param top [Integer] The maximum number of resources to return from the
57
+ # operation. Example: '$top=10'
58
+ # @param orderby [String] The ordering expression for the results, using OData
59
+ # notation. Example: '$orderby=name desc'
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
+ #
65
+ def list_with_http_info(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
66
+ list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # List virtual machines in a given lab.
71
+ #
72
+ # @param resource_group_name [String] The name of the resource group.
73
+ # @param lab_name [String] The name of the lab.
74
+ # @param expand [String] Specify the $expand query. Example:
75
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
76
+ # @param filter [String] The filter to apply to the operation. Example:
77
+ # '$filter=contains(name,'myName')
78
+ # @param top [Integer] The maximum number of resources to return from the
79
+ # operation. Example: '$top=10'
80
+ # @param orderby [String] The ordering expression for the results, using OData
81
+ # notation. Example: '$orderby=name desc'
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def list_async(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
90
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
91
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
92
+
93
+
94
+ request_headers = {}
95
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
96
+
97
+ # Set Headers
98
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
99
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
100
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines'
101
+
102
+ request_url = @base_url || @client.base_url
103
+
104
+ options = {
105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
106
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name},
107
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
108
+ headers: request_headers.merge(custom_headers || {}),
109
+ base_url: request_url
110
+ }
111
+ promise = @client.make_request_async(:get, path_template, options)
112
+
113
+ promise = promise.then do |result|
114
+ http_response = result.response
115
+ status_code = http_response.status
116
+ response_content = http_response.body
117
+ unless status_code == 200
118
+ error_model = JSON.load(response_content)
119
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
120
+ end
121
+
122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
123
+ # Deserialize Response
124
+ if status_code == 200
125
+ begin
126
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
127
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList.mapper()
128
+ result.body = @client.deserialize(result_mapper, parsed_response)
129
+ rescue Exception => e
130
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
131
+ end
132
+ end
133
+
134
+ result
135
+ end
136
+
137
+ promise.execute
138
+ end
139
+
140
+ #
141
+ # Get virtual machine.
142
+ #
143
+ # @param resource_group_name [String] The name of the resource group.
144
+ # @param lab_name [String] The name of the lab.
145
+ # @param name [String] The name of the virtual machine.
146
+ # @param expand [String] Specify the $expand query. Example:
147
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
149
+ # will be added to the HTTP request.
150
+ #
151
+ # @return [LabVirtualMachine] operation results.
152
+ #
153
+ def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil)
154
+ response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value!
155
+ response.body unless response.nil?
156
+ end
157
+
158
+ #
159
+ # Get virtual machine.
160
+ #
161
+ # @param resource_group_name [String] The name of the resource group.
162
+ # @param lab_name [String] The name of the lab.
163
+ # @param name [String] The name of the virtual machine.
164
+ # @param expand [String] Specify the $expand query. Example:
165
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
+ # will be added to the HTTP request.
168
+ #
169
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
170
+ #
171
+ def get_with_http_info(resource_group_name, lab_name, name, expand:nil, custom_headers:nil)
172
+ get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value!
173
+ end
174
+
175
+ #
176
+ # Get virtual machine.
177
+ #
178
+ # @param resource_group_name [String] The name of the resource group.
179
+ # @param lab_name [String] The name of the lab.
180
+ # @param name [String] The name of the virtual machine.
181
+ # @param expand [String] Specify the $expand query. Example:
182
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
183
+ # @param [Hash{String => String}] A hash of custom headers that will be added
184
+ # to the HTTP request.
185
+ #
186
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
187
+ #
188
+ def get_async(resource_group_name, lab_name, name, expand:nil, custom_headers:nil)
189
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
190
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
191
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
192
+ fail ArgumentError, 'name is nil' if name.nil?
193
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
194
+
195
+
196
+ request_headers = {}
197
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
198
+
199
+ # Set Headers
200
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
201
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
202
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'
203
+
204
+ request_url = @base_url || @client.base_url
205
+
206
+ options = {
207
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
208
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
209
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
210
+ headers: request_headers.merge(custom_headers || {}),
211
+ base_url: request_url
212
+ }
213
+ promise = @client.make_request_async(:get, path_template, options)
214
+
215
+ promise = promise.then do |result|
216
+ http_response = result.response
217
+ status_code = http_response.status
218
+ response_content = http_response.body
219
+ unless status_code == 200
220
+ error_model = JSON.load(response_content)
221
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
222
+ end
223
+
224
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
225
+ # Deserialize Response
226
+ if status_code == 200
227
+ begin
228
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
229
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper()
230
+ result.body = @client.deserialize(result_mapper, parsed_response)
231
+ rescue Exception => e
232
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
233
+ end
234
+ end
235
+
236
+ result
237
+ end
238
+
239
+ promise.execute
240
+ end
241
+
242
+ #
243
+ # Create or replace an existing Virtual machine. This operation can take a
244
+ # while to complete.
245
+ #
246
+ # @param resource_group_name [String] The name of the resource group.
247
+ # @param lab_name [String] The name of the lab.
248
+ # @param name [String] The name of the virtual machine.
249
+ # @param lab_virtual_machine [LabVirtualMachine] A virtual machine.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [LabVirtualMachine] operation results.
254
+ #
255
+ def create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
256
+ response = create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value!
257
+ response.body unless response.nil?
258
+ end
259
+
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group.
262
+ # @param lab_name [String] The name of the lab.
263
+ # @param name [String] The name of the virtual machine.
264
+ # @param lab_virtual_machine [LabVirtualMachine] A virtual machine.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] promise which provides async access to http
269
+ # response.
270
+ #
271
+ def create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
272
+ # Send request
273
+ promise = begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers)
274
+
275
+ promise = promise.then do |response|
276
+ # Defining deserialization method.
277
+ deserialize_method = lambda do |parsed_response|
278
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper()
279
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
280
+ end
281
+
282
+ # Waiting for response.
283
+ @client.get_long_running_operation_result(response, deserialize_method)
284
+ end
285
+
286
+ promise
287
+ end
288
+
289
+ #
290
+ # Delete virtual machine. This operation can take a while to complete.
291
+ #
292
+ # @param resource_group_name [String] The name of the resource group.
293
+ # @param lab_name [String] The name of the lab.
294
+ # @param name [String] The name of the virtual machine.
295
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
296
+ # will be added to the HTTP request.
297
+ #
298
+ def delete(resource_group_name, lab_name, name, custom_headers:nil)
299
+ response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
300
+ nil
301
+ end
302
+
303
+ #
304
+ # @param resource_group_name [String] The name of the resource group.
305
+ # @param lab_name [String] The name of the lab.
306
+ # @param name [String] The name of the virtual machine.
307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
+ # will be added to the HTTP request.
309
+ #
310
+ # @return [Concurrent::Promise] promise which provides async access to http
311
+ # response.
312
+ #
313
+ def delete_async(resource_group_name, lab_name, name, custom_headers:nil)
314
+ # Send request
315
+ promise = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
316
+
317
+ promise = promise.then do |response|
318
+ # Defining deserialization method.
319
+ deserialize_method = lambda do |parsed_response|
320
+ end
321
+
322
+ # Waiting for response.
323
+ @client.get_long_running_operation_result(response, deserialize_method)
324
+ end
325
+
326
+ promise
327
+ end
328
+
329
+ #
330
+ # Modify properties of virtual machines.
331
+ #
332
+ # @param resource_group_name [String] The name of the resource group.
333
+ # @param lab_name [String] The name of the lab.
334
+ # @param name [String] The name of the virtual machine.
335
+ # @param lab_virtual_machine [LabVirtualMachineFragment] A virtual machine.
336
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
337
+ # will be added to the HTTP request.
338
+ #
339
+ # @return [LabVirtualMachine] operation results.
340
+ #
341
+ def update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
342
+ response = update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value!
343
+ response.body unless response.nil?
344
+ end
345
+
346
+ #
347
+ # Modify properties of virtual machines.
348
+ #
349
+ # @param resource_group_name [String] The name of the resource group.
350
+ # @param lab_name [String] The name of the lab.
351
+ # @param name [String] The name of the virtual machine.
352
+ # @param lab_virtual_machine [LabVirtualMachineFragment] A virtual machine.
353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
354
+ # will be added to the HTTP request.
355
+ #
356
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
357
+ #
358
+ def update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
359
+ update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value!
360
+ end
361
+
362
+ #
363
+ # Modify properties of virtual machines.
364
+ #
365
+ # @param resource_group_name [String] The name of the resource group.
366
+ # @param lab_name [String] The name of the lab.
367
+ # @param name [String] The name of the virtual machine.
368
+ # @param lab_virtual_machine [LabVirtualMachineFragment] A virtual machine.
369
+ # @param [Hash{String => String}] A hash of custom headers that will be added
370
+ # to the HTTP request.
371
+ #
372
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
373
+ #
374
+ def update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
375
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
376
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
377
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
378
+ fail ArgumentError, 'name is nil' if name.nil?
379
+ fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil?
380
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
381
+
382
+
383
+ request_headers = {}
384
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
385
+
386
+ # Set Headers
387
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
388
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
389
+
390
+ # Serialize Request
391
+ request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineFragment.mapper()
392
+ request_content = @client.serialize(request_mapper, lab_virtual_machine)
393
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
394
+
395
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'
396
+
397
+ request_url = @base_url || @client.base_url
398
+
399
+ options = {
400
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
401
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
402
+ query_params: {'api-version' => @client.api_version},
403
+ body: request_content,
404
+ headers: request_headers.merge(custom_headers || {}),
405
+ base_url: request_url
406
+ }
407
+ promise = @client.make_request_async(:patch, path_template, options)
408
+
409
+ promise = promise.then do |result|
410
+ http_response = result.response
411
+ status_code = http_response.status
412
+ response_content = http_response.body
413
+ unless status_code == 200
414
+ error_model = JSON.load(response_content)
415
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
416
+ end
417
+
418
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+ # Deserialize Response
420
+ if status_code == 200
421
+ begin
422
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
423
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper()
424
+ result.body = @client.deserialize(result_mapper, parsed_response)
425
+ rescue Exception => e
426
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
427
+ end
428
+ end
429
+
430
+ result
431
+ end
432
+
433
+ promise.execute
434
+ end
435
+
436
+ #
437
+ # Attach a new or existing data disk to virtual machine. This operation can
438
+ # take a while to complete.
439
+ #
440
+ # @param resource_group_name [String] The name of the resource group.
441
+ # @param lab_name [String] The name of the lab.
442
+ # @param name [String] The name of the virtual machine.
443
+ # @param data_disk_properties [DataDiskProperties] Request body for adding a
444
+ # new or existing data disk to a virtual machine.
445
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
+ # will be added to the HTTP request.
447
+ #
448
+ def add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil)
449
+ response = add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value!
450
+ nil
451
+ end
452
+
453
+ #
454
+ # @param resource_group_name [String] The name of the resource group.
455
+ # @param lab_name [String] The name of the lab.
456
+ # @param name [String] The name of the virtual machine.
457
+ # @param data_disk_properties [DataDiskProperties] Request body for adding a
458
+ # new or existing data disk to a virtual machine.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [Concurrent::Promise] promise which provides async access to http
463
+ # response.
464
+ #
465
+ def add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil)
466
+ # Send request
467
+ promise = begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers)
468
+
469
+ promise = promise.then do |response|
470
+ # Defining deserialization method.
471
+ deserialize_method = lambda do |parsed_response|
472
+ end
473
+
474
+ # Waiting for response.
475
+ @client.get_long_running_operation_result(response, deserialize_method)
476
+ end
477
+
478
+ promise
479
+ end
480
+
481
+ #
482
+ # Apply artifacts to virtual machine. This operation can take a while to
483
+ # complete.
484
+ #
485
+ # @param resource_group_name [String] The name of the resource group.
486
+ # @param lab_name [String] The name of the lab.
487
+ # @param name [String] The name of the virtual machine.
488
+ # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for
489
+ # applying artifacts to a virtual machine.
490
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
491
+ # will be added to the HTTP request.
492
+ #
493
+ def apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil)
494
+ response = apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value!
495
+ nil
496
+ end
497
+
498
+ #
499
+ # @param resource_group_name [String] The name of the resource group.
500
+ # @param lab_name [String] The name of the lab.
501
+ # @param name [String] The name of the virtual machine.
502
+ # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for
503
+ # applying artifacts to a virtual machine.
504
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
505
+ # will be added to the HTTP request.
506
+ #
507
+ # @return [Concurrent::Promise] promise which provides async access to http
508
+ # response.
509
+ #
510
+ def apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil)
511
+ # Send request
512
+ promise = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers)
513
+
514
+ promise = promise.then do |response|
515
+ # Defining deserialization method.
516
+ deserialize_method = lambda do |parsed_response|
517
+ end
518
+
519
+ # Waiting for response.
520
+ @client.get_long_running_operation_result(response, deserialize_method)
521
+ end
522
+
523
+ promise
524
+ end
525
+
526
+ #
527
+ # Take ownership of an existing virtual machine This operation can take a while
528
+ # to complete.
529
+ #
530
+ # @param resource_group_name [String] The name of the resource group.
531
+ # @param lab_name [String] The name of the lab.
532
+ # @param name [String] The name of the virtual machine.
533
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
534
+ # will be added to the HTTP request.
535
+ #
536
+ def claim(resource_group_name, lab_name, name, custom_headers:nil)
537
+ response = claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
538
+ nil
539
+ end
540
+
541
+ #
542
+ # @param resource_group_name [String] The name of the resource group.
543
+ # @param lab_name [String] The name of the lab.
544
+ # @param name [String] The name of the virtual machine.
545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
546
+ # will be added to the HTTP request.
547
+ #
548
+ # @return [Concurrent::Promise] promise which provides async access to http
549
+ # response.
550
+ #
551
+ def claim_async(resource_group_name, lab_name, name, custom_headers:nil)
552
+ # Send request
553
+ promise = begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
554
+
555
+ promise = promise.then do |response|
556
+ # Defining deserialization method.
557
+ deserialize_method = lambda do |parsed_response|
558
+ end
559
+
560
+ # Waiting for response.
561
+ @client.get_long_running_operation_result(response, deserialize_method)
562
+ end
563
+
564
+ promise
565
+ end
566
+
567
+ #
568
+ # Detach the specified disk from the virtual machine. This operation can take a
569
+ # while to complete.
570
+ #
571
+ # @param resource_group_name [String] The name of the resource group.
572
+ # @param lab_name [String] The name of the lab.
573
+ # @param name [String] The name of the virtual machine.
574
+ # @param detach_data_disk_properties [DetachDataDiskProperties] Request body
575
+ # for detaching data disk from a virtual machine.
576
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
577
+ # will be added to the HTTP request.
578
+ #
579
+ def detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil)
580
+ response = detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value!
581
+ nil
582
+ end
583
+
584
+ #
585
+ # @param resource_group_name [String] The name of the resource group.
586
+ # @param lab_name [String] The name of the lab.
587
+ # @param name [String] The name of the virtual machine.
588
+ # @param detach_data_disk_properties [DetachDataDiskProperties] Request body
589
+ # for detaching data disk from a virtual machine.
590
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
591
+ # will be added to the HTTP request.
592
+ #
593
+ # @return [Concurrent::Promise] promise which provides async access to http
594
+ # response.
595
+ #
596
+ def detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil)
597
+ # Send request
598
+ promise = begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers)
599
+
600
+ promise = promise.then do |response|
601
+ # Defining deserialization method.
602
+ deserialize_method = lambda do |parsed_response|
603
+ end
604
+
605
+ # Waiting for response.
606
+ @client.get_long_running_operation_result(response, deserialize_method)
607
+ end
608
+
609
+ promise
610
+ end
611
+
612
+ #
613
+ # Gets a string that represents the contents of the RDP file for the virtual
614
+ # machine
615
+ #
616
+ # @param resource_group_name [String] The name of the resource group.
617
+ # @param lab_name [String] The name of the lab.
618
+ # @param name [String] The name of the virtual machine.
619
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
620
+ # will be added to the HTTP request.
621
+ #
622
+ # @return [RdpConnection] operation results.
623
+ #
624
+ def get_rdp_file_contents(resource_group_name, lab_name, name, custom_headers:nil)
625
+ response = get_rdp_file_contents_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
626
+ response.body unless response.nil?
627
+ end
628
+
629
+ #
630
+ # Gets a string that represents the contents of the RDP file for the virtual
631
+ # machine
632
+ #
633
+ # @param resource_group_name [String] The name of the resource group.
634
+ # @param lab_name [String] The name of the lab.
635
+ # @param name [String] The name of the virtual machine.
636
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
637
+ # will be added to the HTTP request.
638
+ #
639
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
640
+ #
641
+ def get_rdp_file_contents_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
642
+ get_rdp_file_contents_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
643
+ end
644
+
645
+ #
646
+ # Gets a string that represents the contents of the RDP file for the virtual
647
+ # machine
648
+ #
649
+ # @param resource_group_name [String] The name of the resource group.
650
+ # @param lab_name [String] The name of the lab.
651
+ # @param name [String] The name of the virtual machine.
652
+ # @param [Hash{String => String}] A hash of custom headers that will be added
653
+ # to the HTTP request.
654
+ #
655
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
656
+ #
657
+ def get_rdp_file_contents_async(resource_group_name, lab_name, name, custom_headers:nil)
658
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
659
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
660
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
661
+ fail ArgumentError, 'name is nil' if name.nil?
662
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
663
+
664
+
665
+ request_headers = {}
666
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
667
+
668
+ # Set Headers
669
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
670
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
671
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/getRdpFileContents'
672
+
673
+ request_url = @base_url || @client.base_url
674
+
675
+ options = {
676
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
677
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
678
+ query_params: {'api-version' => @client.api_version},
679
+ headers: request_headers.merge(custom_headers || {}),
680
+ base_url: request_url
681
+ }
682
+ promise = @client.make_request_async(:post, path_template, options)
683
+
684
+ promise = promise.then do |result|
685
+ http_response = result.response
686
+ status_code = http_response.status
687
+ response_content = http_response.body
688
+ unless status_code == 200
689
+ error_model = JSON.load(response_content)
690
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
691
+ end
692
+
693
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
694
+ # Deserialize Response
695
+ if status_code == 200
696
+ begin
697
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
698
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RdpConnection.mapper()
699
+ result.body = @client.deserialize(result_mapper, parsed_response)
700
+ rescue Exception => e
701
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
702
+ end
703
+ end
704
+
705
+ result
706
+ end
707
+
708
+ promise.execute
709
+ end
710
+
711
+ #
712
+ # Lists the applicable start/stop schedules, if any.
713
+ #
714
+ # @param resource_group_name [String] The name of the resource group.
715
+ # @param lab_name [String] The name of the lab.
716
+ # @param name [String] The name of the virtual machine.
717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
718
+ # will be added to the HTTP request.
719
+ #
720
+ # @return [ApplicableSchedule] operation results.
721
+ #
722
+ def list_applicable_schedules(resource_group_name, lab_name, name, custom_headers:nil)
723
+ response = list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
724
+ response.body unless response.nil?
725
+ end
726
+
727
+ #
728
+ # Lists the applicable start/stop schedules, if any.
729
+ #
730
+ # @param resource_group_name [String] The name of the resource group.
731
+ # @param lab_name [String] The name of the lab.
732
+ # @param name [String] The name of the virtual machine.
733
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
734
+ # will be added to the HTTP request.
735
+ #
736
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
737
+ #
738
+ def list_applicable_schedules_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
739
+ list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
740
+ end
741
+
742
+ #
743
+ # Lists the applicable start/stop schedules, if any.
744
+ #
745
+ # @param resource_group_name [String] The name of the resource group.
746
+ # @param lab_name [String] The name of the lab.
747
+ # @param name [String] The name of the virtual machine.
748
+ # @param [Hash{String => String}] A hash of custom headers that will be added
749
+ # to the HTTP request.
750
+ #
751
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
752
+ #
753
+ def list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:nil)
754
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
755
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
756
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
757
+ fail ArgumentError, 'name is nil' if name.nil?
758
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
759
+
760
+
761
+ request_headers = {}
762
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
763
+
764
+ # Set Headers
765
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
766
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
767
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules'
768
+
769
+ request_url = @base_url || @client.base_url
770
+
771
+ options = {
772
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
773
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
774
+ query_params: {'api-version' => @client.api_version},
775
+ headers: request_headers.merge(custom_headers || {}),
776
+ base_url: request_url
777
+ }
778
+ promise = @client.make_request_async(:post, path_template, options)
779
+
780
+ promise = promise.then do |result|
781
+ http_response = result.response
782
+ status_code = http_response.status
783
+ response_content = http_response.body
784
+ unless status_code == 200
785
+ error_model = JSON.load(response_content)
786
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
787
+ end
788
+
789
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
790
+ # Deserialize Response
791
+ if status_code == 200
792
+ begin
793
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
794
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule.mapper()
795
+ result.body = @client.deserialize(result_mapper, parsed_response)
796
+ rescue Exception => e
797
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
798
+ end
799
+ end
800
+
801
+ result
802
+ end
803
+
804
+ promise.execute
805
+ end
806
+
807
+ #
808
+ # Redeploy a virtual machine This operation can take a while to complete.
809
+ #
810
+ # @param resource_group_name [String] The name of the resource group.
811
+ # @param lab_name [String] The name of the lab.
812
+ # @param name [String] The name of the virtual machine.
813
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
814
+ # will be added to the HTTP request.
815
+ #
816
+ def redeploy(resource_group_name, lab_name, name, custom_headers:nil)
817
+ response = redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
818
+ nil
819
+ end
820
+
821
+ #
822
+ # @param resource_group_name [String] The name of the resource group.
823
+ # @param lab_name [String] The name of the lab.
824
+ # @param name [String] The name of the virtual machine.
825
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
826
+ # will be added to the HTTP request.
827
+ #
828
+ # @return [Concurrent::Promise] promise which provides async access to http
829
+ # response.
830
+ #
831
+ def redeploy_async(resource_group_name, lab_name, name, custom_headers:nil)
832
+ # Send request
833
+ promise = begin_redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
834
+
835
+ promise = promise.then do |response|
836
+ # Defining deserialization method.
837
+ deserialize_method = lambda do |parsed_response|
838
+ end
839
+
840
+ # Waiting for response.
841
+ @client.get_long_running_operation_result(response, deserialize_method)
842
+ end
843
+
844
+ promise
845
+ end
846
+
847
+ #
848
+ # Resize Virtual Machine. This operation can take a while to complete.
849
+ #
850
+ # @param resource_group_name [String] The name of the resource group.
851
+ # @param lab_name [String] The name of the lab.
852
+ # @param name [String] The name of the virtual machine.
853
+ # @param resize_lab_virtual_machine_properties
854
+ # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual
855
+ # machine.
856
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
857
+ # will be added to the HTTP request.
858
+ #
859
+ def resize(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil)
860
+ response = resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers).value!
861
+ nil
862
+ end
863
+
864
+ #
865
+ # @param resource_group_name [String] The name of the resource group.
866
+ # @param lab_name [String] The name of the lab.
867
+ # @param name [String] The name of the virtual machine.
868
+ # @param resize_lab_virtual_machine_properties
869
+ # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual
870
+ # machine.
871
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
872
+ # will be added to the HTTP request.
873
+ #
874
+ # @return [Concurrent::Promise] promise which provides async access to http
875
+ # response.
876
+ #
877
+ def resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil)
878
+ # Send request
879
+ promise = begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers)
880
+
881
+ promise = promise.then do |response|
882
+ # Defining deserialization method.
883
+ deserialize_method = lambda do |parsed_response|
884
+ end
885
+
886
+ # Waiting for response.
887
+ @client.get_long_running_operation_result(response, deserialize_method)
888
+ end
889
+
890
+ promise
891
+ end
892
+
893
+ #
894
+ # Restart a virtual machine. This operation can take a while to complete.
895
+ #
896
+ # @param resource_group_name [String] The name of the resource group.
897
+ # @param lab_name [String] The name of the lab.
898
+ # @param name [String] The name of the virtual machine.
899
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
900
+ # will be added to the HTTP request.
901
+ #
902
+ def restart(resource_group_name, lab_name, name, custom_headers:nil)
903
+ response = restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
904
+ nil
905
+ end
906
+
907
+ #
908
+ # @param resource_group_name [String] The name of the resource group.
909
+ # @param lab_name [String] The name of the lab.
910
+ # @param name [String] The name of the virtual machine.
911
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
912
+ # will be added to the HTTP request.
913
+ #
914
+ # @return [Concurrent::Promise] promise which provides async access to http
915
+ # response.
916
+ #
917
+ def restart_async(resource_group_name, lab_name, name, custom_headers:nil)
918
+ # Send request
919
+ promise = begin_restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
920
+
921
+ promise = promise.then do |response|
922
+ # Defining deserialization method.
923
+ deserialize_method = lambda do |parsed_response|
924
+ end
925
+
926
+ # Waiting for response.
927
+ @client.get_long_running_operation_result(response, deserialize_method)
928
+ end
929
+
930
+ promise
931
+ end
932
+
933
+ #
934
+ # Start a virtual machine. This operation can take a while to complete.
935
+ #
936
+ # @param resource_group_name [String] The name of the resource group.
937
+ # @param lab_name [String] The name of the lab.
938
+ # @param name [String] The name of the virtual machine.
939
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
940
+ # will be added to the HTTP request.
941
+ #
942
+ def start(resource_group_name, lab_name, name, custom_headers:nil)
943
+ response = start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
944
+ nil
945
+ end
946
+
947
+ #
948
+ # @param resource_group_name [String] The name of the resource group.
949
+ # @param lab_name [String] The name of the lab.
950
+ # @param name [String] The name of the virtual machine.
951
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
952
+ # will be added to the HTTP request.
953
+ #
954
+ # @return [Concurrent::Promise] promise which provides async access to http
955
+ # response.
956
+ #
957
+ def start_async(resource_group_name, lab_name, name, custom_headers:nil)
958
+ # Send request
959
+ promise = begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
960
+
961
+ promise = promise.then do |response|
962
+ # Defining deserialization method.
963
+ deserialize_method = lambda do |parsed_response|
964
+ end
965
+
966
+ # Waiting for response.
967
+ @client.get_long_running_operation_result(response, deserialize_method)
968
+ end
969
+
970
+ promise
971
+ end
972
+
973
+ #
974
+ # Stop a virtual machine This operation can take a while to complete.
975
+ #
976
+ # @param resource_group_name [String] The name of the resource group.
977
+ # @param lab_name [String] The name of the lab.
978
+ # @param name [String] The name of the virtual machine.
979
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
980
+ # will be added to the HTTP request.
981
+ #
982
+ def stop(resource_group_name, lab_name, name, custom_headers:nil)
983
+ response = stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
984
+ nil
985
+ end
986
+
987
+ #
988
+ # @param resource_group_name [String] The name of the resource group.
989
+ # @param lab_name [String] The name of the lab.
990
+ # @param name [String] The name of the virtual machine.
991
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
992
+ # will be added to the HTTP request.
993
+ #
994
+ # @return [Concurrent::Promise] promise which provides async access to http
995
+ # response.
996
+ #
997
+ def stop_async(resource_group_name, lab_name, name, custom_headers:nil)
998
+ # Send request
999
+ promise = begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
1000
+
1001
+ promise = promise.then do |response|
1002
+ # Defining deserialization method.
1003
+ deserialize_method = lambda do |parsed_response|
1004
+ end
1005
+
1006
+ # Waiting for response.
1007
+ @client.get_long_running_operation_result(response, deserialize_method)
1008
+ end
1009
+
1010
+ promise
1011
+ end
1012
+
1013
+ #
1014
+ # Transfers all data disks attached to the virtual machine to be owned by the
1015
+ # current user. This operation can take a while to complete.
1016
+ #
1017
+ # @param resource_group_name [String] The name of the resource group.
1018
+ # @param lab_name [String] The name of the lab.
1019
+ # @param name [String] The name of the virtual machine.
1020
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1021
+ # will be added to the HTTP request.
1022
+ #
1023
+ def transfer_disks(resource_group_name, lab_name, name, custom_headers:nil)
1024
+ response = transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1025
+ nil
1026
+ end
1027
+
1028
+ #
1029
+ # @param resource_group_name [String] The name of the resource group.
1030
+ # @param lab_name [String] The name of the lab.
1031
+ # @param name [String] The name of the virtual machine.
1032
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1033
+ # will be added to the HTTP request.
1034
+ #
1035
+ # @return [Concurrent::Promise] promise which provides async access to http
1036
+ # response.
1037
+ #
1038
+ def transfer_disks_async(resource_group_name, lab_name, name, custom_headers:nil)
1039
+ # Send request
1040
+ promise = begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
1041
+
1042
+ promise = promise.then do |response|
1043
+ # Defining deserialization method.
1044
+ deserialize_method = lambda do |parsed_response|
1045
+ end
1046
+
1047
+ # Waiting for response.
1048
+ @client.get_long_running_operation_result(response, deserialize_method)
1049
+ end
1050
+
1051
+ promise
1052
+ end
1053
+
1054
+ #
1055
+ # Release ownership of an existing virtual machine This operation can take a
1056
+ # while to complete.
1057
+ #
1058
+ # @param resource_group_name [String] The name of the resource group.
1059
+ # @param lab_name [String] The name of the lab.
1060
+ # @param name [String] The name of the virtual machine.
1061
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1062
+ # will be added to the HTTP request.
1063
+ #
1064
+ def un_claim(resource_group_name, lab_name, name, custom_headers:nil)
1065
+ response = un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1066
+ nil
1067
+ end
1068
+
1069
+ #
1070
+ # @param resource_group_name [String] The name of the resource group.
1071
+ # @param lab_name [String] The name of the lab.
1072
+ # @param name [String] The name of the virtual machine.
1073
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1074
+ # will be added to the HTTP request.
1075
+ #
1076
+ # @return [Concurrent::Promise] promise which provides async access to http
1077
+ # response.
1078
+ #
1079
+ def un_claim_async(resource_group_name, lab_name, name, custom_headers:nil)
1080
+ # Send request
1081
+ promise = begin_un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers)
1082
+
1083
+ promise = promise.then do |response|
1084
+ # Defining deserialization method.
1085
+ deserialize_method = lambda do |parsed_response|
1086
+ end
1087
+
1088
+ # Waiting for response.
1089
+ @client.get_long_running_operation_result(response, deserialize_method)
1090
+ end
1091
+
1092
+ promise
1093
+ end
1094
+
1095
+ #
1096
+ # Create or replace an existing Virtual machine. This operation can take a
1097
+ # while to complete.
1098
+ #
1099
+ # @param resource_group_name [String] The name of the resource group.
1100
+ # @param lab_name [String] The name of the lab.
1101
+ # @param name [String] The name of the virtual machine.
1102
+ # @param lab_virtual_machine [LabVirtualMachine] A virtual machine.
1103
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1104
+ # will be added to the HTTP request.
1105
+ #
1106
+ # @return [LabVirtualMachine] operation results.
1107
+ #
1108
+ def begin_create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
1109
+ response = begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value!
1110
+ response.body unless response.nil?
1111
+ end
1112
+
1113
+ #
1114
+ # Create or replace an existing Virtual machine. This operation can take a
1115
+ # while to complete.
1116
+ #
1117
+ # @param resource_group_name [String] The name of the resource group.
1118
+ # @param lab_name [String] The name of the lab.
1119
+ # @param name [String] The name of the virtual machine.
1120
+ # @param lab_virtual_machine [LabVirtualMachine] A virtual machine.
1121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1122
+ # will be added to the HTTP request.
1123
+ #
1124
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1125
+ #
1126
+ def begin_create_or_update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
1127
+ begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value!
1128
+ end
1129
+
1130
+ #
1131
+ # Create or replace an existing Virtual machine. This operation can take a
1132
+ # while to complete.
1133
+ #
1134
+ # @param resource_group_name [String] The name of the resource group.
1135
+ # @param lab_name [String] The name of the lab.
1136
+ # @param name [String] The name of the virtual machine.
1137
+ # @param lab_virtual_machine [LabVirtualMachine] A virtual machine.
1138
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1139
+ # to the HTTP request.
1140
+ #
1141
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1142
+ #
1143
+ def begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil)
1144
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1145
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1146
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1147
+ fail ArgumentError, 'name is nil' if name.nil?
1148
+ fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil?
1149
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1150
+
1151
+
1152
+ request_headers = {}
1153
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1154
+
1155
+ # Set Headers
1156
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1157
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1158
+
1159
+ # Serialize Request
1160
+ request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper()
1161
+ request_content = @client.serialize(request_mapper, lab_virtual_machine)
1162
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1163
+
1164
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'
1165
+
1166
+ request_url = @base_url || @client.base_url
1167
+
1168
+ options = {
1169
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1170
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1171
+ query_params: {'api-version' => @client.api_version},
1172
+ body: request_content,
1173
+ headers: request_headers.merge(custom_headers || {}),
1174
+ base_url: request_url
1175
+ }
1176
+ promise = @client.make_request_async(:put, path_template, options)
1177
+
1178
+ promise = promise.then do |result|
1179
+ http_response = result.response
1180
+ status_code = http_response.status
1181
+ response_content = http_response.body
1182
+ unless status_code == 200 || status_code == 201
1183
+ error_model = JSON.load(response_content)
1184
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1185
+ end
1186
+
1187
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1188
+ # Deserialize Response
1189
+ if status_code == 200
1190
+ begin
1191
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1192
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper()
1193
+ result.body = @client.deserialize(result_mapper, parsed_response)
1194
+ rescue Exception => e
1195
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1196
+ end
1197
+ end
1198
+ # Deserialize Response
1199
+ if status_code == 201
1200
+ begin
1201
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1202
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper()
1203
+ result.body = @client.deserialize(result_mapper, parsed_response)
1204
+ rescue Exception => e
1205
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1206
+ end
1207
+ end
1208
+
1209
+ result
1210
+ end
1211
+
1212
+ promise.execute
1213
+ end
1214
+
1215
+ #
1216
+ # Delete virtual machine. This operation can take a while to complete.
1217
+ #
1218
+ # @param resource_group_name [String] The name of the resource group.
1219
+ # @param lab_name [String] The name of the lab.
1220
+ # @param name [String] The name of the virtual machine.
1221
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1222
+ # will be added to the HTTP request.
1223
+ #
1224
+ #
1225
+ def begin_delete(resource_group_name, lab_name, name, custom_headers:nil)
1226
+ response = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1227
+ nil
1228
+ end
1229
+
1230
+ #
1231
+ # Delete virtual machine. This operation can take a while to complete.
1232
+ #
1233
+ # @param resource_group_name [String] The name of the resource group.
1234
+ # @param lab_name [String] The name of the lab.
1235
+ # @param name [String] The name of the virtual machine.
1236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1237
+ # will be added to the HTTP request.
1238
+ #
1239
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1240
+ #
1241
+ def begin_delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
1242
+ begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1243
+ end
1244
+
1245
+ #
1246
+ # Delete virtual machine. This operation can take a while to complete.
1247
+ #
1248
+ # @param resource_group_name [String] The name of the resource group.
1249
+ # @param lab_name [String] The name of the lab.
1250
+ # @param name [String] The name of the virtual machine.
1251
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1252
+ # to the HTTP request.
1253
+ #
1254
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1255
+ #
1256
+ def begin_delete_async(resource_group_name, lab_name, name, custom_headers:nil)
1257
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1258
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1259
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1260
+ fail ArgumentError, 'name is nil' if name.nil?
1261
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1262
+
1263
+
1264
+ request_headers = {}
1265
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1266
+
1267
+ # Set Headers
1268
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1269
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1270
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'
1271
+
1272
+ request_url = @base_url || @client.base_url
1273
+
1274
+ options = {
1275
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1276
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1277
+ query_params: {'api-version' => @client.api_version},
1278
+ headers: request_headers.merge(custom_headers || {}),
1279
+ base_url: request_url
1280
+ }
1281
+ promise = @client.make_request_async(:delete, path_template, options)
1282
+
1283
+ promise = promise.then do |result|
1284
+ http_response = result.response
1285
+ status_code = http_response.status
1286
+ response_content = http_response.body
1287
+ unless status_code == 200 || status_code == 202 || status_code == 204
1288
+ error_model = JSON.load(response_content)
1289
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1290
+ end
1291
+
1292
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1293
+
1294
+ result
1295
+ end
1296
+
1297
+ promise.execute
1298
+ end
1299
+
1300
+ #
1301
+ # Attach a new or existing data disk to virtual machine. This operation can
1302
+ # take a while to complete.
1303
+ #
1304
+ # @param resource_group_name [String] The name of the resource group.
1305
+ # @param lab_name [String] The name of the lab.
1306
+ # @param name [String] The name of the virtual machine.
1307
+ # @param data_disk_properties [DataDiskProperties] Request body for adding a
1308
+ # new or existing data disk to a virtual machine.
1309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1310
+ # will be added to the HTTP request.
1311
+ #
1312
+ #
1313
+ def begin_add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil)
1314
+ response = begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value!
1315
+ nil
1316
+ end
1317
+
1318
+ #
1319
+ # Attach a new or existing data disk to virtual machine. This operation can
1320
+ # take a while to complete.
1321
+ #
1322
+ # @param resource_group_name [String] The name of the resource group.
1323
+ # @param lab_name [String] The name of the lab.
1324
+ # @param name [String] The name of the virtual machine.
1325
+ # @param data_disk_properties [DataDiskProperties] Request body for adding a
1326
+ # new or existing data disk to a virtual machine.
1327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1328
+ # will be added to the HTTP request.
1329
+ #
1330
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1331
+ #
1332
+ def begin_add_data_disk_with_http_info(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil)
1333
+ begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value!
1334
+ end
1335
+
1336
+ #
1337
+ # Attach a new or existing data disk to virtual machine. This operation can
1338
+ # take a while to complete.
1339
+ #
1340
+ # @param resource_group_name [String] The name of the resource group.
1341
+ # @param lab_name [String] The name of the lab.
1342
+ # @param name [String] The name of the virtual machine.
1343
+ # @param data_disk_properties [DataDiskProperties] Request body for adding a
1344
+ # new or existing data disk to a virtual machine.
1345
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1346
+ # to the HTTP request.
1347
+ #
1348
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1349
+ #
1350
+ def begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil)
1351
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1352
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1353
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1354
+ fail ArgumentError, 'name is nil' if name.nil?
1355
+ fail ArgumentError, 'data_disk_properties is nil' if data_disk_properties.nil?
1356
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1357
+
1358
+
1359
+ request_headers = {}
1360
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1361
+
1362
+ # Set Headers
1363
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1364
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1365
+
1366
+ # Serialize Request
1367
+ request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskProperties.mapper()
1368
+ request_content = @client.serialize(request_mapper, data_disk_properties)
1369
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1370
+
1371
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/addDataDisk'
1372
+
1373
+ request_url = @base_url || @client.base_url
1374
+
1375
+ options = {
1376
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1377
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1378
+ query_params: {'api-version' => @client.api_version},
1379
+ body: request_content,
1380
+ headers: request_headers.merge(custom_headers || {}),
1381
+ base_url: request_url
1382
+ }
1383
+ promise = @client.make_request_async(:post, path_template, options)
1384
+
1385
+ promise = promise.then do |result|
1386
+ http_response = result.response
1387
+ status_code = http_response.status
1388
+ response_content = http_response.body
1389
+ unless status_code == 200 || status_code == 202
1390
+ error_model = JSON.load(response_content)
1391
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1392
+ end
1393
+
1394
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1395
+
1396
+ result
1397
+ end
1398
+
1399
+ promise.execute
1400
+ end
1401
+
1402
+ #
1403
+ # Apply artifacts to virtual machine. This operation can take a while to
1404
+ # complete.
1405
+ #
1406
+ # @param resource_group_name [String] The name of the resource group.
1407
+ # @param lab_name [String] The name of the lab.
1408
+ # @param name [String] The name of the virtual machine.
1409
+ # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for
1410
+ # applying artifacts to a virtual machine.
1411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1412
+ # will be added to the HTTP request.
1413
+ #
1414
+ #
1415
+ def begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil)
1416
+ response = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value!
1417
+ nil
1418
+ end
1419
+
1420
+ #
1421
+ # Apply artifacts to virtual machine. This operation can take a while to
1422
+ # complete.
1423
+ #
1424
+ # @param resource_group_name [String] The name of the resource group.
1425
+ # @param lab_name [String] The name of the lab.
1426
+ # @param name [String] The name of the virtual machine.
1427
+ # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for
1428
+ # applying artifacts to a virtual machine.
1429
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1430
+ # will be added to the HTTP request.
1431
+ #
1432
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1433
+ #
1434
+ def begin_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil)
1435
+ begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value!
1436
+ end
1437
+
1438
+ #
1439
+ # Apply artifacts to virtual machine. This operation can take a while to
1440
+ # complete.
1441
+ #
1442
+ # @param resource_group_name [String] The name of the resource group.
1443
+ # @param lab_name [String] The name of the lab.
1444
+ # @param name [String] The name of the virtual machine.
1445
+ # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for
1446
+ # applying artifacts to a virtual machine.
1447
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1448
+ # to the HTTP request.
1449
+ #
1450
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1451
+ #
1452
+ def begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil)
1453
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1454
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1455
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1456
+ fail ArgumentError, 'name is nil' if name.nil?
1457
+ fail ArgumentError, 'apply_artifacts_request is nil' if apply_artifacts_request.nil?
1458
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1459
+
1460
+
1461
+ request_headers = {}
1462
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1463
+
1464
+ # Set Headers
1465
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1466
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1467
+
1468
+ # Serialize Request
1469
+ request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplyArtifactsRequest.mapper()
1470
+ request_content = @client.serialize(request_mapper, apply_artifacts_request)
1471
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1472
+
1473
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts'
1474
+
1475
+ request_url = @base_url || @client.base_url
1476
+
1477
+ options = {
1478
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1479
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1480
+ query_params: {'api-version' => @client.api_version},
1481
+ body: request_content,
1482
+ headers: request_headers.merge(custom_headers || {}),
1483
+ base_url: request_url
1484
+ }
1485
+ promise = @client.make_request_async(:post, path_template, options)
1486
+
1487
+ promise = promise.then do |result|
1488
+ http_response = result.response
1489
+ status_code = http_response.status
1490
+ response_content = http_response.body
1491
+ unless status_code == 200 || status_code == 202
1492
+ error_model = JSON.load(response_content)
1493
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1494
+ end
1495
+
1496
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1497
+
1498
+ result
1499
+ end
1500
+
1501
+ promise.execute
1502
+ end
1503
+
1504
+ #
1505
+ # Take ownership of an existing virtual machine This operation can take a while
1506
+ # to complete.
1507
+ #
1508
+ # @param resource_group_name [String] The name of the resource group.
1509
+ # @param lab_name [String] The name of the lab.
1510
+ # @param name [String] The name of the virtual machine.
1511
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1512
+ # will be added to the HTTP request.
1513
+ #
1514
+ #
1515
+ def begin_claim(resource_group_name, lab_name, name, custom_headers:nil)
1516
+ response = begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1517
+ nil
1518
+ end
1519
+
1520
+ #
1521
+ # Take ownership of an existing virtual machine This operation can take a while
1522
+ # to complete.
1523
+ #
1524
+ # @param resource_group_name [String] The name of the resource group.
1525
+ # @param lab_name [String] The name of the lab.
1526
+ # @param name [String] The name of the virtual machine.
1527
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1528
+ # will be added to the HTTP request.
1529
+ #
1530
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1531
+ #
1532
+ def begin_claim_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
1533
+ begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1534
+ end
1535
+
1536
+ #
1537
+ # Take ownership of an existing virtual machine This operation can take a while
1538
+ # to complete.
1539
+ #
1540
+ # @param resource_group_name [String] The name of the resource group.
1541
+ # @param lab_name [String] The name of the lab.
1542
+ # @param name [String] The name of the virtual machine.
1543
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1544
+ # to the HTTP request.
1545
+ #
1546
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1547
+ #
1548
+ def begin_claim_async(resource_group_name, lab_name, name, custom_headers:nil)
1549
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1550
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1551
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1552
+ fail ArgumentError, 'name is nil' if name.nil?
1553
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1554
+
1555
+
1556
+ request_headers = {}
1557
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1558
+
1559
+ # Set Headers
1560
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1561
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1562
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/claim'
1563
+
1564
+ request_url = @base_url || @client.base_url
1565
+
1566
+ options = {
1567
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1568
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1569
+ query_params: {'api-version' => @client.api_version},
1570
+ headers: request_headers.merge(custom_headers || {}),
1571
+ base_url: request_url
1572
+ }
1573
+ promise = @client.make_request_async(:post, path_template, options)
1574
+
1575
+ promise = promise.then do |result|
1576
+ http_response = result.response
1577
+ status_code = http_response.status
1578
+ response_content = http_response.body
1579
+ unless status_code == 200 || status_code == 202
1580
+ error_model = JSON.load(response_content)
1581
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1582
+ end
1583
+
1584
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1585
+
1586
+ result
1587
+ end
1588
+
1589
+ promise.execute
1590
+ end
1591
+
1592
+ #
1593
+ # Detach the specified disk from the virtual machine. This operation can take a
1594
+ # while to complete.
1595
+ #
1596
+ # @param resource_group_name [String] The name of the resource group.
1597
+ # @param lab_name [String] The name of the lab.
1598
+ # @param name [String] The name of the virtual machine.
1599
+ # @param detach_data_disk_properties [DetachDataDiskProperties] Request body
1600
+ # for detaching data disk from a virtual machine.
1601
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1602
+ # will be added to the HTTP request.
1603
+ #
1604
+ #
1605
+ def begin_detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil)
1606
+ response = begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value!
1607
+ nil
1608
+ end
1609
+
1610
+ #
1611
+ # Detach the specified disk from the virtual machine. This operation can take a
1612
+ # while to complete.
1613
+ #
1614
+ # @param resource_group_name [String] The name of the resource group.
1615
+ # @param lab_name [String] The name of the lab.
1616
+ # @param name [String] The name of the virtual machine.
1617
+ # @param detach_data_disk_properties [DetachDataDiskProperties] Request body
1618
+ # for detaching data disk from a virtual machine.
1619
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1620
+ # will be added to the HTTP request.
1621
+ #
1622
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1623
+ #
1624
+ def begin_detach_data_disk_with_http_info(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil)
1625
+ begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value!
1626
+ end
1627
+
1628
+ #
1629
+ # Detach the specified disk from the virtual machine. This operation can take a
1630
+ # while to complete.
1631
+ #
1632
+ # @param resource_group_name [String] The name of the resource group.
1633
+ # @param lab_name [String] The name of the lab.
1634
+ # @param name [String] The name of the virtual machine.
1635
+ # @param detach_data_disk_properties [DetachDataDiskProperties] Request body
1636
+ # for detaching data disk from a virtual machine.
1637
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1638
+ # to the HTTP request.
1639
+ #
1640
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1641
+ #
1642
+ def begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil)
1643
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1644
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1645
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1646
+ fail ArgumentError, 'name is nil' if name.nil?
1647
+ fail ArgumentError, 'detach_data_disk_properties is nil' if detach_data_disk_properties.nil?
1648
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1649
+
1650
+
1651
+ request_headers = {}
1652
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1653
+
1654
+ # Set Headers
1655
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1656
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1657
+
1658
+ # Serialize Request
1659
+ request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDataDiskProperties.mapper()
1660
+ request_content = @client.serialize(request_mapper, detach_data_disk_properties)
1661
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1662
+
1663
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/detachDataDisk'
1664
+
1665
+ request_url = @base_url || @client.base_url
1666
+
1667
+ options = {
1668
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1669
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1670
+ query_params: {'api-version' => @client.api_version},
1671
+ body: request_content,
1672
+ headers: request_headers.merge(custom_headers || {}),
1673
+ base_url: request_url
1674
+ }
1675
+ promise = @client.make_request_async(:post, path_template, options)
1676
+
1677
+ promise = promise.then do |result|
1678
+ http_response = result.response
1679
+ status_code = http_response.status
1680
+ response_content = http_response.body
1681
+ unless status_code == 200 || status_code == 202
1682
+ error_model = JSON.load(response_content)
1683
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1684
+ end
1685
+
1686
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1687
+
1688
+ result
1689
+ end
1690
+
1691
+ promise.execute
1692
+ end
1693
+
1694
+ #
1695
+ # Redeploy a virtual machine This operation can take a while to complete.
1696
+ #
1697
+ # @param resource_group_name [String] The name of the resource group.
1698
+ # @param lab_name [String] The name of the lab.
1699
+ # @param name [String] The name of the virtual machine.
1700
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1701
+ # will be added to the HTTP request.
1702
+ #
1703
+ #
1704
+ def begin_redeploy(resource_group_name, lab_name, name, custom_headers:nil)
1705
+ response = begin_redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1706
+ nil
1707
+ end
1708
+
1709
+ #
1710
+ # Redeploy a virtual machine This operation can take a while to complete.
1711
+ #
1712
+ # @param resource_group_name [String] The name of the resource group.
1713
+ # @param lab_name [String] The name of the lab.
1714
+ # @param name [String] The name of the virtual machine.
1715
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1716
+ # will be added to the HTTP request.
1717
+ #
1718
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1719
+ #
1720
+ def begin_redeploy_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
1721
+ begin_redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1722
+ end
1723
+
1724
+ #
1725
+ # Redeploy a virtual machine This operation can take a while to complete.
1726
+ #
1727
+ # @param resource_group_name [String] The name of the resource group.
1728
+ # @param lab_name [String] The name of the lab.
1729
+ # @param name [String] The name of the virtual machine.
1730
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1731
+ # to the HTTP request.
1732
+ #
1733
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1734
+ #
1735
+ def begin_redeploy_async(resource_group_name, lab_name, name, custom_headers:nil)
1736
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1737
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1738
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1739
+ fail ArgumentError, 'name is nil' if name.nil?
1740
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1741
+
1742
+
1743
+ request_headers = {}
1744
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1745
+
1746
+ # Set Headers
1747
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1748
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1749
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/redeploy'
1750
+
1751
+ request_url = @base_url || @client.base_url
1752
+
1753
+ options = {
1754
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1755
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1756
+ query_params: {'api-version' => @client.api_version},
1757
+ headers: request_headers.merge(custom_headers || {}),
1758
+ base_url: request_url
1759
+ }
1760
+ promise = @client.make_request_async(:post, path_template, options)
1761
+
1762
+ promise = promise.then do |result|
1763
+ http_response = result.response
1764
+ status_code = http_response.status
1765
+ response_content = http_response.body
1766
+ unless status_code == 200 || status_code == 202
1767
+ error_model = JSON.load(response_content)
1768
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1769
+ end
1770
+
1771
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1772
+
1773
+ result
1774
+ end
1775
+
1776
+ promise.execute
1777
+ end
1778
+
1779
+ #
1780
+ # Resize Virtual Machine. This operation can take a while to complete.
1781
+ #
1782
+ # @param resource_group_name [String] The name of the resource group.
1783
+ # @param lab_name [String] The name of the lab.
1784
+ # @param name [String] The name of the virtual machine.
1785
+ # @param resize_lab_virtual_machine_properties
1786
+ # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual
1787
+ # machine.
1788
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1789
+ # will be added to the HTTP request.
1790
+ #
1791
+ #
1792
+ def begin_resize(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil)
1793
+ response = begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers).value!
1794
+ nil
1795
+ end
1796
+
1797
+ #
1798
+ # Resize Virtual Machine. This operation can take a while to complete.
1799
+ #
1800
+ # @param resource_group_name [String] The name of the resource group.
1801
+ # @param lab_name [String] The name of the lab.
1802
+ # @param name [String] The name of the virtual machine.
1803
+ # @param resize_lab_virtual_machine_properties
1804
+ # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual
1805
+ # machine.
1806
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1807
+ # will be added to the HTTP request.
1808
+ #
1809
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1810
+ #
1811
+ def begin_resize_with_http_info(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil)
1812
+ begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers).value!
1813
+ end
1814
+
1815
+ #
1816
+ # Resize Virtual Machine. This operation can take a while to complete.
1817
+ #
1818
+ # @param resource_group_name [String] The name of the resource group.
1819
+ # @param lab_name [String] The name of the lab.
1820
+ # @param name [String] The name of the virtual machine.
1821
+ # @param resize_lab_virtual_machine_properties
1822
+ # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual
1823
+ # machine.
1824
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1825
+ # to the HTTP request.
1826
+ #
1827
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1828
+ #
1829
+ def begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil)
1830
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1831
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1832
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1833
+ fail ArgumentError, 'name is nil' if name.nil?
1834
+ fail ArgumentError, 'resize_lab_virtual_machine_properties is nil' if resize_lab_virtual_machine_properties.nil?
1835
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1836
+
1837
+
1838
+ request_headers = {}
1839
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1840
+
1841
+ # Set Headers
1842
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1843
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1844
+
1845
+ # Serialize Request
1846
+ request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ResizeLabVirtualMachineProperties.mapper()
1847
+ request_content = @client.serialize(request_mapper, resize_lab_virtual_machine_properties)
1848
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1849
+
1850
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/resize'
1851
+
1852
+ request_url = @base_url || @client.base_url
1853
+
1854
+ options = {
1855
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1856
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1857
+ query_params: {'api-version' => @client.api_version},
1858
+ body: request_content,
1859
+ headers: request_headers.merge(custom_headers || {}),
1860
+ base_url: request_url
1861
+ }
1862
+ promise = @client.make_request_async(:post, path_template, options)
1863
+
1864
+ promise = promise.then do |result|
1865
+ http_response = result.response
1866
+ status_code = http_response.status
1867
+ response_content = http_response.body
1868
+ unless status_code == 200 || status_code == 202
1869
+ error_model = JSON.load(response_content)
1870
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1871
+ end
1872
+
1873
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1874
+
1875
+ result
1876
+ end
1877
+
1878
+ promise.execute
1879
+ end
1880
+
1881
+ #
1882
+ # Restart a virtual machine. This operation can take a while to complete.
1883
+ #
1884
+ # @param resource_group_name [String] The name of the resource group.
1885
+ # @param lab_name [String] The name of the lab.
1886
+ # @param name [String] The name of the virtual machine.
1887
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1888
+ # will be added to the HTTP request.
1889
+ #
1890
+ #
1891
+ def begin_restart(resource_group_name, lab_name, name, custom_headers:nil)
1892
+ response = begin_restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1893
+ nil
1894
+ end
1895
+
1896
+ #
1897
+ # Restart a virtual machine. This operation can take a while to complete.
1898
+ #
1899
+ # @param resource_group_name [String] The name of the resource group.
1900
+ # @param lab_name [String] The name of the lab.
1901
+ # @param name [String] The name of the virtual machine.
1902
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1903
+ # will be added to the HTTP request.
1904
+ #
1905
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1906
+ #
1907
+ def begin_restart_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
1908
+ begin_restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1909
+ end
1910
+
1911
+ #
1912
+ # Restart a virtual machine. This operation can take a while to complete.
1913
+ #
1914
+ # @param resource_group_name [String] The name of the resource group.
1915
+ # @param lab_name [String] The name of the lab.
1916
+ # @param name [String] The name of the virtual machine.
1917
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1918
+ # to the HTTP request.
1919
+ #
1920
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1921
+ #
1922
+ def begin_restart_async(resource_group_name, lab_name, name, custom_headers:nil)
1923
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1924
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1925
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1926
+ fail ArgumentError, 'name is nil' if name.nil?
1927
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1928
+
1929
+
1930
+ request_headers = {}
1931
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1932
+
1933
+ # Set Headers
1934
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1935
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1936
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/restart'
1937
+
1938
+ request_url = @base_url || @client.base_url
1939
+
1940
+ options = {
1941
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1942
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
1943
+ query_params: {'api-version' => @client.api_version},
1944
+ headers: request_headers.merge(custom_headers || {}),
1945
+ base_url: request_url
1946
+ }
1947
+ promise = @client.make_request_async(:post, path_template, options)
1948
+
1949
+ promise = promise.then do |result|
1950
+ http_response = result.response
1951
+ status_code = http_response.status
1952
+ response_content = http_response.body
1953
+ unless status_code == 200 || status_code == 202
1954
+ error_model = JSON.load(response_content)
1955
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1956
+ end
1957
+
1958
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1959
+
1960
+ result
1961
+ end
1962
+
1963
+ promise.execute
1964
+ end
1965
+
1966
+ #
1967
+ # Start a virtual machine. This operation can take a while to complete.
1968
+ #
1969
+ # @param resource_group_name [String] The name of the resource group.
1970
+ # @param lab_name [String] The name of the lab.
1971
+ # @param name [String] The name of the virtual machine.
1972
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1973
+ # will be added to the HTTP request.
1974
+ #
1975
+ #
1976
+ def begin_start(resource_group_name, lab_name, name, custom_headers:nil)
1977
+ response = begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1978
+ nil
1979
+ end
1980
+
1981
+ #
1982
+ # Start a virtual machine. This operation can take a while to complete.
1983
+ #
1984
+ # @param resource_group_name [String] The name of the resource group.
1985
+ # @param lab_name [String] The name of the lab.
1986
+ # @param name [String] The name of the virtual machine.
1987
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1988
+ # will be added to the HTTP request.
1989
+ #
1990
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1991
+ #
1992
+ def begin_start_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
1993
+ begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
1994
+ end
1995
+
1996
+ #
1997
+ # Start a virtual machine. This operation can take a while to complete.
1998
+ #
1999
+ # @param resource_group_name [String] The name of the resource group.
2000
+ # @param lab_name [String] The name of the lab.
2001
+ # @param name [String] The name of the virtual machine.
2002
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2003
+ # to the HTTP request.
2004
+ #
2005
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2006
+ #
2007
+ def begin_start_async(resource_group_name, lab_name, name, custom_headers:nil)
2008
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2009
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2010
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
2011
+ fail ArgumentError, 'name is nil' if name.nil?
2012
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2013
+
2014
+
2015
+ request_headers = {}
2016
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2017
+
2018
+ # Set Headers
2019
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2020
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2021
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/start'
2022
+
2023
+ request_url = @base_url || @client.base_url
2024
+
2025
+ options = {
2026
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2027
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
2028
+ query_params: {'api-version' => @client.api_version},
2029
+ headers: request_headers.merge(custom_headers || {}),
2030
+ base_url: request_url
2031
+ }
2032
+ promise = @client.make_request_async(:post, path_template, options)
2033
+
2034
+ promise = promise.then do |result|
2035
+ http_response = result.response
2036
+ status_code = http_response.status
2037
+ response_content = http_response.body
2038
+ unless status_code == 200 || status_code == 202
2039
+ error_model = JSON.load(response_content)
2040
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2041
+ end
2042
+
2043
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2044
+
2045
+ result
2046
+ end
2047
+
2048
+ promise.execute
2049
+ end
2050
+
2051
+ #
2052
+ # Stop a virtual machine This operation can take a while to complete.
2053
+ #
2054
+ # @param resource_group_name [String] The name of the resource group.
2055
+ # @param lab_name [String] The name of the lab.
2056
+ # @param name [String] The name of the virtual machine.
2057
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2058
+ # will be added to the HTTP request.
2059
+ #
2060
+ #
2061
+ def begin_stop(resource_group_name, lab_name, name, custom_headers:nil)
2062
+ response = begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
2063
+ nil
2064
+ end
2065
+
2066
+ #
2067
+ # Stop a virtual machine This operation can take a while to complete.
2068
+ #
2069
+ # @param resource_group_name [String] The name of the resource group.
2070
+ # @param lab_name [String] The name of the lab.
2071
+ # @param name [String] The name of the virtual machine.
2072
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2073
+ # will be added to the HTTP request.
2074
+ #
2075
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2076
+ #
2077
+ def begin_stop_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
2078
+ begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
2079
+ end
2080
+
2081
+ #
2082
+ # Stop a virtual machine This operation can take a while to complete.
2083
+ #
2084
+ # @param resource_group_name [String] The name of the resource group.
2085
+ # @param lab_name [String] The name of the lab.
2086
+ # @param name [String] The name of the virtual machine.
2087
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2088
+ # to the HTTP request.
2089
+ #
2090
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2091
+ #
2092
+ def begin_stop_async(resource_group_name, lab_name, name, custom_headers:nil)
2093
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2094
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2095
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
2096
+ fail ArgumentError, 'name is nil' if name.nil?
2097
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2098
+
2099
+
2100
+ request_headers = {}
2101
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2102
+
2103
+ # Set Headers
2104
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2105
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2106
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/stop'
2107
+
2108
+ request_url = @base_url || @client.base_url
2109
+
2110
+ options = {
2111
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2112
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
2113
+ query_params: {'api-version' => @client.api_version},
2114
+ headers: request_headers.merge(custom_headers || {}),
2115
+ base_url: request_url
2116
+ }
2117
+ promise = @client.make_request_async(:post, path_template, options)
2118
+
2119
+ promise = promise.then do |result|
2120
+ http_response = result.response
2121
+ status_code = http_response.status
2122
+ response_content = http_response.body
2123
+ unless status_code == 200 || status_code == 202
2124
+ error_model = JSON.load(response_content)
2125
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2126
+ end
2127
+
2128
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2129
+
2130
+ result
2131
+ end
2132
+
2133
+ promise.execute
2134
+ end
2135
+
2136
+ #
2137
+ # Transfers all data disks attached to the virtual machine to be owned by the
2138
+ # current user. This operation can take a while to complete.
2139
+ #
2140
+ # @param resource_group_name [String] The name of the resource group.
2141
+ # @param lab_name [String] The name of the lab.
2142
+ # @param name [String] The name of the virtual machine.
2143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2144
+ # will be added to the HTTP request.
2145
+ #
2146
+ #
2147
+ def begin_transfer_disks(resource_group_name, lab_name, name, custom_headers:nil)
2148
+ response = begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
2149
+ nil
2150
+ end
2151
+
2152
+ #
2153
+ # Transfers all data disks attached to the virtual machine to be owned by the
2154
+ # current user. This operation can take a while to complete.
2155
+ #
2156
+ # @param resource_group_name [String] The name of the resource group.
2157
+ # @param lab_name [String] The name of the lab.
2158
+ # @param name [String] The name of the virtual machine.
2159
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2160
+ # will be added to the HTTP request.
2161
+ #
2162
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2163
+ #
2164
+ def begin_transfer_disks_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
2165
+ begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
2166
+ end
2167
+
2168
+ #
2169
+ # Transfers all data disks attached to the virtual machine to be owned by the
2170
+ # current user. This operation can take a while to complete.
2171
+ #
2172
+ # @param resource_group_name [String] The name of the resource group.
2173
+ # @param lab_name [String] The name of the lab.
2174
+ # @param name [String] The name of the virtual machine.
2175
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2176
+ # to the HTTP request.
2177
+ #
2178
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2179
+ #
2180
+ def begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers:nil)
2181
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2182
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2183
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
2184
+ fail ArgumentError, 'name is nil' if name.nil?
2185
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2186
+
2187
+
2188
+ request_headers = {}
2189
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2190
+
2191
+ # Set Headers
2192
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2193
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2194
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/transferDisks'
2195
+
2196
+ request_url = @base_url || @client.base_url
2197
+
2198
+ options = {
2199
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2200
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
2201
+ query_params: {'api-version' => @client.api_version},
2202
+ headers: request_headers.merge(custom_headers || {}),
2203
+ base_url: request_url
2204
+ }
2205
+ promise = @client.make_request_async(:post, path_template, options)
2206
+
2207
+ promise = promise.then do |result|
2208
+ http_response = result.response
2209
+ status_code = http_response.status
2210
+ response_content = http_response.body
2211
+ unless status_code == 200 || status_code == 202
2212
+ error_model = JSON.load(response_content)
2213
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2214
+ end
2215
+
2216
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2217
+
2218
+ result
2219
+ end
2220
+
2221
+ promise.execute
2222
+ end
2223
+
2224
+ #
2225
+ # Release ownership of an existing virtual machine This operation can take a
2226
+ # while to complete.
2227
+ #
2228
+ # @param resource_group_name [String] The name of the resource group.
2229
+ # @param lab_name [String] The name of the lab.
2230
+ # @param name [String] The name of the virtual machine.
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_un_claim(resource_group_name, lab_name, name, custom_headers:nil)
2236
+ response = begin_un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
2237
+ nil
2238
+ end
2239
+
2240
+ #
2241
+ # Release ownership of an existing virtual machine This operation can take a
2242
+ # while to complete.
2243
+ #
2244
+ # @param resource_group_name [String] The name of the resource group.
2245
+ # @param lab_name [String] The name of the lab.
2246
+ # @param name [String] The name of the virtual machine.
2247
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2248
+ # will be added to the HTTP request.
2249
+ #
2250
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2251
+ #
2252
+ def begin_un_claim_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
2253
+ begin_un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
2254
+ end
2255
+
2256
+ #
2257
+ # Release ownership of an existing virtual machine This operation can take a
2258
+ # while to complete.
2259
+ #
2260
+ # @param resource_group_name [String] The name of the resource group.
2261
+ # @param lab_name [String] The name of the lab.
2262
+ # @param name [String] The name of the virtual machine.
2263
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2264
+ # to the HTTP request.
2265
+ #
2266
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2267
+ #
2268
+ def begin_un_claim_async(resource_group_name, lab_name, name, custom_headers:nil)
2269
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2270
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2271
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
2272
+ fail ArgumentError, 'name is nil' if name.nil?
2273
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2274
+
2275
+
2276
+ request_headers = {}
2277
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2278
+
2279
+ # Set Headers
2280
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2281
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2282
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/unClaim'
2283
+
2284
+ request_url = @base_url || @client.base_url
2285
+
2286
+ options = {
2287
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2288
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
2289
+ query_params: {'api-version' => @client.api_version},
2290
+ headers: request_headers.merge(custom_headers || {}),
2291
+ base_url: request_url
2292
+ }
2293
+ promise = @client.make_request_async(:post, path_template, options)
2294
+
2295
+ promise = promise.then do |result|
2296
+ http_response = result.response
2297
+ status_code = http_response.status
2298
+ response_content = http_response.body
2299
+ unless status_code == 200 || status_code == 202
2300
+ error_model = JSON.load(response_content)
2301
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2302
+ end
2303
+
2304
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2305
+
2306
+ result
2307
+ end
2308
+
2309
+ promise.execute
2310
+ end
2311
+
2312
+ #
2313
+ # List virtual machines in a given lab.
2314
+ #
2315
+ # @param next_page_link [String] The NextLink from the previous successful call
2316
+ # to List operation.
2317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2318
+ # will be added to the HTTP request.
2319
+ #
2320
+ # @return [LabVirtualMachineList] operation results.
2321
+ #
2322
+ def list_next(next_page_link, custom_headers:nil)
2323
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2324
+ response.body unless response.nil?
2325
+ end
2326
+
2327
+ #
2328
+ # List virtual machines in a given lab.
2329
+ #
2330
+ # @param next_page_link [String] The NextLink from the previous successful call
2331
+ # to List operation.
2332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2333
+ # will be added to the HTTP request.
2334
+ #
2335
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2336
+ #
2337
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2338
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2339
+ end
2340
+
2341
+ #
2342
+ # List virtual machines in a given lab.
2343
+ #
2344
+ # @param next_page_link [String] The NextLink from the previous successful call
2345
+ # to List operation.
2346
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2347
+ # to the HTTP request.
2348
+ #
2349
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2350
+ #
2351
+ def list_next_async(next_page_link, custom_headers:nil)
2352
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2353
+
2354
+
2355
+ request_headers = {}
2356
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2357
+
2358
+ # Set Headers
2359
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2360
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2361
+ path_template = '{nextLink}'
2362
+
2363
+ request_url = @base_url || @client.base_url
2364
+
2365
+ options = {
2366
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2367
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2368
+ headers: request_headers.merge(custom_headers || {}),
2369
+ base_url: request_url
2370
+ }
2371
+ promise = @client.make_request_async(:get, path_template, options)
2372
+
2373
+ promise = promise.then do |result|
2374
+ http_response = result.response
2375
+ status_code = http_response.status
2376
+ response_content = http_response.body
2377
+ unless status_code == 200
2378
+ error_model = JSON.load(response_content)
2379
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2380
+ end
2381
+
2382
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2383
+ # Deserialize Response
2384
+ if status_code == 200
2385
+ begin
2386
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2387
+ result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList.mapper()
2388
+ result.body = @client.deserialize(result_mapper, parsed_response)
2389
+ rescue Exception => e
2390
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2391
+ end
2392
+ end
2393
+
2394
+ result
2395
+ end
2396
+
2397
+ promise.execute
2398
+ end
2399
+
2400
+ #
2401
+ # List virtual machines in a given lab.
2402
+ #
2403
+ # @param resource_group_name [String] The name of the resource group.
2404
+ # @param lab_name [String] The name of the lab.
2405
+ # @param expand [String] Specify the $expand query. Example:
2406
+ # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
2407
+ # @param filter [String] The filter to apply to the operation. Example:
2408
+ # '$filter=contains(name,'myName')
2409
+ # @param top [Integer] The maximum number of resources to return from the
2410
+ # operation. Example: '$top=10'
2411
+ # @param orderby [String] The ordering expression for the results, using OData
2412
+ # notation. Example: '$orderby=name desc'
2413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2414
+ # will be added to the HTTP request.
2415
+ #
2416
+ # @return [LabVirtualMachineList] which provide lazy access to pages of the
2417
+ # response.
2418
+ #
2419
+ def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
2420
+ response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
2421
+ unless response.nil?
2422
+ page = response.body
2423
+ page.next_method = Proc.new do |next_page_link|
2424
+ list_next_async(next_page_link, custom_headers:custom_headers)
2425
+ end
2426
+ page
2427
+ end
2428
+ end
2429
+
2430
+ end
2431
+ end