azure_mgmt_compute 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_compute.gemspec +4 -4
  3. data/lib/azure_mgmt_compute.rb +3 -138
  4. data/lib/generated/azure_mgmt_compute.rb +128 -0
  5. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/availability_sets.rb +24 -22
  6. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/compute_management_client.rb +12 -12
  7. data/lib/generated/azure_mgmt_compute/models/additional_unattend_content.rb +88 -0
  8. data/lib/generated/azure_mgmt_compute/models/api_entity_reference.rb +45 -0
  9. data/lib/generated/azure_mgmt_compute/models/api_error.rb +93 -0
  10. data/lib/generated/azure_mgmt_compute/models/api_error_base.rb +64 -0
  11. data/lib/generated/azure_mgmt_compute/models/availability_set.rb +136 -0
  12. data/lib/generated/azure_mgmt_compute/models/availability_set_list_result.rb +52 -0
  13. data/lib/generated/azure_mgmt_compute/models/boot_diagnostics.rb +56 -0
  14. data/lib/generated/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +54 -0
  15. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/caching_types.rb +0 -0
  16. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/component_names.rb +0 -0
  17. data/lib/generated/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +44 -0
  18. data/lib/generated/azure_mgmt_compute/models/data_disk.rb +114 -0
  19. data/lib/generated/azure_mgmt_compute/models/data_disk_image.rb +48 -0
  20. data/lib/generated/azure_mgmt_compute/models/diagnostics_profile.rb +45 -0
  21. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/disk_create_option_types.rb +0 -0
  22. data/lib/generated/azure_mgmt_compute/models/disk_encryption_settings.rb +69 -0
  23. data/lib/generated/azure_mgmt_compute/models/disk_instance_view.rb +62 -0
  24. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/hardware_profile.rb +20 -35
  25. data/lib/generated/azure_mgmt_compute/models/image_reference.rb +76 -0
  26. data/lib/generated/azure_mgmt_compute/models/inner_error.rb +54 -0
  27. data/lib/generated/azure_mgmt_compute/models/instance_view_status.rb +87 -0
  28. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/instance_view_types.rb +0 -0
  29. data/lib/generated/azure_mgmt_compute/models/key_vault_key_reference.rb +56 -0
  30. data/lib/generated/azure_mgmt_compute/models/key_vault_secret_reference.rb +56 -0
  31. data/lib/generated/azure_mgmt_compute/models/linux_configuration.rb +56 -0
  32. data/lib/generated/azure_mgmt_compute/models/list_usages_result.rb +95 -0
  33. data/lib/generated/azure_mgmt_compute/models/network_interface_reference.rb +51 -0
  34. data/lib/generated/azure_mgmt_compute/models/network_profile.rb +52 -0
  35. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/operating_system_types.rb +0 -0
  36. data/lib/generated/azure_mgmt_compute/models/osdisk.rb +127 -0
  37. data/lib/generated/azure_mgmt_compute/models/osdisk_image.rb +46 -0
  38. data/lib/generated/azure_mgmt_compute/models/osprofile.rb +116 -0
  39. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/pass_names.rb +0 -0
  40. data/lib/generated/azure_mgmt_compute/models/plan.rb +74 -0
  41. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/protocol_types.rb +0 -0
  42. data/lib/generated/azure_mgmt_compute/models/purchase_plan.rb +65 -0
  43. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/setting_names.rb +0 -0
  44. data/lib/generated/azure_mgmt_compute/models/sku.rb +64 -0
  45. data/lib/generated/azure_mgmt_compute/models/ssh_configuration.rb +53 -0
  46. data/lib/generated/azure_mgmt_compute/models/ssh_public_key.rb +59 -0
  47. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/status_level_types.rb +0 -0
  48. data/lib/generated/azure_mgmt_compute/models/storage_profile.rb +74 -0
  49. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/upgrade_mode.rb +0 -0
  50. data/lib/generated/azure_mgmt_compute/models/upgrade_policy.rb +46 -0
  51. data/lib/generated/azure_mgmt_compute/models/usage.rb +78 -0
  52. data/lib/generated/azure_mgmt_compute/models/usage_name.rb +54 -0
  53. data/lib/generated/azure_mgmt_compute/models/vault_certificate.rb +57 -0
  54. data/lib/generated/azure_mgmt_compute/models/vault_secret_group.rb +65 -0
  55. data/lib/generated/azure_mgmt_compute/models/virtual_hard_disk.rb +45 -0
  56. data/lib/generated/azure_mgmt_compute/models/virtual_machine.rb +224 -0
  57. data/lib/generated/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +81 -0
  58. data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +65 -0
  59. data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_result.rb +51 -0
  60. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension.rb +175 -0
  61. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +67 -0
  62. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +134 -0
  63. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +101 -0
  64. data/lib/generated/azure_mgmt_compute/models/virtual_machine_image.rb +109 -0
  65. data/lib/generated/azure_mgmt_compute/models/virtual_machine_image_resource.rb +78 -0
  66. data/lib/generated/azure_mgmt_compute/models/virtual_machine_instance_view.rb +142 -0
  67. data/lib/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +94 -0
  68. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +135 -0
  69. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +124 -0
  70. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +53 -0
  71. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +85 -0
  72. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +56 -0
  73. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +117 -0
  74. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +95 -0
  75. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +97 -0
  76. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +97 -0
  77. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +82 -0
  78. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +53 -0
  79. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +111 -0
  80. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +116 -0
  81. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +70 -0
  82. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +80 -0
  83. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/virtual_machine_scale_set_sku_scale_type.rb +0 -0
  84. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +56 -0
  85. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +248 -0
  86. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +66 -0
  87. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +51 -0
  88. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +52 -0
  89. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +142 -0
  90. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +96 -0
  91. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +82 -0
  92. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size.rb +95 -0
  93. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +52 -0
  94. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/virtual_machine_size_types.rb +0 -0
  95. data/lib/generated/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +58 -0
  96. data/lib/generated/azure_mgmt_compute/models/win_rmconfiguration.rb +53 -0
  97. data/lib/generated/azure_mgmt_compute/models/win_rmlistener.rb +58 -0
  98. data/lib/generated/azure_mgmt_compute/models/windows_configuration.rb +98 -0
  99. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/module_definition.rb +0 -0
  100. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/usage_operations.rb +32 -11
  101. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/version.rb +1 -1
  102. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_extension_images.rb +40 -26
  103. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_extensions.rb +59 -31
  104. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_images.rb +76 -48
  105. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_scale_set_vms.rb +169 -41
  106. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_scale_sets.rb +341 -125
  107. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_sizes.rb +4 -4
  108. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machines.rb +340 -84
  109. metadata +126 -142
  110. data/lib/azure_mgmt_compute/models/additional_unattend_content.rb +0 -105
  111. data/lib/azure_mgmt_compute/models/api_entity_reference.rb +0 -57
  112. data/lib/azure_mgmt_compute/models/api_error.rb +0 -119
  113. data/lib/azure_mgmt_compute/models/api_error_base.rb +0 -74
  114. data/lib/azure_mgmt_compute/models/availability_set.rb +0 -92
  115. data/lib/azure_mgmt_compute/models/availability_set_list_result.rb +0 -77
  116. data/lib/azure_mgmt_compute/models/availability_set_properties.rb +0 -128
  117. data/lib/azure_mgmt_compute/models/boot_diagnostics.rb +0 -67
  118. data/lib/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +0 -65
  119. data/lib/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +0 -56
  120. data/lib/azure_mgmt_compute/models/data_disk.rb +0 -143
  121. data/lib/azure_mgmt_compute/models/data_disk_image.rb +0 -60
  122. data/lib/azure_mgmt_compute/models/diagnostics_profile.rb +0 -62
  123. data/lib/azure_mgmt_compute/models/disk_encryption_settings.rb +0 -90
  124. data/lib/azure_mgmt_compute/models/disk_instance_view.rb +0 -86
  125. data/lib/azure_mgmt_compute/models/image_reference.rb +0 -85
  126. data/lib/azure_mgmt_compute/models/inner_error.rb +0 -66
  127. data/lib/azure_mgmt_compute/models/instance_view_status.rb +0 -100
  128. data/lib/azure_mgmt_compute/models/key_vault_key_reference.rb +0 -74
  129. data/lib/azure_mgmt_compute/models/key_vault_secret_reference.rb +0 -75
  130. data/lib/azure_mgmt_compute/models/linux_configuration.rb +0 -73
  131. data/lib/azure_mgmt_compute/models/list_usages_result.rb +0 -76
  132. data/lib/azure_mgmt_compute/models/network_interface_reference.rb +0 -68
  133. data/lib/azure_mgmt_compute/models/network_interface_reference_properties.rb +0 -57
  134. data/lib/azure_mgmt_compute/models/network_profile.rb +0 -77
  135. data/lib/azure_mgmt_compute/models/osdisk.rb +0 -163
  136. data/lib/azure_mgmt_compute/models/osdisk_image.rb +0 -61
  137. data/lib/azure_mgmt_compute/models/osprofile.rb +0 -147
  138. data/lib/azure_mgmt_compute/models/plan.rb +0 -83
  139. data/lib/azure_mgmt_compute/models/purchase_plan.rb +0 -77
  140. data/lib/azure_mgmt_compute/models/sku.rb +0 -75
  141. data/lib/azure_mgmt_compute/models/ssh_configuration.rb +0 -77
  142. data/lib/azure_mgmt_compute/models/ssh_public_key.rb +0 -70
  143. data/lib/azure_mgmt_compute/models/storage_profile.rb +0 -108
  144. data/lib/azure_mgmt_compute/models/upgrade_policy.rb +0 -60
  145. data/lib/azure_mgmt_compute/models/usage.rb +0 -96
  146. data/lib/azure_mgmt_compute/models/usage_name.rb +0 -66
  147. data/lib/azure_mgmt_compute/models/vault_certificate.rb +0 -68
  148. data/lib/azure_mgmt_compute/models/vault_secret_group.rb +0 -94
  149. data/lib/azure_mgmt_compute/models/virtual_hard_disk.rb +0 -57
  150. data/lib/azure_mgmt_compute/models/virtual_machine.rb +0 -140
  151. data/lib/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +0 -117
  152. data/lib/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +0 -78
  153. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result.rb +0 -68
  154. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result_properties.rb +0 -56
  155. data/lib/azure_mgmt_compute/models/virtual_machine_extension.rb +0 -92
  156. data/lib/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +0 -83
  157. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image.rb +0 -92
  158. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image_properties.rb +0 -102
  159. data/lib/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +0 -137
  160. data/lib/azure_mgmt_compute/models/virtual_machine_extension_properties.rb +0 -141
  161. data/lib/azure_mgmt_compute/models/virtual_machine_image.rb +0 -86
  162. data/lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb +0 -108
  163. data/lib/azure_mgmt_compute/models/virtual_machine_image_resource.rb +0 -83
  164. data/lib/azure_mgmt_compute/models/virtual_machine_instance_view.rb +0 -202
  165. data/lib/azure_mgmt_compute/models/virtual_machine_list_result.rb +0 -87
  166. data/lib/azure_mgmt_compute/models/virtual_machine_properties.rb +0 -189
  167. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set.rb +0 -108
  168. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +0 -77
  169. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +0 -77
  170. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_properties.rb +0 -116
  171. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +0 -125
  172. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +0 -79
  173. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +0 -78
  174. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration_properties.rb +0 -158
  175. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +0 -77
  176. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +0 -77
  177. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +0 -88
  178. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +0 -80
  179. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_properties.rb +0 -89
  180. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +0 -77
  181. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +0 -129
  182. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +0 -147
  183. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_properties.rb +0 -99
  184. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +0 -88
  185. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +0 -90
  186. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +0 -78
  187. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +0 -165
  188. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +0 -87
  189. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +0 -57
  190. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +0 -59
  191. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +0 -202
  192. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +0 -77
  193. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +0 -114
  194. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmproperties.rb +0 -190
  195. data/lib/azure_mgmt_compute/models/virtual_machine_size.rb +0 -109
  196. data/lib/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +0 -77
  197. data/lib/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +0 -68
  198. data/lib/azure_mgmt_compute/models/win_rmconfiguration.rb +0 -77
  199. data/lib/azure_mgmt_compute/models/win_rmlistener.rb +0 -71
  200. data/lib/azure_mgmt_compute/models/windows_configuration.rb +0 -124
@@ -31,26 +31,37 @@ module Azure::ARM::Compute
31
31
  # Set operation.
32
32
  # @param parameters [VirtualMachineScaleSet] Parameters supplied to the Create
33
33
  # Virtual Machine Scale Set operation.
34
- # @param @client.api_version [String] Client Api Version.
35
- # @param @client.subscription_id [String] Gets subscription credentials which
36
- # uniquely identify Microsoft Azure subscription. The subscription ID forms
37
- # part of the URI for every service call.
38
- # @param @client.accept_language [String] Gets or sets the preferred language
39
- # for the response.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [VirtualMachineScaleSet] operation results.
38
+ #
39
+ def create_or_update(resource_group_name, name, parameters, custom_headers = nil)
40
+ response = create_or_update_async(resource_group_name, name, parameters, custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group.
46
+ # @param name [String] Parameters supplied to the Create Virtual Machine Scale
47
+ # Set operation.
48
+ # @param parameters [VirtualMachineScaleSet] Parameters supplied to the Create
49
+ # Virtual Machine Scale Set operation.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
40
52
  #
41
53
  # @return [Concurrent::Promise] promise which provides async access to http
42
54
  # response.
43
55
  #
44
- def create_or_update(resource_group_name, name, parameters, custom_headers = nil)
56
+ def create_or_update_async(resource_group_name, name, parameters, custom_headers = nil)
45
57
  # Send request
46
58
  promise = begin_create_or_update_async(resource_group_name, name, parameters, custom_headers)
47
59
 
48
60
  promise = promise.then do |response|
49
61
  # Defining deserialization method.
50
62
  deserialize_method = lambda do |parsed_response|
51
- unless parsed_response.nil?
52
- parsed_response = VirtualMachineScaleSet.deserialize_object(parsed_response)
53
- end
63
+ result_mapper = VirtualMachineScaleSet.mapper()
64
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
54
65
  end
55
66
 
56
67
  # Waiting for response.
@@ -115,21 +126,23 @@ module Azure::ARM::Compute
115
126
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
116
127
  fail ArgumentError, 'name is nil' if name.nil?
117
128
  fail ArgumentError, 'parameters is nil' if parameters.nil?
118
- parameters.validate unless parameters.nil?
119
129
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
120
130
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
131
+
132
+
121
133
  request_headers = {}
122
134
 
123
135
  # Set Headers
124
136
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
125
137
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
126
138
 
127
- # Serialize Request
128
139
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
129
- unless parameters.nil?
130
- parameters = VirtualMachineScaleSet.serialize_object(parameters)
131
- end
132
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
140
+
141
+ # Serialize Request
142
+ request_mapper = VirtualMachineScaleSet.mapper()
143
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
144
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
145
+
133
146
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}'
134
147
  options = {
135
148
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -161,10 +174,8 @@ module Azure::ARM::Compute
161
174
  if status_code == 200
162
175
  begin
163
176
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
164
- unless parsed_response.nil?
165
- parsed_response = VirtualMachineScaleSet.deserialize_object(parsed_response)
166
- end
167
- result.body = parsed_response
177
+ result_mapper = VirtualMachineScaleSet.mapper()
178
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
168
179
  rescue Exception => e
169
180
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
170
181
  end
@@ -173,10 +184,8 @@ module Azure::ARM::Compute
173
184
  if status_code == 201
174
185
  begin
175
186
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
176
- unless parsed_response.nil?
177
- parsed_response = VirtualMachineScaleSet.deserialize_object(parsed_response)
178
- end
179
- result.body = parsed_response
187
+ result_mapper = VirtualMachineScaleSet.mapper()
188
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
180
189
  rescue Exception => e
181
190
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
182
191
  end
@@ -198,10 +207,26 @@ module Azure::ARM::Compute
198
207
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
199
208
  # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
200
209
  # virtual machine scale set instance IDs.
210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
211
+ # will be added to the HTTP request.
212
+ #
213
+ def deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
214
+ response = deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers).value!
215
+ nil
216
+ end
217
+
218
+ #
219
+ # @param resource_group_name [String] The name of the resource group.
220
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
221
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
222
+ # virtual machine scale set instance IDs.
223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
+ # will be added to the HTTP request.
225
+ #
201
226
  # @return [Concurrent::Promise] promise which provides async access to http
202
227
  # response.
203
228
  #
204
- def deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
229
+ def deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
205
230
  # Send request
206
231
  promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers)
207
232
 
@@ -210,8 +235,8 @@ module Azure::ARM::Compute
210
235
  deserialize_method = lambda do |parsed_response|
211
236
  end
212
237
 
213
- # Waiting for response.
214
- @client.get_long_running_operation_result(response, deserialize_method)
238
+ # Waiting for response.
239
+ @client.get_long_running_operation_result(response, deserialize_method)
215
240
  end
216
241
 
217
242
  promise
@@ -273,21 +298,23 @@ module Azure::ARM::Compute
273
298
  def begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
274
299
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
275
300
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
276
- vm_instance_ids.validate unless vm_instance_ids.nil?
277
301
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
278
302
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
303
+
304
+
279
305
  request_headers = {}
280
306
 
281
307
  # Set Headers
282
308
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
283
309
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
284
310
 
285
- # Serialize Request
286
311
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
287
- unless vm_instance_ids.nil?
288
- vm_instance_ids = VirtualMachineScaleSetVMInstanceIDs.serialize_object(vm_instance_ids)
289
- end
290
- request_content = vm_instance_ids != nil ? JSON.generate(vm_instance_ids, quirks_mode: true) : nil
312
+
313
+ # Serialize Request
314
+ request_mapper = VirtualMachineScaleSetVMInstanceIDs.mapper()
315
+ request_content = @client.serialize(request_mapper, vm_instance_ids, 'vm_instance_ids')
316
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
317
+
291
318
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'
292
319
  options = {
293
320
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -327,10 +354,24 @@ module Azure::ARM::Compute
327
354
  #
328
355
  # @param resource_group_name [String] The name of the resource group.
329
356
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ def delete(resource_group_name, vm_scale_set_name, custom_headers = nil)
361
+ response = delete_async(resource_group_name, vm_scale_set_name, custom_headers).value!
362
+ nil
363
+ end
364
+
365
+ #
366
+ # @param resource_group_name [String] The name of the resource group.
367
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
369
+ # will be added to the HTTP request.
370
+ #
330
371
  # @return [Concurrent::Promise] promise which provides async access to http
331
372
  # response.
332
373
  #
333
- def delete(resource_group_name, vm_scale_set_name, custom_headers = nil)
374
+ def delete_async(resource_group_name, vm_scale_set_name, custom_headers = nil)
334
375
  # Send request
335
376
  promise = begin_delete_async(resource_group_name, vm_scale_set_name, custom_headers)
336
377
 
@@ -339,8 +380,8 @@ module Azure::ARM::Compute
339
380
  deserialize_method = lambda do |parsed_response|
340
381
  end
341
382
 
342
- # Waiting for response.
343
- @client.get_long_running_operation_result(response, deserialize_method)
383
+ # Waiting for response.
384
+ @client.get_long_running_operation_result(response, deserialize_method)
344
385
  end
345
386
 
346
387
  promise
@@ -389,6 +430,8 @@ module Azure::ARM::Compute
389
430
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
390
431
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
391
432
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
433
+
434
+
392
435
  request_headers = {}
393
436
 
394
437
  # Set Headers
@@ -471,6 +514,8 @@ module Azure::ARM::Compute
471
514
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
472
515
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
473
516
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
517
+
518
+
474
519
  request_headers = {}
475
520
 
476
521
  # Set Headers
@@ -506,10 +551,8 @@ module Azure::ARM::Compute
506
551
  if status_code == 200
507
552
  begin
508
553
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
509
- unless parsed_response.nil?
510
- parsed_response = VirtualMachineScaleSet.deserialize_object(parsed_response)
511
- end
512
- result.body = parsed_response
554
+ result_mapper = VirtualMachineScaleSet.mapper()
555
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
513
556
  rescue Exception => e
514
557
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
515
558
  end
@@ -528,10 +571,26 @@ module Azure::ARM::Compute
528
571
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
529
572
  # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] The
530
573
  # list of virtual machine scale set instance IDs.
574
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
575
+ # will be added to the HTTP request.
576
+ #
577
+ def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers = nil)
578
+ response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers).value!
579
+ nil
580
+ end
581
+
582
+ #
583
+ # @param resource_group_name [String] The name of the resource group.
584
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
585
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] The
586
+ # list of virtual machine scale set instance IDs.
587
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
588
+ # will be added to the HTTP request.
589
+ #
531
590
  # @return [Concurrent::Promise] promise which provides async access to http
532
591
  # response.
533
592
  #
534
- def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers = nil)
593
+ def delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers = nil)
535
594
  # Send request
536
595
  promise = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers)
537
596
 
@@ -540,8 +599,8 @@ module Azure::ARM::Compute
540
599
  deserialize_method = lambda do |parsed_response|
541
600
  end
542
601
 
543
- # Waiting for response.
544
- @client.get_long_running_operation_result(response, deserialize_method)
602
+ # Waiting for response.
603
+ @client.get_long_running_operation_result(response, deserialize_method)
545
604
  end
546
605
 
547
606
  promise
@@ -595,21 +654,23 @@ module Azure::ARM::Compute
595
654
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
596
655
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
597
656
  fail ArgumentError, 'vm_instance_ids is nil' if vm_instance_ids.nil?
598
- vm_instance_ids.validate unless vm_instance_ids.nil?
599
657
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
600
658
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
659
+
660
+
601
661
  request_headers = {}
602
662
 
603
663
  # Set Headers
604
664
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
605
665
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
606
666
 
607
- # Serialize Request
608
667
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
609
- unless vm_instance_ids.nil?
610
- vm_instance_ids = VirtualMachineScaleSetVMInstanceRequiredIDs.serialize_object(vm_instance_ids)
611
- end
612
- request_content = vm_instance_ids != nil ? JSON.generate(vm_instance_ids, quirks_mode: true) : nil
668
+
669
+ # Serialize Request
670
+ request_mapper = VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
671
+ request_content = @client.serialize(request_mapper, vm_instance_ids, 'vm_instance_ids')
672
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
673
+
613
674
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'
614
675
  options = {
615
676
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -688,6 +749,8 @@ module Azure::ARM::Compute
688
749
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
689
750
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
690
751
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
752
+
753
+
691
754
  request_headers = {}
692
755
 
693
756
  # Set Headers
@@ -723,10 +786,8 @@ module Azure::ARM::Compute
723
786
  if status_code == 200
724
787
  begin
725
788
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
726
- unless parsed_response.nil?
727
- parsed_response = VirtualMachineScaleSetInstanceView.deserialize_object(parsed_response)
728
- end
729
- result.body = parsed_response
789
+ result_mapper = VirtualMachineScaleSetInstanceView.mapper()
790
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
730
791
  rescue Exception => e
731
792
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
732
793
  end
@@ -745,11 +806,32 @@ module Azure::ARM::Compute
745
806
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
746
807
  # will be added to the HTTP request.
747
808
  #
748
- # @return [VirtualMachineScaleSetListResult] operation results.
809
+ # @return [VirtualMachineScaleSetListResult] which provide lazy access to
810
+ # pages of the response.
749
811
  #
750
- def list(resource_group_name, custom_headers = nil)
812
+ def list_as_lazy(resource_group_name, custom_headers = nil)
751
813
  response = list_async(resource_group_name, custom_headers).value!
752
- response.body unless response.nil?
814
+ unless response.nil?
815
+ page = response.body
816
+ page.next_method = Proc.new do |next_link|
817
+ list_next_async(next_link, custom_headers)
818
+ end
819
+ page
820
+ end
821
+ end
822
+
823
+ #
824
+ # Lists all virtual machine scale sets under a resource group.
825
+ #
826
+ # @param resource_group_name [String] The name of the resource group.
827
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
828
+ # will be added to the HTTP request.
829
+ #
830
+ # @return [Array<VirtualMachineScaleSet>] operation results.
831
+ #
832
+ def list(resource_group_name, custom_headers = nil)
833
+ first_page = list_as_lazy(resource_group_name, custom_headers)
834
+ first_page.get_all_items
753
835
  end
754
836
 
755
837
  #
@@ -778,6 +860,8 @@ module Azure::ARM::Compute
778
860
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
779
861
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
780
862
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
863
+
864
+
781
865
  request_headers = {}
782
866
 
783
867
  # Set Headers
@@ -813,10 +897,8 @@ module Azure::ARM::Compute
813
897
  if status_code == 200
814
898
  begin
815
899
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
816
- unless parsed_response.nil?
817
- parsed_response = VirtualMachineScaleSetListResult.deserialize_object(parsed_response)
818
- end
819
- result.body = parsed_response
900
+ result_mapper = VirtualMachineScaleSetListResult.mapper()
901
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
820
902
  rescue Exception => e
821
903
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
822
904
  end
@@ -837,11 +919,34 @@ module Azure::ARM::Compute
837
919
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
838
920
  # will be added to the HTTP request.
839
921
  #
840
- # @return [VirtualMachineScaleSetListWithLinkResult] operation results.
922
+ # @return [VirtualMachineScaleSetListWithLinkResult] which provide lazy access
923
+ # to pages of the response.
841
924
  #
842
- def list_all(custom_headers = nil)
925
+ def list_all_as_lazy(custom_headers = nil)
843
926
  response = list_all_async(custom_headers).value!
844
- response.body unless response.nil?
927
+ unless response.nil?
928
+ page = response.body
929
+ page.next_method = Proc.new do |next_link|
930
+ list_all_next_async(next_link, custom_headers)
931
+ end
932
+ page
933
+ end
934
+ end
935
+
936
+ #
937
+ # Lists all Virtual Machine Scale Sets in the subscription. Use nextLink
938
+ # property in the response to get the next page of Virtual Machine Scale
939
+ # Sets. Do this till nextLink is not null to fetch all the Virtual Machine
940
+ # Scale Sets.
941
+ #
942
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
943
+ # will be added to the HTTP request.
944
+ #
945
+ # @return [Array<VirtualMachineScaleSet>] operation results.
946
+ #
947
+ def list_all(custom_headers = nil)
948
+ first_page = list_all_as_lazy(custom_headers)
949
+ first_page.get_all_items
845
950
  end
846
951
 
847
952
  #
@@ -873,6 +978,8 @@ module Azure::ARM::Compute
873
978
  def list_all_async(custom_headers = nil)
874
979
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
875
980
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
981
+
982
+
876
983
  request_headers = {}
877
984
 
878
985
  # Set Headers
@@ -908,10 +1015,8 @@ module Azure::ARM::Compute
908
1015
  if status_code == 200
909
1016
  begin
910
1017
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
911
- unless parsed_response.nil?
912
- parsed_response = VirtualMachineScaleSetListWithLinkResult.deserialize_object(parsed_response)
913
- end
914
- result.body = parsed_response
1018
+ result_mapper = VirtualMachineScaleSetListWithLinkResult.mapper()
1019
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
915
1020
  rescue Exception => e
916
1021
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
917
1022
  end
@@ -932,11 +1037,34 @@ module Azure::ARM::Compute
932
1037
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
933
1038
  # will be added to the HTTP request.
934
1039
  #
935
- # @return [VirtualMachineScaleSetListSkusResult] operation results.
1040
+ # @return [VirtualMachineScaleSetListSkusResult] which provide lazy access to
1041
+ # pages of the response.
936
1042
  #
937
- def list_skus(resource_group_name, vm_scale_set_name, custom_headers = nil)
1043
+ def list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers = nil)
938
1044
  response = list_skus_async(resource_group_name, vm_scale_set_name, custom_headers).value!
939
- response.body unless response.nil?
1045
+ unless response.nil?
1046
+ page = response.body
1047
+ page.next_method = Proc.new do |next_link|
1048
+ list_skus_next_async(next_link, custom_headers)
1049
+ end
1050
+ page
1051
+ end
1052
+ end
1053
+
1054
+ #
1055
+ # Displays available skus for your virtual machine scale set including the
1056
+ # minimum and maximum vm instances allowed for a particular sku.
1057
+ #
1058
+ # @param resource_group_name [String] The name of the resource group.
1059
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1060
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1061
+ # will be added to the HTTP request.
1062
+ #
1063
+ # @return [Array<VirtualMachineScaleSetSku>] operation results.
1064
+ #
1065
+ def list_skus(resource_group_name, vm_scale_set_name, custom_headers = nil)
1066
+ first_page = list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers)
1067
+ first_page.get_all_items
940
1068
  end
941
1069
 
942
1070
  #
@@ -970,6 +1098,8 @@ module Azure::ARM::Compute
970
1098
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
971
1099
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
972
1100
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1101
+
1102
+
973
1103
  request_headers = {}
974
1104
 
975
1105
  # Set Headers
@@ -1005,10 +1135,8 @@ module Azure::ARM::Compute
1005
1135
  if status_code == 200
1006
1136
  begin
1007
1137
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1008
- unless parsed_response.nil?
1009
- parsed_response = VirtualMachineScaleSetListSkusResult.deserialize_object(parsed_response)
1010
- end
1011
- result.body = parsed_response
1138
+ result_mapper = VirtualMachineScaleSetListSkusResult.mapper()
1139
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1012
1140
  rescue Exception => e
1013
1141
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1014
1142
  end
@@ -1029,10 +1157,26 @@ module Azure::ARM::Compute
1029
1157
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1030
1158
  # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
1031
1159
  # virtual machine scale set instance IDs.
1160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1161
+ # will be added to the HTTP request.
1162
+ #
1163
+ def power_off(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1164
+ response = power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers).value!
1165
+ nil
1166
+ end
1167
+
1168
+ #
1169
+ # @param resource_group_name [String] The name of the resource group.
1170
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1171
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
1172
+ # virtual machine scale set instance IDs.
1173
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1174
+ # will be added to the HTTP request.
1175
+ #
1032
1176
  # @return [Concurrent::Promise] promise which provides async access to http
1033
1177
  # response.
1034
1178
  #
1035
- def power_off(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1179
+ def power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1036
1180
  # Send request
1037
1181
  promise = begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers)
1038
1182
 
@@ -1041,8 +1185,8 @@ module Azure::ARM::Compute
1041
1185
  deserialize_method = lambda do |parsed_response|
1042
1186
  end
1043
1187
 
1044
- # Waiting for response.
1045
- @client.get_long_running_operation_result(response, deserialize_method)
1188
+ # Waiting for response.
1189
+ @client.get_long_running_operation_result(response, deserialize_method)
1046
1190
  end
1047
1191
 
1048
1192
  promise
@@ -1101,21 +1245,23 @@ module Azure::ARM::Compute
1101
1245
  def begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1102
1246
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1103
1247
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1104
- vm_instance_ids.validate unless vm_instance_ids.nil?
1105
1248
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1106
1249
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1250
+
1251
+
1107
1252
  request_headers = {}
1108
1253
 
1109
1254
  # Set Headers
1110
1255
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1111
1256
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1112
1257
 
1113
- # Serialize Request
1114
1258
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
1115
- unless vm_instance_ids.nil?
1116
- vm_instance_ids = VirtualMachineScaleSetVMInstanceIDs.serialize_object(vm_instance_ids)
1117
- end
1118
- request_content = vm_instance_ids != nil ? JSON.generate(vm_instance_ids, quirks_mode: true) : nil
1259
+
1260
+ # Serialize Request
1261
+ request_mapper = VirtualMachineScaleSetVMInstanceIDs.mapper()
1262
+ request_content = @client.serialize(request_mapper, vm_instance_ids, 'vm_instance_ids')
1263
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1264
+
1119
1265
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'
1120
1266
  options = {
1121
1267
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -1157,10 +1303,26 @@ module Azure::ARM::Compute
1157
1303
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1158
1304
  # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
1159
1305
  # virtual machine scale set instance IDs.
1306
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1307
+ # will be added to the HTTP request.
1308
+ #
1309
+ def restart(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1310
+ response = restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers).value!
1311
+ nil
1312
+ end
1313
+
1314
+ #
1315
+ # @param resource_group_name [String] The name of the resource group.
1316
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1317
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
1318
+ # virtual machine scale set instance IDs.
1319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1320
+ # will be added to the HTTP request.
1321
+ #
1160
1322
  # @return [Concurrent::Promise] promise which provides async access to http
1161
1323
  # response.
1162
1324
  #
1163
- def restart(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1325
+ def restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1164
1326
  # Send request
1165
1327
  promise = begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers)
1166
1328
 
@@ -1169,8 +1331,8 @@ module Azure::ARM::Compute
1169
1331
  deserialize_method = lambda do |parsed_response|
1170
1332
  end
1171
1333
 
1172
- # Waiting for response.
1173
- @client.get_long_running_operation_result(response, deserialize_method)
1334
+ # Waiting for response.
1335
+ @client.get_long_running_operation_result(response, deserialize_method)
1174
1336
  end
1175
1337
 
1176
1338
  promise
@@ -1223,21 +1385,23 @@ module Azure::ARM::Compute
1223
1385
  def begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1224
1386
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1225
1387
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1226
- vm_instance_ids.validate unless vm_instance_ids.nil?
1227
1388
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1228
1389
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1390
+
1391
+
1229
1392
  request_headers = {}
1230
1393
 
1231
1394
  # Set Headers
1232
1395
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1233
1396
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1234
1397
 
1235
- # Serialize Request
1236
1398
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
1237
- unless vm_instance_ids.nil?
1238
- vm_instance_ids = VirtualMachineScaleSetVMInstanceIDs.serialize_object(vm_instance_ids)
1239
- end
1240
- request_content = vm_instance_ids != nil ? JSON.generate(vm_instance_ids, quirks_mode: true) : nil
1399
+
1400
+ # Serialize Request
1401
+ request_mapper = VirtualMachineScaleSetVMInstanceIDs.mapper()
1402
+ request_content = @client.serialize(request_mapper, vm_instance_ids, 'vm_instance_ids')
1403
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1404
+
1241
1405
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'
1242
1406
  options = {
1243
1407
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -1279,10 +1443,26 @@ module Azure::ARM::Compute
1279
1443
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1280
1444
  # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
1281
1445
  # virtual machine scale set instance IDs.
1446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1447
+ # will be added to the HTTP request.
1448
+ #
1449
+ def start(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1450
+ response = start_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers).value!
1451
+ nil
1452
+ end
1453
+
1454
+ #
1455
+ # @param resource_group_name [String] The name of the resource group.
1456
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1457
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] The list of
1458
+ # virtual machine scale set instance IDs.
1459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1460
+ # will be added to the HTTP request.
1461
+ #
1282
1462
  # @return [Concurrent::Promise] promise which provides async access to http
1283
1463
  # response.
1284
1464
  #
1285
- def start(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1465
+ def start_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1286
1466
  # Send request
1287
1467
  promise = begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers)
1288
1468
 
@@ -1291,8 +1471,8 @@ module Azure::ARM::Compute
1291
1471
  deserialize_method = lambda do |parsed_response|
1292
1472
  end
1293
1473
 
1294
- # Waiting for response.
1295
- @client.get_long_running_operation_result(response, deserialize_method)
1474
+ # Waiting for response.
1475
+ @client.get_long_running_operation_result(response, deserialize_method)
1296
1476
  end
1297
1477
 
1298
1478
  promise
@@ -1345,21 +1525,23 @@ module Azure::ARM::Compute
1345
1525
  def begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids = nil, custom_headers = nil)
1346
1526
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1347
1527
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1348
- vm_instance_ids.validate unless vm_instance_ids.nil?
1349
1528
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1350
1529
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1530
+
1531
+
1351
1532
  request_headers = {}
1352
1533
 
1353
1534
  # Set Headers
1354
1535
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1355
1536
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1356
1537
 
1357
- # Serialize Request
1358
1538
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
1359
- unless vm_instance_ids.nil?
1360
- vm_instance_ids = VirtualMachineScaleSetVMInstanceIDs.serialize_object(vm_instance_ids)
1361
- end
1362
- request_content = vm_instance_ids != nil ? JSON.generate(vm_instance_ids, quirks_mode: true) : nil
1539
+
1540
+ # Serialize Request
1541
+ request_mapper = VirtualMachineScaleSetVMInstanceIDs.mapper()
1542
+ request_content = @client.serialize(request_mapper, vm_instance_ids, 'vm_instance_ids')
1543
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1544
+
1363
1545
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'
1364
1546
  options = {
1365
1547
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -1402,10 +1584,26 @@ module Azure::ARM::Compute
1402
1584
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1403
1585
  # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] The
1404
1586
  # list of virtual machine scale set instance IDs.
1587
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1588
+ # will be added to the HTTP request.
1589
+ #
1590
+ def update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers = nil)
1591
+ response = update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers).value!
1592
+ nil
1593
+ end
1594
+
1595
+ #
1596
+ # @param resource_group_name [String] The name of the resource group.
1597
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1598
+ # @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] The
1599
+ # list of virtual machine scale set instance IDs.
1600
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1601
+ # will be added to the HTTP request.
1602
+ #
1405
1603
  # @return [Concurrent::Promise] promise which provides async access to http
1406
1604
  # response.
1407
1605
  #
1408
- def update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers = nil)
1606
+ def update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers = nil)
1409
1607
  # Send request
1410
1608
  promise = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers)
1411
1609
 
@@ -1414,8 +1612,8 @@ module Azure::ARM::Compute
1414
1612
  deserialize_method = lambda do |parsed_response|
1415
1613
  end
1416
1614
 
1417
- # Waiting for response.
1418
- @client.get_long_running_operation_result(response, deserialize_method)
1615
+ # Waiting for response.
1616
+ @client.get_long_running_operation_result(response, deserialize_method)
1419
1617
  end
1420
1618
 
1421
1619
  promise
@@ -1472,21 +1670,23 @@ module Azure::ARM::Compute
1472
1670
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1473
1671
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1474
1672
  fail ArgumentError, 'vm_instance_ids is nil' if vm_instance_ids.nil?
1475
- vm_instance_ids.validate unless vm_instance_ids.nil?
1476
1673
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1477
1674
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1675
+
1676
+
1478
1677
  request_headers = {}
1479
1678
 
1480
1679
  # Set Headers
1481
1680
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1482
1681
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1483
1682
 
1484
- # Serialize Request
1485
1683
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
1486
- unless vm_instance_ids.nil?
1487
- vm_instance_ids = VirtualMachineScaleSetVMInstanceRequiredIDs.serialize_object(vm_instance_ids)
1488
- end
1489
- request_content = vm_instance_ids != nil ? JSON.generate(vm_instance_ids, quirks_mode: true) : nil
1684
+
1685
+ # Serialize Request
1686
+ request_mapper = VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
1687
+ request_content = @client.serialize(request_mapper, vm_instance_ids, 'vm_instance_ids')
1688
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1689
+
1490
1690
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'
1491
1691
  options = {
1492
1692
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -1527,10 +1727,24 @@ module Azure::ARM::Compute
1527
1727
  #
1528
1728
  # @param resource_group_name [String] The name of the resource group.
1529
1729
  # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1730
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1731
+ # will be added to the HTTP request.
1732
+ #
1733
+ def reimage(resource_group_name, vm_scale_set_name, custom_headers = nil)
1734
+ response = reimage_async(resource_group_name, vm_scale_set_name, custom_headers).value!
1735
+ nil
1736
+ end
1737
+
1738
+ #
1739
+ # @param resource_group_name [String] The name of the resource group.
1740
+ # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1741
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1742
+ # will be added to the HTTP request.
1743
+ #
1530
1744
  # @return [Concurrent::Promise] promise which provides async access to http
1531
1745
  # response.
1532
1746
  #
1533
- def reimage(resource_group_name, vm_scale_set_name, custom_headers = nil)
1747
+ def reimage_async(resource_group_name, vm_scale_set_name, custom_headers = nil)
1534
1748
  # Send request
1535
1749
  promise = begin_reimage_async(resource_group_name, vm_scale_set_name, custom_headers)
1536
1750
 
@@ -1539,8 +1753,8 @@ module Azure::ARM::Compute
1539
1753
  deserialize_method = lambda do |parsed_response|
1540
1754
  end
1541
1755
 
1542
- # Waiting for response.
1543
- @client.get_long_running_operation_result(response, deserialize_method)
1756
+ # Waiting for response.
1757
+ @client.get_long_running_operation_result(response, deserialize_method)
1544
1758
  end
1545
1759
 
1546
1760
  promise
@@ -1592,6 +1806,8 @@ module Azure::ARM::Compute
1592
1806
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
1593
1807
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1594
1808
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1809
+
1810
+
1595
1811
  request_headers = {}
1596
1812
 
1597
1813
  # Set Headers
@@ -1671,6 +1887,8 @@ module Azure::ARM::Compute
1671
1887
  #
1672
1888
  def list_next_async(next_page_link, custom_headers = nil)
1673
1889
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1890
+
1891
+
1674
1892
  request_headers = {}
1675
1893
 
1676
1894
  # Set Headers
@@ -1705,10 +1923,8 @@ module Azure::ARM::Compute
1705
1923
  if status_code == 200
1706
1924
  begin
1707
1925
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1708
- unless parsed_response.nil?
1709
- parsed_response = VirtualMachineScaleSetListResult.deserialize_object(parsed_response)
1710
- end
1711
- result.body = parsed_response
1926
+ result_mapper = VirtualMachineScaleSetListResult.mapper()
1927
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1712
1928
  rescue Exception => e
1713
1929
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1714
1930
  end
@@ -1770,6 +1986,8 @@ module Azure::ARM::Compute
1770
1986
  #
1771
1987
  def list_all_next_async(next_page_link, custom_headers = nil)
1772
1988
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1989
+
1990
+
1773
1991
  request_headers = {}
1774
1992
 
1775
1993
  # Set Headers
@@ -1804,10 +2022,8 @@ module Azure::ARM::Compute
1804
2022
  if status_code == 200
1805
2023
  begin
1806
2024
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1807
- unless parsed_response.nil?
1808
- parsed_response = VirtualMachineScaleSetListWithLinkResult.deserialize_object(parsed_response)
1809
- end
1810
- result.body = parsed_response
2025
+ result_mapper = VirtualMachineScaleSetListWithLinkResult.mapper()
2026
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1811
2027
  rescue Exception => e
1812
2028
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1813
2029
  end
@@ -1863,6 +2079,8 @@ module Azure::ARM::Compute
1863
2079
  #
1864
2080
  def list_skus_next_async(next_page_link, custom_headers = nil)
1865
2081
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2082
+
2083
+
1866
2084
  request_headers = {}
1867
2085
 
1868
2086
  # Set Headers
@@ -1897,10 +2115,8 @@ module Azure::ARM::Compute
1897
2115
  if status_code == 200
1898
2116
  begin
1899
2117
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1900
- unless parsed_response.nil?
1901
- parsed_response = VirtualMachineScaleSetListSkusResult.deserialize_object(parsed_response)
1902
- end
1903
- result.body = parsed_response
2118
+ result_mapper = VirtualMachineScaleSetListSkusResult.mapper()
2119
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1904
2120
  rescue Exception => e
1905
2121
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1906
2122
  end