azure_mgmt_compute 0.20.0 → 0.21.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-15/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  3. data/lib/2016-03-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  4. data/lib/2016-04-30-preview/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  5. data/lib/2017-03-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  6. data/lib/2017-09-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  7. data/lib/2017-12-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  8. data/lib/2018-04-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  9. data/lib/2018-06-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  10. data/lib/2018-09-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  11. data/lib/2018-10-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  12. data/lib/2019-03-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  13. data/lib/2019-04-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  14. data/lib/2019-07-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  15. data/lib/2019-11-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  16. data/lib/2019-12-01/generated/azure_mgmt_compute.rb +94 -93
  17. data/lib/2019-12-01/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  18. data/lib/2019-12-01/generated/azure_mgmt_compute/models/gallery_application_version_publishing_profile.rb +7 -7
  19. data/lib/2019-12-01/generated/azure_mgmt_compute/models/user_artifact_manage.rb +74 -0
  20. data/lib/2019-12-01/generated/azure_mgmt_compute/models/user_artifact_source.rb +10 -9
  21. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +12 -4
  22. data/lib/2019-12-01/generated/azure_mgmt_compute/virtual_machines.rb +36 -8
  23. data/lib/2020-06-01/generated/azure_mgmt_compute.rb +102 -92
  24. data/lib/2020-06-01/generated/azure_mgmt_compute/compute_management_client.rb +6 -1
  25. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_group.rb +1 -1
  26. data/lib/2020-06-01/generated/azure_mgmt_compute/models/dedicated_host_group_update.rb +1 -1
  27. data/lib/2020-06-01/generated/azure_mgmt_compute/models/execution_state.rb +21 -0
  28. data/lib/2020-06-01/generated/azure_mgmt_compute/models/hardware_profile.rb +20 -15
  29. data/lib/2020-06-01/generated/azure_mgmt_compute/models/log_analytics_input_base.rb +22 -0
  30. data/lib/2020-06-01/generated/azure_mgmt_compute/models/request_rate_by_interval_input.rb +16 -0
  31. data/lib/2020-06-01/generated/azure_mgmt_compute/models/ssh_public_key.rb +1 -1
  32. data/lib/2020-06-01/generated/azure_mgmt_compute/models/throttled_requests_input.rb +16 -0
  33. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine.rb +8 -7
  34. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_run_command.rb +241 -0
  35. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_run_command_instance_view.rb +135 -0
  36. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_run_command_script_source.rb +68 -0
  37. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_run_command_update.rb +206 -0
  38. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_run_commands_list_result.rb +98 -0
  39. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +12 -0
  40. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_update_network_configuration.rb +12 -0
  41. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +8 -7
  42. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextension.rb +190 -0
  43. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextension_update.rb +164 -0
  44. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_list_result.rb +57 -0
  45. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +8 -7
  46. data/lib/2020-06-01/generated/azure_mgmt_compute/models/virtual_machine_update.rb +8 -7
  47. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_run_commands.rb +790 -0
  48. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vmextensions.rb +35 -35
  49. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vmrun_commands.rb +827 -0
  50. data/lib/2020-06-01/generated/azure_mgmt_compute/virtual_machines.rb +5 -5
  51. data/lib/2020-06-30/generated/azure_mgmt_compute/compute_management_client.rb +1 -1
  52. data/lib/2020-09-30-preview/generated/azure_mgmt_compute.rb +106 -0
  53. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/compute_management_client.rb +165 -0
  54. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/galleries.rb +994 -0
  55. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/gallery_application_versions.rb +915 -0
  56. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/gallery_applications.rb +856 -0
  57. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/gallery_image_versions.rb +911 -0
  58. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/gallery_images.rb +856 -0
  59. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/gallery_sharing_profile.rb +189 -0
  60. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/aggregated_replication_state.rb +18 -0
  61. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/api_error.rb +100 -0
  62. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
  63. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/data_disk_image_encryption.rb +57 -0
  64. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/disallowed.rb +54 -0
  65. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/disk_image_encryption.rb +47 -0
  66. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/encryption_images.rb +69 -0
  67. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery.rb +137 -0
  68. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application.rb +161 -0
  69. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application_list.rb +100 -0
  70. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application_update.rb +153 -0
  71. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application_version.rb +127 -0
  72. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application_version_list.rb +101 -0
  73. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application_version_publishing_profile.rb +130 -0
  74. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_application_version_update.rb +119 -0
  75. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_artifact_publishing_profile_base.rb +120 -0
  76. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_artifact_source.rb +47 -0
  77. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_artifact_version_source.rb +60 -0
  78. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_data_disk_image.rb +76 -0
  79. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_disk_image.rb +74 -0
  80. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_identifier.rb +48 -0
  81. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image.rb +271 -0
  82. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_feature.rb +57 -0
  83. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_identifier.rb +68 -0
  84. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_list.rb +100 -0
  85. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_update.rb +263 -0
  86. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_version.rb +139 -0
  87. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_version_list.rb +100 -0
  88. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_version_publishing_profile.rb +93 -0
  89. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_version_storage_profile.rb +79 -0
  90. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_image_version_update.rb +131 -0
  91. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_list.rb +99 -0
  92. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_osdisk_image.rb +62 -0
  93. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_sharing_permission_types.rb +16 -0
  94. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/gallery_update.rb +129 -0
  95. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/host_caching.rb +17 -0
  96. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/hyper_vgeneration.rb +16 -0
  97. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/image_purchase_plan.rb +69 -0
  98. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
  99. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/managed_artifact.rb +46 -0
  100. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/operating_system_state_types.rb +16 -0
  101. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/operating_system_types.rb +16 -0
  102. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/osdisk_image_encryption.rb +43 -0
  103. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/pir_resource.rb +59 -0
  104. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/pir_shared_gallery_resource.rb +64 -0
  105. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/recommended_machine_configuration.rb +60 -0
  106. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/regional_replication_status.rb +86 -0
  107. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/replication_state.rb +18 -0
  108. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/replication_status.rb +71 -0
  109. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/replication_status_types.rb +15 -0
  110. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/resource.rb +110 -0
  111. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/resource_range.rb +57 -0
  112. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/select_permissions.rb +15 -0
  113. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_gallery.rb +62 -0
  114. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_gallery_image.rb +186 -0
  115. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_gallery_image_list.rb +100 -0
  116. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_gallery_image_version.rb +88 -0
  117. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_gallery_image_version_list.rb +101 -0
  118. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_gallery_list.rb +99 -0
  119. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/shared_to_values.rb +15 -0
  120. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/sharing_profile.rb +70 -0
  121. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/sharing_profile_group.rb +69 -0
  122. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/sharing_profile_group_types.rb +16 -0
  123. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/sharing_update.rb +69 -0
  124. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/sharing_update_operation_types.rb +17 -0
  125. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/storage_account_type.rb +17 -0
  126. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/target_region.rb +83 -0
  127. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/update_resource_definition.rb +90 -0
  128. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/user_artifact_manage.rb +74 -0
  129. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/models/user_artifact_source.rb +59 -0
  130. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/module_definition.rb +9 -0
  131. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/shared_galleries.rb +332 -0
  132. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/shared_gallery_image_versions.rb +366 -0
  133. data/lib/2020-09-30-preview/generated/azure_mgmt_compute/shared_gallery_images.rb +344 -0
  134. data/lib/2020-09-30/generated/azure_mgmt_compute.rb +89 -0
  135. data/lib/2020-09-30/generated/azure_mgmt_compute/compute_management_client.rb +149 -0
  136. data/lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb +1804 -0
  137. data/lib/2020-09-30/generated/azure_mgmt_compute/disk_encryption_sets.rb +1236 -0
  138. data/lib/2020-09-30/generated/azure_mgmt_compute/disk_restore_point_operations.rb +372 -0
  139. data/lib/2020-09-30/generated/azure_mgmt_compute/disks.rb +1294 -0
  140. data/lib/2020-09-30/generated/azure_mgmt_compute/models/access_level.rb +17 -0
  141. data/lib/2020-09-30/generated/azure_mgmt_compute/models/access_uri.rb +47 -0
  142. data/lib/2020-09-30/generated/azure_mgmt_compute/models/api_error.rb +100 -0
  143. data/lib/2020-09-30/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
  144. data/lib/2020-09-30/generated/azure_mgmt_compute/models/creation_data.rb +150 -0
  145. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk.rb +462 -0
  146. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_access.rb +133 -0
  147. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_access_list.rb +100 -0
  148. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_access_update.rb +54 -0
  149. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_create_option.rb +21 -0
  150. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_encryption_set.rb +160 -0
  151. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_encryption_set_identity_type.rb +16 -0
  152. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_encryption_set_list.rb +100 -0
  153. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_encryption_set_type.rb +16 -0
  154. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_encryption_set_update.rb +79 -0
  155. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_list.rb +99 -0
  156. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_restore_point.rb +164 -0
  157. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_restore_point_list.rb +100 -0
  158. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_sku.rb +61 -0
  159. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_state.rb +20 -0
  160. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_storage_account_types.rb +18 -0
  161. data/lib/2020-09-30/generated/azure_mgmt_compute/models/disk_update.rb +251 -0
  162. data/lib/2020-09-30/generated/azure_mgmt_compute/models/encryption.rb +60 -0
  163. data/lib/2020-09-30/generated/azure_mgmt_compute/models/encryption_set_identity.rb +81 -0
  164. data/lib/2020-09-30/generated/azure_mgmt_compute/models/encryption_settings_collection.rb +85 -0
  165. data/lib/2020-09-30/generated/azure_mgmt_compute/models/encryption_settings_element.rb +62 -0
  166. data/lib/2020-09-30/generated/azure_mgmt_compute/models/encryption_type.rb +17 -0
  167. data/lib/2020-09-30/generated/azure_mgmt_compute/models/extended_location.rb +58 -0
  168. data/lib/2020-09-30/generated/azure_mgmt_compute/models/extended_location_types.rb +15 -0
  169. data/lib/2020-09-30/generated/azure_mgmt_compute/models/grant_access_data.rb +58 -0
  170. data/lib/2020-09-30/generated/azure_mgmt_compute/models/hyper_vgeneration.rb +16 -0
  171. data/lib/2020-09-30/generated/azure_mgmt_compute/models/image_disk_reference.rb +60 -0
  172. data/lib/2020-09-30/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
  173. data/lib/2020-09-30/generated/azure_mgmt_compute/models/key_for_disk_encryption_set.rb +61 -0
  174. data/lib/2020-09-30/generated/azure_mgmt_compute/models/key_vault_and_key_reference.rb +60 -0
  175. data/lib/2020-09-30/generated/azure_mgmt_compute/models/key_vault_and_secret_reference.rb +59 -0
  176. data/lib/2020-09-30/generated/azure_mgmt_compute/models/network_access_policy.rb +17 -0
  177. data/lib/2020-09-30/generated/azure_mgmt_compute/models/operating_system_types.rb +16 -0
  178. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_endpoint.rb +47 -0
  179. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_endpoint_connection.rb +110 -0
  180. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_endpoint_connection_list_result.rb +100 -0
  181. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_endpoint_connection_provisioning_state.rb +18 -0
  182. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_endpoint_service_connection_status.rb +17 -0
  183. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_link_resource.rb +123 -0
  184. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_link_resource_list_result.rb +55 -0
  185. data/lib/2020-09-30/generated/azure_mgmt_compute/models/private_link_service_connection_state.rb +72 -0
  186. data/lib/2020-09-30/generated/azure_mgmt_compute/models/proxy_only_resource.rb +71 -0
  187. data/lib/2020-09-30/generated/azure_mgmt_compute/models/purchase_plan.rb +82 -0
  188. data/lib/2020-09-30/generated/azure_mgmt_compute/models/resource.rb +110 -0
  189. data/lib/2020-09-30/generated/azure_mgmt_compute/models/resource_uri_list.rb +100 -0
  190. data/lib/2020-09-30/generated/azure_mgmt_compute/models/share_info_element.rb +49 -0
  191. data/lib/2020-09-30/generated/azure_mgmt_compute/models/snapshot.rb +316 -0
  192. data/lib/2020-09-30/generated/azure_mgmt_compute/models/snapshot_list.rb +99 -0
  193. data/lib/2020-09-30/generated/azure_mgmt_compute/models/snapshot_sku.rb +62 -0
  194. data/lib/2020-09-30/generated/azure_mgmt_compute/models/snapshot_storage_account_types.rb +17 -0
  195. data/lib/2020-09-30/generated/azure_mgmt_compute/models/snapshot_update.rb +145 -0
  196. data/lib/2020-09-30/generated/azure_mgmt_compute/models/source_vault.rb +47 -0
  197. data/lib/2020-09-30/generated/azure_mgmt_compute/module_definition.rb +9 -0
  198. data/lib/2020-09-30/generated/azure_mgmt_compute/snapshots.rb +1294 -0
  199. data/lib/2020-10-01-preview/generated/azure_mgmt_compute.rb +73 -0
  200. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/cloud_service_role_instances.rb +1091 -0
  201. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/cloud_service_roles.rb +343 -0
  202. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/cloud_services.rb +1870 -0
  203. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/cloud_services_update_domain.rb +486 -0
  204. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/compute_management_client.rb +145 -0
  205. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/api_error.rb +100 -0
  206. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
  207. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service.rb +113 -0
  208. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_extension_profile.rb +55 -0
  209. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_extension_properties.rb +180 -0
  210. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_instance_view.rb +81 -0
  211. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_list_result.rb +98 -0
  212. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_network_profile.rb +68 -0
  213. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_os_profile.rb +56 -0
  214. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_properties.rb +176 -0
  215. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_role.rb +107 -0
  216. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_role_list_result.rb +98 -0
  217. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_role_profile.rb +56 -0
  218. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_role_profile_properties.rb +58 -0
  219. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_role_properties.rb +49 -0
  220. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_role_sku.rb +72 -0
  221. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_update.rb +55 -0
  222. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_upgrade_mode.rb +17 -0
  223. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_vault_and_secret_reference.rb +59 -0
  224. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_vault_certificate.rb +48 -0
  225. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/cloud_service_vault_secret_group.rb +69 -0
  226. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/extension.rb +58 -0
  227. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
  228. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/instance_sku.rb +60 -0
  229. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/instance_view_statuses_summary.rb +56 -0
  230. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/instance_view_types.rb +15 -0
  231. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/load_balancer_configuration.rb +58 -0
  232. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/load_balancer_configuration_properties.rb +56 -0
  233. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/load_balancer_frontend_ipconfiguration.rb +59 -0
  234. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/load_balancer_frontend_ipconfiguration_properties.rb +72 -0
  235. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/resource_instance_view_status.rb +97 -0
  236. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/role_instance.rb +128 -0
  237. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/role_instance_instance_view.rb +95 -0
  238. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/role_instance_list_result.rb +98 -0
  239. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/role_instance_network_profile.rb +57 -0
  240. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/role_instance_properties.rb +60 -0
  241. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/role_instances.rb +55 -0
  242. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/status_code_count.rb +60 -0
  243. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/status_level_types.rb +17 -0
  244. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/sub_resource.rb +47 -0
  245. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/update_domain.rb +59 -0
  246. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/models/update_domain_list_result.rb +98 -0
  247. data/lib/2020-10-01-preview/generated/azure_mgmt_compute/module_definition.rb +9 -0
  248. data/lib/azure_mgmt_compute.rb +3 -0
  249. data/lib/profiles/latest/modules/compute_profile_module.rb +700 -468
  250. data/lib/version.rb +1 -1
  251. metadata +209 -2
@@ -0,0 +1,343 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Compute::Mgmt::V2020_10_01_preview
7
+ #
8
+ # Compute Client
9
+ #
10
+ class CloudServiceRoles
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the CloudServiceRoles class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ComputeManagementClient] reference to the ComputeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a role from a cloud service.
26
+ #
27
+ # @param role_name [String] Name of the role.
28
+ # @param resource_group_name [String]
29
+ # @param cloud_service_name [String]
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [CloudServiceRole] operation results.
34
+ #
35
+ def get(role_name, resource_group_name, cloud_service_name, custom_headers:nil)
36
+ response = get_async(role_name, resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Gets a role from a cloud service.
42
+ #
43
+ # @param role_name [String] Name of the role.
44
+ # @param resource_group_name [String]
45
+ # @param cloud_service_name [String]
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(role_name, resource_group_name, cloud_service_name, custom_headers:nil)
52
+ get_async(role_name, resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets a role from a cloud service.
57
+ #
58
+ # @param role_name [String] Name of the role.
59
+ # @param resource_group_name [String]
60
+ # @param cloud_service_name [String]
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(role_name, resource_group_name, cloud_service_name, custom_headers:nil)
67
+ fail ArgumentError, 'role_name is nil' if role_name.nil?
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
72
+
73
+
74
+ request_headers = {}
75
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
76
+
77
+ # Set Headers
78
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
79
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
80
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}'
81
+
82
+ request_url = @base_url || @client.base_url
83
+
84
+ options = {
85
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
86
+ path_params: {'roleName' => role_name,'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
87
+ query_params: {'api-version' => @client.api_version},
88
+ headers: request_headers.merge(custom_headers || {}),
89
+ base_url: request_url
90
+ }
91
+ promise = @client.make_request_async(:get, path_template, options)
92
+
93
+ promise = promise.then do |result|
94
+ http_response = result.response
95
+ status_code = http_response.status
96
+ response_content = http_response.body
97
+ unless status_code == 200
98
+ error_model = JSON.load(response_content)
99
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
100
+ end
101
+
102
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
103
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
104
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
105
+ # Deserialize Response
106
+ if status_code == 200
107
+ begin
108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceRole.mapper()
110
+ result.body = @client.deserialize(result_mapper, parsed_response)
111
+ rescue Exception => e
112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
113
+ end
114
+ end
115
+
116
+ result
117
+ end
118
+
119
+ promise.execute
120
+ end
121
+
122
+ #
123
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
124
+ # response to get the next page of roles. Do this till nextLink is null to
125
+ # fetch all the roles.
126
+ #
127
+ # @param resource_group_name [String]
128
+ # @param cloud_service_name [String]
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [Array<CloudServiceRole>] operation results.
133
+ #
134
+ def list(resource_group_name, cloud_service_name, custom_headers:nil)
135
+ first_page = list_as_lazy(resource_group_name, cloud_service_name, custom_headers:custom_headers)
136
+ first_page.get_all_items
137
+ end
138
+
139
+ #
140
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
141
+ # response to get the next page of roles. Do this till nextLink is null to
142
+ # fetch all the roles.
143
+ #
144
+ # @param resource_group_name [String]
145
+ # @param cloud_service_name [String]
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def list_with_http_info(resource_group_name, cloud_service_name, custom_headers:nil)
152
+ list_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
157
+ # response to get the next page of roles. Do this till nextLink is null to
158
+ # fetch all the roles.
159
+ #
160
+ # @param resource_group_name [String]
161
+ # @param cloud_service_name [String]
162
+ # @param [Hash{String => String}] A hash of custom headers that will be added
163
+ # to the HTTP request.
164
+ #
165
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
166
+ #
167
+ def list_async(resource_group_name, cloud_service_name, custom_headers:nil)
168
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
169
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
170
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
171
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
172
+
173
+
174
+ request_headers = {}
175
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
176
+
177
+ # Set Headers
178
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
179
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
180
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles'
181
+
182
+ request_url = @base_url || @client.base_url
183
+
184
+ options = {
185
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
186
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
187
+ query_params: {'api-version' => @client.api_version},
188
+ headers: request_headers.merge(custom_headers || {}),
189
+ base_url: request_url
190
+ }
191
+ promise = @client.make_request_async(:get, path_template, options)
192
+
193
+ promise = promise.then do |result|
194
+ http_response = result.response
195
+ status_code = http_response.status
196
+ response_content = http_response.body
197
+ unless status_code == 200
198
+ error_model = JSON.load(response_content)
199
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
200
+ end
201
+
202
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
203
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
204
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
205
+ # Deserialize Response
206
+ if status_code == 200
207
+ begin
208
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
209
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceRoleListResult.mapper()
210
+ result.body = @client.deserialize(result_mapper, parsed_response)
211
+ rescue Exception => e
212
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
213
+ end
214
+ end
215
+
216
+ result
217
+ end
218
+
219
+ promise.execute
220
+ end
221
+
222
+ #
223
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
224
+ # response to get the next page of roles. Do this till nextLink is null to
225
+ # fetch all the roles.
226
+ #
227
+ # @param next_page_link [String] The NextLink from the previous successful call
228
+ # to List operation.
229
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
230
+ # will be added to the HTTP request.
231
+ #
232
+ # @return [CloudServiceRoleListResult] operation results.
233
+ #
234
+ def list_next(next_page_link, custom_headers:nil)
235
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
236
+ response.body unless response.nil?
237
+ end
238
+
239
+ #
240
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
241
+ # response to get the next page of roles. Do this till nextLink is null to
242
+ # fetch all the roles.
243
+ #
244
+ # @param next_page_link [String] The NextLink from the previous successful call
245
+ # to List operation.
246
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
247
+ # will be added to the HTTP request.
248
+ #
249
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
250
+ #
251
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
252
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
253
+ end
254
+
255
+ #
256
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
257
+ # response to get the next page of roles. Do this till nextLink is null to
258
+ # fetch all the roles.
259
+ #
260
+ # @param next_page_link [String] The NextLink from the previous successful call
261
+ # to List operation.
262
+ # @param [Hash{String => String}] A hash of custom headers that will be added
263
+ # to the HTTP request.
264
+ #
265
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
266
+ #
267
+ def list_next_async(next_page_link, custom_headers:nil)
268
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
269
+
270
+
271
+ request_headers = {}
272
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
273
+
274
+ # Set Headers
275
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
276
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
277
+ path_template = '{nextLink}'
278
+
279
+ request_url = @base_url || @client.base_url
280
+
281
+ options = {
282
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
283
+ skip_encoding_path_params: {'nextLink' => next_page_link},
284
+ headers: request_headers.merge(custom_headers || {}),
285
+ base_url: request_url
286
+ }
287
+ promise = @client.make_request_async(:get, path_template, options)
288
+
289
+ promise = promise.then do |result|
290
+ http_response = result.response
291
+ status_code = http_response.status
292
+ response_content = http_response.body
293
+ unless status_code == 200
294
+ error_model = JSON.load(response_content)
295
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
296
+ end
297
+
298
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
299
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
300
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
301
+ # Deserialize Response
302
+ if status_code == 200
303
+ begin
304
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
305
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceRoleListResult.mapper()
306
+ result.body = @client.deserialize(result_mapper, parsed_response)
307
+ rescue Exception => e
308
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
309
+ end
310
+ end
311
+
312
+ result
313
+ end
314
+
315
+ promise.execute
316
+ end
317
+
318
+ #
319
+ # Gets a list of all roles in a cloud service. Use nextLink property in the
320
+ # response to get the next page of roles. Do this till nextLink is null to
321
+ # fetch all the roles.
322
+ #
323
+ # @param resource_group_name [String]
324
+ # @param cloud_service_name [String]
325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
+ # will be added to the HTTP request.
327
+ #
328
+ # @return [CloudServiceRoleListResult] which provide lazy access to pages of
329
+ # the response.
330
+ #
331
+ def list_as_lazy(resource_group_name, cloud_service_name, custom_headers:nil)
332
+ response = list_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
333
+ unless response.nil?
334
+ page = response.body
335
+ page.next_method = Proc.new do |next_page_link|
336
+ list_next_async(next_page_link, custom_headers:custom_headers)
337
+ end
338
+ page
339
+ end
340
+ end
341
+
342
+ end
343
+ end
@@ -0,0 +1,1870 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Compute::Mgmt::V2020_10_01_preview
7
+ #
8
+ # Compute Client
9
+ #
10
+ class CloudServices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the CloudServices class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ComputeManagementClient] reference to the ComputeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Create or update a cloud service. Please note some properties can be set only
26
+ # during cloud service creation.
27
+ #
28
+ # @param resource_group_name [String] Name of the resource group.
29
+ # @param cloud_service_name [String] Name of the cloud service.
30
+ # @param parameters [CloudService] The cloud service object.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CloudService] operation results.
35
+ #
36
+ def create_or_update(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
37
+ response = create_or_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # @param resource_group_name [String] Name of the resource group.
43
+ # @param cloud_service_name [String] Name of the cloud service.
44
+ # @param parameters [CloudService] The cloud service object.
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [Concurrent::Promise] promise which provides async access to http
49
+ # response.
50
+ #
51
+ def create_or_update_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
52
+ # Send request
53
+ promise = begin_create_or_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers)
54
+
55
+ promise = promise.then do |response|
56
+ # Defining deserialization method.
57
+ deserialize_method = lambda do |parsed_response|
58
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
59
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
60
+ end
61
+
62
+ # Waiting for response.
63
+ @client.get_long_running_operation_result(response, deserialize_method)
64
+ end
65
+
66
+ promise
67
+ end
68
+
69
+ #
70
+ # Update a cloud service.
71
+ #
72
+ # @param resource_group_name [String] Name of the resource group.
73
+ # @param cloud_service_name [String] Name of the cloud service.
74
+ # @param parameters [CloudServiceUpdate] The cloud service object.
75
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
76
+ # will be added to the HTTP request.
77
+ #
78
+ # @return [CloudService] operation results.
79
+ #
80
+ def update(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
81
+ response = update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
82
+ response.body unless response.nil?
83
+ end
84
+
85
+ #
86
+ # @param resource_group_name [String] Name of the resource group.
87
+ # @param cloud_service_name [String] Name of the cloud service.
88
+ # @param parameters [CloudServiceUpdate] The cloud service object.
89
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
90
+ # will be added to the HTTP request.
91
+ #
92
+ # @return [Concurrent::Promise] promise which provides async access to http
93
+ # response.
94
+ #
95
+ def update_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
96
+ # Send request
97
+ promise = begin_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers)
98
+
99
+ promise = promise.then do |response|
100
+ # Defining deserialization method.
101
+ deserialize_method = lambda do |parsed_response|
102
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
103
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
104
+ end
105
+
106
+ # Waiting for response.
107
+ @client.get_long_running_operation_result(response, deserialize_method)
108
+ end
109
+
110
+ promise
111
+ end
112
+
113
+ #
114
+ # Deletes a cloud service.
115
+ #
116
+ # @param resource_group_name [String] Name of the resource group.
117
+ # @param cloud_service_name [String] Name of the cloud service.
118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
119
+ # will be added to the HTTP request.
120
+ #
121
+ def delete(resource_group_name, cloud_service_name, custom_headers:nil)
122
+ response = delete_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
123
+ nil
124
+ end
125
+
126
+ #
127
+ # @param resource_group_name [String] Name of the resource group.
128
+ # @param cloud_service_name [String] Name of the cloud service.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [Concurrent::Promise] promise which provides async access to http
133
+ # response.
134
+ #
135
+ def delete_async(resource_group_name, cloud_service_name, custom_headers:nil)
136
+ # Send request
137
+ promise = begin_delete_async(resource_group_name, cloud_service_name, custom_headers:custom_headers)
138
+
139
+ promise = promise.then do |response|
140
+ # Defining deserialization method.
141
+ deserialize_method = lambda do |parsed_response|
142
+ end
143
+
144
+ # Waiting for response.
145
+ @client.get_long_running_operation_result(response, deserialize_method)
146
+ end
147
+
148
+ promise
149
+ end
150
+
151
+ #
152
+ # Display information about a cloud service.
153
+ #
154
+ # @param resource_group_name [String] Name of the resource group.
155
+ # @param cloud_service_name [String] Name of the cloud service.
156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
+ # will be added to the HTTP request.
158
+ #
159
+ # @return [CloudService] operation results.
160
+ #
161
+ def get(resource_group_name, cloud_service_name, custom_headers:nil)
162
+ response = get_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
163
+ response.body unless response.nil?
164
+ end
165
+
166
+ #
167
+ # Display information about a cloud service.
168
+ #
169
+ # @param resource_group_name [String] Name of the resource group.
170
+ # @param cloud_service_name [String] Name of the cloud service.
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
175
+ #
176
+ def get_with_http_info(resource_group_name, cloud_service_name, custom_headers:nil)
177
+ get_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
178
+ end
179
+
180
+ #
181
+ # Display information about a cloud service.
182
+ #
183
+ # @param resource_group_name [String] Name of the resource group.
184
+ # @param cloud_service_name [String] Name of the cloud service.
185
+ # @param [Hash{String => String}] A hash of custom headers that will be added
186
+ # to the HTTP request.
187
+ #
188
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
189
+ #
190
+ def get_async(resource_group_name, cloud_service_name, custom_headers:nil)
191
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
192
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
193
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
194
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
195
+
196
+
197
+ request_headers = {}
198
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
199
+
200
+ # Set Headers
201
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
202
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
203
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}'
204
+
205
+ request_url = @base_url || @client.base_url
206
+
207
+ options = {
208
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
209
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
210
+ query_params: {'api-version' => @client.api_version},
211
+ headers: request_headers.merge(custom_headers || {}),
212
+ base_url: request_url
213
+ }
214
+ promise = @client.make_request_async(:get, path_template, options)
215
+
216
+ promise = promise.then do |result|
217
+ http_response = result.response
218
+ status_code = http_response.status
219
+ response_content = http_response.body
220
+ unless status_code == 200
221
+ error_model = JSON.load(response_content)
222
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
223
+ end
224
+
225
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
226
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
227
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
228
+ # Deserialize Response
229
+ if status_code == 200
230
+ begin
231
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
232
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
233
+ result.body = @client.deserialize(result_mapper, parsed_response)
234
+ rescue Exception => e
235
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
236
+ end
237
+ end
238
+
239
+ result
240
+ end
241
+
242
+ promise.execute
243
+ end
244
+
245
+ #
246
+ # Gets the status of a cloud service.
247
+ #
248
+ # @param resource_group_name [String] Name of the resource group.
249
+ # @param cloud_service_name [String] Name of the cloud service.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [CloudServiceInstanceView] operation results.
254
+ #
255
+ def get_instance_view(resource_group_name, cloud_service_name, custom_headers:nil)
256
+ response = get_instance_view_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
257
+ response.body unless response.nil?
258
+ end
259
+
260
+ #
261
+ # Gets the status of a cloud service.
262
+ #
263
+ # @param resource_group_name [String] Name of the resource group.
264
+ # @param cloud_service_name [String] Name of the cloud service.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
269
+ #
270
+ def get_instance_view_with_http_info(resource_group_name, cloud_service_name, custom_headers:nil)
271
+ get_instance_view_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
272
+ end
273
+
274
+ #
275
+ # Gets the status of a cloud service.
276
+ #
277
+ # @param resource_group_name [String] Name of the resource group.
278
+ # @param cloud_service_name [String] Name of the cloud service.
279
+ # @param [Hash{String => String}] A hash of custom headers that will be added
280
+ # to the HTTP request.
281
+ #
282
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
283
+ #
284
+ def get_instance_view_async(resource_group_name, cloud_service_name, custom_headers:nil)
285
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
286
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
287
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
288
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
289
+
290
+
291
+ request_headers = {}
292
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
293
+
294
+ # Set Headers
295
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
296
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
297
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView'
298
+
299
+ request_url = @base_url || @client.base_url
300
+
301
+ options = {
302
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
303
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
304
+ query_params: {'api-version' => @client.api_version},
305
+ headers: request_headers.merge(custom_headers || {}),
306
+ base_url: request_url
307
+ }
308
+ promise = @client.make_request_async(:get, path_template, options)
309
+
310
+ promise = promise.then do |result|
311
+ http_response = result.response
312
+ status_code = http_response.status
313
+ response_content = http_response.body
314
+ unless status_code == 200
315
+ error_model = JSON.load(response_content)
316
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
317
+ end
318
+
319
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
320
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
321
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
322
+ # Deserialize Response
323
+ if status_code == 200
324
+ begin
325
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
326
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceInstanceView.mapper()
327
+ result.body = @client.deserialize(result_mapper, parsed_response)
328
+ rescue Exception => e
329
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
330
+ end
331
+ end
332
+
333
+ result
334
+ end
335
+
336
+ promise.execute
337
+ end
338
+
339
+ #
340
+ # Gets a list of all cloud services in the subscription, regardless of the
341
+ # associated resource group. Use nextLink property in the response to get the
342
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
343
+ # Cloud Services.
344
+ #
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [Array<CloudService>] operation results.
349
+ #
350
+ def list_all(custom_headers:nil)
351
+ first_page = list_all_as_lazy(custom_headers:custom_headers)
352
+ first_page.get_all_items
353
+ end
354
+
355
+ #
356
+ # Gets a list of all cloud services in the subscription, regardless of the
357
+ # associated resource group. Use nextLink property in the response to get the
358
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
359
+ # Cloud Services.
360
+ #
361
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
362
+ # will be added to the HTTP request.
363
+ #
364
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
365
+ #
366
+ def list_all_with_http_info(custom_headers:nil)
367
+ list_all_async(custom_headers:custom_headers).value!
368
+ end
369
+
370
+ #
371
+ # Gets a list of all cloud services in the subscription, regardless of the
372
+ # associated resource group. Use nextLink property in the response to get the
373
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
374
+ # Cloud Services.
375
+ #
376
+ # @param [Hash{String => String}] A hash of custom headers that will be added
377
+ # to the HTTP request.
378
+ #
379
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
380
+ #
381
+ def list_all_async(custom_headers:nil)
382
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
383
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
384
+
385
+
386
+ request_headers = {}
387
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
388
+
389
+ # Set Headers
390
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
391
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
392
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices'
393
+
394
+ request_url = @base_url || @client.base_url
395
+
396
+ options = {
397
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
398
+ path_params: {'subscriptionId' => @client.subscription_id},
399
+ query_params: {'api-version' => @client.api_version},
400
+ headers: request_headers.merge(custom_headers || {}),
401
+ base_url: request_url
402
+ }
403
+ promise = @client.make_request_async(:get, path_template, options)
404
+
405
+ promise = promise.then do |result|
406
+ http_response = result.response
407
+ status_code = http_response.status
408
+ response_content = http_response.body
409
+ unless status_code == 200
410
+ error_model = JSON.load(response_content)
411
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
412
+ end
413
+
414
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
415
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
416
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
417
+ # Deserialize Response
418
+ if status_code == 200
419
+ begin
420
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
421
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceListResult.mapper()
422
+ result.body = @client.deserialize(result_mapper, parsed_response)
423
+ rescue Exception => e
424
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
425
+ end
426
+ end
427
+
428
+ result
429
+ end
430
+
431
+ promise.execute
432
+ end
433
+
434
+ #
435
+ # Gets a list of all cloud services under a resource group. Use nextLink
436
+ # property in the response to get the next page of Cloud Services. Do this till
437
+ # nextLink is null to fetch all the Cloud Services.
438
+ #
439
+ # @param resource_group_name [String] Name of the resource group.
440
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
441
+ # will be added to the HTTP request.
442
+ #
443
+ # @return [Array<CloudService>] operation results.
444
+ #
445
+ def list(resource_group_name, custom_headers:nil)
446
+ first_page = list_as_lazy(resource_group_name, custom_headers:custom_headers)
447
+ first_page.get_all_items
448
+ end
449
+
450
+ #
451
+ # Gets a list of all cloud services under a resource group. Use nextLink
452
+ # property in the response to get the next page of Cloud Services. Do this till
453
+ # nextLink is null to fetch all the Cloud Services.
454
+ #
455
+ # @param resource_group_name [String] Name of the resource group.
456
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
457
+ # will be added to the HTTP request.
458
+ #
459
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
460
+ #
461
+ def list_with_http_info(resource_group_name, custom_headers:nil)
462
+ list_async(resource_group_name, custom_headers:custom_headers).value!
463
+ end
464
+
465
+ #
466
+ # Gets a list of all cloud services under a resource group. Use nextLink
467
+ # property in the response to get the next page of Cloud Services. Do this till
468
+ # nextLink is null to fetch all the Cloud Services.
469
+ #
470
+ # @param resource_group_name [String] Name of the resource group.
471
+ # @param [Hash{String => String}] A hash of custom headers that will be added
472
+ # to the HTTP request.
473
+ #
474
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
475
+ #
476
+ def list_async(resource_group_name, custom_headers:nil)
477
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
478
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
479
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
480
+
481
+
482
+ request_headers = {}
483
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
484
+
485
+ # Set Headers
486
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
487
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
488
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices'
489
+
490
+ request_url = @base_url || @client.base_url
491
+
492
+ options = {
493
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
494
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
495
+ query_params: {'api-version' => @client.api_version},
496
+ headers: request_headers.merge(custom_headers || {}),
497
+ base_url: request_url
498
+ }
499
+ promise = @client.make_request_async(:get, path_template, options)
500
+
501
+ promise = promise.then do |result|
502
+ http_response = result.response
503
+ status_code = http_response.status
504
+ response_content = http_response.body
505
+ unless status_code == 200
506
+ error_model = JSON.load(response_content)
507
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
508
+ end
509
+
510
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
511
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
512
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
513
+ # Deserialize Response
514
+ if status_code == 200
515
+ begin
516
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
517
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceListResult.mapper()
518
+ result.body = @client.deserialize(result_mapper, parsed_response)
519
+ rescue Exception => e
520
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
521
+ end
522
+ end
523
+
524
+ result
525
+ end
526
+
527
+ promise.execute
528
+ end
529
+
530
+ #
531
+ # Starts the cloud service.
532
+ #
533
+ # @param resource_group_name [String] Name of the resource group.
534
+ # @param cloud_service_name [String] Name of the cloud service.
535
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
536
+ # will be added to the HTTP request.
537
+ #
538
+ def start(resource_group_name, cloud_service_name, custom_headers:nil)
539
+ response = start_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
540
+ nil
541
+ end
542
+
543
+ #
544
+ # @param resource_group_name [String] Name of the resource group.
545
+ # @param cloud_service_name [String] Name of the cloud service.
546
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
547
+ # will be added to the HTTP request.
548
+ #
549
+ # @return [Concurrent::Promise] promise which provides async access to http
550
+ # response.
551
+ #
552
+ def start_async(resource_group_name, cloud_service_name, custom_headers:nil)
553
+ # Send request
554
+ promise = begin_start_async(resource_group_name, cloud_service_name, custom_headers:custom_headers)
555
+
556
+ promise = promise.then do |response|
557
+ # Defining deserialization method.
558
+ deserialize_method = lambda do |parsed_response|
559
+ end
560
+
561
+ # Waiting for response.
562
+ @client.get_long_running_operation_result(response, deserialize_method)
563
+ end
564
+
565
+ promise
566
+ end
567
+
568
+ #
569
+ # Power off the cloud service. Note that resources are still attached and you
570
+ # are getting charged for the resources.
571
+ #
572
+ # @param resource_group_name [String] Name of the resource group.
573
+ # @param cloud_service_name [String] Name of the cloud service.
574
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
575
+ # will be added to the HTTP request.
576
+ #
577
+ def power_off(resource_group_name, cloud_service_name, custom_headers:nil)
578
+ response = power_off_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
579
+ nil
580
+ end
581
+
582
+ #
583
+ # @param resource_group_name [String] Name of the resource group.
584
+ # @param cloud_service_name [String] Name of the cloud service.
585
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
586
+ # will be added to the HTTP request.
587
+ #
588
+ # @return [Concurrent::Promise] promise which provides async access to http
589
+ # response.
590
+ #
591
+ def power_off_async(resource_group_name, cloud_service_name, custom_headers:nil)
592
+ # Send request
593
+ promise = begin_power_off_async(resource_group_name, cloud_service_name, custom_headers:custom_headers)
594
+
595
+ promise = promise.then do |response|
596
+ # Defining deserialization method.
597
+ deserialize_method = lambda do |parsed_response|
598
+ end
599
+
600
+ # Waiting for response.
601
+ @client.get_long_running_operation_result(response, deserialize_method)
602
+ end
603
+
604
+ promise
605
+ end
606
+
607
+ #
608
+ # Restarts one or more role instances in a cloud service.
609
+ #
610
+ # @param resource_group_name [String] Name of the resource group.
611
+ # @param cloud_service_name [String] Name of the cloud service.
612
+ # @param parameters [RoleInstances] List of cloud service role instance names.
613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
614
+ # will be added to the HTTP request.
615
+ #
616
+ def restart(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
617
+ response = restart_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
618
+ nil
619
+ end
620
+
621
+ #
622
+ # @param resource_group_name [String] Name of the resource group.
623
+ # @param cloud_service_name [String] Name of the cloud service.
624
+ # @param parameters [RoleInstances] List of cloud service role instance names.
625
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
626
+ # will be added to the HTTP request.
627
+ #
628
+ # @return [Concurrent::Promise] promise which provides async access to http
629
+ # response.
630
+ #
631
+ def restart_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
632
+ # Send request
633
+ promise = begin_restart_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers)
634
+
635
+ promise = promise.then do |response|
636
+ # Defining deserialization method.
637
+ deserialize_method = lambda do |parsed_response|
638
+ end
639
+
640
+ # Waiting for response.
641
+ @client.get_long_running_operation_result(response, deserialize_method)
642
+ end
643
+
644
+ promise
645
+ end
646
+
647
+ #
648
+ # Reimage asynchronous operation reinstalls the operating system on instances
649
+ # of web roles or worker roles.
650
+ #
651
+ # @param resource_group_name [String] Name of the resource group.
652
+ # @param cloud_service_name [String] Name of the cloud service.
653
+ # @param parameters [RoleInstances] List of cloud service role instance names.
654
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
655
+ # will be added to the HTTP request.
656
+ #
657
+ def reimage(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
658
+ response = reimage_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
659
+ nil
660
+ end
661
+
662
+ #
663
+ # @param resource_group_name [String] Name of the resource group.
664
+ # @param cloud_service_name [String] Name of the cloud service.
665
+ # @param parameters [RoleInstances] List of cloud service role instance names.
666
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
667
+ # will be added to the HTTP request.
668
+ #
669
+ # @return [Concurrent::Promise] promise which provides async access to http
670
+ # response.
671
+ #
672
+ def reimage_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
673
+ # Send request
674
+ promise = begin_reimage_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers)
675
+
676
+ promise = promise.then do |response|
677
+ # Defining deserialization method.
678
+ deserialize_method = lambda do |parsed_response|
679
+ end
680
+
681
+ # Waiting for response.
682
+ @client.get_long_running_operation_result(response, deserialize_method)
683
+ end
684
+
685
+ promise
686
+ end
687
+
688
+ #
689
+ # Rebuild Role Instances reinstalls the operating system on instances of web
690
+ # roles or worker roles and initializes the storage resources that are used by
691
+ # them. If you do not want to initialize storage resources, you can use Reimage
692
+ # Role Instances.
693
+ #
694
+ # @param resource_group_name [String] Name of the resource group.
695
+ # @param cloud_service_name [String] Name of the cloud service.
696
+ # @param parameters [RoleInstances] List of cloud service role instance names.
697
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
698
+ # will be added to the HTTP request.
699
+ #
700
+ def rebuild(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
701
+ response = rebuild_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
702
+ nil
703
+ end
704
+
705
+ #
706
+ # @param resource_group_name [String] Name of the resource group.
707
+ # @param cloud_service_name [String] Name of the cloud service.
708
+ # @param parameters [RoleInstances] List of cloud service role instance names.
709
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
710
+ # will be added to the HTTP request.
711
+ #
712
+ # @return [Concurrent::Promise] promise which provides async access to http
713
+ # response.
714
+ #
715
+ def rebuild_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
716
+ # Send request
717
+ promise = begin_rebuild_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers)
718
+
719
+ promise = promise.then do |response|
720
+ # Defining deserialization method.
721
+ deserialize_method = lambda do |parsed_response|
722
+ end
723
+
724
+ # Waiting for response.
725
+ @client.get_long_running_operation_result(response, deserialize_method)
726
+ end
727
+
728
+ promise
729
+ end
730
+
731
+ #
732
+ # Deletes role instances in a cloud service.
733
+ #
734
+ # @param resource_group_name [String] Name of the resource group.
735
+ # @param cloud_service_name [String] Name of the cloud service.
736
+ # @param parameters [RoleInstances] List of cloud service role instance names.
737
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
738
+ # will be added to the HTTP request.
739
+ #
740
+ def delete_instances(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
741
+ response = delete_instances_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
742
+ nil
743
+ end
744
+
745
+ #
746
+ # @param resource_group_name [String] Name of the resource group.
747
+ # @param cloud_service_name [String] Name of the cloud service.
748
+ # @param parameters [RoleInstances] List of cloud service role instance names.
749
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
750
+ # will be added to the HTTP request.
751
+ #
752
+ # @return [Concurrent::Promise] promise which provides async access to http
753
+ # response.
754
+ #
755
+ def delete_instances_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
756
+ # Send request
757
+ promise = begin_delete_instances_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers)
758
+
759
+ promise = promise.then do |response|
760
+ # Defining deserialization method.
761
+ deserialize_method = lambda do |parsed_response|
762
+ end
763
+
764
+ # Waiting for response.
765
+ @client.get_long_running_operation_result(response, deserialize_method)
766
+ end
767
+
768
+ promise
769
+ end
770
+
771
+ #
772
+ # Create or update a cloud service. Please note some properties can be set only
773
+ # during cloud service creation.
774
+ #
775
+ # @param resource_group_name [String] Name of the resource group.
776
+ # @param cloud_service_name [String] Name of the cloud service.
777
+ # @param parameters [CloudService] The cloud service object.
778
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
779
+ # will be added to the HTTP request.
780
+ #
781
+ # @return [CloudService] operation results.
782
+ #
783
+ def begin_create_or_update(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
784
+ response = begin_create_or_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
785
+ response.body unless response.nil?
786
+ end
787
+
788
+ #
789
+ # Create or update a cloud service. Please note some properties can be set only
790
+ # during cloud service creation.
791
+ #
792
+ # @param resource_group_name [String] Name of the resource group.
793
+ # @param cloud_service_name [String] Name of the cloud service.
794
+ # @param parameters [CloudService] The cloud service object.
795
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
796
+ # will be added to the HTTP request.
797
+ #
798
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
799
+ #
800
+ def begin_create_or_update_with_http_info(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
801
+ begin_create_or_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
802
+ end
803
+
804
+ #
805
+ # Create or update a cloud service. Please note some properties can be set only
806
+ # during cloud service creation.
807
+ #
808
+ # @param resource_group_name [String] Name of the resource group.
809
+ # @param cloud_service_name [String] Name of the cloud service.
810
+ # @param parameters [CloudService] The cloud service object.
811
+ # @param [Hash{String => String}] A hash of custom headers that will be added
812
+ # to the HTTP request.
813
+ #
814
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
815
+ #
816
+ def begin_create_or_update_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
817
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
818
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
819
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
820
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
821
+
822
+
823
+ request_headers = {}
824
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
825
+
826
+ # Set Headers
827
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
828
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
829
+
830
+ # Serialize Request
831
+ request_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
832
+ request_content = @client.serialize(request_mapper, parameters)
833
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
834
+
835
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}'
836
+
837
+ request_url = @base_url || @client.base_url
838
+
839
+ options = {
840
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
841
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
842
+ query_params: {'api-version' => @client.api_version},
843
+ body: request_content,
844
+ headers: request_headers.merge(custom_headers || {}),
845
+ base_url: request_url
846
+ }
847
+ promise = @client.make_request_async(:put, path_template, options)
848
+
849
+ promise = promise.then do |result|
850
+ http_response = result.response
851
+ status_code = http_response.status
852
+ response_content = http_response.body
853
+ unless status_code == 200 || status_code == 201
854
+ error_model = JSON.load(response_content)
855
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
856
+ end
857
+
858
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
859
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
860
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
861
+ # Deserialize Response
862
+ if status_code == 200
863
+ begin
864
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
865
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
866
+ result.body = @client.deserialize(result_mapper, parsed_response)
867
+ rescue Exception => e
868
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
869
+ end
870
+ end
871
+ # Deserialize Response
872
+ if status_code == 201
873
+ begin
874
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
875
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
876
+ result.body = @client.deserialize(result_mapper, parsed_response)
877
+ rescue Exception => e
878
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
879
+ end
880
+ end
881
+
882
+ result
883
+ end
884
+
885
+ promise.execute
886
+ end
887
+
888
+ #
889
+ # Update a cloud service.
890
+ #
891
+ # @param resource_group_name [String] Name of the resource group.
892
+ # @param cloud_service_name [String] Name of the cloud service.
893
+ # @param parameters [CloudServiceUpdate] The cloud service object.
894
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
895
+ # will be added to the HTTP request.
896
+ #
897
+ # @return [CloudService] operation results.
898
+ #
899
+ def begin_update(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
900
+ response = begin_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
901
+ response.body unless response.nil?
902
+ end
903
+
904
+ #
905
+ # Update a cloud service.
906
+ #
907
+ # @param resource_group_name [String] Name of the resource group.
908
+ # @param cloud_service_name [String] Name of the cloud service.
909
+ # @param parameters [CloudServiceUpdate] The cloud service object.
910
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
911
+ # will be added to the HTTP request.
912
+ #
913
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
914
+ #
915
+ def begin_update_with_http_info(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
916
+ begin_update_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
917
+ end
918
+
919
+ #
920
+ # Update a cloud service.
921
+ #
922
+ # @param resource_group_name [String] Name of the resource group.
923
+ # @param cloud_service_name [String] Name of the cloud service.
924
+ # @param parameters [CloudServiceUpdate] The cloud service object.
925
+ # @param [Hash{String => String}] A hash of custom headers that will be added
926
+ # to the HTTP request.
927
+ #
928
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
929
+ #
930
+ def begin_update_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
931
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
932
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
933
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
934
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
935
+
936
+
937
+ request_headers = {}
938
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
939
+
940
+ # Set Headers
941
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
942
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
943
+
944
+ # Serialize Request
945
+ request_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceUpdate.mapper()
946
+ request_content = @client.serialize(request_mapper, parameters)
947
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
948
+
949
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}'
950
+
951
+ request_url = @base_url || @client.base_url
952
+
953
+ options = {
954
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
955
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
956
+ query_params: {'api-version' => @client.api_version},
957
+ body: request_content,
958
+ headers: request_headers.merge(custom_headers || {}),
959
+ base_url: request_url
960
+ }
961
+ promise = @client.make_request_async(:patch, path_template, options)
962
+
963
+ promise = promise.then do |result|
964
+ http_response = result.response
965
+ status_code = http_response.status
966
+ response_content = http_response.body
967
+ unless status_code == 200
968
+ error_model = JSON.load(response_content)
969
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
970
+ end
971
+
972
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
973
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
974
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
975
+ # Deserialize Response
976
+ if status_code == 200
977
+ begin
978
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
979
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudService.mapper()
980
+ result.body = @client.deserialize(result_mapper, parsed_response)
981
+ rescue Exception => e
982
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
983
+ end
984
+ end
985
+
986
+ result
987
+ end
988
+
989
+ promise.execute
990
+ end
991
+
992
+ #
993
+ # Deletes a cloud service.
994
+ #
995
+ # @param resource_group_name [String] Name of the resource group.
996
+ # @param cloud_service_name [String] Name of the cloud service.
997
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
998
+ # will be added to the HTTP request.
999
+ #
1000
+ #
1001
+ def begin_delete(resource_group_name, cloud_service_name, custom_headers:nil)
1002
+ response = begin_delete_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
1003
+ nil
1004
+ end
1005
+
1006
+ #
1007
+ # Deletes a cloud service.
1008
+ #
1009
+ # @param resource_group_name [String] Name of the resource group.
1010
+ # @param cloud_service_name [String] Name of the cloud service.
1011
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1012
+ # will be added to the HTTP request.
1013
+ #
1014
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1015
+ #
1016
+ def begin_delete_with_http_info(resource_group_name, cloud_service_name, custom_headers:nil)
1017
+ begin_delete_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
1018
+ end
1019
+
1020
+ #
1021
+ # Deletes a cloud service.
1022
+ #
1023
+ # @param resource_group_name [String] Name of the resource group.
1024
+ # @param cloud_service_name [String] Name of the cloud service.
1025
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1026
+ # to the HTTP request.
1027
+ #
1028
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1029
+ #
1030
+ def begin_delete_async(resource_group_name, cloud_service_name, custom_headers:nil)
1031
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1032
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1033
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1034
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1035
+
1036
+
1037
+ request_headers = {}
1038
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1039
+
1040
+ # Set Headers
1041
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1042
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1043
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}'
1044
+
1045
+ request_url = @base_url || @client.base_url
1046
+
1047
+ options = {
1048
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1049
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1050
+ query_params: {'api-version' => @client.api_version},
1051
+ headers: request_headers.merge(custom_headers || {}),
1052
+ base_url: request_url
1053
+ }
1054
+ promise = @client.make_request_async(:delete, path_template, options)
1055
+
1056
+ promise = promise.then do |result|
1057
+ http_response = result.response
1058
+ status_code = http_response.status
1059
+ response_content = http_response.body
1060
+ unless status_code == 200 || status_code == 202 || status_code == 204
1061
+ error_model = JSON.load(response_content)
1062
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1063
+ end
1064
+
1065
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1066
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1067
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1068
+
1069
+ result
1070
+ end
1071
+
1072
+ promise.execute
1073
+ end
1074
+
1075
+ #
1076
+ # Starts the cloud service.
1077
+ #
1078
+ # @param resource_group_name [String] Name of the resource group.
1079
+ # @param cloud_service_name [String] Name of the cloud service.
1080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1081
+ # will be added to the HTTP request.
1082
+ #
1083
+ #
1084
+ def begin_start(resource_group_name, cloud_service_name, custom_headers:nil)
1085
+ response = begin_start_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
1086
+ nil
1087
+ end
1088
+
1089
+ #
1090
+ # Starts the cloud service.
1091
+ #
1092
+ # @param resource_group_name [String] Name of the resource group.
1093
+ # @param cloud_service_name [String] Name of the cloud service.
1094
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1095
+ # will be added to the HTTP request.
1096
+ #
1097
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1098
+ #
1099
+ def begin_start_with_http_info(resource_group_name, cloud_service_name, custom_headers:nil)
1100
+ begin_start_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
1101
+ end
1102
+
1103
+ #
1104
+ # Starts the cloud service.
1105
+ #
1106
+ # @param resource_group_name [String] Name of the resource group.
1107
+ # @param cloud_service_name [String] Name of the cloud service.
1108
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1109
+ # to the HTTP request.
1110
+ #
1111
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1112
+ #
1113
+ def begin_start_async(resource_group_name, cloud_service_name, custom_headers:nil)
1114
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1115
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1116
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1117
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1118
+
1119
+
1120
+ request_headers = {}
1121
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1122
+
1123
+ # Set Headers
1124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1126
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start'
1127
+
1128
+ request_url = @base_url || @client.base_url
1129
+
1130
+ options = {
1131
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1132
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1133
+ query_params: {'api-version' => @client.api_version},
1134
+ headers: request_headers.merge(custom_headers || {}),
1135
+ base_url: request_url
1136
+ }
1137
+ promise = @client.make_request_async(:post, path_template, options)
1138
+
1139
+ promise = promise.then do |result|
1140
+ http_response = result.response
1141
+ status_code = http_response.status
1142
+ response_content = http_response.body
1143
+ unless status_code == 200 || status_code == 202
1144
+ error_model = JSON.load(response_content)
1145
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1146
+ end
1147
+
1148
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1149
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1150
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1151
+
1152
+ result
1153
+ end
1154
+
1155
+ promise.execute
1156
+ end
1157
+
1158
+ #
1159
+ # Power off the cloud service. Note that resources are still attached and you
1160
+ # are getting charged for the resources.
1161
+ #
1162
+ # @param resource_group_name [String] Name of the resource group.
1163
+ # @param cloud_service_name [String] Name of the cloud service.
1164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1165
+ # will be added to the HTTP request.
1166
+ #
1167
+ #
1168
+ def begin_power_off(resource_group_name, cloud_service_name, custom_headers:nil)
1169
+ response = begin_power_off_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
1170
+ nil
1171
+ end
1172
+
1173
+ #
1174
+ # Power off the cloud service. Note that resources are still attached and you
1175
+ # are getting charged for the resources.
1176
+ #
1177
+ # @param resource_group_name [String] Name of the resource group.
1178
+ # @param cloud_service_name [String] Name of the cloud service.
1179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1180
+ # will be added to the HTTP request.
1181
+ #
1182
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1183
+ #
1184
+ def begin_power_off_with_http_info(resource_group_name, cloud_service_name, custom_headers:nil)
1185
+ begin_power_off_async(resource_group_name, cloud_service_name, custom_headers:custom_headers).value!
1186
+ end
1187
+
1188
+ #
1189
+ # Power off the cloud service. Note that resources are still attached and you
1190
+ # are getting charged for the resources.
1191
+ #
1192
+ # @param resource_group_name [String] Name of the resource group.
1193
+ # @param cloud_service_name [String] Name of the cloud service.
1194
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1195
+ # to the HTTP request.
1196
+ #
1197
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1198
+ #
1199
+ def begin_power_off_async(resource_group_name, cloud_service_name, custom_headers:nil)
1200
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1201
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1202
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1203
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1204
+
1205
+
1206
+ request_headers = {}
1207
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1208
+
1209
+ # Set Headers
1210
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1211
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1212
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff'
1213
+
1214
+ request_url = @base_url || @client.base_url
1215
+
1216
+ options = {
1217
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1218
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1219
+ query_params: {'api-version' => @client.api_version},
1220
+ headers: request_headers.merge(custom_headers || {}),
1221
+ base_url: request_url
1222
+ }
1223
+ promise = @client.make_request_async(:post, path_template, options)
1224
+
1225
+ promise = promise.then do |result|
1226
+ http_response = result.response
1227
+ status_code = http_response.status
1228
+ response_content = http_response.body
1229
+ unless status_code == 200 || status_code == 202
1230
+ error_model = JSON.load(response_content)
1231
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1232
+ end
1233
+
1234
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1235
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1236
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1237
+
1238
+ result
1239
+ end
1240
+
1241
+ promise.execute
1242
+ end
1243
+
1244
+ #
1245
+ # Restarts one or more role instances in a cloud service.
1246
+ #
1247
+ # @param resource_group_name [String] Name of the resource group.
1248
+ # @param cloud_service_name [String] Name of the cloud service.
1249
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1251
+ # will be added to the HTTP request.
1252
+ #
1253
+ #
1254
+ def begin_restart(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1255
+ response = begin_restart_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1256
+ nil
1257
+ end
1258
+
1259
+ #
1260
+ # Restarts one or more role instances in a cloud service.
1261
+ #
1262
+ # @param resource_group_name [String] Name of the resource group.
1263
+ # @param cloud_service_name [String] Name of the cloud service.
1264
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1266
+ # will be added to the HTTP request.
1267
+ #
1268
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1269
+ #
1270
+ def begin_restart_with_http_info(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1271
+ begin_restart_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1272
+ end
1273
+
1274
+ #
1275
+ # Restarts one or more role instances in a cloud service.
1276
+ #
1277
+ # @param resource_group_name [String] Name of the resource group.
1278
+ # @param cloud_service_name [String] Name of the cloud service.
1279
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1280
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1281
+ # to the HTTP request.
1282
+ #
1283
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1284
+ #
1285
+ def begin_restart_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1286
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1287
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1288
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1289
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1290
+
1291
+
1292
+ request_headers = {}
1293
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1294
+
1295
+ # Set Headers
1296
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1297
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1298
+
1299
+ # Serialize Request
1300
+ request_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::RoleInstances.mapper()
1301
+ request_content = @client.serialize(request_mapper, parameters)
1302
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1303
+
1304
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart'
1305
+
1306
+ request_url = @base_url || @client.base_url
1307
+
1308
+ options = {
1309
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1310
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1311
+ query_params: {'api-version' => @client.api_version},
1312
+ body: request_content,
1313
+ headers: request_headers.merge(custom_headers || {}),
1314
+ base_url: request_url
1315
+ }
1316
+ promise = @client.make_request_async(:post, path_template, options)
1317
+
1318
+ promise = promise.then do |result|
1319
+ http_response = result.response
1320
+ status_code = http_response.status
1321
+ response_content = http_response.body
1322
+ unless status_code == 200 || status_code == 202
1323
+ error_model = JSON.load(response_content)
1324
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1325
+ end
1326
+
1327
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1328
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1329
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1330
+
1331
+ result
1332
+ end
1333
+
1334
+ promise.execute
1335
+ end
1336
+
1337
+ #
1338
+ # Reimage asynchronous operation reinstalls the operating system on instances
1339
+ # of web roles or worker roles.
1340
+ #
1341
+ # @param resource_group_name [String] Name of the resource group.
1342
+ # @param cloud_service_name [String] Name of the cloud service.
1343
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1345
+ # will be added to the HTTP request.
1346
+ #
1347
+ #
1348
+ def begin_reimage(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1349
+ response = begin_reimage_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1350
+ nil
1351
+ end
1352
+
1353
+ #
1354
+ # Reimage asynchronous operation reinstalls the operating system on instances
1355
+ # of web roles or worker roles.
1356
+ #
1357
+ # @param resource_group_name [String] Name of the resource group.
1358
+ # @param cloud_service_name [String] Name of the cloud service.
1359
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1360
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1361
+ # will be added to the HTTP request.
1362
+ #
1363
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1364
+ #
1365
+ def begin_reimage_with_http_info(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1366
+ begin_reimage_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1367
+ end
1368
+
1369
+ #
1370
+ # Reimage asynchronous operation reinstalls the operating system on instances
1371
+ # of web roles or worker roles.
1372
+ #
1373
+ # @param resource_group_name [String] Name of the resource group.
1374
+ # @param cloud_service_name [String] Name of the cloud service.
1375
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1376
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1377
+ # to the HTTP request.
1378
+ #
1379
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1380
+ #
1381
+ def begin_reimage_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1382
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1383
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1384
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1385
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1386
+
1387
+
1388
+ request_headers = {}
1389
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1390
+
1391
+ # Set Headers
1392
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1393
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1394
+
1395
+ # Serialize Request
1396
+ request_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::RoleInstances.mapper()
1397
+ request_content = @client.serialize(request_mapper, parameters)
1398
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1399
+
1400
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage'
1401
+
1402
+ request_url = @base_url || @client.base_url
1403
+
1404
+ options = {
1405
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1406
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1407
+ query_params: {'api-version' => @client.api_version},
1408
+ body: request_content,
1409
+ headers: request_headers.merge(custom_headers || {}),
1410
+ base_url: request_url
1411
+ }
1412
+ promise = @client.make_request_async(:post, path_template, options)
1413
+
1414
+ promise = promise.then do |result|
1415
+ http_response = result.response
1416
+ status_code = http_response.status
1417
+ response_content = http_response.body
1418
+ unless status_code == 200 || status_code == 202
1419
+ error_model = JSON.load(response_content)
1420
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1421
+ end
1422
+
1423
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1424
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1425
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1426
+
1427
+ result
1428
+ end
1429
+
1430
+ promise.execute
1431
+ end
1432
+
1433
+ #
1434
+ # Rebuild Role Instances reinstalls the operating system on instances of web
1435
+ # roles or worker roles and initializes the storage resources that are used by
1436
+ # them. If you do not want to initialize storage resources, you can use Reimage
1437
+ # Role Instances.
1438
+ #
1439
+ # @param resource_group_name [String] Name of the resource group.
1440
+ # @param cloud_service_name [String] Name of the cloud service.
1441
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1443
+ # will be added to the HTTP request.
1444
+ #
1445
+ #
1446
+ def begin_rebuild(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1447
+ response = begin_rebuild_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1448
+ nil
1449
+ end
1450
+
1451
+ #
1452
+ # Rebuild Role Instances reinstalls the operating system on instances of web
1453
+ # roles or worker roles and initializes the storage resources that are used by
1454
+ # them. If you do not want to initialize storage resources, you can use Reimage
1455
+ # Role Instances.
1456
+ #
1457
+ # @param resource_group_name [String] Name of the resource group.
1458
+ # @param cloud_service_name [String] Name of the cloud service.
1459
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1460
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1461
+ # will be added to the HTTP request.
1462
+ #
1463
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1464
+ #
1465
+ def begin_rebuild_with_http_info(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1466
+ begin_rebuild_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1467
+ end
1468
+
1469
+ #
1470
+ # Rebuild Role Instances reinstalls the operating system on instances of web
1471
+ # roles or worker roles and initializes the storage resources that are used by
1472
+ # them. If you do not want to initialize storage resources, you can use Reimage
1473
+ # Role Instances.
1474
+ #
1475
+ # @param resource_group_name [String] Name of the resource group.
1476
+ # @param cloud_service_name [String] Name of the cloud service.
1477
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1478
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1479
+ # to the HTTP request.
1480
+ #
1481
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1482
+ #
1483
+ def begin_rebuild_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1484
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1485
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1486
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1487
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1488
+
1489
+
1490
+ request_headers = {}
1491
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1492
+
1493
+ # Set Headers
1494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1495
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1496
+
1497
+ # Serialize Request
1498
+ request_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::RoleInstances.mapper()
1499
+ request_content = @client.serialize(request_mapper, parameters)
1500
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1501
+
1502
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild'
1503
+
1504
+ request_url = @base_url || @client.base_url
1505
+
1506
+ options = {
1507
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1508
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1509
+ query_params: {'api-version' => @client.api_version},
1510
+ body: request_content,
1511
+ headers: request_headers.merge(custom_headers || {}),
1512
+ base_url: request_url
1513
+ }
1514
+ promise = @client.make_request_async(:post, path_template, options)
1515
+
1516
+ promise = promise.then do |result|
1517
+ http_response = result.response
1518
+ status_code = http_response.status
1519
+ response_content = http_response.body
1520
+ unless status_code == 200 || status_code == 202
1521
+ error_model = JSON.load(response_content)
1522
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1523
+ end
1524
+
1525
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1526
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1527
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1528
+
1529
+ result
1530
+ end
1531
+
1532
+ promise.execute
1533
+ end
1534
+
1535
+ #
1536
+ # Deletes role instances in a cloud service.
1537
+ #
1538
+ # @param resource_group_name [String] Name of the resource group.
1539
+ # @param cloud_service_name [String] Name of the cloud service.
1540
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1542
+ # will be added to the HTTP request.
1543
+ #
1544
+ #
1545
+ def begin_delete_instances(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1546
+ response = begin_delete_instances_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1547
+ nil
1548
+ end
1549
+
1550
+ #
1551
+ # Deletes role instances in a cloud service.
1552
+ #
1553
+ # @param resource_group_name [String] Name of the resource group.
1554
+ # @param cloud_service_name [String] Name of the cloud service.
1555
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1556
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1557
+ # will be added to the HTTP request.
1558
+ #
1559
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1560
+ #
1561
+ def begin_delete_instances_with_http_info(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1562
+ begin_delete_instances_async(resource_group_name, cloud_service_name, parameters:parameters, custom_headers:custom_headers).value!
1563
+ end
1564
+
1565
+ #
1566
+ # Deletes role instances in a cloud service.
1567
+ #
1568
+ # @param resource_group_name [String] Name of the resource group.
1569
+ # @param cloud_service_name [String] Name of the cloud service.
1570
+ # @param parameters [RoleInstances] List of cloud service role instance names.
1571
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1572
+ # to the HTTP request.
1573
+ #
1574
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1575
+ #
1576
+ def begin_delete_instances_async(resource_group_name, cloud_service_name, parameters:nil, custom_headers:nil)
1577
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1578
+ fail ArgumentError, 'cloud_service_name is nil' if cloud_service_name.nil?
1579
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1580
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1581
+
1582
+
1583
+ request_headers = {}
1584
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1585
+
1586
+ # Set Headers
1587
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1588
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1589
+
1590
+ # Serialize Request
1591
+ request_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::RoleInstances.mapper()
1592
+ request_content = @client.serialize(request_mapper, parameters)
1593
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1594
+
1595
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete'
1596
+
1597
+ request_url = @base_url || @client.base_url
1598
+
1599
+ options = {
1600
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1601
+ path_params: {'resourceGroupName' => resource_group_name,'cloudServiceName' => cloud_service_name,'subscriptionId' => @client.subscription_id},
1602
+ query_params: {'api-version' => @client.api_version},
1603
+ body: request_content,
1604
+ headers: request_headers.merge(custom_headers || {}),
1605
+ base_url: request_url
1606
+ }
1607
+ promise = @client.make_request_async(:post, path_template, options)
1608
+
1609
+ promise = promise.then do |result|
1610
+ http_response = result.response
1611
+ status_code = http_response.status
1612
+ response_content = http_response.body
1613
+ unless status_code == 200 || status_code == 202
1614
+ error_model = JSON.load(response_content)
1615
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1616
+ end
1617
+
1618
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1619
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1620
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1621
+
1622
+ result
1623
+ end
1624
+
1625
+ promise.execute
1626
+ end
1627
+
1628
+ #
1629
+ # Gets a list of all cloud services in the subscription, regardless of the
1630
+ # associated resource group. Use nextLink property in the response to get the
1631
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
1632
+ # Cloud Services.
1633
+ #
1634
+ # @param next_page_link [String] The NextLink from the previous successful call
1635
+ # to List operation.
1636
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1637
+ # will be added to the HTTP request.
1638
+ #
1639
+ # @return [CloudServiceListResult] operation results.
1640
+ #
1641
+ def list_all_next(next_page_link, custom_headers:nil)
1642
+ response = list_all_next_async(next_page_link, custom_headers:custom_headers).value!
1643
+ response.body unless response.nil?
1644
+ end
1645
+
1646
+ #
1647
+ # Gets a list of all cloud services in the subscription, regardless of the
1648
+ # associated resource group. Use nextLink property in the response to get the
1649
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
1650
+ # Cloud Services.
1651
+ #
1652
+ # @param next_page_link [String] The NextLink from the previous successful call
1653
+ # to List operation.
1654
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1655
+ # will be added to the HTTP request.
1656
+ #
1657
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1658
+ #
1659
+ def list_all_next_with_http_info(next_page_link, custom_headers:nil)
1660
+ list_all_next_async(next_page_link, custom_headers:custom_headers).value!
1661
+ end
1662
+
1663
+ #
1664
+ # Gets a list of all cloud services in the subscription, regardless of the
1665
+ # associated resource group. Use nextLink property in the response to get the
1666
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
1667
+ # Cloud Services.
1668
+ #
1669
+ # @param next_page_link [String] The NextLink from the previous successful call
1670
+ # to List operation.
1671
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1672
+ # to the HTTP request.
1673
+ #
1674
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1675
+ #
1676
+ def list_all_next_async(next_page_link, custom_headers:nil)
1677
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1678
+
1679
+
1680
+ request_headers = {}
1681
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1682
+
1683
+ # Set Headers
1684
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1685
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1686
+ path_template = '{nextLink}'
1687
+
1688
+ request_url = @base_url || @client.base_url
1689
+
1690
+ options = {
1691
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1692
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1693
+ headers: request_headers.merge(custom_headers || {}),
1694
+ base_url: request_url
1695
+ }
1696
+ promise = @client.make_request_async(:get, path_template, options)
1697
+
1698
+ promise = promise.then do |result|
1699
+ http_response = result.response
1700
+ status_code = http_response.status
1701
+ response_content = http_response.body
1702
+ unless status_code == 200
1703
+ error_model = JSON.load(response_content)
1704
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1705
+ end
1706
+
1707
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1708
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1709
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1710
+ # Deserialize Response
1711
+ if status_code == 200
1712
+ begin
1713
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1714
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceListResult.mapper()
1715
+ result.body = @client.deserialize(result_mapper, parsed_response)
1716
+ rescue Exception => e
1717
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1718
+ end
1719
+ end
1720
+
1721
+ result
1722
+ end
1723
+
1724
+ promise.execute
1725
+ end
1726
+
1727
+ #
1728
+ # Gets a list of all cloud services under a resource group. Use nextLink
1729
+ # property in the response to get the next page of Cloud Services. Do this till
1730
+ # nextLink is null to fetch all the Cloud Services.
1731
+ #
1732
+ # @param next_page_link [String] The NextLink from the previous successful call
1733
+ # to List operation.
1734
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1735
+ # will be added to the HTTP request.
1736
+ #
1737
+ # @return [CloudServiceListResult] operation results.
1738
+ #
1739
+ def list_next(next_page_link, custom_headers:nil)
1740
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1741
+ response.body unless response.nil?
1742
+ end
1743
+
1744
+ #
1745
+ # Gets a list of all cloud services under a resource group. Use nextLink
1746
+ # property in the response to get the next page of Cloud Services. Do this till
1747
+ # nextLink is null to fetch all the Cloud Services.
1748
+ #
1749
+ # @param next_page_link [String] The NextLink from the previous successful call
1750
+ # to List operation.
1751
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1752
+ # will be added to the HTTP request.
1753
+ #
1754
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1755
+ #
1756
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1757
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1758
+ end
1759
+
1760
+ #
1761
+ # Gets a list of all cloud services under a resource group. Use nextLink
1762
+ # property in the response to get the next page of Cloud Services. Do this till
1763
+ # nextLink is null to fetch all the Cloud Services.
1764
+ #
1765
+ # @param next_page_link [String] The NextLink from the previous successful call
1766
+ # to List operation.
1767
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1768
+ # to the HTTP request.
1769
+ #
1770
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1771
+ #
1772
+ def list_next_async(next_page_link, custom_headers:nil)
1773
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1774
+
1775
+
1776
+ request_headers = {}
1777
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1778
+
1779
+ # Set Headers
1780
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1781
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1782
+ path_template = '{nextLink}'
1783
+
1784
+ request_url = @base_url || @client.base_url
1785
+
1786
+ options = {
1787
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1788
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1789
+ headers: request_headers.merge(custom_headers || {}),
1790
+ base_url: request_url
1791
+ }
1792
+ promise = @client.make_request_async(:get, path_template, options)
1793
+
1794
+ promise = promise.then do |result|
1795
+ http_response = result.response
1796
+ status_code = http_response.status
1797
+ response_content = http_response.body
1798
+ unless status_code == 200
1799
+ error_model = JSON.load(response_content)
1800
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1801
+ end
1802
+
1803
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1804
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1805
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1806
+ # Deserialize Response
1807
+ if status_code == 200
1808
+ begin
1809
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1810
+ result_mapper = Azure::Compute::Mgmt::V2020_10_01_preview::Models::CloudServiceListResult.mapper()
1811
+ result.body = @client.deserialize(result_mapper, parsed_response)
1812
+ rescue Exception => e
1813
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1814
+ end
1815
+ end
1816
+
1817
+ result
1818
+ end
1819
+
1820
+ promise.execute
1821
+ end
1822
+
1823
+ #
1824
+ # Gets a list of all cloud services in the subscription, regardless of the
1825
+ # associated resource group. Use nextLink property in the response to get the
1826
+ # next page of Cloud Services. Do this till nextLink is null to fetch all the
1827
+ # Cloud Services.
1828
+ #
1829
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1830
+ # will be added to the HTTP request.
1831
+ #
1832
+ # @return [CloudServiceListResult] which provide lazy access to pages of the
1833
+ # response.
1834
+ #
1835
+ def list_all_as_lazy(custom_headers:nil)
1836
+ response = list_all_async(custom_headers:custom_headers).value!
1837
+ unless response.nil?
1838
+ page = response.body
1839
+ page.next_method = Proc.new do |next_page_link|
1840
+ list_all_next_async(next_page_link, custom_headers:custom_headers)
1841
+ end
1842
+ page
1843
+ end
1844
+ end
1845
+
1846
+ #
1847
+ # Gets a list of all cloud services under a resource group. Use nextLink
1848
+ # property in the response to get the next page of Cloud Services. Do this till
1849
+ # nextLink is null to fetch all the Cloud Services.
1850
+ #
1851
+ # @param resource_group_name [String] Name of the resource group.
1852
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1853
+ # will be added to the HTTP request.
1854
+ #
1855
+ # @return [CloudServiceListResult] which provide lazy access to pages of the
1856
+ # response.
1857
+ #
1858
+ def list_as_lazy(resource_group_name, custom_headers:nil)
1859
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
1860
+ unless response.nil?
1861
+ page = response.body
1862
+ page.next_method = Proc.new do |next_page_link|
1863
+ list_next_async(next_page_link, custom_headers:custom_headers)
1864
+ end
1865
+ page
1866
+ end
1867
+ end
1868
+
1869
+ end
1870
+ end