azure_mgmt_devtestlabs 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_devtestlabs.rb +149 -55
  3. data/lib/generated/azure_mgmt_devtestlabs/arm_templates.rb +363 -0
  4. data/lib/generated/azure_mgmt_devtestlabs/{artifact_source_operations.rb → artifact_sources.rb} +85 -69
  5. data/lib/generated/azure_mgmt_devtestlabs/{artifact_operations.rb → artifacts.rb} +59 -43
  6. data/lib/generated/azure_mgmt_devtestlabs/costs.rb +244 -0
  7. data/lib/generated/azure_mgmt_devtestlabs/{custom_image_operations.rb → custom_images.rb} +81 -68
  8. data/lib/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +73 -37
  9. data/lib/generated/azure_mgmt_devtestlabs/disks.rb +975 -0
  10. data/lib/generated/azure_mgmt_devtestlabs/environments.rb +672 -0
  11. data/lib/generated/azure_mgmt_devtestlabs/{formula_operations.rb → formulas.rb} +82 -64
  12. data/lib/generated/azure_mgmt_devtestlabs/{gallery_image_operations.rb → gallery_images.rb} +33 -26
  13. data/lib/generated/azure_mgmt_devtestlabs/global_schedules.rb +1121 -0
  14. data/lib/generated/azure_mgmt_devtestlabs/{lab_operations.rb → labs.rb} +439 -141
  15. data/lib/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb +105 -0
  16. data/lib/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb +105 -0
  17. data/lib/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +2 -1
  18. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template.rb +167 -0
  19. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +2 -1
  20. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb +55 -0
  21. data/lib/generated/azure_mgmt_devtestlabs/models/artifact.rb +70 -53
  22. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +2 -1
  23. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb +68 -0
  24. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +43 -1
  25. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb +105 -0
  26. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +2 -1
  27. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb +55 -0
  28. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +75 -62
  29. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb +185 -0
  30. data/lib/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb +46 -0
  31. data/lib/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +66 -0
  32. data/lib/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb +45 -0
  33. data/lib/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb +76 -0
  34. data/lib/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb +76 -0
  35. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb +65 -0
  36. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb +65 -0
  37. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb +131 -0
  38. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb +131 -0
  39. data/lib/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb +92 -0
  40. data/lib/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb +16 -0
  41. data/lib/generated/azure_mgmt_devtestlabs/models/{lab_cost_type.rb → cost_type.rb} +3 -3
  42. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image.rb +58 -57
  43. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb +1 -1
  44. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +5 -4
  45. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +2 -1
  46. data/lib/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb +70 -0
  47. data/lib/generated/azure_mgmt_devtestlabs/models/day_details.rb +3 -2
  48. data/lib/generated/azure_mgmt_devtestlabs/models/{subscription_notification_properties.rb → day_details_fragment.rb} +11 -11
  49. data/lib/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb +46 -0
  50. data/lib/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb +46 -0
  51. data/lib/generated/azure_mgmt_devtestlabs/models/disk.rb +186 -0
  52. data/lib/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb +146 -0
  53. data/lib/generated/azure_mgmt_devtestlabs/models/enable_status.rb +1 -1
  54. data/lib/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb +64 -0
  55. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +2 -1
  56. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +2 -1
  57. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +2 -1
  58. data/lib/generated/azure_mgmt_devtestlabs/models/event.rb +47 -0
  59. data/lib/generated/azure_mgmt_devtestlabs/models/event_fragment.rb +47 -0
  60. data/lib/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb +58 -0
  61. data/lib/generated/azure_mgmt_devtestlabs/models/external_subnet.rb +55 -0
  62. data/lib/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb +55 -0
  63. data/lib/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb +16 -0
  64. data/lib/generated/azure_mgmt_devtestlabs/models/formula.rb +53 -61
  65. data/lib/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +2 -1
  66. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +44 -54
  67. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +2 -1
  68. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb +85 -0
  69. data/lib/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +14 -1
  70. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +2 -1
  71. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +2 -1
  72. data/lib/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb +17 -0
  73. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details.rb +2 -1
  74. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb +45 -0
  75. data/lib/generated/azure_mgmt_devtestlabs/models/identity_properties.rb +75 -0
  76. data/lib/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb +70 -0
  77. data/lib/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb +70 -0
  78. data/lib/generated/azure_mgmt_devtestlabs/models/lab.rb +85 -54
  79. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost.rb +204 -0
  80. data/lib/generated/azure_mgmt_devtestlabs/models/{cost_per_day_properties.rb → lab_cost_details_properties.rb} +7 -6
  81. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb +45 -0
  82. data/lib/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb +127 -0
  83. data/lib/generated/azure_mgmt_devtestlabs/models/{resource_cost_properties.rb → lab_resource_cost_properties.rb} +49 -28
  84. data/lib/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +3 -2
  85. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +141 -42
  86. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb +412 -0
  87. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb +410 -0
  88. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +5 -3
  89. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb +1 -1
  90. data/lib/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb +130 -0
  91. data/lib/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb +130 -0
  92. data/lib/generated/azure_mgmt_devtestlabs/models/notification_channel.rb +150 -0
  93. data/lib/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb +16 -0
  94. data/lib/generated/azure_mgmt_devtestlabs/models/{cost.rb → notification_channel_fragment.rb} +64 -64
  95. data/lib/generated/azure_mgmt_devtestlabs/models/notification_settings.rb +69 -0
  96. data/lib/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb +69 -0
  97. data/lib/generated/azure_mgmt_devtestlabs/models/notification_status.rb +16 -0
  98. data/lib/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb +56 -0
  99. data/lib/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +5 -5
  100. data/lib/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb +55 -0
  101. data/lib/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb +45 -0
  102. data/lib/generated/azure_mgmt_devtestlabs/models/policy.rb +62 -58
  103. data/lib/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb +1 -1
  104. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb +4 -1
  105. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb +168 -0
  106. data/lib/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +2 -1
  107. data/lib/generated/azure_mgmt_devtestlabs/models/policy_status.rb +1 -1
  108. data/lib/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +2 -1
  109. data/lib/generated/azure_mgmt_devtestlabs/models/port.rb +56 -0
  110. data/lib/generated/azure_mgmt_devtestlabs/models/port_fragment.rb +56 -0
  111. data/lib/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb +16 -0
  112. data/lib/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb +16 -0
  113. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_arm_template.rb +94 -0
  114. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb +2 -1
  115. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb +2 -1
  116. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb +2 -1
  117. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_disk.rb +94 -0
  118. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_dtl_environment.rb +95 -0
  119. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb +2 -1
  120. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb +2 -1
  121. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb +2 -1
  122. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb +2 -1
  123. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb +2 -1
  124. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_notification_channel.rb +96 -0
  125. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb +2 -1
  126. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb +2 -1
  127. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_secret.rb +94 -0
  128. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_service_runner.rb +94 -0
  129. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_user.rb +94 -0
  130. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb +2 -1
  131. data/lib/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb +57 -0
  132. data/lib/generated/azure_mgmt_devtestlabs/models/schedule.rb +82 -57
  133. data/lib/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb +189 -0
  134. data/lib/generated/azure_mgmt_devtestlabs/models/secret.rb +110 -0
  135. data/lib/generated/azure_mgmt_devtestlabs/models/service_runner.rb +91 -0
  136. data/lib/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb +54 -0
  137. data/lib/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb +55 -0
  138. data/lib/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb +147 -0
  139. data/lib/generated/azure_mgmt_devtestlabs/models/source_control_type.rb +1 -1
  140. data/lib/generated/azure_mgmt_devtestlabs/models/{lab_storage_type.rb → storage_type.rb} +3 -3
  141. data/lib/generated/azure_mgmt_devtestlabs/models/subnet.rb +8 -7
  142. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb +67 -0
  143. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +29 -6
  144. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb +101 -0
  145. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb +54 -0
  146. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb +55 -0
  147. data/lib/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb +105 -0
  148. data/lib/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb +16 -0
  149. data/lib/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb +16 -0
  150. data/lib/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb +1 -1
  151. data/lib/generated/azure_mgmt_devtestlabs/models/user.rb +133 -0
  152. data/lib/generated/azure_mgmt_devtestlabs/models/user_fragment.rb +122 -0
  153. data/lib/generated/azure_mgmt_devtestlabs/models/user_identity.rb +91 -0
  154. data/lib/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb +91 -0
  155. data/lib/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb +55 -0
  156. data/lib/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb +55 -0
  157. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb +16 -0
  158. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +77 -59
  159. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb +177 -0
  160. data/lib/generated/azure_mgmt_devtestlabs/models/week_details.rb +5 -3
  161. data/lib/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb +63 -0
  162. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +4 -2
  163. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb +1 -1
  164. data/lib/generated/azure_mgmt_devtestlabs/module_definition.rb +1 -1
  165. data/lib/generated/azure_mgmt_devtestlabs/notification_channels.rb +764 -0
  166. data/lib/generated/azure_mgmt_devtestlabs/{policy_operations.rb → policies.rb} +82 -69
  167. data/lib/generated/azure_mgmt_devtestlabs/{policy_set.rb → policy_sets.rb} +18 -16
  168. data/lib/generated/azure_mgmt_devtestlabs/{virtual_machine.rb → schedules.rb} +282 -417
  169. data/lib/generated/azure_mgmt_devtestlabs/secrets.rb +573 -0
  170. data/lib/generated/azure_mgmt_devtestlabs/service_runners.rb +545 -0
  171. data/lib/generated/azure_mgmt_devtestlabs/users.rb +704 -0
  172. data/lib/generated/azure_mgmt_devtestlabs/version.rb +2 -2
  173. data/lib/generated/azure_mgmt_devtestlabs/{schedule_operations.rb → virtual_machine_schedules.rb} +132 -92
  174. data/lib/generated/azure_mgmt_devtestlabs/virtual_machines.rb +1669 -0
  175. data/lib/generated/azure_mgmt_devtestlabs/{virtual_network_operations.rb → virtual_networks.rb} +94 -81
  176. metadata +118 -24
  177. data/lib/generated/azure_mgmt_devtestlabs/cost_operations.rb +0 -121
  178. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification.rb +0 -68
  179. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_state.rb +0 -20
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -34,41 +34,68 @@ module Azure::ARM::DevTestLabs
34
34
  # is generated and included in each request. Default is true.
35
35
  attr_accessor :generate_client_request_id
36
36
 
37
- # @return [LabOperations] lab_operations
38
- attr_reader :lab_operations
37
+ # @return [Labs] labs
38
+ attr_reader :labs
39
39
 
40
- # @return [ArtifactSourceOperations] artifact_source_operations
41
- attr_reader :artifact_source_operations
40
+ # @return [GlobalSchedules] global_schedules
41
+ attr_reader :global_schedules
42
42
 
43
- # @return [ArtifactOperations] artifact_operations
44
- attr_reader :artifact_operations
43
+ # @return [ArtifactSources] artifact_sources
44
+ attr_reader :artifact_sources
45
45
 
46
- # @return [CostOperations] cost_operations
47
- attr_reader :cost_operations
46
+ # @return [ArmTemplates] arm_templates
47
+ attr_reader :arm_templates
48
48
 
49
- # @return [CustomImageOperations] custom_image_operations
50
- attr_reader :custom_image_operations
49
+ # @return [Artifacts] artifacts
50
+ attr_reader :artifacts
51
51
 
52
- # @return [FormulaOperations] formula_operations
53
- attr_reader :formula_operations
52
+ # @return [Costs] costs
53
+ attr_reader :costs
54
54
 
55
- # @return [GalleryImageOperations] gallery_image_operations
56
- attr_reader :gallery_image_operations
55
+ # @return [CustomImages] custom_images
56
+ attr_reader :custom_images
57
57
 
58
- # @return [PolicySet] policy_set
59
- attr_reader :policy_set
58
+ # @return [Formulas] formulas
59
+ attr_reader :formulas
60
60
 
61
- # @return [PolicyOperations] policy_operations
62
- attr_reader :policy_operations
61
+ # @return [GalleryImages] gallery_images
62
+ attr_reader :gallery_images
63
63
 
64
- # @return [ScheduleOperations] schedule_operations
65
- attr_reader :schedule_operations
64
+ # @return [NotificationChannels] notification_channels
65
+ attr_reader :notification_channels
66
66
 
67
- # @return [VirtualMachine] virtual_machine
68
- attr_reader :virtual_machine
67
+ # @return [PolicySets] policy_sets
68
+ attr_reader :policy_sets
69
69
 
70
- # @return [VirtualNetworkOperations] virtual_network_operations
71
- attr_reader :virtual_network_operations
70
+ # @return [Policies] policies
71
+ attr_reader :policies
72
+
73
+ # @return [Schedules] schedules
74
+ attr_reader :schedules
75
+
76
+ # @return [ServiceRunners] service_runners
77
+ attr_reader :service_runners
78
+
79
+ # @return [Users] users
80
+ attr_reader :users
81
+
82
+ # @return [Disks] disks
83
+ attr_reader :disks
84
+
85
+ # @return [Environments] environments
86
+ attr_reader :environments
87
+
88
+ # @return [Secrets] secrets
89
+ attr_reader :secrets
90
+
91
+ # @return [VirtualMachines] virtual_machines
92
+ attr_reader :virtual_machines
93
+
94
+ # @return [VirtualMachineSchedules] virtual_machine_schedules
95
+ attr_reader :virtual_machine_schedules
96
+
97
+ # @return [VirtualNetworks] virtual_networks
98
+ attr_reader :virtual_networks
72
99
 
73
100
  #
74
101
  # Creates initializes a new instance of the DevTestLabsClient class.
@@ -83,18 +110,27 @@ module Azure::ARM::DevTestLabs
83
110
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
84
111
  @credentials = credentials
85
112
 
86
- @lab_operations = LabOperations.new(self)
87
- @artifact_source_operations = ArtifactSourceOperations.new(self)
88
- @artifact_operations = ArtifactOperations.new(self)
89
- @cost_operations = CostOperations.new(self)
90
- @custom_image_operations = CustomImageOperations.new(self)
91
- @formula_operations = FormulaOperations.new(self)
92
- @gallery_image_operations = GalleryImageOperations.new(self)
93
- @policy_set = PolicySet.new(self)
94
- @policy_operations = PolicyOperations.new(self)
95
- @schedule_operations = ScheduleOperations.new(self)
96
- @virtual_machine = VirtualMachine.new(self)
97
- @virtual_network_operations = VirtualNetworkOperations.new(self)
113
+ @labs = Labs.new(self)
114
+ @global_schedules = GlobalSchedules.new(self)
115
+ @artifact_sources = ArtifactSources.new(self)
116
+ @arm_templates = ArmTemplates.new(self)
117
+ @artifacts = Artifacts.new(self)
118
+ @costs = Costs.new(self)
119
+ @custom_images = CustomImages.new(self)
120
+ @formulas = Formulas.new(self)
121
+ @gallery_images = GalleryImages.new(self)
122
+ @notification_channels = NotificationChannels.new(self)
123
+ @policy_sets = PolicySets.new(self)
124
+ @policies = Policies.new(self)
125
+ @schedules = Schedules.new(self)
126
+ @service_runners = ServiceRunners.new(self)
127
+ @users = Users.new(self)
128
+ @disks = Disks.new(self)
129
+ @environments = Environments.new(self)
130
+ @secrets = Secrets.new(self)
131
+ @virtual_machines = VirtualMachines.new(self)
132
+ @virtual_machine_schedules = VirtualMachineSchedules.new(self)
133
+ @virtual_networks = VirtualNetworks.new(self)
98
134
  @api_version = '2016-05-15'
99
135
  @accept_language = 'en-US'
100
136
  @long_running_operation_retry_timeout = 30
@@ -0,0 +1,975 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::DevTestLabs
7
+ #
8
+ # The DevTest Labs 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 [DevTestLabsClient] reference to the DevTestLabsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List disks in a given user profile.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param lab_name [String] The name of the lab.
29
+ # @param user_name [String] The name of the user profile.
30
+ # @param expand [String] Specify the $expand query. Example:
31
+ # 'properties($select=diskType)'
32
+ # @param filter [String] The filter to apply to the operation.
33
+ # @param top [Integer] The maximum number of resources to return from the
34
+ # operation.
35
+ # @param orderby [String] The ordering expression for the results, using OData
36
+ # notation.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [Array<Disk>] operation results.
41
+ #
42
+ def list(resource_group_name, lab_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
43
+ first_page = list_as_lazy(resource_group_name, lab_name, user_name, expand, filter, top, orderby, custom_headers)
44
+ first_page.get_all_items
45
+ end
46
+
47
+ #
48
+ # List disks in a given user profile.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group.
51
+ # @param lab_name [String] The name of the lab.
52
+ # @param user_name [String] The name of the user profile.
53
+ # @param expand [String] Specify the $expand query. Example:
54
+ # 'properties($select=diskType)'
55
+ # @param filter [String] The filter to apply to the operation.
56
+ # @param top [Integer] The maximum number of resources to return from the
57
+ # operation.
58
+ # @param orderby [String] The ordering expression for the results, using OData
59
+ # notation.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
+ #
65
+ def list_with_http_info(resource_group_name, lab_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
66
+ list_async(resource_group_name, lab_name, user_name, expand, filter, top, orderby, custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # List disks in a given user profile.
71
+ #
72
+ # @param resource_group_name [String] The name of the resource group.
73
+ # @param lab_name [String] The name of the lab.
74
+ # @param user_name [String] The name of the user profile.
75
+ # @param expand [String] Specify the $expand query. Example:
76
+ # 'properties($select=diskType)'
77
+ # @param filter [String] The filter to apply to the operation.
78
+ # @param top [Integer] The maximum number of resources to return from the
79
+ # operation.
80
+ # @param orderby [String] The ordering expression for the results, using OData
81
+ # notation.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def list_async(resource_group_name, lab_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
90
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
91
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
92
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
93
+
94
+
95
+ request_headers = {}
96
+
97
+ # Set Headers
98
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
99
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
100
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks'
101
+
102
+ request_url = @base_url || @client.base_url
103
+
104
+ options = {
105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
106
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name},
107
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
108
+ headers: request_headers.merge(custom_headers || {}),
109
+ base_url: request_url
110
+ }
111
+ promise = @client.make_request_async(:get, path_template, options)
112
+
113
+ promise = promise.then do |result|
114
+ http_response = result.response
115
+ status_code = http_response.status
116
+ response_content = http_response.body
117
+ unless status_code == 200
118
+ error_model = JSON.load(response_content)
119
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
120
+ end
121
+
122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
123
+ # Deserialize Response
124
+ if status_code == 200
125
+ begin
126
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
127
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationDisk.mapper()
128
+ result.body = @client.deserialize(result_mapper, parsed_response)
129
+ rescue Exception => e
130
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
131
+ end
132
+ end
133
+
134
+ result
135
+ end
136
+
137
+ promise.execute
138
+ end
139
+
140
+ #
141
+ # Get disk.
142
+ #
143
+ # @param resource_group_name [String] The name of the resource group.
144
+ # @param lab_name [String] The name of the lab.
145
+ # @param user_name [String] The name of the user profile.
146
+ # @param name [String] The name of the disk.
147
+ # @param expand [String] Specify the $expand query. Example:
148
+ # 'properties($select=diskType)'
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [Disk] operation results.
153
+ #
154
+ def get(resource_group_name, lab_name, user_name, name, expand = nil, custom_headers = nil)
155
+ response = get_async(resource_group_name, lab_name, user_name, name, expand, custom_headers).value!
156
+ response.body unless response.nil?
157
+ end
158
+
159
+ #
160
+ # Get disk.
161
+ #
162
+ # @param resource_group_name [String] The name of the resource group.
163
+ # @param lab_name [String] The name of the lab.
164
+ # @param user_name [String] The name of the user profile.
165
+ # @param name [String] The name of the disk.
166
+ # @param expand [String] Specify the $expand query. Example:
167
+ # 'properties($select=diskType)'
168
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
169
+ # will be added to the HTTP request.
170
+ #
171
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
172
+ #
173
+ def get_with_http_info(resource_group_name, lab_name, user_name, name, expand = nil, custom_headers = nil)
174
+ get_async(resource_group_name, lab_name, user_name, name, expand, custom_headers).value!
175
+ end
176
+
177
+ #
178
+ # Get disk.
179
+ #
180
+ # @param resource_group_name [String] The name of the resource group.
181
+ # @param lab_name [String] The name of the lab.
182
+ # @param user_name [String] The name of the user profile.
183
+ # @param name [String] The name of the disk.
184
+ # @param expand [String] Specify the $expand query. Example:
185
+ # 'properties($select=diskType)'
186
+ # @param [Hash{String => String}] A hash of custom headers that will be added
187
+ # to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
190
+ #
191
+ def get_async(resource_group_name, lab_name, user_name, name, expand = nil, custom_headers = nil)
192
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
193
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
194
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
195
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
196
+ fail ArgumentError, 'name is nil' if name.nil?
197
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
198
+
199
+
200
+ request_headers = {}
201
+
202
+ # Set Headers
203
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
204
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
205
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}'
206
+
207
+ request_url = @base_url || @client.base_url
208
+
209
+ options = {
210
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
211
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
212
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
213
+ headers: request_headers.merge(custom_headers || {}),
214
+ base_url: request_url
215
+ }
216
+ promise = @client.make_request_async(:get, path_template, options)
217
+
218
+ promise = promise.then do |result|
219
+ http_response = result.response
220
+ status_code = http_response.status
221
+ response_content = http_response.body
222
+ unless status_code == 200
223
+ error_model = JSON.load(response_content)
224
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
225
+ end
226
+
227
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
228
+ # Deserialize Response
229
+ if status_code == 200
230
+ begin
231
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
232
+ result_mapper = Azure::ARM::DevTestLabs::Models::Disk.mapper()
233
+ result.body = @client.deserialize(result_mapper, parsed_response)
234
+ rescue Exception => e
235
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
236
+ end
237
+ end
238
+
239
+ result
240
+ end
241
+
242
+ promise.execute
243
+ end
244
+
245
+ #
246
+ # Create or replace an existing disk. This operation can take a while to
247
+ # complete.
248
+ #
249
+ # @param resource_group_name [String] The name of the resource group.
250
+ # @param lab_name [String] The name of the lab.
251
+ # @param user_name [String] The name of the user profile.
252
+ # @param name [String] The name of the disk.
253
+ # @param disk [Disk] A Disk.
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ # @return [Disk] operation results.
258
+ #
259
+ def create_or_update(resource_group_name, lab_name, user_name, name, disk, custom_headers = nil)
260
+ response = create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers).value!
261
+ response.body unless response.nil?
262
+ end
263
+
264
+ #
265
+ # @param resource_group_name [String] The name of the resource group.
266
+ # @param lab_name [String] The name of the lab.
267
+ # @param user_name [String] The name of the user profile.
268
+ # @param name [String] The name of the disk.
269
+ # @param disk [Disk] A Disk.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [Concurrent::Promise] promise which provides async access to http
274
+ # response.
275
+ #
276
+ def create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers = nil)
277
+ # Send request
278
+ promise = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers)
279
+
280
+ promise = promise.then do |response|
281
+ # Defining deserialization method.
282
+ deserialize_method = lambda do |parsed_response|
283
+ result_mapper = Azure::ARM::DevTestLabs::Models::Disk.mapper()
284
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
285
+ end
286
+
287
+ # Waiting for response.
288
+ @client.get_long_running_operation_result(response, deserialize_method)
289
+ end
290
+
291
+ promise
292
+ end
293
+
294
+ #
295
+ # Delete disk. This operation can take a while to complete.
296
+ #
297
+ # @param resource_group_name [String] The name of the resource group.
298
+ # @param lab_name [String] The name of the lab.
299
+ # @param user_name [String] The name of the user profile.
300
+ # @param name [String] The name of the disk.
301
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
302
+ # will be added to the HTTP request.
303
+ #
304
+ def delete(resource_group_name, lab_name, user_name, name, custom_headers = nil)
305
+ response = delete_async(resource_group_name, lab_name, user_name, name, custom_headers).value!
306
+ nil
307
+ end
308
+
309
+ #
310
+ # @param resource_group_name [String] The name of the resource group.
311
+ # @param lab_name [String] The name of the lab.
312
+ # @param user_name [String] The name of the user profile.
313
+ # @param name [String] The name of the disk.
314
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
315
+ # will be added to the HTTP request.
316
+ #
317
+ # @return [Concurrent::Promise] promise which provides async access to http
318
+ # response.
319
+ #
320
+ def delete_async(resource_group_name, lab_name, user_name, name, custom_headers = nil)
321
+ # Send request
322
+ promise = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers)
323
+
324
+ promise = promise.then do |response|
325
+ # Defining deserialization method.
326
+ deserialize_method = lambda do |parsed_response|
327
+ end
328
+
329
+ # Waiting for response.
330
+ @client.get_long_running_operation_result(response, deserialize_method)
331
+ end
332
+
333
+ promise
334
+ end
335
+
336
+ #
337
+ # Attach and create the lease of the disk to the virtual machine. This
338
+ # operation can take a while to complete.
339
+ #
340
+ # @param resource_group_name [String] The name of the resource group.
341
+ # @param lab_name [String] The name of the lab.
342
+ # @param user_name [String] The name of the user profile.
343
+ # @param name [String] The name of the disk.
344
+ # @param attach_disk_properties [AttachDiskProperties] Properties of the disk
345
+ # to attach.
346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
+ # will be added to the HTTP request.
348
+ #
349
+ def attach(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers = nil)
350
+ response = attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers).value!
351
+ nil
352
+ end
353
+
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group.
356
+ # @param lab_name [String] The name of the lab.
357
+ # @param user_name [String] The name of the user profile.
358
+ # @param name [String] The name of the disk.
359
+ # @param attach_disk_properties [AttachDiskProperties] Properties of the disk
360
+ # to attach.
361
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
362
+ # will be added to the HTTP request.
363
+ #
364
+ # @return [Concurrent::Promise] promise which provides async access to http
365
+ # response.
366
+ #
367
+ def attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers = nil)
368
+ # Send request
369
+ promise = begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers)
370
+
371
+ promise = promise.then do |response|
372
+ # Defining deserialization method.
373
+ deserialize_method = lambda do |parsed_response|
374
+ end
375
+
376
+ # Waiting for response.
377
+ @client.get_long_running_operation_result(response, deserialize_method)
378
+ end
379
+
380
+ promise
381
+ end
382
+
383
+ #
384
+ # Detach and break the lease of the disk attached to the virtual machine. This
385
+ # operation can take a while to complete.
386
+ #
387
+ # @param resource_group_name [String] The name of the resource group.
388
+ # @param lab_name [String] The name of the lab.
389
+ # @param user_name [String] The name of the user profile.
390
+ # @param name [String] The name of the disk.
391
+ # @param detach_disk_properties [DetachDiskProperties] Properties of the disk
392
+ # to detach.
393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
394
+ # will be added to the HTTP request.
395
+ #
396
+ def detach(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers = nil)
397
+ response = detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers).value!
398
+ nil
399
+ end
400
+
401
+ #
402
+ # @param resource_group_name [String] The name of the resource group.
403
+ # @param lab_name [String] The name of the lab.
404
+ # @param user_name [String] The name of the user profile.
405
+ # @param name [String] The name of the disk.
406
+ # @param detach_disk_properties [DetachDiskProperties] Properties of the disk
407
+ # to detach.
408
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
409
+ # will be added to the HTTP request.
410
+ #
411
+ # @return [Concurrent::Promise] promise which provides async access to http
412
+ # response.
413
+ #
414
+ def detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers = nil)
415
+ # Send request
416
+ promise = begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers)
417
+
418
+ promise = promise.then do |response|
419
+ # Defining deserialization method.
420
+ deserialize_method = lambda do |parsed_response|
421
+ end
422
+
423
+ # Waiting for response.
424
+ @client.get_long_running_operation_result(response, deserialize_method)
425
+ end
426
+
427
+ promise
428
+ end
429
+
430
+ #
431
+ # Create or replace an existing disk. This operation can take a while to
432
+ # complete.
433
+ #
434
+ # @param resource_group_name [String] The name of the resource group.
435
+ # @param lab_name [String] The name of the lab.
436
+ # @param user_name [String] The name of the user profile.
437
+ # @param name [String] The name of the disk.
438
+ # @param disk [Disk] A Disk.
439
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
440
+ # will be added to the HTTP request.
441
+ #
442
+ # @return [Disk] operation results.
443
+ #
444
+ def begin_create_or_update(resource_group_name, lab_name, user_name, name, disk, custom_headers = nil)
445
+ response = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers).value!
446
+ response.body unless response.nil?
447
+ end
448
+
449
+ #
450
+ # Create or replace an existing disk. This operation can take a while to
451
+ # complete.
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group.
454
+ # @param lab_name [String] The name of the lab.
455
+ # @param user_name [String] The name of the user profile.
456
+ # @param name [String] The name of the disk.
457
+ # @param disk [Disk] A Disk.
458
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
459
+ # will be added to the HTTP request.
460
+ #
461
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
462
+ #
463
+ def begin_create_or_update_with_http_info(resource_group_name, lab_name, user_name, name, disk, custom_headers = nil)
464
+ begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers).value!
465
+ end
466
+
467
+ #
468
+ # Create or replace an existing disk. This operation can take a while to
469
+ # complete.
470
+ #
471
+ # @param resource_group_name [String] The name of the resource group.
472
+ # @param lab_name [String] The name of the lab.
473
+ # @param user_name [String] The name of the user profile.
474
+ # @param name [String] The name of the disk.
475
+ # @param disk [Disk] A Disk.
476
+ # @param [Hash{String => String}] A hash of custom headers that will be added
477
+ # to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
480
+ #
481
+ def begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers = nil)
482
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
483
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
484
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
485
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
486
+ fail ArgumentError, 'name is nil' if name.nil?
487
+ fail ArgumentError, 'disk is nil' if disk.nil?
488
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
489
+
490
+
491
+ request_headers = {}
492
+
493
+ # Set Headers
494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
496
+
497
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
498
+
499
+ # Serialize Request
500
+ request_mapper = Azure::ARM::DevTestLabs::Models::Disk.mapper()
501
+ request_content = @client.serialize(request_mapper, disk)
502
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
503
+
504
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}'
505
+
506
+ request_url = @base_url || @client.base_url
507
+
508
+ options = {
509
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
510
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
511
+ query_params: {'api-version' => @client.api_version},
512
+ body: request_content,
513
+ headers: request_headers.merge(custom_headers || {}),
514
+ base_url: request_url
515
+ }
516
+ promise = @client.make_request_async(:put, path_template, options)
517
+
518
+ promise = promise.then do |result|
519
+ http_response = result.response
520
+ status_code = http_response.status
521
+ response_content = http_response.body
522
+ unless status_code == 200 || status_code == 201
523
+ error_model = JSON.load(response_content)
524
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
525
+ end
526
+
527
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
528
+ # Deserialize Response
529
+ if status_code == 200
530
+ begin
531
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
532
+ result_mapper = Azure::ARM::DevTestLabs::Models::Disk.mapper()
533
+ result.body = @client.deserialize(result_mapper, parsed_response)
534
+ rescue Exception => e
535
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
536
+ end
537
+ end
538
+ # Deserialize Response
539
+ if status_code == 201
540
+ begin
541
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
542
+ result_mapper = Azure::ARM::DevTestLabs::Models::Disk.mapper()
543
+ result.body = @client.deserialize(result_mapper, parsed_response)
544
+ rescue Exception => e
545
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
546
+ end
547
+ end
548
+
549
+ result
550
+ end
551
+
552
+ promise.execute
553
+ end
554
+
555
+ #
556
+ # Delete disk. This operation can take a while to complete.
557
+ #
558
+ # @param resource_group_name [String] The name of the resource group.
559
+ # @param lab_name [String] The name of the lab.
560
+ # @param user_name [String] The name of the user profile.
561
+ # @param name [String] The name of the disk.
562
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
+ # will be added to the HTTP request.
564
+ #
565
+ #
566
+ def begin_delete(resource_group_name, lab_name, user_name, name, custom_headers = nil)
567
+ response = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers).value!
568
+ nil
569
+ end
570
+
571
+ #
572
+ # Delete disk. This operation can take a while to complete.
573
+ #
574
+ # @param resource_group_name [String] The name of the resource group.
575
+ # @param lab_name [String] The name of the lab.
576
+ # @param user_name [String] The name of the user profile.
577
+ # @param name [String] The name of the disk.
578
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
579
+ # will be added to the HTTP request.
580
+ #
581
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
582
+ #
583
+ def begin_delete_with_http_info(resource_group_name, lab_name, user_name, name, custom_headers = nil)
584
+ begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers).value!
585
+ end
586
+
587
+ #
588
+ # Delete disk. This operation can take a while to complete.
589
+ #
590
+ # @param resource_group_name [String] The name of the resource group.
591
+ # @param lab_name [String] The name of the lab.
592
+ # @param user_name [String] The name of the user profile.
593
+ # @param name [String] The name of the disk.
594
+ # @param [Hash{String => String}] A hash of custom headers that will be added
595
+ # to the HTTP request.
596
+ #
597
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
598
+ #
599
+ def begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers = nil)
600
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
601
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
602
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
603
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
604
+ fail ArgumentError, 'name is nil' if name.nil?
605
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
606
+
607
+
608
+ request_headers = {}
609
+
610
+ # Set Headers
611
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
612
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
613
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}'
614
+
615
+ request_url = @base_url || @client.base_url
616
+
617
+ options = {
618
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
619
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
620
+ query_params: {'api-version' => @client.api_version},
621
+ headers: request_headers.merge(custom_headers || {}),
622
+ base_url: request_url
623
+ }
624
+ promise = @client.make_request_async(:delete, path_template, options)
625
+
626
+ promise = promise.then do |result|
627
+ http_response = result.response
628
+ status_code = http_response.status
629
+ response_content = http_response.body
630
+ unless status_code == 202 || status_code == 204
631
+ error_model = JSON.load(response_content)
632
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
633
+ end
634
+
635
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
636
+
637
+ result
638
+ end
639
+
640
+ promise.execute
641
+ end
642
+
643
+ #
644
+ # Attach and create the lease of the disk to the virtual machine. This
645
+ # operation can take a while to complete.
646
+ #
647
+ # @param resource_group_name [String] The name of the resource group.
648
+ # @param lab_name [String] The name of the lab.
649
+ # @param user_name [String] The name of the user profile.
650
+ # @param name [String] The name of the disk.
651
+ # @param attach_disk_properties [AttachDiskProperties] Properties of the disk
652
+ # to attach.
653
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
654
+ # will be added to the HTTP request.
655
+ #
656
+ #
657
+ def begin_attach(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers = nil)
658
+ response = begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers).value!
659
+ nil
660
+ end
661
+
662
+ #
663
+ # Attach and create the lease of the disk to the virtual machine. This
664
+ # operation can take a while to complete.
665
+ #
666
+ # @param resource_group_name [String] The name of the resource group.
667
+ # @param lab_name [String] The name of the lab.
668
+ # @param user_name [String] The name of the user profile.
669
+ # @param name [String] The name of the disk.
670
+ # @param attach_disk_properties [AttachDiskProperties] Properties of the disk
671
+ # to attach.
672
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
673
+ # will be added to the HTTP request.
674
+ #
675
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
676
+ #
677
+ def begin_attach_with_http_info(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers = nil)
678
+ begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers).value!
679
+ end
680
+
681
+ #
682
+ # Attach and create the lease of the disk to the virtual machine. This
683
+ # operation can take a while to complete.
684
+ #
685
+ # @param resource_group_name [String] The name of the resource group.
686
+ # @param lab_name [String] The name of the lab.
687
+ # @param user_name [String] The name of the user profile.
688
+ # @param name [String] The name of the disk.
689
+ # @param attach_disk_properties [AttachDiskProperties] Properties of the disk
690
+ # to attach.
691
+ # @param [Hash{String => String}] A hash of custom headers that will be added
692
+ # to the HTTP request.
693
+ #
694
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
695
+ #
696
+ def begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers = nil)
697
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
698
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
699
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
700
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
701
+ fail ArgumentError, 'name is nil' if name.nil?
702
+ fail ArgumentError, 'attach_disk_properties is nil' if attach_disk_properties.nil?
703
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
704
+
705
+
706
+ request_headers = {}
707
+
708
+ # Set Headers
709
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
710
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
711
+
712
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
713
+
714
+ # Serialize Request
715
+ request_mapper = Azure::ARM::DevTestLabs::Models::AttachDiskProperties.mapper()
716
+ request_content = @client.serialize(request_mapper, attach_disk_properties)
717
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
718
+
719
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/attach'
720
+
721
+ request_url = @base_url || @client.base_url
722
+
723
+ options = {
724
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
725
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
726
+ query_params: {'api-version' => @client.api_version},
727
+ body: request_content,
728
+ headers: request_headers.merge(custom_headers || {}),
729
+ base_url: request_url
730
+ }
731
+ promise = @client.make_request_async(:post, path_template, options)
732
+
733
+ promise = promise.then do |result|
734
+ http_response = result.response
735
+ status_code = http_response.status
736
+ response_content = http_response.body
737
+ unless status_code == 200 || status_code == 202
738
+ error_model = JSON.load(response_content)
739
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
740
+ end
741
+
742
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
743
+
744
+ result
745
+ end
746
+
747
+ promise.execute
748
+ end
749
+
750
+ #
751
+ # Detach and break the lease of the disk attached to the virtual machine. This
752
+ # operation can take a while to complete.
753
+ #
754
+ # @param resource_group_name [String] The name of the resource group.
755
+ # @param lab_name [String] The name of the lab.
756
+ # @param user_name [String] The name of the user profile.
757
+ # @param name [String] The name of the disk.
758
+ # @param detach_disk_properties [DetachDiskProperties] Properties of the disk
759
+ # to detach.
760
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
761
+ # will be added to the HTTP request.
762
+ #
763
+ #
764
+ def begin_detach(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers = nil)
765
+ response = begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers).value!
766
+ nil
767
+ end
768
+
769
+ #
770
+ # Detach and break the lease of the disk attached to the virtual machine. This
771
+ # operation can take a while to complete.
772
+ #
773
+ # @param resource_group_name [String] The name of the resource group.
774
+ # @param lab_name [String] The name of the lab.
775
+ # @param user_name [String] The name of the user profile.
776
+ # @param name [String] The name of the disk.
777
+ # @param detach_disk_properties [DetachDiskProperties] Properties of the disk
778
+ # to detach.
779
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
780
+ # will be added to the HTTP request.
781
+ #
782
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
783
+ #
784
+ def begin_detach_with_http_info(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers = nil)
785
+ begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers).value!
786
+ end
787
+
788
+ #
789
+ # Detach and break the lease of the disk attached to the virtual machine. This
790
+ # operation can take a while to complete.
791
+ #
792
+ # @param resource_group_name [String] The name of the resource group.
793
+ # @param lab_name [String] The name of the lab.
794
+ # @param user_name [String] The name of the user profile.
795
+ # @param name [String] The name of the disk.
796
+ # @param detach_disk_properties [DetachDiskProperties] Properties of the disk
797
+ # to detach.
798
+ # @param [Hash{String => String}] A hash of custom headers that will be added
799
+ # to the HTTP request.
800
+ #
801
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
802
+ #
803
+ def begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers = nil)
804
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
805
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
806
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
807
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
808
+ fail ArgumentError, 'name is nil' if name.nil?
809
+ fail ArgumentError, 'detach_disk_properties is nil' if detach_disk_properties.nil?
810
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
811
+
812
+
813
+ request_headers = {}
814
+
815
+ # Set Headers
816
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
817
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
818
+
819
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
820
+
821
+ # Serialize Request
822
+ request_mapper = Azure::ARM::DevTestLabs::Models::DetachDiskProperties.mapper()
823
+ request_content = @client.serialize(request_mapper, detach_disk_properties)
824
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
825
+
826
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/detach'
827
+
828
+ request_url = @base_url || @client.base_url
829
+
830
+ options = {
831
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
832
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
833
+ query_params: {'api-version' => @client.api_version},
834
+ body: request_content,
835
+ headers: request_headers.merge(custom_headers || {}),
836
+ base_url: request_url
837
+ }
838
+ promise = @client.make_request_async(:post, path_template, options)
839
+
840
+ promise = promise.then do |result|
841
+ http_response = result.response
842
+ status_code = http_response.status
843
+ response_content = http_response.body
844
+ unless status_code == 200 || status_code == 202
845
+ error_model = JSON.load(response_content)
846
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
847
+ end
848
+
849
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
850
+
851
+ result
852
+ end
853
+
854
+ promise.execute
855
+ end
856
+
857
+ #
858
+ # List disks in a given user profile.
859
+ #
860
+ # @param next_page_link [String] The NextLink from the previous successful call
861
+ # to List operation.
862
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
863
+ # will be added to the HTTP request.
864
+ #
865
+ # @return [ResponseWithContinuationDisk] operation results.
866
+ #
867
+ def list_next(next_page_link, custom_headers = nil)
868
+ response = list_next_async(next_page_link, custom_headers).value!
869
+ response.body unless response.nil?
870
+ end
871
+
872
+ #
873
+ # List disks in a given user profile.
874
+ #
875
+ # @param next_page_link [String] The NextLink from the previous successful call
876
+ # to List operation.
877
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
878
+ # will be added to the HTTP request.
879
+ #
880
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
881
+ #
882
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
883
+ list_next_async(next_page_link, custom_headers).value!
884
+ end
885
+
886
+ #
887
+ # List disks in a given user profile.
888
+ #
889
+ # @param next_page_link [String] The NextLink from the previous successful call
890
+ # to List operation.
891
+ # @param [Hash{String => String}] A hash of custom headers that will be added
892
+ # to the HTTP request.
893
+ #
894
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
895
+ #
896
+ def list_next_async(next_page_link, custom_headers = nil)
897
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
898
+
899
+
900
+ request_headers = {}
901
+
902
+ # Set Headers
903
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
904
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
905
+ path_template = '{nextLink}'
906
+
907
+ request_url = @base_url || @client.base_url
908
+
909
+ options = {
910
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
911
+ skip_encoding_path_params: {'nextLink' => next_page_link},
912
+ headers: request_headers.merge(custom_headers || {}),
913
+ base_url: request_url
914
+ }
915
+ promise = @client.make_request_async(:get, path_template, options)
916
+
917
+ promise = promise.then do |result|
918
+ http_response = result.response
919
+ status_code = http_response.status
920
+ response_content = http_response.body
921
+ unless status_code == 200
922
+ error_model = JSON.load(response_content)
923
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
924
+ end
925
+
926
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
927
+ # Deserialize Response
928
+ if status_code == 200
929
+ begin
930
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
931
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationDisk.mapper()
932
+ result.body = @client.deserialize(result_mapper, parsed_response)
933
+ rescue Exception => e
934
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
935
+ end
936
+ end
937
+
938
+ result
939
+ end
940
+
941
+ promise.execute
942
+ end
943
+
944
+ #
945
+ # List disks in a given user profile.
946
+ #
947
+ # @param resource_group_name [String] The name of the resource group.
948
+ # @param lab_name [String] The name of the lab.
949
+ # @param user_name [String] The name of the user profile.
950
+ # @param expand [String] Specify the $expand query. Example:
951
+ # 'properties($select=diskType)'
952
+ # @param filter [String] The filter to apply to the operation.
953
+ # @param top [Integer] The maximum number of resources to return from the
954
+ # operation.
955
+ # @param orderby [String] The ordering expression for the results, using OData
956
+ # notation.
957
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
958
+ # will be added to the HTTP request.
959
+ #
960
+ # @return [ResponseWithContinuationDisk] which provide lazy access to pages of
961
+ # the response.
962
+ #
963
+ def list_as_lazy(resource_group_name, lab_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
964
+ response = list_async(resource_group_name, lab_name, user_name, expand, filter, top, orderby, custom_headers).value!
965
+ unless response.nil?
966
+ page = response.body
967
+ page.next_method = Proc.new do |next_page_link|
968
+ list_next_async(next_page_link, custom_headers)
969
+ end
970
+ page
971
+ end
972
+ end
973
+
974
+ end
975
+ end