azure_mgmt_compute 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_compute.rb +48 -46
  3. data/lib/generated/azure_mgmt_compute/availability_sets.rb +16 -19
  4. data/lib/generated/azure_mgmt_compute/compute_management_client.rb +18 -5
  5. data/lib/generated/azure_mgmt_compute/container_services.rb +920 -0
  6. data/lib/generated/azure_mgmt_compute/models/additional_unattend_content.rb +9 -10
  7. data/lib/generated/azure_mgmt_compute/models/api_entity_reference.rb +1 -1
  8. data/lib/generated/azure_mgmt_compute/models/api_error.rb +1 -1
  9. data/lib/generated/azure_mgmt_compute/models/api_error_base.rb +1 -1
  10. data/lib/generated/azure_mgmt_compute/models/availability_set.rb +6 -5
  11. data/lib/generated/azure_mgmt_compute/models/availability_set_list_result.rb +2 -2
  12. data/lib/generated/azure_mgmt_compute/models/boot_diagnostics.rb +4 -4
  13. data/lib/generated/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +3 -3
  14. data/lib/generated/azure_mgmt_compute/models/caching_types.rb +1 -1
  15. data/lib/generated/azure_mgmt_compute/models/component_names.rb +1 -1
  16. data/lib/generated/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +1 -1
  17. data/lib/generated/azure_mgmt_compute/models/container_service.rb +36 -13
  18. data/lib/generated/azure_mgmt_compute/models/container_service_agent_pool_profile.rb +18 -16
  19. data/lib/generated/azure_mgmt_compute/models/container_service_custom_profile.rb +44 -0
  20. data/lib/generated/azure_mgmt_compute/models/container_service_diagnostics_profile.rb +5 -4
  21. data/lib/generated/azure_mgmt_compute/models/container_service_linux_profile.rb +8 -5
  22. data/lib/generated/azure_mgmt_compute/models/container_service_list_result.rb +45 -3
  23. data/lib/generated/azure_mgmt_compute/models/container_service_master_profile.rb +8 -5
  24. data/lib/generated/azure_mgmt_compute/models/container_service_ochestrator_types.rb +3 -1
  25. data/lib/generated/azure_mgmt_compute/models/container_service_orchestrator_profile.rb +7 -6
  26. data/lib/generated/azure_mgmt_compute/models/container_service_service_principal_profile.rb +56 -0
  27. data/lib/generated/azure_mgmt_compute/models/container_service_ssh_configuration.rb +5 -5
  28. data/lib/generated/azure_mgmt_compute/models/container_service_ssh_public_key.rb +3 -3
  29. data/lib/generated/azure_mgmt_compute/models/container_service_vmdiagnostics.rb +7 -7
  30. data/lib/generated/azure_mgmt_compute/models/container_service_vmsize_types.rb +1 -1
  31. data/lib/generated/azure_mgmt_compute/models/container_service_windows_profile.rb +10 -4
  32. data/lib/generated/azure_mgmt_compute/models/data_disk.rb +12 -12
  33. data/lib/generated/azure_mgmt_compute/models/data_disk_image.rb +4 -5
  34. data/lib/generated/azure_mgmt_compute/models/diagnostics_profile.rb +4 -2
  35. data/lib/generated/azure_mgmt_compute/models/disk_create_option_types.rb +1 -1
  36. data/lib/generated/azure_mgmt_compute/models/disk_encryption_settings.rb +7 -7
  37. data/lib/generated/azure_mgmt_compute/models/disk_instance_view.rb +3 -3
  38. data/lib/generated/azure_mgmt_compute/models/hardware_profile.rb +1 -1
  39. data/lib/generated/azure_mgmt_compute/models/image_reference.rb +7 -7
  40. data/lib/generated/azure_mgmt_compute/models/inner_error.rb +1 -1
  41. data/lib/generated/azure_mgmt_compute/models/instance_view_status.rb +7 -7
  42. data/lib/generated/azure_mgmt_compute/models/instance_view_types.rb +1 -1
  43. data/lib/generated/azure_mgmt_compute/models/key_vault_key_reference.rb +4 -4
  44. data/lib/generated/azure_mgmt_compute/models/key_vault_secret_reference.rb +3 -3
  45. data/lib/generated/azure_mgmt_compute/models/linux_configuration.rb +5 -5
  46. data/lib/generated/azure_mgmt_compute/models/list_usages_result.rb +6 -6
  47. data/lib/generated/azure_mgmt_compute/models/network_interface_reference.rb +3 -2
  48. data/lib/generated/azure_mgmt_compute/models/network_profile.rb +4 -2
  49. data/lib/generated/azure_mgmt_compute/models/operating_system_types.rb +1 -1
  50. data/lib/generated/azure_mgmt_compute/models/osdisk.rb +12 -12
  51. data/lib/generated/azure_mgmt_compute/models/osdisk_image.rb +3 -3
  52. data/lib/generated/azure_mgmt_compute/models/osprofile.rb +12 -9
  53. data/lib/generated/azure_mgmt_compute/models/pass_names.rb +1 -1
  54. data/lib/generated/azure_mgmt_compute/models/plan.rb +5 -5
  55. data/lib/generated/azure_mgmt_compute/models/protocol_types.rb +1 -1
  56. data/lib/generated/azure_mgmt_compute/models/purchase_plan.rb +4 -4
  57. data/lib/generated/azure_mgmt_compute/models/setting_names.rb +1 -1
  58. data/lib/generated/azure_mgmt_compute/models/sku.rb +4 -4
  59. data/lib/generated/azure_mgmt_compute/models/ssh_configuration.rb +3 -3
  60. data/lib/generated/azure_mgmt_compute/models/ssh_public_key.rb +7 -7
  61. data/lib/generated/azure_mgmt_compute/models/status_level_types.rb +1 -1
  62. data/lib/generated/azure_mgmt_compute/models/storage_profile.rb +4 -4
  63. data/lib/generated/azure_mgmt_compute/models/upgrade_mode.rb +1 -1
  64. data/lib/generated/azure_mgmt_compute/models/upgrade_policy.rb +1 -1
  65. data/lib/generated/azure_mgmt_compute/models/usage.rb +6 -6
  66. data/lib/generated/azure_mgmt_compute/models/usage_name.rb +3 -3
  67. data/lib/generated/azure_mgmt_compute/models/vault_certificate.rb +3 -3
  68. data/lib/generated/azure_mgmt_compute/models/vault_secret_group.rb +4 -4
  69. data/lib/generated/azure_mgmt_compute/models/virtual_hard_disk.rb +3 -3
  70. data/lib/generated/azure_mgmt_compute/models/virtual_machine.rb +18 -15
  71. data/lib/generated/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +5 -5
  72. data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +5 -5
  73. data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_result.rb +1 -1
  74. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension.rb +3 -3
  75. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +3 -3
  76. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +5 -5
  77. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +1 -1
  78. data/lib/generated/azure_mgmt_compute/models/virtual_machine_image.rb +1 -1
  79. data/lib/generated/azure_mgmt_compute/models/virtual_machine_image_resource.rb +4 -4
  80. data/lib/generated/azure_mgmt_compute/models/virtual_machine_instance_view.rb +7 -7
  81. data/lib/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +4 -4
  82. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +1 -1
  83. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +3 -3
  84. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +1 -1
  85. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +1 -1
  86. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +1 -1
  87. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +1 -1
  88. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +1 -1
  89. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +1 -1
  90. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +3 -3
  91. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +1 -1
  92. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +3 -3
  93. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +4 -4
  94. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +3 -3
  95. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +1 -1
  96. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +1 -1
  97. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_scale_type.rb +1 -1
  98. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +1 -1
  99. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +7 -7
  100. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +1 -1
  101. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +2 -2
  102. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +2 -2
  103. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +1 -1
  104. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +3 -3
  105. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +3 -3
  106. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size.rb +12 -8
  107. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +2 -2
  108. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size_types.rb +1 -1
  109. data/lib/generated/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +1 -1
  110. data/lib/generated/azure_mgmt_compute/models/win_rmconfiguration.rb +2 -2
  111. data/lib/generated/azure_mgmt_compute/models/win_rmlistener.rb +5 -6
  112. data/lib/generated/azure_mgmt_compute/models/windows_configuration.rb +11 -10
  113. data/lib/generated/azure_mgmt_compute/module_definition.rb +1 -1
  114. data/lib/generated/azure_mgmt_compute/usage_operations.rb +51 -37
  115. data/lib/generated/azure_mgmt_compute/version.rb +2 -2
  116. data/lib/generated/azure_mgmt_compute/virtual_machine_extension_images.rb +1 -1
  117. data/lib/generated/azure_mgmt_compute/virtual_machine_extensions.rb +131 -131
  118. data/lib/generated/azure_mgmt_compute/virtual_machine_images.rb +70 -58
  119. data/lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +430 -422
  120. data/lib/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +729 -747
  121. data/lib/generated/azure_mgmt_compute/virtual_machine_sizes.rb +1 -1
  122. data/lib/generated/azure_mgmt_compute/virtual_machines.rb +526 -515
  123. metadata +7 -5
  124. data/lib/generated/azure_mgmt_compute/container_service_operations.rb +0 -508
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -70,152 +70,80 @@ module Azure::ARM::Compute
70
70
  end
71
71
 
72
72
  #
73
- # Captures the VM by copying virtual hard disks of the VM and outputs a
74
- # template that can be used to create similar VMs.
73
+ # The operation to create or update a virtual machine.
75
74
  #
76
75
  # @param resource_group_name [String] The name of the resource group.
77
76
  # @param vm_name [String] The name of the virtual machine.
78
- # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
79
- # the Capture Virtual Machine operation.
77
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
78
+ # Machine operation.
80
79
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
81
80
  # will be added to the HTTP request.
82
81
  #
83
- # @return [VirtualMachineCaptureResult] operation results.
82
+ # @return [VirtualMachine] operation results.
84
83
  #
85
- def begin_capture(resource_group_name, vm_name, parameters, custom_headers = nil)
86
- response = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
84
+ def create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
85
+ response = create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
87
86
  response.body unless response.nil?
88
87
  end
89
88
 
90
- #
91
- # Captures the VM by copying virtual hard disks of the VM and outputs a
92
- # template that can be used to create similar VMs.
93
89
  #
94
90
  # @param resource_group_name [String] The name of the resource group.
95
91
  # @param vm_name [String] The name of the virtual machine.
96
- # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
97
- # the Capture Virtual Machine operation.
92
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
93
+ # Machine operation.
98
94
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
99
95
  # will be added to the HTTP request.
100
96
  #
101
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
102
- #
103
- def begin_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil)
104
- begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
105
- end
106
-
107
- #
108
- # Captures the VM by copying virtual hard disks of the VM and outputs a
109
- # template that can be used to create similar VMs.
110
- #
111
- # @param resource_group_name [String] The name of the resource group.
112
- # @param vm_name [String] The name of the virtual machine.
113
- # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
114
- # the Capture Virtual Machine operation.
115
- # @param [Hash{String => String}] A hash of custom headers that will be added
116
- # to the HTTP request.
117
- #
118
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
97
+ # @return [Concurrent::Promise] promise which provides async access to http
98
+ # response.
119
99
  #
120
- def begin_capture_async(resource_group_name, vm_name, parameters, custom_headers = nil)
121
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
122
- fail ArgumentError, 'vm_name is nil' if vm_name.nil?
123
- fail ArgumentError, 'parameters is nil' if parameters.nil?
124
- api_version = '2016-03-30'
125
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
126
-
127
-
128
- request_headers = {}
129
-
130
- # Set Headers
131
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
132
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
133
-
134
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
135
-
136
- # Serialize Request
137
- request_mapper = VirtualMachineCaptureParameters.mapper()
138
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
139
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
140
-
141
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'
142
-
143
- request_url = @base_url || @client.base_url
144
-
145
- options = {
146
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
147
- path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
148
- query_params: {'api-version' => api_version},
149
- body: request_content,
150
- headers: request_headers.merge(custom_headers || {}),
151
- base_url: request_url
152
- }
153
- promise = @client.make_request_async(:post, path_template, options)
154
-
155
- promise = promise.then do |result|
156
- http_response = result.response
157
- status_code = http_response.status
158
- response_content = http_response.body
159
- unless status_code == 200 || status_code == 202
160
- error_model = JSON.load(response_content)
161
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
162
- end
100
+ def create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil)
101
+ # Send request
102
+ promise = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers)
163
103
 
164
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
165
- # Deserialize Response
166
- if status_code == 200
167
- begin
168
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
169
- result_mapper = VirtualMachineCaptureResult.mapper()
170
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
171
- rescue Exception => e
172
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
173
- end
104
+ promise = promise.then do |response|
105
+ # Defining deserialization method.
106
+ deserialize_method = lambda do |parsed_response|
107
+ result_mapper = VirtualMachine.mapper()
108
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
174
109
  end
175
110
 
176
- result
111
+ # Waiting for response.
112
+ @client.get_long_running_operation_result(response, deserialize_method)
177
113
  end
178
114
 
179
- promise.execute
115
+ promise
180
116
  end
181
117
 
182
118
  #
183
- # The operation to create or update a virtual machine.
119
+ # The operation to delete a virtual machine.
184
120
  #
185
121
  # @param resource_group_name [String] The name of the resource group.
186
122
  # @param vm_name [String] The name of the virtual machine.
187
- # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
188
- # Machine operation.
189
123
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
190
124
  # will be added to the HTTP request.
191
125
  #
192
- # @return [VirtualMachine] operation results.
193
- #
194
- def create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
195
- response = create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
196
- response.body unless response.nil?
126
+ def delete(resource_group_name, vm_name, custom_headers = nil)
127
+ response = delete_async(resource_group_name, vm_name, custom_headers).value!
128
+ nil
197
129
  end
198
130
 
199
131
  #
200
132
  # @param resource_group_name [String] The name of the resource group.
201
133
  # @param vm_name [String] The name of the virtual machine.
202
- # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
203
- # Machine operation.
204
134
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
135
  # will be added to the HTTP request.
206
136
  #
207
137
  # @return [Concurrent::Promise] promise which provides async access to http
208
138
  # response.
209
139
  #
210
- def create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil)
140
+ def delete_async(resource_group_name, vm_name, custom_headers = nil)
211
141
  # Send request
212
- promise = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers)
142
+ promise = begin_delete_async(resource_group_name, vm_name, custom_headers)
213
143
 
214
144
  promise = promise.then do |response|
215
145
  # Defining deserialization method.
216
146
  deserialize_method = lambda do |parsed_response|
217
- result_mapper = VirtualMachine.mapper()
218
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
219
147
  end
220
148
 
221
149
  # Waiting for response.
@@ -226,54 +154,56 @@ module Azure::ARM::Compute
226
154
  end
227
155
 
228
156
  #
229
- # The operation to create or update a virtual machine.
157
+ # Retrieves information about the model view or the instance view of a virtual
158
+ # machine.
230
159
  #
231
160
  # @param resource_group_name [String] The name of the resource group.
232
161
  # @param vm_name [String] The name of the virtual machine.
233
- # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
234
- # Machine operation.
162
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
163
+ # operation. Possible values include: 'instanceView'
235
164
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
165
  # will be added to the HTTP request.
237
166
  #
238
167
  # @return [VirtualMachine] operation results.
239
168
  #
240
- def begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
241
- response = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
169
+ def get(resource_group_name, vm_name, expand = nil, custom_headers = nil)
170
+ response = get_async(resource_group_name, vm_name, expand, custom_headers).value!
242
171
  response.body unless response.nil?
243
172
  end
244
173
 
245
174
  #
246
- # The operation to create or update a virtual machine.
175
+ # Retrieves information about the model view or the instance view of a virtual
176
+ # machine.
247
177
  #
248
178
  # @param resource_group_name [String] The name of the resource group.
249
179
  # @param vm_name [String] The name of the virtual machine.
250
- # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
251
- # Machine operation.
180
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
181
+ # operation. Possible values include: 'instanceView'
252
182
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
183
  # will be added to the HTTP request.
254
184
  #
255
185
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
256
186
  #
257
- def begin_create_or_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil)
258
- begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
187
+ def get_with_http_info(resource_group_name, vm_name, expand = nil, custom_headers = nil)
188
+ get_async(resource_group_name, vm_name, expand, custom_headers).value!
259
189
  end
260
190
 
261
191
  #
262
- # The operation to create or update a virtual machine.
192
+ # Retrieves information about the model view or the instance view of a virtual
193
+ # machine.
263
194
  #
264
195
  # @param resource_group_name [String] The name of the resource group.
265
196
  # @param vm_name [String] The name of the virtual machine.
266
- # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
267
- # Machine operation.
197
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
198
+ # operation. Possible values include: 'instanceView'
268
199
  # @param [Hash{String => String}] A hash of custom headers that will be added
269
200
  # to the HTTP request.
270
201
  #
271
202
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
272
203
  #
273
- def begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil)
204
+ def get_async(resource_group_name, vm_name, expand = nil, custom_headers = nil)
274
205
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
275
206
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
276
- fail ArgumentError, 'parameters is nil' if parameters.nil?
277
207
  api_version = '2016-03-30'
278
208
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
279
209
 
@@ -283,14 +213,6 @@ module Azure::ARM::Compute
283
213
  # Set Headers
284
214
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
285
215
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
286
-
287
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
288
-
289
- # Serialize Request
290
- request_mapper = VirtualMachine.mapper()
291
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
292
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
293
-
294
216
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
295
217
 
296
218
  request_url = @base_url || @client.base_url
@@ -298,18 +220,17 @@ module Azure::ARM::Compute
298
220
  options = {
299
221
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
300
222
  path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
301
- query_params: {'api-version' => api_version},
302
- body: request_content,
223
+ query_params: {'$expand' => expand,'api-version' => api_version},
303
224
  headers: request_headers.merge(custom_headers || {}),
304
225
  base_url: request_url
305
226
  }
306
- promise = @client.make_request_async(:put, path_template, options)
227
+ promise = @client.make_request_async(:get, path_template, options)
307
228
 
308
229
  promise = promise.then do |result|
309
230
  http_response = result.response
310
231
  status_code = http_response.status
311
232
  response_content = http_response.body
312
- unless status_code == 200 || status_code == 201
233
+ unless status_code == 200
313
234
  error_model = JSON.load(response_content)
314
235
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
315
236
  end
@@ -325,16 +246,6 @@ module Azure::ARM::Compute
325
246
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
326
247
  end
327
248
  end
328
- # Deserialize Response
329
- if status_code == 201
330
- begin
331
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
332
- result_mapper = VirtualMachine.mapper()
333
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
334
- rescue Exception => e
335
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
336
- end
337
- end
338
249
 
339
250
  result
340
251
  end
@@ -343,15 +254,16 @@ module Azure::ARM::Compute
343
254
  end
344
255
 
345
256
  #
346
- # The operation to delete a virtual machine.
257
+ # Shuts down the virtual machine and releases the compute resources. You are
258
+ # not billed for the compute resources that this virtual machine uses.
347
259
  #
348
260
  # @param resource_group_name [String] The name of the resource group.
349
261
  # @param vm_name [String] The name of the virtual machine.
350
262
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
351
263
  # will be added to the HTTP request.
352
264
  #
353
- def delete(resource_group_name, vm_name, custom_headers = nil)
354
- response = delete_async(resource_group_name, vm_name, custom_headers).value!
265
+ def deallocate(resource_group_name, vm_name, custom_headers = nil)
266
+ response = deallocate_async(resource_group_name, vm_name, custom_headers).value!
355
267
  nil
356
268
  end
357
269
 
@@ -364,9 +276,9 @@ module Azure::ARM::Compute
364
276
  # @return [Concurrent::Promise] promise which provides async access to http
365
277
  # response.
366
278
  #
367
- def delete_async(resource_group_name, vm_name, custom_headers = nil)
279
+ def deallocate_async(resource_group_name, vm_name, custom_headers = nil)
368
280
  # Send request
369
- promise = begin_delete_async(resource_group_name, vm_name, custom_headers)
281
+ promise = begin_deallocate_async(resource_group_name, vm_name, custom_headers)
370
282
 
371
283
  promise = promise.then do |response|
372
284
  # Defining deserialization method.
@@ -381,7 +293,7 @@ module Azure::ARM::Compute
381
293
  end
382
294
 
383
295
  #
384
- # The operation to delete a virtual machine.
296
+ # Sets the state of the virtual machine to generalized.
385
297
  #
386
298
  # @param resource_group_name [String] The name of the resource group.
387
299
  # @param vm_name [String] The name of the virtual machine.
@@ -389,13 +301,13 @@ module Azure::ARM::Compute
389
301
  # will be added to the HTTP request.
390
302
  #
391
303
  #
392
- def begin_delete(resource_group_name, vm_name, custom_headers = nil)
393
- response = begin_delete_async(resource_group_name, vm_name, custom_headers).value!
304
+ def generalize(resource_group_name, vm_name, custom_headers = nil)
305
+ response = generalize_async(resource_group_name, vm_name, custom_headers).value!
394
306
  nil
395
307
  end
396
308
 
397
309
  #
398
- # The operation to delete a virtual machine.
310
+ # Sets the state of the virtual machine to generalized.
399
311
  #
400
312
  # @param resource_group_name [String] The name of the resource group.
401
313
  # @param vm_name [String] The name of the virtual machine.
@@ -404,12 +316,12 @@ module Azure::ARM::Compute
404
316
  #
405
317
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
406
318
  #
407
- def begin_delete_with_http_info(resource_group_name, vm_name, custom_headers = nil)
408
- begin_delete_async(resource_group_name, vm_name, custom_headers).value!
319
+ def generalize_with_http_info(resource_group_name, vm_name, custom_headers = nil)
320
+ generalize_async(resource_group_name, vm_name, custom_headers).value!
409
321
  end
410
322
 
411
323
  #
412
- # The operation to delete a virtual machine.
324
+ # Sets the state of the virtual machine to generalized.
413
325
  #
414
326
  # @param resource_group_name [String] The name of the resource group.
415
327
  # @param vm_name [String] The name of the virtual machine.
@@ -418,7 +330,7 @@ module Azure::ARM::Compute
418
330
  #
419
331
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
420
332
  #
421
- def begin_delete_async(resource_group_name, vm_name, custom_headers = nil)
333
+ def generalize_async(resource_group_name, vm_name, custom_headers = nil)
422
334
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
423
335
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
424
336
  api_version = '2016-03-30'
@@ -430,7 +342,7 @@ module Azure::ARM::Compute
430
342
  # Set Headers
431
343
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
432
344
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
433
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
345
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'
434
346
 
435
347
  request_url = @base_url || @client.base_url
436
348
 
@@ -441,13 +353,13 @@ module Azure::ARM::Compute
441
353
  headers: request_headers.merge(custom_headers || {}),
442
354
  base_url: request_url
443
355
  }
444
- promise = @client.make_request_async(:delete, path_template, options)
356
+ promise = @client.make_request_async(:post, path_template, options)
445
357
 
446
358
  promise = promise.then do |result|
447
359
  http_response = result.response
448
360
  status_code = http_response.status
449
361
  response_content = http_response.body
450
- unless status_code == 202 || status_code == 204
362
+ unless status_code == 200
451
363
  error_model = JSON.load(response_content)
452
364
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
453
365
  end
@@ -461,53 +373,46 @@ module Azure::ARM::Compute
461
373
  end
462
374
 
463
375
  #
464
- # The operation to get a virtual machine.
376
+ # Lists all of the virtual machines in the specified resource group. Use the
377
+ # nextLink property in the response to get the next page of virtual machines.
465
378
  #
466
379
  # @param resource_group_name [String] The name of the resource group.
467
- # @param vm_name [String] The name of the virtual machine.
468
- # @param expand [InstanceViewTypes] The expand expression to apply on the
469
- # operation. Possible values include: 'instanceView'
470
380
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
471
381
  # will be added to the HTTP request.
472
382
  #
473
- # @return [VirtualMachine] operation results.
383
+ # @return [Array<VirtualMachine>] operation results.
474
384
  #
475
- def get(resource_group_name, vm_name, expand = nil, custom_headers = nil)
476
- response = get_async(resource_group_name, vm_name, expand, custom_headers).value!
477
- response.body unless response.nil?
385
+ def list(resource_group_name, custom_headers = nil)
386
+ first_page = list_as_lazy(resource_group_name, custom_headers)
387
+ first_page.get_all_items
478
388
  end
479
389
 
480
390
  #
481
- # The operation to get a virtual machine.
391
+ # Lists all of the virtual machines in the specified resource group. Use the
392
+ # nextLink property in the response to get the next page of virtual machines.
482
393
  #
483
394
  # @param resource_group_name [String] The name of the resource group.
484
- # @param vm_name [String] The name of the virtual machine.
485
- # @param expand [InstanceViewTypes] The expand expression to apply on the
486
- # operation. Possible values include: 'instanceView'
487
395
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
488
396
  # will be added to the HTTP request.
489
397
  #
490
398
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
491
399
  #
492
- def get_with_http_info(resource_group_name, vm_name, expand = nil, custom_headers = nil)
493
- get_async(resource_group_name, vm_name, expand, custom_headers).value!
400
+ def list_with_http_info(resource_group_name, custom_headers = nil)
401
+ list_async(resource_group_name, custom_headers).value!
494
402
  end
495
403
 
496
404
  #
497
- # The operation to get a virtual machine.
405
+ # Lists all of the virtual machines in the specified resource group. Use the
406
+ # nextLink property in the response to get the next page of virtual machines.
498
407
  #
499
408
  # @param resource_group_name [String] The name of the resource group.
500
- # @param vm_name [String] The name of the virtual machine.
501
- # @param expand [InstanceViewTypes] The expand expression to apply on the
502
- # operation. Possible values include: 'instanceView'
503
409
  # @param [Hash{String => String}] A hash of custom headers that will be added
504
410
  # to the HTTP request.
505
411
  #
506
412
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
507
413
  #
508
- def get_async(resource_group_name, vm_name, expand = nil, custom_headers = nil)
414
+ def list_async(resource_group_name, custom_headers = nil)
509
415
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
510
- fail ArgumentError, 'vm_name is nil' if vm_name.nil?
511
416
  api_version = '2016-03-30'
512
417
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
513
418
 
@@ -517,14 +422,14 @@ module Azure::ARM::Compute
517
422
  # Set Headers
518
423
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
519
424
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
520
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
425
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'
521
426
 
522
427
  request_url = @base_url || @client.base_url
523
428
 
524
429
  options = {
525
430
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
526
- path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
527
- query_params: {'$expand' => expand,'api-version' => api_version},
431
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
432
+ query_params: {'api-version' => api_version},
528
433
  headers: request_headers.merge(custom_headers || {}),
529
434
  base_url: request_url
530
435
  }
@@ -544,7 +449,7 @@ module Azure::ARM::Compute
544
449
  if status_code == 200
545
450
  begin
546
451
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
- result_mapper = VirtualMachine.mapper()
452
+ result_mapper = VirtualMachineListResult.mapper()
548
453
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
549
454
  rescue Exception => e
550
455
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -558,62 +463,110 @@ module Azure::ARM::Compute
558
463
  end
559
464
 
560
465
  #
561
- # Shuts down the Virtual Machine and releases the compute resources. You are
562
- # not billed for the compute resources that this Virtual Machine uses.
466
+ # Lists all of the virtual machines in the specified subscription. Use the
467
+ # nextLink property in the response to get the next page of virtual machines.
563
468
  #
564
- # @param resource_group_name [String] The name of the resource group.
565
- # @param vm_name [String] The name of the virtual machine.
566
469
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
470
  # will be added to the HTTP request.
568
471
  #
569
- def deallocate(resource_group_name, vm_name, custom_headers = nil)
570
- response = deallocate_async(resource_group_name, vm_name, custom_headers).value!
571
- nil
472
+ # @return [Array<VirtualMachine>] operation results.
473
+ #
474
+ def list_all(custom_headers = nil)
475
+ first_page = list_all_as_lazy(custom_headers)
476
+ first_page.get_all_items
572
477
  end
573
478
 
574
479
  #
575
- # @param resource_group_name [String] The name of the resource group.
576
- # @param vm_name [String] The name of the virtual machine.
480
+ # Lists all of the virtual machines in the specified subscription. Use the
481
+ # nextLink property in the response to get the next page of virtual machines.
482
+ #
577
483
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
578
484
  # will be added to the HTTP request.
579
485
  #
580
- # @return [Concurrent::Promise] promise which provides async access to http
581
- # response.
486
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
582
487
  #
583
- def deallocate_async(resource_group_name, vm_name, custom_headers = nil)
584
- # Send request
585
- promise = begin_deallocate_async(resource_group_name, vm_name, custom_headers)
488
+ def list_all_with_http_info(custom_headers = nil)
489
+ list_all_async(custom_headers).value!
490
+ end
586
491
 
587
- promise = promise.then do |response|
588
- # Defining deserialization method.
589
- deserialize_method = lambda do |parsed_response|
492
+ #
493
+ # Lists all of the virtual machines in the specified subscription. Use the
494
+ # nextLink property in the response to get the next page of virtual machines.
495
+ #
496
+ # @param [Hash{String => String}] A hash of custom headers that will be added
497
+ # to the HTTP request.
498
+ #
499
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
500
+ #
501
+ def list_all_async(custom_headers = nil)
502
+ api_version = '2016-03-30'
503
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
504
+
505
+
506
+ request_headers = {}
507
+
508
+ # Set Headers
509
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
510
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
511
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'
512
+
513
+ request_url = @base_url || @client.base_url
514
+
515
+ options = {
516
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
517
+ path_params: {'subscriptionId' => @client.subscription_id},
518
+ query_params: {'api-version' => api_version},
519
+ headers: request_headers.merge(custom_headers || {}),
520
+ base_url: request_url
521
+ }
522
+ promise = @client.make_request_async(:get, path_template, options)
523
+
524
+ promise = promise.then do |result|
525
+ http_response = result.response
526
+ status_code = http_response.status
527
+ response_content = http_response.body
528
+ unless status_code == 200
529
+ error_model = JSON.load(response_content)
530
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
590
531
  end
591
532
 
592
- # Waiting for response.
593
- @client.get_long_running_operation_result(response, deserialize_method)
533
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
534
+ # Deserialize Response
535
+ if status_code == 200
536
+ begin
537
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
538
+ result_mapper = VirtualMachineListResult.mapper()
539
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
540
+ rescue Exception => e
541
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
542
+ end
543
+ end
544
+
545
+ result
594
546
  end
595
547
 
596
- promise
548
+ promise.execute
597
549
  end
598
550
 
599
551
  #
600
- # Shuts down the Virtual Machine and releases the compute resources. You are
601
- # not billed for the compute resources that this Virtual Machine uses.
552
+ # Lists all available virtual machine sizes to which the specified virtual
553
+ # machine can be resized.
602
554
  #
603
555
  # @param resource_group_name [String] The name of the resource group.
604
556
  # @param vm_name [String] The name of the virtual machine.
605
557
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
606
558
  # will be added to the HTTP request.
607
559
  #
560
+ # @return [VirtualMachineSizeListResult] operation results.
608
561
  #
609
- def begin_deallocate(resource_group_name, vm_name, custom_headers = nil)
610
- response = begin_deallocate_async(resource_group_name, vm_name, custom_headers).value!
611
- nil
562
+ def list_available_sizes(resource_group_name, vm_name, custom_headers = nil)
563
+ response = list_available_sizes_async(resource_group_name, vm_name, custom_headers).value!
564
+ response.body unless response.nil?
612
565
  end
613
566
 
614
567
  #
615
- # Shuts down the Virtual Machine and releases the compute resources. You are
616
- # not billed for the compute resources that this Virtual Machine uses.
568
+ # Lists all available virtual machine sizes to which the specified virtual
569
+ # machine can be resized.
617
570
  #
618
571
  # @param resource_group_name [String] The name of the resource group.
619
572
  # @param vm_name [String] The name of the virtual machine.
@@ -622,13 +575,13 @@ module Azure::ARM::Compute
622
575
  #
623
576
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
624
577
  #
625
- def begin_deallocate_with_http_info(resource_group_name, vm_name, custom_headers = nil)
626
- begin_deallocate_async(resource_group_name, vm_name, custom_headers).value!
578
+ def list_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers = nil)
579
+ list_available_sizes_async(resource_group_name, vm_name, custom_headers).value!
627
580
  end
628
581
 
629
582
  #
630
- # Shuts down the Virtual Machine and releases the compute resources. You are
631
- # not billed for the compute resources that this Virtual Machine uses.
583
+ # Lists all available virtual machine sizes to which the specified virtual
584
+ # machine can be resized.
632
585
  #
633
586
  # @param resource_group_name [String] The name of the resource group.
634
587
  # @param vm_name [String] The name of the virtual machine.
@@ -637,7 +590,7 @@ module Azure::ARM::Compute
637
590
  #
638
591
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
639
592
  #
640
- def begin_deallocate_async(resource_group_name, vm_name, custom_headers = nil)
593
+ def list_available_sizes_async(resource_group_name, vm_name, custom_headers = nil)
641
594
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
642
595
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
643
596
  api_version = '2016-03-30'
@@ -649,7 +602,7 @@ module Azure::ARM::Compute
649
602
  # Set Headers
650
603
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
651
604
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
652
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'
605
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'
653
606
 
654
607
  request_url = @base_url || @client.base_url
655
608
 
@@ -660,18 +613,28 @@ module Azure::ARM::Compute
660
613
  headers: request_headers.merge(custom_headers || {}),
661
614
  base_url: request_url
662
615
  }
663
- promise = @client.make_request_async(:post, path_template, options)
616
+ promise = @client.make_request_async(:get, path_template, options)
664
617
 
665
618
  promise = promise.then do |result|
666
619
  http_response = result.response
667
620
  status_code = http_response.status
668
621
  response_content = http_response.body
669
- unless status_code == 202
622
+ unless status_code == 200
670
623
  error_model = JSON.load(response_content)
671
624
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
672
625
  end
673
626
 
674
627
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
628
+ # Deserialize Response
629
+ if status_code == 200
630
+ begin
631
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
632
+ result_mapper = VirtualMachineSizeListResult.mapper()
633
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
634
+ rescue Exception => e
635
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
636
+ end
637
+ end
675
638
 
676
639
  result
677
640
  end
@@ -680,46 +643,211 @@ module Azure::ARM::Compute
680
643
  end
681
644
 
682
645
  #
683
- # Sets the state of the VM as Generalized.
646
+ # The operation to power off (stop) a virtual machine. The virtual machine can
647
+ # be restarted with the same provisioned resources. You are still charged for
648
+ # this virtual machine.
684
649
  #
685
650
  # @param resource_group_name [String] The name of the resource group.
686
651
  # @param vm_name [String] The name of the virtual machine.
687
652
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
688
653
  # will be added to the HTTP request.
689
654
  #
655
+ def power_off(resource_group_name, vm_name, custom_headers = nil)
656
+ response = power_off_async(resource_group_name, vm_name, custom_headers).value!
657
+ nil
658
+ end
659
+
690
660
  #
691
- def generalize(resource_group_name, vm_name, custom_headers = nil)
692
- response = generalize_async(resource_group_name, vm_name, custom_headers).value!
661
+ # @param resource_group_name [String] The name of the resource group.
662
+ # @param vm_name [String] The name of the virtual machine.
663
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
664
+ # will be added to the HTTP request.
665
+ #
666
+ # @return [Concurrent::Promise] promise which provides async access to http
667
+ # response.
668
+ #
669
+ def power_off_async(resource_group_name, vm_name, custom_headers = nil)
670
+ # Send request
671
+ promise = begin_power_off_async(resource_group_name, vm_name, custom_headers)
672
+
673
+ promise = promise.then do |response|
674
+ # Defining deserialization method.
675
+ deserialize_method = lambda do |parsed_response|
676
+ end
677
+
678
+ # Waiting for response.
679
+ @client.get_long_running_operation_result(response, deserialize_method)
680
+ end
681
+
682
+ promise
683
+ end
684
+
685
+ #
686
+ # The operation to restart a virtual machine.
687
+ #
688
+ # @param resource_group_name [String] The name of the resource group.
689
+ # @param vm_name [String] The name of the virtual machine.
690
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
691
+ # will be added to the HTTP request.
692
+ #
693
+ def restart(resource_group_name, vm_name, custom_headers = nil)
694
+ response = restart_async(resource_group_name, vm_name, custom_headers).value!
695
+ nil
696
+ end
697
+
698
+ #
699
+ # @param resource_group_name [String] The name of the resource group.
700
+ # @param vm_name [String] The name of the virtual machine.
701
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
702
+ # will be added to the HTTP request.
703
+ #
704
+ # @return [Concurrent::Promise] promise which provides async access to http
705
+ # response.
706
+ #
707
+ def restart_async(resource_group_name, vm_name, custom_headers = nil)
708
+ # Send request
709
+ promise = begin_restart_async(resource_group_name, vm_name, custom_headers)
710
+
711
+ promise = promise.then do |response|
712
+ # Defining deserialization method.
713
+ deserialize_method = lambda do |parsed_response|
714
+ end
715
+
716
+ # Waiting for response.
717
+ @client.get_long_running_operation_result(response, deserialize_method)
718
+ end
719
+
720
+ promise
721
+ end
722
+
723
+ #
724
+ # The operation to start a virtual machine.
725
+ #
726
+ # @param resource_group_name [String] The name of the resource group.
727
+ # @param vm_name [String] The name of the virtual machine.
728
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
729
+ # will be added to the HTTP request.
730
+ #
731
+ def start(resource_group_name, vm_name, custom_headers = nil)
732
+ response = start_async(resource_group_name, vm_name, custom_headers).value!
733
+ nil
734
+ end
735
+
736
+ #
737
+ # @param resource_group_name [String] The name of the resource group.
738
+ # @param vm_name [String] The name of the virtual machine.
739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
+ # will be added to the HTTP request.
741
+ #
742
+ # @return [Concurrent::Promise] promise which provides async access to http
743
+ # response.
744
+ #
745
+ def start_async(resource_group_name, vm_name, custom_headers = nil)
746
+ # Send request
747
+ promise = begin_start_async(resource_group_name, vm_name, custom_headers)
748
+
749
+ promise = promise.then do |response|
750
+ # Defining deserialization method.
751
+ deserialize_method = lambda do |parsed_response|
752
+ end
753
+
754
+ # Waiting for response.
755
+ @client.get_long_running_operation_result(response, deserialize_method)
756
+ end
757
+
758
+ promise
759
+ end
760
+
761
+ #
762
+ # The operation to redeploy a virtual machine.
763
+ #
764
+ # @param resource_group_name [String] The name of the resource group.
765
+ # @param vm_name [String] The name of the virtual machine.
766
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
767
+ # will be added to the HTTP request.
768
+ #
769
+ def redeploy(resource_group_name, vm_name, custom_headers = nil)
770
+ response = redeploy_async(resource_group_name, vm_name, custom_headers).value!
693
771
  nil
694
772
  end
695
773
 
696
774
  #
697
- # Sets the state of the VM as Generalized.
775
+ # @param resource_group_name [String] The name of the resource group.
776
+ # @param vm_name [String] The name of the virtual machine.
777
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
778
+ # will be added to the HTTP request.
779
+ #
780
+ # @return [Concurrent::Promise] promise which provides async access to http
781
+ # response.
782
+ #
783
+ def redeploy_async(resource_group_name, vm_name, custom_headers = nil)
784
+ # Send request
785
+ promise = begin_redeploy_async(resource_group_name, vm_name, custom_headers)
786
+
787
+ promise = promise.then do |response|
788
+ # Defining deserialization method.
789
+ deserialize_method = lambda do |parsed_response|
790
+ end
791
+
792
+ # Waiting for response.
793
+ @client.get_long_running_operation_result(response, deserialize_method)
794
+ end
795
+
796
+ promise
797
+ end
798
+
799
+ #
800
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
801
+ # template that can be used to create similar VMs.
698
802
  #
699
803
  # @param resource_group_name [String] The name of the resource group.
700
804
  # @param vm_name [String] The name of the virtual machine.
805
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
806
+ # the Capture Virtual Machine operation.
807
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
808
+ # will be added to the HTTP request.
809
+ #
810
+ # @return [VirtualMachineCaptureResult] operation results.
811
+ #
812
+ def begin_capture(resource_group_name, vm_name, parameters, custom_headers = nil)
813
+ response = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
814
+ response.body unless response.nil?
815
+ end
816
+
817
+ #
818
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
819
+ # template that can be used to create similar VMs.
820
+ #
821
+ # @param resource_group_name [String] The name of the resource group.
822
+ # @param vm_name [String] The name of the virtual machine.
823
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
824
+ # the Capture Virtual Machine operation.
701
825
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
702
826
  # will be added to the HTTP request.
703
827
  #
704
828
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
705
829
  #
706
- def generalize_with_http_info(resource_group_name, vm_name, custom_headers = nil)
707
- generalize_async(resource_group_name, vm_name, custom_headers).value!
830
+ def begin_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil)
831
+ begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
708
832
  end
709
833
 
710
834
  #
711
- # Sets the state of the VM as Generalized.
835
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
836
+ # template that can be used to create similar VMs.
712
837
  #
713
838
  # @param resource_group_name [String] The name of the resource group.
714
839
  # @param vm_name [String] The name of the virtual machine.
840
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
841
+ # the Capture Virtual Machine operation.
715
842
  # @param [Hash{String => String}] A hash of custom headers that will be added
716
843
  # to the HTTP request.
717
844
  #
718
845
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
719
846
  #
720
- def generalize_async(resource_group_name, vm_name, custom_headers = nil)
847
+ def begin_capture_async(resource_group_name, vm_name, parameters, custom_headers = nil)
721
848
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
722
849
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
850
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
723
851
  api_version = '2016-03-30'
724
852
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
725
853
 
@@ -729,7 +857,15 @@ module Azure::ARM::Compute
729
857
  # Set Headers
730
858
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
731
859
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
732
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'
860
+
861
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
862
+
863
+ # Serialize Request
864
+ request_mapper = VirtualMachineCaptureParameters.mapper()
865
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
866
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
867
+
868
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'
733
869
 
734
870
  request_url = @base_url || @client.base_url
735
871
 
@@ -737,6 +873,7 @@ module Azure::ARM::Compute
737
873
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
738
874
  path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
739
875
  query_params: {'api-version' => api_version},
876
+ body: request_content,
740
877
  headers: request_headers.merge(custom_headers || {}),
741
878
  base_url: request_url
742
879
  }
@@ -746,12 +883,22 @@ module Azure::ARM::Compute
746
883
  http_response = result.response
747
884
  status_code = http_response.status
748
885
  response_content = http_response.body
749
- unless status_code == 200
886
+ unless status_code == 200 || status_code == 202
750
887
  error_model = JSON.load(response_content)
751
888
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
752
889
  end
753
890
 
754
891
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
892
+ # Deserialize Response
893
+ if status_code == 200
894
+ begin
895
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
896
+ result_mapper = VirtualMachineCaptureResult.mapper()
897
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
898
+ rescue Exception => e
899
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
900
+ end
901
+ end
755
902
 
756
903
  result
757
904
  end
@@ -760,64 +907,54 @@ module Azure::ARM::Compute
760
907
  end
761
908
 
762
909
  #
763
- # The operation to list virtual machines under a resource group.
764
- #
765
- # @param resource_group_name [String] The name of the resource group.
766
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
767
- # will be added to the HTTP request.
768
- #
769
- # @return [VirtualMachineListResult] which provide lazy access to pages of the
770
- # response.
771
- #
772
- def list_as_lazy(resource_group_name, custom_headers = nil)
773
- response = list_async(resource_group_name, custom_headers).value!
774
- unless response.nil?
775
- page = response.body
776
- page.next_method = Proc.new do |next_page_link|
777
- list_next_async(next_page_link, custom_headers)
778
- end
779
- page
780
- end
781
- end
782
-
783
- #
784
- # The operation to list virtual machines under a resource group.
910
+ # The operation to create or update a virtual machine.
785
911
  #
786
912
  # @param resource_group_name [String] The name of the resource group.
913
+ # @param vm_name [String] The name of the virtual machine.
914
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
915
+ # Machine operation.
787
916
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
788
917
  # will be added to the HTTP request.
789
918
  #
790
- # @return [Array<VirtualMachine>] operation results.
919
+ # @return [VirtualMachine] operation results.
791
920
  #
792
- def list(resource_group_name, custom_headers = nil)
793
- first_page = list_as_lazy(resource_group_name, custom_headers)
794
- first_page.get_all_items
921
+ def begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
922
+ response = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
923
+ response.body unless response.nil?
795
924
  end
796
925
 
797
926
  #
798
- # The operation to list virtual machines under a resource group.
927
+ # The operation to create or update a virtual machine.
799
928
  #
800
929
  # @param resource_group_name [String] The name of the resource group.
930
+ # @param vm_name [String] The name of the virtual machine.
931
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
932
+ # Machine operation.
801
933
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
802
934
  # will be added to the HTTP request.
803
935
  #
804
936
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
805
937
  #
806
- def list_with_http_info(resource_group_name, custom_headers = nil)
807
- list_async(resource_group_name, custom_headers).value!
938
+ def begin_create_or_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil)
939
+ begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
808
940
  end
809
941
 
810
942
  #
811
- # The operation to list virtual machines under a resource group.
943
+ # The operation to create or update a virtual machine.
812
944
  #
813
945
  # @param resource_group_name [String] The name of the resource group.
946
+ # @param vm_name [String] The name of the virtual machine.
947
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
948
+ # Machine operation.
814
949
  # @param [Hash{String => String}] A hash of custom headers that will be added
815
950
  # to the HTTP request.
816
951
  #
817
952
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
818
953
  #
819
- def list_async(resource_group_name, custom_headers = nil)
954
+ def begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil)
820
955
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
956
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
957
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
821
958
  api_version = '2016-03-30'
822
959
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
823
960
 
@@ -827,24 +964,33 @@ module Azure::ARM::Compute
827
964
  # Set Headers
828
965
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
829
966
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
830
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'
967
+
968
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
969
+
970
+ # Serialize Request
971
+ request_mapper = VirtualMachine.mapper()
972
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
973
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
974
+
975
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
831
976
 
832
977
  request_url = @base_url || @client.base_url
833
978
 
834
979
  options = {
835
980
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
836
- path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
981
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
837
982
  query_params: {'api-version' => api_version},
983
+ body: request_content,
838
984
  headers: request_headers.merge(custom_headers || {}),
839
985
  base_url: request_url
840
986
  }
841
- promise = @client.make_request_async(:get, path_template, options)
987
+ promise = @client.make_request_async(:put, path_template, options)
842
988
 
843
989
  promise = promise.then do |result|
844
990
  http_response = result.response
845
991
  status_code = http_response.status
846
992
  response_content = http_response.body
847
- unless status_code == 200
993
+ unless status_code == 200 || status_code == 201
848
994
  error_model = JSON.load(response_content)
849
995
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
850
996
  end
@@ -854,7 +1000,17 @@ module Azure::ARM::Compute
854
1000
  if status_code == 200
855
1001
  begin
856
1002
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
857
- result_mapper = VirtualMachineListResult.mapper()
1003
+ result_mapper = VirtualMachine.mapper()
1004
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1005
+ rescue Exception => e
1006
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1007
+ end
1008
+ end
1009
+ # Deserialize Response
1010
+ if status_code == 201
1011
+ begin
1012
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1013
+ result_mapper = VirtualMachine.mapper()
858
1014
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
859
1015
  rescue Exception => e
860
1016
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -868,67 +1024,46 @@ module Azure::ARM::Compute
868
1024
  end
869
1025
 
870
1026
  #
871
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
872
- # in the response to get the next page of Virtual Machines. Do this till
873
- # nextLink is not null to fetch all the Virtual Machines.
874
- #
875
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
876
- # will be added to the HTTP request.
877
- #
878
- # @return [VirtualMachineListResult] which provide lazy access to pages of the
879
- # response.
880
- #
881
- def list_all_as_lazy(custom_headers = nil)
882
- response = list_all_async(custom_headers).value!
883
- unless response.nil?
884
- page = response.body
885
- page.next_method = Proc.new do |next_page_link|
886
- list_all_next_async(next_page_link, custom_headers)
887
- end
888
- page
889
- end
890
- end
891
-
892
- #
893
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
894
- # in the response to get the next page of Virtual Machines. Do this till
895
- # nextLink is not null to fetch all the Virtual Machines.
1027
+ # The operation to delete a virtual machine.
896
1028
  #
1029
+ # @param resource_group_name [String] The name of the resource group.
1030
+ # @param vm_name [String] The name of the virtual machine.
897
1031
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
898
1032
  # will be added to the HTTP request.
899
1033
  #
900
- # @return [Array<VirtualMachine>] operation results.
901
1034
  #
902
- def list_all(custom_headers = nil)
903
- first_page = list_all_as_lazy(custom_headers)
904
- first_page.get_all_items
1035
+ def begin_delete(resource_group_name, vm_name, custom_headers = nil)
1036
+ response = begin_delete_async(resource_group_name, vm_name, custom_headers).value!
1037
+ nil
905
1038
  end
906
1039
 
907
1040
  #
908
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
909
- # in the response to get the next page of Virtual Machines. Do this till
910
- # nextLink is not null to fetch all the Virtual Machines.
1041
+ # The operation to delete a virtual machine.
911
1042
  #
1043
+ # @param resource_group_name [String] The name of the resource group.
1044
+ # @param vm_name [String] The name of the virtual machine.
912
1045
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
913
1046
  # will be added to the HTTP request.
914
1047
  #
915
1048
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
916
1049
  #
917
- def list_all_with_http_info(custom_headers = nil)
918
- list_all_async(custom_headers).value!
1050
+ def begin_delete_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1051
+ begin_delete_async(resource_group_name, vm_name, custom_headers).value!
919
1052
  end
920
1053
 
921
1054
  #
922
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
923
- # in the response to get the next page of Virtual Machines. Do this till
924
- # nextLink is not null to fetch all the Virtual Machines.
1055
+ # The operation to delete a virtual machine.
925
1056
  #
1057
+ # @param resource_group_name [String] The name of the resource group.
1058
+ # @param vm_name [String] The name of the virtual machine.
926
1059
  # @param [Hash{String => String}] A hash of custom headers that will be added
927
1060
  # to the HTTP request.
928
1061
  #
929
1062
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
930
1063
  #
931
- def list_all_async(custom_headers = nil)
1064
+ def begin_delete_async(resource_group_name, vm_name, custom_headers = nil)
1065
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1066
+ fail ArgumentError, 'vm_name is nil' if vm_name.nil?
932
1067
  api_version = '2016-03-30'
933
1068
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
934
1069
 
@@ -938,39 +1073,29 @@ module Azure::ARM::Compute
938
1073
  # Set Headers
939
1074
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
940
1075
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
941
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'
1076
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
942
1077
 
943
1078
  request_url = @base_url || @client.base_url
944
1079
 
945
1080
  options = {
946
1081
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
947
- path_params: {'subscriptionId' => @client.subscription_id},
1082
+ path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
948
1083
  query_params: {'api-version' => api_version},
949
1084
  headers: request_headers.merge(custom_headers || {}),
950
1085
  base_url: request_url
951
1086
  }
952
- promise = @client.make_request_async(:get, path_template, options)
1087
+ promise = @client.make_request_async(:delete, path_template, options)
953
1088
 
954
1089
  promise = promise.then do |result|
955
1090
  http_response = result.response
956
1091
  status_code = http_response.status
957
1092
  response_content = http_response.body
958
- unless status_code == 200
1093
+ unless status_code == 202 || status_code == 204
959
1094
  error_model = JSON.load(response_content)
960
1095
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
961
1096
  end
962
1097
 
963
1098
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
964
- # Deserialize Response
965
- if status_code == 200
966
- begin
967
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
968
- result_mapper = VirtualMachineListResult.mapper()
969
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
970
- rescue Exception => e
971
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
972
- end
973
- end
974
1099
 
975
1100
  result
976
1101
  end
@@ -979,24 +1104,23 @@ module Azure::ARM::Compute
979
1104
  end
980
1105
 
981
1106
  #
982
- # Lists all available virtual machine sizes it can be resized to for a virtual
983
- # machine.
1107
+ # Shuts down the virtual machine and releases the compute resources. You are
1108
+ # not billed for the compute resources that this virtual machine uses.
984
1109
  #
985
1110
  # @param resource_group_name [String] The name of the resource group.
986
1111
  # @param vm_name [String] The name of the virtual machine.
987
1112
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
988
1113
  # will be added to the HTTP request.
989
1114
  #
990
- # @return [VirtualMachineSizeListResult] operation results.
991
1115
  #
992
- def list_available_sizes(resource_group_name, vm_name, custom_headers = nil)
993
- response = list_available_sizes_async(resource_group_name, vm_name, custom_headers).value!
994
- response.body unless response.nil?
1116
+ def begin_deallocate(resource_group_name, vm_name, custom_headers = nil)
1117
+ response = begin_deallocate_async(resource_group_name, vm_name, custom_headers).value!
1118
+ nil
995
1119
  end
996
1120
 
997
1121
  #
998
- # Lists all available virtual machine sizes it can be resized to for a virtual
999
- # machine.
1122
+ # Shuts down the virtual machine and releases the compute resources. You are
1123
+ # not billed for the compute resources that this virtual machine uses.
1000
1124
  #
1001
1125
  # @param resource_group_name [String] The name of the resource group.
1002
1126
  # @param vm_name [String] The name of the virtual machine.
@@ -1005,13 +1129,13 @@ module Azure::ARM::Compute
1005
1129
  #
1006
1130
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1007
1131
  #
1008
- def list_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1009
- list_available_sizes_async(resource_group_name, vm_name, custom_headers).value!
1132
+ def begin_deallocate_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1133
+ begin_deallocate_async(resource_group_name, vm_name, custom_headers).value!
1010
1134
  end
1011
1135
 
1012
1136
  #
1013
- # Lists all available virtual machine sizes it can be resized to for a virtual
1014
- # machine.
1137
+ # Shuts down the virtual machine and releases the compute resources. You are
1138
+ # not billed for the compute resources that this virtual machine uses.
1015
1139
  #
1016
1140
  # @param resource_group_name [String] The name of the resource group.
1017
1141
  # @param vm_name [String] The name of the virtual machine.
@@ -1020,7 +1144,7 @@ module Azure::ARM::Compute
1020
1144
  #
1021
1145
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1022
1146
  #
1023
- def list_available_sizes_async(resource_group_name, vm_name, custom_headers = nil)
1147
+ def begin_deallocate_async(resource_group_name, vm_name, custom_headers = nil)
1024
1148
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1025
1149
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
1026
1150
  api_version = '2016-03-30'
@@ -1032,7 +1156,7 @@ module Azure::ARM::Compute
1032
1156
  # Set Headers
1033
1157
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1034
1158
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1035
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'
1159
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'
1036
1160
 
1037
1161
  request_url = @base_url || @client.base_url
1038
1162
 
@@ -1043,28 +1167,18 @@ module Azure::ARM::Compute
1043
1167
  headers: request_headers.merge(custom_headers || {}),
1044
1168
  base_url: request_url
1045
1169
  }
1046
- promise = @client.make_request_async(:get, path_template, options)
1170
+ promise = @client.make_request_async(:post, path_template, options)
1047
1171
 
1048
1172
  promise = promise.then do |result|
1049
1173
  http_response = result.response
1050
1174
  status_code = http_response.status
1051
1175
  response_content = http_response.body
1052
- unless status_code == 200
1176
+ unless status_code == 202
1053
1177
  error_model = JSON.load(response_content)
1054
1178
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1055
1179
  end
1056
1180
 
1057
1181
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1058
- # Deserialize Response
1059
- if status_code == 200
1060
- begin
1061
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1062
- result_mapper = VirtualMachineSizeListResult.mapper()
1063
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1064
- rescue Exception => e
1065
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1066
- end
1067
- end
1068
1182
 
1069
1183
  result
1070
1184
  end
@@ -1073,45 +1187,9 @@ module Azure::ARM::Compute
1073
1187
  end
1074
1188
 
1075
1189
  #
1076
- # The operation to power off (stop) a virtual machine.
1077
- #
1078
- # @param resource_group_name [String] The name of the resource group.
1079
- # @param vm_name [String] The name of the virtual machine.
1080
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1081
- # will be added to the HTTP request.
1082
- #
1083
- def power_off(resource_group_name, vm_name, custom_headers = nil)
1084
- response = power_off_async(resource_group_name, vm_name, custom_headers).value!
1085
- nil
1086
- end
1087
-
1088
- #
1089
- # @param resource_group_name [String] The name of the resource group.
1090
- # @param vm_name [String] The name of the virtual machine.
1091
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1092
- # will be added to the HTTP request.
1093
- #
1094
- # @return [Concurrent::Promise] promise which provides async access to http
1095
- # response.
1096
- #
1097
- def power_off_async(resource_group_name, vm_name, custom_headers = nil)
1098
- # Send request
1099
- promise = begin_power_off_async(resource_group_name, vm_name, custom_headers)
1100
-
1101
- promise = promise.then do |response|
1102
- # Defining deserialization method.
1103
- deserialize_method = lambda do |parsed_response|
1104
- end
1105
-
1106
- # Waiting for response.
1107
- @client.get_long_running_operation_result(response, deserialize_method)
1108
- end
1109
-
1110
- promise
1111
- end
1112
-
1113
- #
1114
- # The operation to power off (stop) a virtual machine.
1190
+ # The operation to power off (stop) a virtual machine. The virtual machine can
1191
+ # be restarted with the same provisioned resources. You are still charged for
1192
+ # this virtual machine.
1115
1193
  #
1116
1194
  # @param resource_group_name [String] The name of the resource group.
1117
1195
  # @param vm_name [String] The name of the virtual machine.
@@ -1125,7 +1203,9 @@ module Azure::ARM::Compute
1125
1203
  end
1126
1204
 
1127
1205
  #
1128
- # The operation to power off (stop) a virtual machine.
1206
+ # The operation to power off (stop) a virtual machine. The virtual machine can
1207
+ # be restarted with the same provisioned resources. You are still charged for
1208
+ # this virtual machine.
1129
1209
  #
1130
1210
  # @param resource_group_name [String] The name of the resource group.
1131
1211
  # @param vm_name [String] The name of the virtual machine.
@@ -1139,7 +1219,9 @@ module Azure::ARM::Compute
1139
1219
  end
1140
1220
 
1141
1221
  #
1142
- # The operation to power off (stop) a virtual machine.
1222
+ # The operation to power off (stop) a virtual machine. The virtual machine can
1223
+ # be restarted with the same provisioned resources. You are still charged for
1224
+ # this virtual machine.
1143
1225
  #
1144
1226
  # @param resource_group_name [String] The name of the resource group.
1145
1227
  # @param vm_name [String] The name of the virtual machine.
@@ -1190,44 +1272,6 @@ module Azure::ARM::Compute
1190
1272
  promise.execute
1191
1273
  end
1192
1274
 
1193
- #
1194
- # The operation to restart a virtual machine.
1195
- #
1196
- # @param resource_group_name [String] The name of the resource group.
1197
- # @param vm_name [String] The name of the virtual machine.
1198
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1199
- # will be added to the HTTP request.
1200
- #
1201
- def restart(resource_group_name, vm_name, custom_headers = nil)
1202
- response = restart_async(resource_group_name, vm_name, custom_headers).value!
1203
- nil
1204
- end
1205
-
1206
- #
1207
- # @param resource_group_name [String] The name of the resource group.
1208
- # @param vm_name [String] The name of the virtual machine.
1209
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1210
- # will be added to the HTTP request.
1211
- #
1212
- # @return [Concurrent::Promise] promise which provides async access to http
1213
- # response.
1214
- #
1215
- def restart_async(resource_group_name, vm_name, custom_headers = nil)
1216
- # Send request
1217
- promise = begin_restart_async(resource_group_name, vm_name, custom_headers)
1218
-
1219
- promise = promise.then do |response|
1220
- # Defining deserialization method.
1221
- deserialize_method = lambda do |parsed_response|
1222
- end
1223
-
1224
- # Waiting for response.
1225
- @client.get_long_running_operation_result(response, deserialize_method)
1226
- end
1227
-
1228
- promise
1229
- end
1230
-
1231
1275
  #
1232
1276
  # The operation to restart a virtual machine.
1233
1277
  #
@@ -1308,44 +1352,6 @@ module Azure::ARM::Compute
1308
1352
  promise.execute
1309
1353
  end
1310
1354
 
1311
- #
1312
- # The operation to start a virtual machine.
1313
- #
1314
- # @param resource_group_name [String] The name of the resource group.
1315
- # @param vm_name [String] The name of the virtual machine.
1316
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1317
- # will be added to the HTTP request.
1318
- #
1319
- def start(resource_group_name, vm_name, custom_headers = nil)
1320
- response = start_async(resource_group_name, vm_name, custom_headers).value!
1321
- nil
1322
- end
1323
-
1324
- #
1325
- # @param resource_group_name [String] The name of the resource group.
1326
- # @param vm_name [String] The name of the virtual machine.
1327
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1328
- # will be added to the HTTP request.
1329
- #
1330
- # @return [Concurrent::Promise] promise which provides async access to http
1331
- # response.
1332
- #
1333
- def start_async(resource_group_name, vm_name, custom_headers = nil)
1334
- # Send request
1335
- promise = begin_start_async(resource_group_name, vm_name, custom_headers)
1336
-
1337
- promise = promise.then do |response|
1338
- # Defining deserialization method.
1339
- deserialize_method = lambda do |parsed_response|
1340
- end
1341
-
1342
- # Waiting for response.
1343
- @client.get_long_running_operation_result(response, deserialize_method)
1344
- end
1345
-
1346
- promise
1347
- end
1348
-
1349
1355
  #
1350
1356
  # The operation to start a virtual machine.
1351
1357
  #
@@ -1426,44 +1432,6 @@ module Azure::ARM::Compute
1426
1432
  promise.execute
1427
1433
  end
1428
1434
 
1429
- #
1430
- # The operation to redeploy a virtual machine.
1431
- #
1432
- # @param resource_group_name [String] The name of the resource group.
1433
- # @param vm_name [String] The name of the virtual machine.
1434
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1435
- # will be added to the HTTP request.
1436
- #
1437
- def redeploy(resource_group_name, vm_name, custom_headers = nil)
1438
- response = redeploy_async(resource_group_name, vm_name, custom_headers).value!
1439
- nil
1440
- end
1441
-
1442
- #
1443
- # @param resource_group_name [String] The name of the resource group.
1444
- # @param vm_name [String] The name of the virtual machine.
1445
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1446
- # will be added to the HTTP request.
1447
- #
1448
- # @return [Concurrent::Promise] promise which provides async access to http
1449
- # response.
1450
- #
1451
- def redeploy_async(resource_group_name, vm_name, custom_headers = nil)
1452
- # Send request
1453
- promise = begin_redeploy_async(resource_group_name, vm_name, custom_headers)
1454
-
1455
- promise = promise.then do |response|
1456
- # Defining deserialization method.
1457
- deserialize_method = lambda do |parsed_response|
1458
- end
1459
-
1460
- # Waiting for response.
1461
- @client.get_long_running_operation_result(response, deserialize_method)
1462
- end
1463
-
1464
- promise
1465
- end
1466
-
1467
1435
  #
1468
1436
  # The operation to redeploy a virtual machine.
1469
1437
  #
@@ -1545,10 +1513,11 @@ module Azure::ARM::Compute
1545
1513
  end
1546
1514
 
1547
1515
  #
1548
- # The operation to list virtual machines under a resource group.
1516
+ # Lists all of the virtual machines in the specified resource group. Use the
1517
+ # nextLink property in the response to get the next page of virtual machines.
1549
1518
  #
1550
- # @param next_page_link [String] The NextLink from the previous successful
1551
- # call to List operation.
1519
+ # @param next_page_link [String] The NextLink from the previous successful call
1520
+ # to List operation.
1552
1521
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1553
1522
  # will be added to the HTTP request.
1554
1523
  #
@@ -1560,10 +1529,11 @@ module Azure::ARM::Compute
1560
1529
  end
1561
1530
 
1562
1531
  #
1563
- # The operation to list virtual machines under a resource group.
1532
+ # Lists all of the virtual machines in the specified resource group. Use the
1533
+ # nextLink property in the response to get the next page of virtual machines.
1564
1534
  #
1565
- # @param next_page_link [String] The NextLink from the previous successful
1566
- # call to List operation.
1535
+ # @param next_page_link [String] The NextLink from the previous successful call
1536
+ # to List operation.
1567
1537
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1568
1538
  # will be added to the HTTP request.
1569
1539
  #
@@ -1574,10 +1544,11 @@ module Azure::ARM::Compute
1574
1544
  end
1575
1545
 
1576
1546
  #
1577
- # The operation to list virtual machines under a resource group.
1547
+ # Lists all of the virtual machines in the specified resource group. Use the
1548
+ # nextLink property in the response to get the next page of virtual machines.
1578
1549
  #
1579
- # @param next_page_link [String] The NextLink from the previous successful
1580
- # call to List operation.
1550
+ # @param next_page_link [String] The NextLink from the previous successful call
1551
+ # to List operation.
1581
1552
  # @param [Hash{String => String}] A hash of custom headers that will be added
1582
1553
  # to the HTTP request.
1583
1554
  #
@@ -1632,12 +1603,11 @@ module Azure::ARM::Compute
1632
1603
  end
1633
1604
 
1634
1605
  #
1635
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
1636
- # in the response to get the next page of Virtual Machines. Do this till
1637
- # nextLink is not null to fetch all the Virtual Machines.
1606
+ # Lists all of the virtual machines in the specified subscription. Use the
1607
+ # nextLink property in the response to get the next page of virtual machines.
1638
1608
  #
1639
- # @param next_page_link [String] The NextLink from the previous successful
1640
- # call to List operation.
1609
+ # @param next_page_link [String] The NextLink from the previous successful call
1610
+ # to List operation.
1641
1611
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1642
1612
  # will be added to the HTTP request.
1643
1613
  #
@@ -1649,12 +1619,11 @@ module Azure::ARM::Compute
1649
1619
  end
1650
1620
 
1651
1621
  #
1652
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
1653
- # in the response to get the next page of Virtual Machines. Do this till
1654
- # nextLink is not null to fetch all the Virtual Machines.
1622
+ # Lists all of the virtual machines in the specified subscription. Use the
1623
+ # nextLink property in the response to get the next page of virtual machines.
1655
1624
  #
1656
- # @param next_page_link [String] The NextLink from the previous successful
1657
- # call to List operation.
1625
+ # @param next_page_link [String] The NextLink from the previous successful call
1626
+ # to List operation.
1658
1627
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1659
1628
  # will be added to the HTTP request.
1660
1629
  #
@@ -1665,12 +1634,11 @@ module Azure::ARM::Compute
1665
1634
  end
1666
1635
 
1667
1636
  #
1668
- # Gets the list of Virtual Machines in the subscription. Use nextLink property
1669
- # in the response to get the next page of Virtual Machines. Do this till
1670
- # nextLink is not null to fetch all the Virtual Machines.
1637
+ # Lists all of the virtual machines in the specified subscription. Use the
1638
+ # nextLink property in the response to get the next page of virtual machines.
1671
1639
  #
1672
- # @param next_page_link [String] The NextLink from the previous successful
1673
- # call to List operation.
1640
+ # @param next_page_link [String] The NextLink from the previous successful call
1641
+ # to List operation.
1674
1642
  # @param [Hash{String => String}] A hash of custom headers that will be added
1675
1643
  # to the HTTP request.
1676
1644
  #
@@ -1724,5 +1692,48 @@ module Azure::ARM::Compute
1724
1692
  promise.execute
1725
1693
  end
1726
1694
 
1695
+ #
1696
+ # Lists all of the virtual machines in the specified resource group. Use the
1697
+ # nextLink property in the response to get the next page of virtual machines.
1698
+ #
1699
+ # @param resource_group_name [String] The name of the resource group.
1700
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1701
+ # will be added to the HTTP request.
1702
+ #
1703
+ # @return [VirtualMachineListResult] which provide lazy access to pages of the
1704
+ # response.
1705
+ #
1706
+ def list_as_lazy(resource_group_name, custom_headers = nil)
1707
+ response = list_async(resource_group_name, custom_headers).value!
1708
+ unless response.nil?
1709
+ page = response.body
1710
+ page.next_method = Proc.new do |next_page_link|
1711
+ list_next_async(next_page_link, custom_headers)
1712
+ end
1713
+ page
1714
+ end
1715
+ end
1716
+
1717
+ #
1718
+ # Lists all of the virtual machines in the specified subscription. Use the
1719
+ # nextLink property in the response to get the next page of virtual machines.
1720
+ #
1721
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1722
+ # will be added to the HTTP request.
1723
+ #
1724
+ # @return [VirtualMachineListResult] which provide lazy access to pages of the
1725
+ # response.
1726
+ #
1727
+ def list_all_as_lazy(custom_headers = nil)
1728
+ response = list_all_async(custom_headers).value!
1729
+ unless response.nil?
1730
+ page = response.body
1731
+ page.next_method = Proc.new do |next_page_link|
1732
+ list_all_next_async(next_page_link, custom_headers)
1733
+ end
1734
+ page
1735
+ end
1736
+ end
1737
+
1727
1738
  end
1728
1739
  end