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,372 @@
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_09_30
7
+ #
8
+ # The Disk Resource Provider Client.
9
+ #
10
+ class DiskRestorePointOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the DiskRestorePointOperations 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
+ # Get disk restorePoint resource
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param restore_point_collection_name [String] The name of the restore point
29
+ # collection that the disk restore point belongs. Supported characters for the
30
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
31
+ # @param vm_restore_point_name [String] The name of the vm restore point that
32
+ # the disk disk restore point belongs. Supported characters for the name are
33
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
34
+ # @param disk_restore_point_name [String] The name of the disk restore point
35
+ # created. Supported characters for the name are a-z, A-Z, 0-9 and _. The
36
+ # maximum name length is 80 characters.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [DiskRestorePoint] operation results.
41
+ #
42
+ def get(resource_group_name, restore_point_collection_name, vm_restore_point_name, disk_restore_point_name, custom_headers:nil)
43
+ response = get_async(resource_group_name, restore_point_collection_name, vm_restore_point_name, disk_restore_point_name, custom_headers:custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # Get disk restorePoint resource
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group.
51
+ # @param restore_point_collection_name [String] The name of the restore point
52
+ # collection that the disk restore point belongs. Supported characters for the
53
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
54
+ # @param vm_restore_point_name [String] The name of the vm restore point that
55
+ # the disk disk restore point belongs. Supported characters for the name are
56
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
57
+ # @param disk_restore_point_name [String] The name of the disk restore point
58
+ # created. Supported characters for the name are a-z, A-Z, 0-9 and _. The
59
+ # maximum name length is 80 characters.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
+ #
65
+ def get_with_http_info(resource_group_name, restore_point_collection_name, vm_restore_point_name, disk_restore_point_name, custom_headers:nil)
66
+ get_async(resource_group_name, restore_point_collection_name, vm_restore_point_name, disk_restore_point_name, custom_headers:custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # Get disk restorePoint resource
71
+ #
72
+ # @param resource_group_name [String] The name of the resource group.
73
+ # @param restore_point_collection_name [String] The name of the restore point
74
+ # collection that the disk restore point belongs. Supported characters for the
75
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
76
+ # @param vm_restore_point_name [String] The name of the vm restore point that
77
+ # the disk disk restore point belongs. Supported characters for the name are
78
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
79
+ # @param disk_restore_point_name [String] The name of the disk restore point
80
+ # created. Supported characters for the name are a-z, A-Z, 0-9 and _. The
81
+ # maximum name length is 80 characters.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def get_async(resource_group_name, restore_point_collection_name, vm_restore_point_name, disk_restore_point_name, custom_headers:nil)
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
90
+ fail ArgumentError, 'restore_point_collection_name is nil' if restore_point_collection_name.nil?
91
+ fail ArgumentError, 'vm_restore_point_name is nil' if vm_restore_point_name.nil?
92
+ fail ArgumentError, 'disk_restore_point_name is nil' if disk_restore_point_name.nil?
93
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
94
+
95
+
96
+ request_headers = {}
97
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
98
+
99
+ # Set Headers
100
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
101
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
102
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}'
103
+
104
+ request_url = @base_url || @client.base_url
105
+
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'restorePointCollectionName' => restore_point_collection_name,'vmRestorePointName' => vm_restore_point_name,'diskRestorePointName' => disk_restore_point_name},
109
+ query_params: {'api-version' => @client.api_version},
110
+ headers: request_headers.merge(custom_headers || {}),
111
+ base_url: request_url
112
+ }
113
+ promise = @client.make_request_async(:get, path_template, options)
114
+
115
+ promise = promise.then do |result|
116
+ http_response = result.response
117
+ status_code = http_response.status
118
+ response_content = http_response.body
119
+ unless status_code == 200
120
+ error_model = JSON.load(response_content)
121
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
122
+ end
123
+
124
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
125
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
126
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
127
+ # Deserialize Response
128
+ if status_code == 200
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskRestorePoint.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+
138
+ result
139
+ end
140
+
141
+ promise.execute
142
+ end
143
+
144
+ #
145
+ # Lists diskRestorePoints under a vmRestorePoint.
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group.
148
+ # @param restore_point_collection_name [String] The name of the restore point
149
+ # collection that the disk restore point belongs. Supported characters for the
150
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
151
+ # @param vm_restore_point_name [String] The name of the vm restore point that
152
+ # the disk disk restore point belongs. Supported characters for the name are
153
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [Array<DiskRestorePoint>] operation results.
158
+ #
159
+ def list_by_restore_point(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:nil)
160
+ first_page = list_by_restore_point_as_lazy(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:custom_headers)
161
+ first_page.get_all_items
162
+ end
163
+
164
+ #
165
+ # Lists diskRestorePoints under a vmRestorePoint.
166
+ #
167
+ # @param resource_group_name [String] The name of the resource group.
168
+ # @param restore_point_collection_name [String] The name of the restore point
169
+ # collection that the disk restore point belongs. Supported characters for the
170
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
171
+ # @param vm_restore_point_name [String] The name of the vm restore point that
172
+ # the disk disk restore point belongs. Supported characters for the name are
173
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
174
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
175
+ # will be added to the HTTP request.
176
+ #
177
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
178
+ #
179
+ def list_by_restore_point_with_http_info(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:nil)
180
+ list_by_restore_point_async(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:custom_headers).value!
181
+ end
182
+
183
+ #
184
+ # Lists diskRestorePoints under a vmRestorePoint.
185
+ #
186
+ # @param resource_group_name [String] The name of the resource group.
187
+ # @param restore_point_collection_name [String] The name of the restore point
188
+ # collection that the disk restore point belongs. Supported characters for the
189
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
190
+ # @param vm_restore_point_name [String] The name of the vm restore point that
191
+ # the disk disk restore point belongs. Supported characters for the name are
192
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
193
+ # @param [Hash{String => String}] A hash of custom headers that will be added
194
+ # to the HTTP request.
195
+ #
196
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
197
+ #
198
+ def list_by_restore_point_async(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:nil)
199
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
200
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
201
+ fail ArgumentError, 'restore_point_collection_name is nil' if restore_point_collection_name.nil?
202
+ fail ArgumentError, 'vm_restore_point_name is nil' if vm_restore_point_name.nil?
203
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
204
+
205
+
206
+ request_headers = {}
207
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
208
+
209
+ # Set Headers
210
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
211
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
212
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints'
213
+
214
+ request_url = @base_url || @client.base_url
215
+
216
+ options = {
217
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
218
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'restorePointCollectionName' => restore_point_collection_name,'vmRestorePointName' => vm_restore_point_name},
219
+ query_params: {'api-version' => @client.api_version},
220
+ headers: request_headers.merge(custom_headers || {}),
221
+ base_url: request_url
222
+ }
223
+ promise = @client.make_request_async(:get, path_template, options)
224
+
225
+ promise = promise.then do |result|
226
+ http_response = result.response
227
+ status_code = http_response.status
228
+ response_content = http_response.body
229
+ unless status_code == 200
230
+ error_model = JSON.load(response_content)
231
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
232
+ end
233
+
234
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
235
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
236
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
237
+ # Deserialize Response
238
+ if status_code == 200
239
+ begin
240
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
241
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskRestorePointList.mapper()
242
+ result.body = @client.deserialize(result_mapper, parsed_response)
243
+ rescue Exception => e
244
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
245
+ end
246
+ end
247
+
248
+ result
249
+ end
250
+
251
+ promise.execute
252
+ end
253
+
254
+ #
255
+ # Lists diskRestorePoints under a vmRestorePoint.
256
+ #
257
+ # @param next_page_link [String] The NextLink from the previous successful call
258
+ # to List operation.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [DiskRestorePointList] operation results.
263
+ #
264
+ def list_by_restore_point_next(next_page_link, custom_headers:nil)
265
+ response = list_by_restore_point_next_async(next_page_link, custom_headers:custom_headers).value!
266
+ response.body unless response.nil?
267
+ end
268
+
269
+ #
270
+ # Lists diskRestorePoints under a vmRestorePoint.
271
+ #
272
+ # @param next_page_link [String] The NextLink from the previous successful call
273
+ # to List operation.
274
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
275
+ # will be added to the HTTP request.
276
+ #
277
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
278
+ #
279
+ def list_by_restore_point_next_with_http_info(next_page_link, custom_headers:nil)
280
+ list_by_restore_point_next_async(next_page_link, custom_headers:custom_headers).value!
281
+ end
282
+
283
+ #
284
+ # Lists diskRestorePoints under a vmRestorePoint.
285
+ #
286
+ # @param next_page_link [String] The NextLink from the previous successful call
287
+ # to List operation.
288
+ # @param [Hash{String => String}] A hash of custom headers that will be added
289
+ # to the HTTP request.
290
+ #
291
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
292
+ #
293
+ def list_by_restore_point_next_async(next_page_link, custom_headers:nil)
294
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
295
+
296
+
297
+ request_headers = {}
298
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
299
+
300
+ # Set Headers
301
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
302
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
303
+ path_template = '{nextLink}'
304
+
305
+ request_url = @base_url || @client.base_url
306
+
307
+ options = {
308
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
309
+ skip_encoding_path_params: {'nextLink' => next_page_link},
310
+ headers: request_headers.merge(custom_headers || {}),
311
+ base_url: request_url
312
+ }
313
+ promise = @client.make_request_async(:get, path_template, options)
314
+
315
+ promise = promise.then do |result|
316
+ http_response = result.response
317
+ status_code = http_response.status
318
+ response_content = http_response.body
319
+ unless status_code == 200
320
+ error_model = JSON.load(response_content)
321
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
322
+ end
323
+
324
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
325
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
326
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
327
+ # Deserialize Response
328
+ if status_code == 200
329
+ begin
330
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
331
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskRestorePointList.mapper()
332
+ result.body = @client.deserialize(result_mapper, parsed_response)
333
+ rescue Exception => e
334
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
335
+ end
336
+ end
337
+
338
+ result
339
+ end
340
+
341
+ promise.execute
342
+ end
343
+
344
+ #
345
+ # Lists diskRestorePoints under a vmRestorePoint.
346
+ #
347
+ # @param resource_group_name [String] The name of the resource group.
348
+ # @param restore_point_collection_name [String] The name of the restore point
349
+ # collection that the disk restore point belongs. Supported characters for the
350
+ # name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
351
+ # @param vm_restore_point_name [String] The name of the vm restore point that
352
+ # the disk disk restore point belongs. Supported characters for the name are
353
+ # a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
355
+ # will be added to the HTTP request.
356
+ #
357
+ # @return [DiskRestorePointList] which provide lazy access to pages of the
358
+ # response.
359
+ #
360
+ def list_by_restore_point_as_lazy(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:nil)
361
+ response = list_by_restore_point_async(resource_group_name, restore_point_collection_name, vm_restore_point_name, custom_headers:custom_headers).value!
362
+ unless response.nil?
363
+ page = response.body
364
+ page.next_method = Proc.new do |next_page_link|
365
+ list_by_restore_point_next_async(next_page_link, custom_headers:custom_headers)
366
+ end
367
+ page
368
+ end
369
+ end
370
+
371
+ end
372
+ end
@@ -0,0 +1,1294 @@
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_09_30
7
+ #
8
+ # The Disk Resource Provider Client.
9
+ #
10
+ class Disks
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Disks 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
+ # Creates or updates a disk.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param disk_name [String] The name of the managed disk that is being created.
29
+ # The name can't be changed after the disk is created. Supported characters for
30
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
31
+ # @param disk [Disk] Disk object supplied in the body of the Put disk
32
+ # operation.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Disk] operation results.
37
+ #
38
+ def create_or_update(resource_group_name, disk_name, disk, custom_headers:nil)
39
+ response = create_or_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group.
45
+ # @param disk_name [String] The name of the managed disk that is being created.
46
+ # The name can't be changed after the disk is created. Supported characters for
47
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
48
+ # @param disk [Disk] Disk object supplied in the body of the Put disk
49
+ # operation.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [Concurrent::Promise] promise which provides async access to http
54
+ # response.
55
+ #
56
+ def create_or_update_async(resource_group_name, disk_name, disk, custom_headers:nil)
57
+ # Send request
58
+ promise = begin_create_or_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers)
59
+
60
+ promise = promise.then do |response|
61
+ # Defining deserialization method.
62
+ deserialize_method = lambda do |parsed_response|
63
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
64
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
65
+ end
66
+
67
+ # Waiting for response.
68
+ @client.get_long_running_operation_result(response, deserialize_method)
69
+ end
70
+
71
+ promise
72
+ end
73
+
74
+ #
75
+ # Updates (patches) a disk.
76
+ #
77
+ # @param resource_group_name [String] The name of the resource group.
78
+ # @param disk_name [String] The name of the managed disk that is being created.
79
+ # The name can't be changed after the disk is created. Supported characters for
80
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
81
+ # @param disk [DiskUpdate] Disk object supplied in the body of the Patch disk
82
+ # operation.
83
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
84
+ # will be added to the HTTP request.
85
+ #
86
+ # @return [Disk] operation results.
87
+ #
88
+ def update(resource_group_name, disk_name, disk, custom_headers:nil)
89
+ response = update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
90
+ response.body unless response.nil?
91
+ end
92
+
93
+ #
94
+ # @param resource_group_name [String] The name of the resource group.
95
+ # @param disk_name [String] The name of the managed disk that is being created.
96
+ # The name can't be changed after the disk is created. Supported characters for
97
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
98
+ # @param disk [DiskUpdate] Disk object supplied in the body of the Patch disk
99
+ # operation.
100
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
101
+ # will be added to the HTTP request.
102
+ #
103
+ # @return [Concurrent::Promise] promise which provides async access to http
104
+ # response.
105
+ #
106
+ def update_async(resource_group_name, disk_name, disk, custom_headers:nil)
107
+ # Send request
108
+ promise = begin_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers)
109
+
110
+ promise = promise.then do |response|
111
+ # Defining deserialization method.
112
+ deserialize_method = lambda do |parsed_response|
113
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
114
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
115
+ end
116
+
117
+ # Waiting for response.
118
+ @client.get_long_running_operation_result(response, deserialize_method)
119
+ end
120
+
121
+ promise
122
+ end
123
+
124
+ #
125
+ # Gets information about a disk.
126
+ #
127
+ # @param resource_group_name [String] The name of the resource group.
128
+ # @param disk_name [String] The name of the managed disk that is being created.
129
+ # The name can't be changed after the disk is created. Supported characters for
130
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
131
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
132
+ # will be added to the HTTP request.
133
+ #
134
+ # @return [Disk] operation results.
135
+ #
136
+ def get(resource_group_name, disk_name, custom_headers:nil)
137
+ response = get_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
138
+ response.body unless response.nil?
139
+ end
140
+
141
+ #
142
+ # Gets information about a disk.
143
+ #
144
+ # @param resource_group_name [String] The name of the resource group.
145
+ # @param disk_name [String] The name of the managed disk that is being created.
146
+ # The name can't be changed after the disk is created. Supported characters for
147
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
149
+ # will be added to the HTTP request.
150
+ #
151
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
152
+ #
153
+ def get_with_http_info(resource_group_name, disk_name, custom_headers:nil)
154
+ get_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
155
+ end
156
+
157
+ #
158
+ # Gets information about a disk.
159
+ #
160
+ # @param resource_group_name [String] The name of the resource group.
161
+ # @param disk_name [String] The name of the managed disk that is being created.
162
+ # The name can't be changed after the disk is created. Supported characters for
163
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
164
+ # @param [Hash{String => String}] A hash of custom headers that will be added
165
+ # to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
168
+ #
169
+ def get_async(resource_group_name, disk_name, custom_headers:nil)
170
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
171
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
172
+ fail ArgumentError, 'disk_name is nil' if disk_name.nil?
173
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
174
+
175
+
176
+ request_headers = {}
177
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
178
+
179
+ # Set Headers
180
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
181
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
182
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'
183
+
184
+ request_url = @base_url || @client.base_url
185
+
186
+ options = {
187
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
188
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'diskName' => disk_name},
189
+ query_params: {'api-version' => @client.api_version},
190
+ headers: request_headers.merge(custom_headers || {}),
191
+ base_url: request_url
192
+ }
193
+ promise = @client.make_request_async(:get, path_template, options)
194
+
195
+ promise = promise.then do |result|
196
+ http_response = result.response
197
+ status_code = http_response.status
198
+ response_content = http_response.body
199
+ unless status_code == 200
200
+ error_model = JSON.load(response_content)
201
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
202
+ end
203
+
204
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
205
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
206
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
207
+ # Deserialize Response
208
+ if status_code == 200
209
+ begin
210
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
211
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
212
+ result.body = @client.deserialize(result_mapper, parsed_response)
213
+ rescue Exception => e
214
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
215
+ end
216
+ end
217
+
218
+ result
219
+ end
220
+
221
+ promise.execute
222
+ end
223
+
224
+ #
225
+ # Deletes a disk.
226
+ #
227
+ # @param resource_group_name [String] The name of the resource group.
228
+ # @param disk_name [String] The name of the managed disk that is being created.
229
+ # The name can't be changed after the disk is created. Supported characters for
230
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
232
+ # will be added to the HTTP request.
233
+ #
234
+ def delete(resource_group_name, disk_name, custom_headers:nil)
235
+ response = delete_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
236
+ nil
237
+ end
238
+
239
+ #
240
+ # @param resource_group_name [String] The name of the resource group.
241
+ # @param disk_name [String] The name of the managed disk that is being created.
242
+ # The name can't be changed after the disk is created. Supported characters for
243
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] promise which provides async access to http
248
+ # response.
249
+ #
250
+ def delete_async(resource_group_name, disk_name, custom_headers:nil)
251
+ # Send request
252
+ promise = begin_delete_async(resource_group_name, disk_name, custom_headers:custom_headers)
253
+
254
+ promise = promise.then do |response|
255
+ # Defining deserialization method.
256
+ deserialize_method = lambda do |parsed_response|
257
+ end
258
+
259
+ # Waiting for response.
260
+ @client.get_long_running_operation_result(response, deserialize_method)
261
+ end
262
+
263
+ promise
264
+ end
265
+
266
+ #
267
+ # Lists all the disks under a resource group.
268
+ #
269
+ # @param resource_group_name [String] The name of the resource group.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [Array<Disk>] operation results.
274
+ #
275
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
276
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
277
+ first_page.get_all_items
278
+ end
279
+
280
+ #
281
+ # Lists all the disks under a resource group.
282
+ #
283
+ # @param resource_group_name [String] The name of the resource group.
284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
285
+ # will be added to the HTTP request.
286
+ #
287
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
288
+ #
289
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
290
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
291
+ end
292
+
293
+ #
294
+ # Lists all the disks under a resource group.
295
+ #
296
+ # @param resource_group_name [String] The name of the resource group.
297
+ # @param [Hash{String => String}] A hash of custom headers that will be added
298
+ # to the HTTP request.
299
+ #
300
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
301
+ #
302
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
303
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
304
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
305
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
306
+
307
+
308
+ request_headers = {}
309
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
310
+
311
+ # Set Headers
312
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
313
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
314
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'
315
+
316
+ request_url = @base_url || @client.base_url
317
+
318
+ options = {
319
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
320
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
321
+ query_params: {'api-version' => @client.api_version},
322
+ headers: request_headers.merge(custom_headers || {}),
323
+ base_url: request_url
324
+ }
325
+ promise = @client.make_request_async(:get, path_template, options)
326
+
327
+ promise = promise.then do |result|
328
+ http_response = result.response
329
+ status_code = http_response.status
330
+ response_content = http_response.body
331
+ unless status_code == 200
332
+ error_model = JSON.load(response_content)
333
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
334
+ end
335
+
336
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
337
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
338
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
339
+ # Deserialize Response
340
+ if status_code == 200
341
+ begin
342
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
343
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskList.mapper()
344
+ result.body = @client.deserialize(result_mapper, parsed_response)
345
+ rescue Exception => e
346
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
347
+ end
348
+ end
349
+
350
+ result
351
+ end
352
+
353
+ promise.execute
354
+ end
355
+
356
+ #
357
+ # Lists all the disks under a subscription.
358
+ #
359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
360
+ # will be added to the HTTP request.
361
+ #
362
+ # @return [Array<Disk>] operation results.
363
+ #
364
+ def list(custom_headers:nil)
365
+ first_page = list_as_lazy(custom_headers:custom_headers)
366
+ first_page.get_all_items
367
+ end
368
+
369
+ #
370
+ # Lists all the disks under a subscription.
371
+ #
372
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
373
+ # will be added to the HTTP request.
374
+ #
375
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
376
+ #
377
+ def list_with_http_info(custom_headers:nil)
378
+ list_async(custom_headers:custom_headers).value!
379
+ end
380
+
381
+ #
382
+ # Lists all the disks under a subscription.
383
+ #
384
+ # @param [Hash{String => String}] A hash of custom headers that will be added
385
+ # to the HTTP request.
386
+ #
387
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
388
+ #
389
+ def list_async(custom_headers:nil)
390
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
391
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
392
+
393
+
394
+ request_headers = {}
395
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
396
+
397
+ # Set Headers
398
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
399
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
400
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'
401
+
402
+ request_url = @base_url || @client.base_url
403
+
404
+ options = {
405
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
406
+ path_params: {'subscriptionId' => @client.subscription_id},
407
+ query_params: {'api-version' => @client.api_version},
408
+ headers: request_headers.merge(custom_headers || {}),
409
+ base_url: request_url
410
+ }
411
+ promise = @client.make_request_async(:get, path_template, options)
412
+
413
+ promise = promise.then do |result|
414
+ http_response = result.response
415
+ status_code = http_response.status
416
+ response_content = http_response.body
417
+ unless status_code == 200
418
+ error_model = JSON.load(response_content)
419
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
420
+ end
421
+
422
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
423
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
424
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
425
+ # Deserialize Response
426
+ if status_code == 200
427
+ begin
428
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
429
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskList.mapper()
430
+ result.body = @client.deserialize(result_mapper, parsed_response)
431
+ rescue Exception => e
432
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
433
+ end
434
+ end
435
+
436
+ result
437
+ end
438
+
439
+ promise.execute
440
+ end
441
+
442
+ #
443
+ # Grants access to a disk.
444
+ #
445
+ # @param resource_group_name [String] The name of the resource group.
446
+ # @param disk_name [String] The name of the managed disk that is being created.
447
+ # The name can't be changed after the disk is created. Supported characters for
448
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
449
+ # @param grant_access_data [GrantAccessData] Access data object supplied in the
450
+ # body of the get disk access operation.
451
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
452
+ # will be added to the HTTP request.
453
+ #
454
+ # @return [AccessUri] operation results.
455
+ #
456
+ def grant_access(resource_group_name, disk_name, grant_access_data, custom_headers:nil)
457
+ response = grant_access_async(resource_group_name, disk_name, grant_access_data, custom_headers:custom_headers).value!
458
+ response.body unless response.nil?
459
+ end
460
+
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group.
463
+ # @param disk_name [String] The name of the managed disk that is being created.
464
+ # The name can't be changed after the disk is created. Supported characters for
465
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
466
+ # @param grant_access_data [GrantAccessData] Access data object supplied in the
467
+ # body of the get disk access operation.
468
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
469
+ # will be added to the HTTP request.
470
+ #
471
+ # @return [Concurrent::Promise] promise which provides async access to http
472
+ # response.
473
+ #
474
+ def grant_access_async(resource_group_name, disk_name, grant_access_data, custom_headers:nil)
475
+ # Send request
476
+ promise = begin_grant_access_async(resource_group_name, disk_name, grant_access_data, custom_headers:custom_headers)
477
+
478
+ promise = promise.then do |response|
479
+ # Defining deserialization method.
480
+ deserialize_method = lambda do |parsed_response|
481
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::AccessUri.mapper()
482
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
483
+ end
484
+
485
+ # Waiting for response.
486
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
487
+ end
488
+
489
+ promise
490
+ end
491
+
492
+ #
493
+ # Revokes access to a disk.
494
+ #
495
+ # @param resource_group_name [String] The name of the resource group.
496
+ # @param disk_name [String] The name of the managed disk that is being created.
497
+ # The name can't be changed after the disk is created. Supported characters for
498
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
499
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
500
+ # will be added to the HTTP request.
501
+ #
502
+ def revoke_access(resource_group_name, disk_name, custom_headers:nil)
503
+ response = revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
504
+ nil
505
+ end
506
+
507
+ #
508
+ # @param resource_group_name [String] The name of the resource group.
509
+ # @param disk_name [String] The name of the managed disk that is being created.
510
+ # The name can't be changed after the disk is created. Supported characters for
511
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
512
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
513
+ # will be added to the HTTP request.
514
+ #
515
+ # @return [Concurrent::Promise] promise which provides async access to http
516
+ # response.
517
+ #
518
+ def revoke_access_async(resource_group_name, disk_name, custom_headers:nil)
519
+ # Send request
520
+ promise = begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers)
521
+
522
+ promise = promise.then do |response|
523
+ # Defining deserialization method.
524
+ deserialize_method = lambda do |parsed_response|
525
+ end
526
+
527
+ # Waiting for response.
528
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
529
+ end
530
+
531
+ promise
532
+ end
533
+
534
+ #
535
+ # Creates or updates a disk.
536
+ #
537
+ # @param resource_group_name [String] The name of the resource group.
538
+ # @param disk_name [String] The name of the managed disk that is being created.
539
+ # The name can't be changed after the disk is created. Supported characters for
540
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
541
+ # @param disk [Disk] Disk object supplied in the body of the Put disk
542
+ # operation.
543
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
544
+ # will be added to the HTTP request.
545
+ #
546
+ # @return [Disk] operation results.
547
+ #
548
+ def begin_create_or_update(resource_group_name, disk_name, disk, custom_headers:nil)
549
+ response = begin_create_or_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
550
+ response.body unless response.nil?
551
+ end
552
+
553
+ #
554
+ # Creates or updates a disk.
555
+ #
556
+ # @param resource_group_name [String] The name of the resource group.
557
+ # @param disk_name [String] The name of the managed disk that is being created.
558
+ # The name can't be changed after the disk is created. Supported characters for
559
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
560
+ # @param disk [Disk] Disk object supplied in the body of the Put disk
561
+ # operation.
562
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
+ # will be added to the HTTP request.
564
+ #
565
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
566
+ #
567
+ def begin_create_or_update_with_http_info(resource_group_name, disk_name, disk, custom_headers:nil)
568
+ begin_create_or_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
569
+ end
570
+
571
+ #
572
+ # Creates or updates a disk.
573
+ #
574
+ # @param resource_group_name [String] The name of the resource group.
575
+ # @param disk_name [String] The name of the managed disk that is being created.
576
+ # The name can't be changed after the disk is created. Supported characters for
577
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
578
+ # @param disk [Disk] Disk object supplied in the body of the Put disk
579
+ # operation.
580
+ # @param [Hash{String => String}] A hash of custom headers that will be added
581
+ # to the HTTP request.
582
+ #
583
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
584
+ #
585
+ def begin_create_or_update_async(resource_group_name, disk_name, disk, custom_headers:nil)
586
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
587
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
588
+ fail ArgumentError, 'disk_name is nil' if disk_name.nil?
589
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
590
+ fail ArgumentError, 'disk is nil' if disk.nil?
591
+
592
+
593
+ request_headers = {}
594
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
595
+
596
+ # Set Headers
597
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
598
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
599
+
600
+ # Serialize Request
601
+ request_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
602
+ request_content = @client.serialize(request_mapper, disk)
603
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
604
+
605
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'
606
+
607
+ request_url = @base_url || @client.base_url
608
+
609
+ options = {
610
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
611
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'diskName' => disk_name},
612
+ query_params: {'api-version' => @client.api_version},
613
+ body: request_content,
614
+ headers: request_headers.merge(custom_headers || {}),
615
+ base_url: request_url
616
+ }
617
+ promise = @client.make_request_async(:put, path_template, options)
618
+
619
+ promise = promise.then do |result|
620
+ http_response = result.response
621
+ status_code = http_response.status
622
+ response_content = http_response.body
623
+ unless status_code == 200 || status_code == 202
624
+ error_model = JSON.load(response_content)
625
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
626
+ end
627
+
628
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
629
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
630
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
631
+ # Deserialize Response
632
+ if status_code == 200
633
+ begin
634
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
635
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
636
+ result.body = @client.deserialize(result_mapper, parsed_response)
637
+ rescue Exception => e
638
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
639
+ end
640
+ end
641
+ # Deserialize Response
642
+ if status_code == 202
643
+ begin
644
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
645
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
646
+ result.body = @client.deserialize(result_mapper, parsed_response)
647
+ rescue Exception => e
648
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
649
+ end
650
+ end
651
+
652
+ result
653
+ end
654
+
655
+ promise.execute
656
+ end
657
+
658
+ #
659
+ # Updates (patches) a disk.
660
+ #
661
+ # @param resource_group_name [String] The name of the resource group.
662
+ # @param disk_name [String] The name of the managed disk that is being created.
663
+ # The name can't be changed after the disk is created. Supported characters for
664
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
665
+ # @param disk [DiskUpdate] Disk object supplied in the body of the Patch disk
666
+ # operation.
667
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
668
+ # will be added to the HTTP request.
669
+ #
670
+ # @return [Disk] operation results.
671
+ #
672
+ def begin_update(resource_group_name, disk_name, disk, custom_headers:nil)
673
+ response = begin_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
674
+ response.body unless response.nil?
675
+ end
676
+
677
+ #
678
+ # Updates (patches) a disk.
679
+ #
680
+ # @param resource_group_name [String] The name of the resource group.
681
+ # @param disk_name [String] The name of the managed disk that is being created.
682
+ # The name can't be changed after the disk is created. Supported characters for
683
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
684
+ # @param disk [DiskUpdate] Disk object supplied in the body of the Patch disk
685
+ # operation.
686
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
687
+ # will be added to the HTTP request.
688
+ #
689
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
690
+ #
691
+ def begin_update_with_http_info(resource_group_name, disk_name, disk, custom_headers:nil)
692
+ begin_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
693
+ end
694
+
695
+ #
696
+ # Updates (patches) a disk.
697
+ #
698
+ # @param resource_group_name [String] The name of the resource group.
699
+ # @param disk_name [String] The name of the managed disk that is being created.
700
+ # The name can't be changed after the disk is created. Supported characters for
701
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
702
+ # @param disk [DiskUpdate] Disk object supplied in the body of the Patch disk
703
+ # operation.
704
+ # @param [Hash{String => String}] A hash of custom headers that will be added
705
+ # to the HTTP request.
706
+ #
707
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
708
+ #
709
+ def begin_update_async(resource_group_name, disk_name, disk, custom_headers:nil)
710
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
711
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
712
+ fail ArgumentError, 'disk_name is nil' if disk_name.nil?
713
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
714
+ fail ArgumentError, 'disk is nil' if disk.nil?
715
+
716
+
717
+ request_headers = {}
718
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
719
+
720
+ # Set Headers
721
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
722
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
723
+
724
+ # Serialize Request
725
+ request_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskUpdate.mapper()
726
+ request_content = @client.serialize(request_mapper, disk)
727
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
728
+
729
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'
730
+
731
+ request_url = @base_url || @client.base_url
732
+
733
+ options = {
734
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
735
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'diskName' => disk_name},
736
+ query_params: {'api-version' => @client.api_version},
737
+ body: request_content,
738
+ headers: request_headers.merge(custom_headers || {}),
739
+ base_url: request_url
740
+ }
741
+ promise = @client.make_request_async(:patch, path_template, options)
742
+
743
+ promise = promise.then do |result|
744
+ http_response = result.response
745
+ status_code = http_response.status
746
+ response_content = http_response.body
747
+ unless status_code == 200 || status_code == 202
748
+ error_model = JSON.load(response_content)
749
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
750
+ end
751
+
752
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
753
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
754
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
755
+ # Deserialize Response
756
+ if status_code == 200
757
+ begin
758
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
759
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
760
+ result.body = @client.deserialize(result_mapper, parsed_response)
761
+ rescue Exception => e
762
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
763
+ end
764
+ end
765
+ # Deserialize Response
766
+ if status_code == 202
767
+ begin
768
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
769
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::Disk.mapper()
770
+ result.body = @client.deserialize(result_mapper, parsed_response)
771
+ rescue Exception => e
772
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
773
+ end
774
+ end
775
+
776
+ result
777
+ end
778
+
779
+ promise.execute
780
+ end
781
+
782
+ #
783
+ # Deletes a disk.
784
+ #
785
+ # @param resource_group_name [String] The name of the resource group.
786
+ # @param disk_name [String] The name of the managed disk that is being created.
787
+ # The name can't be changed after the disk is created. Supported characters for
788
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
789
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
790
+ # will be added to the HTTP request.
791
+ #
792
+ #
793
+ def begin_delete(resource_group_name, disk_name, custom_headers:nil)
794
+ response = begin_delete_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
795
+ nil
796
+ end
797
+
798
+ #
799
+ # Deletes a disk.
800
+ #
801
+ # @param resource_group_name [String] The name of the resource group.
802
+ # @param disk_name [String] The name of the managed disk that is being created.
803
+ # The name can't be changed after the disk is created. Supported characters for
804
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
805
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
806
+ # will be added to the HTTP request.
807
+ #
808
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
809
+ #
810
+ def begin_delete_with_http_info(resource_group_name, disk_name, custom_headers:nil)
811
+ begin_delete_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
812
+ end
813
+
814
+ #
815
+ # Deletes a disk.
816
+ #
817
+ # @param resource_group_name [String] The name of the resource group.
818
+ # @param disk_name [String] The name of the managed disk that is being created.
819
+ # The name can't be changed after the disk is created. Supported characters for
820
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
821
+ # @param [Hash{String => String}] A hash of custom headers that will be added
822
+ # to the HTTP request.
823
+ #
824
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
825
+ #
826
+ def begin_delete_async(resource_group_name, disk_name, custom_headers:nil)
827
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
828
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
829
+ fail ArgumentError, 'disk_name is nil' if disk_name.nil?
830
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
831
+
832
+
833
+ request_headers = {}
834
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
835
+
836
+ # Set Headers
837
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
838
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
839
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'
840
+
841
+ request_url = @base_url || @client.base_url
842
+
843
+ options = {
844
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
845
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'diskName' => disk_name},
846
+ query_params: {'api-version' => @client.api_version},
847
+ headers: request_headers.merge(custom_headers || {}),
848
+ base_url: request_url
849
+ }
850
+ promise = @client.make_request_async(:delete, path_template, options)
851
+
852
+ promise = promise.then do |result|
853
+ http_response = result.response
854
+ status_code = http_response.status
855
+ response_content = http_response.body
856
+ unless status_code == 200 || status_code == 202 || status_code == 204
857
+ error_model = JSON.load(response_content)
858
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
859
+ end
860
+
861
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
862
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
863
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
864
+
865
+ result
866
+ end
867
+
868
+ promise.execute
869
+ end
870
+
871
+ #
872
+ # Grants access to a disk.
873
+ #
874
+ # @param resource_group_name [String] The name of the resource group.
875
+ # @param disk_name [String] The name of the managed disk that is being created.
876
+ # The name can't be changed after the disk is created. Supported characters for
877
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
878
+ # @param grant_access_data [GrantAccessData] Access data object supplied in the
879
+ # body of the get disk access operation.
880
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
881
+ # will be added to the HTTP request.
882
+ #
883
+ # @return [AccessUri] operation results.
884
+ #
885
+ def begin_grant_access(resource_group_name, disk_name, grant_access_data, custom_headers:nil)
886
+ response = begin_grant_access_async(resource_group_name, disk_name, grant_access_data, custom_headers:custom_headers).value!
887
+ response.body unless response.nil?
888
+ end
889
+
890
+ #
891
+ # Grants access to a disk.
892
+ #
893
+ # @param resource_group_name [String] The name of the resource group.
894
+ # @param disk_name [String] The name of the managed disk that is being created.
895
+ # The name can't be changed after the disk is created. Supported characters for
896
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
897
+ # @param grant_access_data [GrantAccessData] Access data object supplied in the
898
+ # body of the get disk access operation.
899
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
900
+ # will be added to the HTTP request.
901
+ #
902
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
903
+ #
904
+ def begin_grant_access_with_http_info(resource_group_name, disk_name, grant_access_data, custom_headers:nil)
905
+ begin_grant_access_async(resource_group_name, disk_name, grant_access_data, custom_headers:custom_headers).value!
906
+ end
907
+
908
+ #
909
+ # Grants access to a disk.
910
+ #
911
+ # @param resource_group_name [String] The name of the resource group.
912
+ # @param disk_name [String] The name of the managed disk that is being created.
913
+ # The name can't be changed after the disk is created. Supported characters for
914
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
915
+ # @param grant_access_data [GrantAccessData] Access data object supplied in the
916
+ # body of the get disk access operation.
917
+ # @param [Hash{String => String}] A hash of custom headers that will be added
918
+ # to the HTTP request.
919
+ #
920
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
921
+ #
922
+ def begin_grant_access_async(resource_group_name, disk_name, grant_access_data, custom_headers:nil)
923
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
924
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
925
+ fail ArgumentError, 'disk_name is nil' if disk_name.nil?
926
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
927
+ fail ArgumentError, 'grant_access_data is nil' if grant_access_data.nil?
928
+
929
+
930
+ request_headers = {}
931
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
932
+
933
+ # Set Headers
934
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
935
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
936
+
937
+ # Serialize Request
938
+ request_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::GrantAccessData.mapper()
939
+ request_content = @client.serialize(request_mapper, grant_access_data)
940
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
941
+
942
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'
943
+
944
+ request_url = @base_url || @client.base_url
945
+
946
+ options = {
947
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
948
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'diskName' => disk_name},
949
+ query_params: {'api-version' => @client.api_version},
950
+ body: request_content,
951
+ headers: request_headers.merge(custom_headers || {}),
952
+ base_url: request_url
953
+ }
954
+ promise = @client.make_request_async(:post, path_template, options)
955
+
956
+ promise = promise.then do |result|
957
+ http_response = result.response
958
+ status_code = http_response.status
959
+ response_content = http_response.body
960
+ unless status_code == 200 || status_code == 202
961
+ error_model = JSON.load(response_content)
962
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
963
+ end
964
+
965
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
966
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
967
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
968
+ # Deserialize Response
969
+ if status_code == 200
970
+ begin
971
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
972
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::AccessUri.mapper()
973
+ result.body = @client.deserialize(result_mapper, parsed_response)
974
+ rescue Exception => e
975
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
976
+ end
977
+ end
978
+
979
+ result
980
+ end
981
+
982
+ promise.execute
983
+ end
984
+
985
+ #
986
+ # Revokes access to a disk.
987
+ #
988
+ # @param resource_group_name [String] The name of the resource group.
989
+ # @param disk_name [String] The name of the managed disk that is being created.
990
+ # The name can't be changed after the disk is created. Supported characters for
991
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
992
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
993
+ # will be added to the HTTP request.
994
+ #
995
+ #
996
+ def begin_revoke_access(resource_group_name, disk_name, custom_headers:nil)
997
+ response = begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
998
+ nil
999
+ end
1000
+
1001
+ #
1002
+ # Revokes access to a disk.
1003
+ #
1004
+ # @param resource_group_name [String] The name of the resource group.
1005
+ # @param disk_name [String] The name of the managed disk that is being created.
1006
+ # The name can't be changed after the disk is created. Supported characters for
1007
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
1008
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1009
+ # will be added to the HTTP request.
1010
+ #
1011
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1012
+ #
1013
+ def begin_revoke_access_with_http_info(resource_group_name, disk_name, custom_headers:nil)
1014
+ begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
1015
+ end
1016
+
1017
+ #
1018
+ # Revokes access to a disk.
1019
+ #
1020
+ # @param resource_group_name [String] The name of the resource group.
1021
+ # @param disk_name [String] The name of the managed disk that is being created.
1022
+ # The name can't be changed after the disk is created. Supported characters for
1023
+ # the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
1024
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1025
+ # to the HTTP request.
1026
+ #
1027
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1028
+ #
1029
+ def begin_revoke_access_async(resource_group_name, disk_name, custom_headers:nil)
1030
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1031
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1032
+ fail ArgumentError, 'disk_name is nil' if disk_name.nil?
1033
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1034
+
1035
+
1036
+ request_headers = {}
1037
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1038
+
1039
+ # Set Headers
1040
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1041
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1042
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'
1043
+
1044
+ request_url = @base_url || @client.base_url
1045
+
1046
+ options = {
1047
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1048
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'diskName' => disk_name},
1049
+ query_params: {'api-version' => @client.api_version},
1050
+ headers: request_headers.merge(custom_headers || {}),
1051
+ base_url: request_url
1052
+ }
1053
+ promise = @client.make_request_async(:post, path_template, options)
1054
+
1055
+ promise = promise.then do |result|
1056
+ http_response = result.response
1057
+ status_code = http_response.status
1058
+ response_content = http_response.body
1059
+ unless status_code == 200 || status_code == 202
1060
+ error_model = JSON.load(response_content)
1061
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1062
+ end
1063
+
1064
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1065
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1066
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1067
+
1068
+ result
1069
+ end
1070
+
1071
+ promise.execute
1072
+ end
1073
+
1074
+ #
1075
+ # Lists all the disks under a resource group.
1076
+ #
1077
+ # @param next_page_link [String] The NextLink from the previous successful call
1078
+ # to List operation.
1079
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1080
+ # will be added to the HTTP request.
1081
+ #
1082
+ # @return [DiskList] operation results.
1083
+ #
1084
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1085
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1086
+ response.body unless response.nil?
1087
+ end
1088
+
1089
+ #
1090
+ # Lists all the disks under a resource group.
1091
+ #
1092
+ # @param next_page_link [String] The NextLink from the previous successful call
1093
+ # to List operation.
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 list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1100
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1101
+ end
1102
+
1103
+ #
1104
+ # Lists all the disks under a resource group.
1105
+ #
1106
+ # @param next_page_link [String] The NextLink from the previous successful call
1107
+ # to List operation.
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 list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1114
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1115
+
1116
+
1117
+ request_headers = {}
1118
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1119
+
1120
+ # Set Headers
1121
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1122
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1123
+ path_template = '{nextLink}'
1124
+
1125
+ request_url = @base_url || @client.base_url
1126
+
1127
+ options = {
1128
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1129
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1130
+ headers: request_headers.merge(custom_headers || {}),
1131
+ base_url: request_url
1132
+ }
1133
+ promise = @client.make_request_async(:get, path_template, options)
1134
+
1135
+ promise = promise.then do |result|
1136
+ http_response = result.response
1137
+ status_code = http_response.status
1138
+ response_content = http_response.body
1139
+ unless status_code == 200
1140
+ error_model = JSON.load(response_content)
1141
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1142
+ end
1143
+
1144
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1145
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1146
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1147
+ # Deserialize Response
1148
+ if status_code == 200
1149
+ begin
1150
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1151
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskList.mapper()
1152
+ result.body = @client.deserialize(result_mapper, parsed_response)
1153
+ rescue Exception => e
1154
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1155
+ end
1156
+ end
1157
+
1158
+ result
1159
+ end
1160
+
1161
+ promise.execute
1162
+ end
1163
+
1164
+ #
1165
+ # Lists all the disks under a subscription.
1166
+ #
1167
+ # @param next_page_link [String] The NextLink from the previous successful call
1168
+ # to List operation.
1169
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1170
+ # will be added to the HTTP request.
1171
+ #
1172
+ # @return [DiskList] operation results.
1173
+ #
1174
+ def list_next(next_page_link, custom_headers:nil)
1175
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1176
+ response.body unless response.nil?
1177
+ end
1178
+
1179
+ #
1180
+ # Lists all the disks under a subscription.
1181
+ #
1182
+ # @param next_page_link [String] The NextLink from the previous successful call
1183
+ # to List operation.
1184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1185
+ # will be added to the HTTP request.
1186
+ #
1187
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1188
+ #
1189
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1190
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1191
+ end
1192
+
1193
+ #
1194
+ # Lists all the disks under a subscription.
1195
+ #
1196
+ # @param next_page_link [String] The NextLink from the previous successful call
1197
+ # to List operation.
1198
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1199
+ # to the HTTP request.
1200
+ #
1201
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1202
+ #
1203
+ def list_next_async(next_page_link, custom_headers:nil)
1204
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1205
+
1206
+
1207
+ request_headers = {}
1208
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1209
+
1210
+ # Set Headers
1211
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1212
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1213
+ path_template = '{nextLink}'
1214
+
1215
+ request_url = @base_url || @client.base_url
1216
+
1217
+ options = {
1218
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1219
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1220
+ headers: request_headers.merge(custom_headers || {}),
1221
+ base_url: request_url
1222
+ }
1223
+ promise = @client.make_request_async(:get, 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
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
+ # Deserialize Response
1238
+ if status_code == 200
1239
+ begin
1240
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1241
+ result_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskList.mapper()
1242
+ result.body = @client.deserialize(result_mapper, parsed_response)
1243
+ rescue Exception => e
1244
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1245
+ end
1246
+ end
1247
+
1248
+ result
1249
+ end
1250
+
1251
+ promise.execute
1252
+ end
1253
+
1254
+ #
1255
+ # Lists all the disks under a resource group.
1256
+ #
1257
+ # @param resource_group_name [String] The name of the resource group.
1258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1259
+ # will be added to the HTTP request.
1260
+ #
1261
+ # @return [DiskList] which provide lazy access to pages of the response.
1262
+ #
1263
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1264
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1265
+ unless response.nil?
1266
+ page = response.body
1267
+ page.next_method = Proc.new do |next_page_link|
1268
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1269
+ end
1270
+ page
1271
+ end
1272
+ end
1273
+
1274
+ #
1275
+ # Lists all the disks under a subscription.
1276
+ #
1277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1278
+ # will be added to the HTTP request.
1279
+ #
1280
+ # @return [DiskList] which provide lazy access to pages of the response.
1281
+ #
1282
+ def list_as_lazy(custom_headers:nil)
1283
+ response = list_async(custom_headers:custom_headers).value!
1284
+ unless response.nil?
1285
+ page = response.body
1286
+ page.next_method = Proc.new do |next_page_link|
1287
+ list_next_async(next_page_link, custom_headers:custom_headers)
1288
+ end
1289
+ page
1290
+ end
1291
+ end
1292
+
1293
+ end
1294
+ end