azure_mgmt_compute 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +1 -27
  3. data/azure_mgmt_compute.gemspec +1 -1
  4. data/lib/azure_mgmt_compute/availability_sets.rb +184 -141
  5. data/lib/azure_mgmt_compute/compute_management_client.rb +2 -2
  6. data/lib/azure_mgmt_compute/models/additional_unattend_content.rb +1 -1
  7. data/lib/azure_mgmt_compute/models/api_entity_reference.rb +2 -3
  8. data/lib/azure_mgmt_compute/models/api_error.rb +1 -1
  9. data/lib/azure_mgmt_compute/models/api_error_base.rb +1 -1
  10. data/lib/azure_mgmt_compute/models/availability_set.rb +1 -1
  11. data/lib/azure_mgmt_compute/models/availability_set_list_result.rb +1 -1
  12. data/lib/azure_mgmt_compute/models/availability_set_properties.rb +2 -2
  13. data/lib/azure_mgmt_compute/models/boot_diagnostics.rb +3 -3
  14. data/lib/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +1 -1
  15. data/lib/azure_mgmt_compute/models/caching_types.rb +1 -1
  16. data/lib/azure_mgmt_compute/models/component_names.rb +1 -1
  17. data/lib/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +1 -1
  18. data/lib/azure_mgmt_compute/models/data_disk.rb +1 -1
  19. data/lib/azure_mgmt_compute/models/data_disk_image.rb +1 -1
  20. data/lib/azure_mgmt_compute/models/diagnostics_profile.rb +1 -1
  21. data/lib/azure_mgmt_compute/models/disk_create_option_types.rb +1 -1
  22. data/lib/azure_mgmt_compute/models/disk_encryption_settings.rb +11 -2
  23. data/lib/azure_mgmt_compute/models/disk_instance_view.rb +1 -1
  24. data/lib/azure_mgmt_compute/models/hardware_profile.rb +9 -6
  25. data/lib/azure_mgmt_compute/models/image_reference.rb +1 -1
  26. data/lib/azure_mgmt_compute/models/inner_error.rb +1 -1
  27. data/lib/azure_mgmt_compute/models/instance_view_status.rb +4 -4
  28. data/lib/azure_mgmt_compute/models/instance_view_types.rb +15 -0
  29. data/lib/azure_mgmt_compute/models/key_vault_key_reference.rb +1 -1
  30. data/lib/azure_mgmt_compute/models/key_vault_secret_reference.rb +1 -1
  31. data/lib/azure_mgmt_compute/models/linux_configuration.rb +1 -1
  32. data/lib/azure_mgmt_compute/models/list_usages_result.rb +1 -1
  33. data/lib/azure_mgmt_compute/models/network_interface_reference.rb +1 -1
  34. data/lib/azure_mgmt_compute/models/network_interface_reference_properties.rb +1 -1
  35. data/lib/azure_mgmt_compute/models/network_profile.rb +1 -1
  36. data/lib/azure_mgmt_compute/models/operating_system_types.rb +1 -1
  37. data/lib/azure_mgmt_compute/models/osdisk.rb +1 -1
  38. data/lib/azure_mgmt_compute/models/osdisk_image.rb +1 -1
  39. data/lib/azure_mgmt_compute/models/osprofile.rb +1 -1
  40. data/lib/azure_mgmt_compute/models/pass_names.rb +1 -1
  41. data/lib/azure_mgmt_compute/models/plan.rb +1 -1
  42. data/lib/azure_mgmt_compute/models/protocol_types.rb +1 -1
  43. data/lib/azure_mgmt_compute/models/purchase_plan.rb +1 -1
  44. data/lib/azure_mgmt_compute/models/setting_names.rb +1 -1
  45. data/lib/azure_mgmt_compute/models/sku.rb +1 -1
  46. data/lib/azure_mgmt_compute/models/ssh_configuration.rb +1 -1
  47. data/lib/azure_mgmt_compute/models/ssh_public_key.rb +1 -1
  48. data/lib/azure_mgmt_compute/models/status_level_types.rb +1 -1
  49. data/lib/azure_mgmt_compute/models/storage_profile.rb +1 -1
  50. data/lib/azure_mgmt_compute/models/upgrade_mode.rb +1 -1
  51. data/lib/azure_mgmt_compute/models/upgrade_policy.rb +1 -1
  52. data/lib/azure_mgmt_compute/models/usage.rb +1 -1
  53. data/lib/azure_mgmt_compute/models/usage_name.rb +1 -1
  54. data/lib/azure_mgmt_compute/models/vault_certificate.rb +1 -1
  55. data/lib/azure_mgmt_compute/models/vault_secret_group.rb +1 -1
  56. data/lib/azure_mgmt_compute/models/virtual_hard_disk.rb +1 -1
  57. data/lib/azure_mgmt_compute/models/virtual_machine.rb +1 -1
  58. data/lib/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +1 -1
  59. data/lib/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +1 -1
  60. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result.rb +1 -1
  61. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result_properties.rb +1 -1
  62. data/lib/azure_mgmt_compute/models/virtual_machine_extension.rb +1 -1
  63. data/lib/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +1 -1
  64. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image.rb +20 -27
  65. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image_properties.rb +1 -1
  66. data/lib/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +1 -1
  67. data/lib/azure_mgmt_compute/models/virtual_machine_extension_properties.rb +11 -11
  68. data/lib/azure_mgmt_compute/models/virtual_machine_image.rb +8 -21
  69. data/lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb +1 -1
  70. data/lib/azure_mgmt_compute/models/virtual_machine_image_resource.rb +1 -1
  71. data/lib/azure_mgmt_compute/models/virtual_machine_instance_view.rb +1 -1
  72. data/lib/azure_mgmt_compute/models/virtual_machine_list_result.rb +1 -1
  73. data/lib/azure_mgmt_compute/models/virtual_machine_properties.rb +10 -1
  74. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set.rb +1 -1
  75. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +1 -1
  76. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +1 -1
  77. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_properties.rb +1 -1
  78. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +1 -1
  79. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +1 -1
  80. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +1 -1
  81. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration_properties.rb +43 -12
  82. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +1 -1
  83. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +1 -1
  84. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +1 -1
  85. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +1 -1
  86. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_properties.rb +1 -1
  87. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +1 -1
  88. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +1 -1
  89. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +1 -1
  90. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_properties.rb +11 -1
  91. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +1 -1
  92. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +1 -1
  93. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_scale_type.rb +1 -1
  94. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +1 -1
  95. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +1 -1
  96. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +1 -1
  97. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +1 -1
  98. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +1 -1
  99. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +1 -1
  100. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +1 -1
  101. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +1 -1
  102. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmproperties.rb +1 -1
  103. data/lib/azure_mgmt_compute/models/virtual_machine_size.rb +1 -1
  104. data/lib/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +1 -1
  105. data/lib/azure_mgmt_compute/models/virtual_machine_size_types.rb +12 -1
  106. data/lib/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +1 -1
  107. data/lib/azure_mgmt_compute/models/win_rmconfiguration.rb +1 -1
  108. data/lib/azure_mgmt_compute/models/win_rmlistener.rb +1 -1
  109. data/lib/azure_mgmt_compute/models/windows_configuration.rb +1 -1
  110. data/lib/azure_mgmt_compute/module_definition.rb +1 -1
  111. data/lib/azure_mgmt_compute/usage_operations.rb +71 -11
  112. data/lib/azure_mgmt_compute/version.rb +2 -2
  113. data/lib/azure_mgmt_compute/virtual_machine_extension_images.rb +123 -18
  114. data/lib/azure_mgmt_compute/virtual_machine_extensions.rb +132 -22
  115. data/lib/azure_mgmt_compute/virtual_machine_images.rb +197 -26
  116. data/lib/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +419 -79
  117. data/lib/azure_mgmt_compute/virtual_machine_scale_sets.rb +736 -147
  118. data/lib/azure_mgmt_compute/virtual_machine_sizes.rb +36 -64
  119. data/lib/azure_mgmt_compute/virtual_machines.rb +531 -200
  120. data/lib/azure_mgmt_compute.rb +3 -6
  121. metadata +26 -24
  122. data/lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb +0 -123
  123. data/lib/azure_mgmt_compute/models/compute_operation_status.rb +0 -18
  124. data/lib/azure_mgmt_compute/models/delete_operation_result.rb +0 -110
  125. data/lib/azure_mgmt_compute/models/operation_status.rb +0 -17
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -23,8 +23,8 @@ module Azure::ARM::Compute
23
23
  attr_reader :client
24
24
 
25
25
  #
26
- # Captures the VM by copying VirtualHardDisks of the VM and outputs a template
27
- # that can be used to create similar VMs.
26
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
27
+ # template that can be used to create similar VMs.
28
28
  #
29
29
  # @param resource_group_name [String] The name of the resource group.
30
30
  # @param vm_name [String] The name of the virtual machine.
@@ -35,7 +35,7 @@ module Azure::ARM::Compute
35
35
  #
36
36
  def capture(resource_group_name, vm_name, parameters, custom_headers = nil)
37
37
  # Send request
38
- promise = begin_capture(resource_group_name, vm_name, parameters, custom_headers)
38
+ promise = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers)
39
39
 
40
40
  promise = promise.then do |response|
41
41
  # Defining deserialization method.
@@ -46,27 +46,61 @@ module Azure::ARM::Compute
46
46
  end
47
47
 
48
48
  # Waiting for response.
49
- @client.get_post_or_delete_operation_result(response, deserialize_method)
49
+ @client.get_long_running_operation_result(response, deserialize_method)
50
50
  end
51
51
 
52
52
  promise
53
53
  end
54
54
 
55
55
  #
56
- # Captures the VM by copying VirtualHardDisks of the VM and outputs a template
57
- # that can be used to create similar VMs.
56
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
57
+ # template that can be used to create similar VMs.
58
58
  #
59
59
  # @param resource_group_name [String] The name of the resource group.
60
60
  # @param vm_name [String] The name of the virtual machine.
61
61
  # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
62
62
  # the Capture Virtual Machine operation.
63
- # @param [Hash{String => String}] The hash of custom headers need to be
64
- # applied to HTTP request.
63
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
64
+ # will be added to the HTTP request.
65
65
  #
66
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
67
- # response.
66
+ # @return [VirtualMachineCaptureResult] operation results.
68
67
  #
69
68
  def begin_capture(resource_group_name, vm_name, parameters, custom_headers = nil)
69
+ response = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
70
+ response.body unless response.nil?
71
+ end
72
+
73
+ #
74
+ # Captures the VM by copying virtual hard disks of the VM and outputs a
75
+ # template that can be used to create similar VMs.
76
+ #
77
+ # @param resource_group_name [String] The name of the resource group.
78
+ # @param vm_name [String] The name of the virtual machine.
79
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
80
+ # the Capture Virtual Machine operation.
81
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
82
+ # will be added to the HTTP request.
83
+ #
84
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
85
+ #
86
+ def begin_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil)
87
+ begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
88
+ end
89
+
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
+ #
94
+ # @param resource_group_name [String] The name of the resource group.
95
+ # @param vm_name [String] The name of the virtual machine.
96
+ # @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
97
+ # the Capture Virtual Machine operation.
98
+ # @param [Hash{String => String}] A hash of custom headers that will be added
99
+ # to the HTTP request.
100
+ #
101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
102
+ #
103
+ def begin_capture_async(resource_group_name, vm_name, parameters, custom_headers = nil)
70
104
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
105
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
72
106
  fail ArgumentError, 'parameters is nil' if parameters.nil?
@@ -84,7 +118,7 @@ module Azure::ARM::Compute
84
118
  unless parameters.nil?
85
119
  parameters = VirtualMachineCaptureParameters.serialize_object(parameters)
86
120
  end
87
- request_content = JSON.generate(parameters, quirks_mode: true)
121
+ request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
88
122
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'
89
123
  options = {
90
124
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -93,7 +127,10 @@ module Azure::ARM::Compute
93
127
  body: request_content,
94
128
  headers: request_headers.merge(custom_headers || {})
95
129
  }
96
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
130
+
131
+ request_url = @base_url || @client.base_url
132
+
133
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
97
134
  promise = request.run_promise do |req|
98
135
  @client.credentials.sign_request(req) unless @client.credentials.nil?
99
136
  end
@@ -147,7 +184,7 @@ module Azure::ARM::Compute
147
184
  #
148
185
  def create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
149
186
  # Send request
150
- promise = begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers)
187
+ promise = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers)
151
188
 
152
189
  promise = promise.then do |response|
153
190
  # Defining deserialization method.
@@ -158,7 +195,7 @@ module Azure::ARM::Compute
158
195
  end
159
196
 
160
197
  # Waiting for response.
161
- @client.get_put_operation_result(response, deserialize_method)
198
+ @client.get_long_running_operation_result(response, deserialize_method)
162
199
  end
163
200
 
164
201
  promise
@@ -171,13 +208,45 @@ module Azure::ARM::Compute
171
208
  # @param vm_name [String] The name of the virtual machine.
172
209
  # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
173
210
  # Machine operation.
174
- # @param [Hash{String => String}] The hash of custom headers need to be
175
- # applied to HTTP request.
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
176
213
  #
177
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
178
- # response.
214
+ # @return [VirtualMachine] operation results.
179
215
  #
180
216
  def begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
217
+ response = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
218
+ response.body unless response.nil?
219
+ end
220
+
221
+ #
222
+ # The operation to create or update a virtual machine.
223
+ #
224
+ # @param resource_group_name [String] The name of the resource group.
225
+ # @param vm_name [String] The name of the virtual machine.
226
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
227
+ # Machine operation.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
232
+ #
233
+ def begin_create_or_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil)
234
+ begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
235
+ end
236
+
237
+ #
238
+ # The operation to create or update a virtual machine.
239
+ #
240
+ # @param resource_group_name [String] The name of the resource group.
241
+ # @param vm_name [String] The name of the virtual machine.
242
+ # @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
243
+ # Machine operation.
244
+ # @param [Hash{String => String}] A hash of custom headers that will be added
245
+ # to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
248
+ #
249
+ def begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil)
181
250
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
182
251
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
183
252
  fail ArgumentError, 'parameters is nil' if parameters.nil?
@@ -195,7 +264,7 @@ module Azure::ARM::Compute
195
264
  unless parameters.nil?
196
265
  parameters = VirtualMachine.serialize_object(parameters)
197
266
  end
198
- request_content = JSON.generate(parameters, quirks_mode: true)
267
+ request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
199
268
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
200
269
  options = {
201
270
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -204,7 +273,10 @@ module Azure::ARM::Compute
204
273
  body: request_content,
205
274
  headers: request_headers.merge(custom_headers || {})
206
275
  }
207
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
276
+
277
+ request_url = @base_url || @client.base_url
278
+
279
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
208
280
  promise = request.run_promise do |req|
209
281
  @client.credentials.sign_request(req) unless @client.credentials.nil?
210
282
  end
@@ -261,7 +333,7 @@ module Azure::ARM::Compute
261
333
  #
262
334
  def delete(resource_group_name, vm_name, custom_headers = nil)
263
335
  # Send request
264
- promise = begin_delete(resource_group_name, vm_name, custom_headers)
336
+ promise = begin_delete_async(resource_group_name, vm_name, custom_headers)
265
337
 
266
338
  promise = promise.then do |response|
267
339
  # Defining deserialization method.
@@ -269,7 +341,7 @@ module Azure::ARM::Compute
269
341
  end
270
342
 
271
343
  # Waiting for response.
272
- @client.get_post_or_delete_operation_result(response, deserialize_method)
344
+ @client.get_long_running_operation_result(response, deserialize_method)
273
345
  end
274
346
 
275
347
  promise
@@ -280,13 +352,40 @@ module Azure::ARM::Compute
280
352
  #
281
353
  # @param resource_group_name [String] The name of the resource group.
282
354
  # @param vm_name [String] The name of the virtual machine.
283
- # @param [Hash{String => String}] The hash of custom headers need to be
284
- # applied to HTTP request.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
285
357
  #
286
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
287
- # response.
288
358
  #
289
359
  def begin_delete(resource_group_name, vm_name, custom_headers = nil)
360
+ response = begin_delete_async(resource_group_name, vm_name, custom_headers).value!
361
+ nil
362
+ end
363
+
364
+ #
365
+ # The operation to delete a virtual machine.
366
+ #
367
+ # @param resource_group_name [String] The name of the resource group.
368
+ # @param vm_name [String] The name of the virtual machine.
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
373
+ #
374
+ def begin_delete_with_http_info(resource_group_name, vm_name, custom_headers = nil)
375
+ begin_delete_async(resource_group_name, vm_name, custom_headers).value!
376
+ end
377
+
378
+ #
379
+ # The operation to delete a virtual machine.
380
+ #
381
+ # @param resource_group_name [String] The name of the resource group.
382
+ # @param vm_name [String] The name of the virtual machine.
383
+ # @param [Hash{String => String}] A hash of custom headers that will be added
384
+ # to the HTTP request.
385
+ #
386
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
387
+ #
388
+ def begin_delete_async(resource_group_name, vm_name, custom_headers = nil)
290
389
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
291
390
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
292
391
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -303,7 +402,10 @@ module Azure::ARM::Compute
303
402
  query_params: {'api-version' => @client.api_version},
304
403
  headers: request_headers.merge(custom_headers || {})
305
404
  }
306
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
405
+
406
+ request_url = @base_url || @client.base_url
407
+
408
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
307
409
  promise = request.run_promise do |req|
308
410
  @client.credentials.sign_request(req) unless @client.credentials.nil?
309
411
  end
@@ -311,7 +413,7 @@ module Azure::ARM::Compute
311
413
  promise = promise.then do |http_response|
312
414
  status_code = http_response.status
313
415
  response_content = http_response.body
314
- unless status_code == 200 || status_code == 202 || status_code == 204
416
+ unless status_code == 202 || status_code == 204
315
417
  error_model = JSON.load(response_content)
316
418
  fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
317
419
  end
@@ -331,14 +433,47 @@ module Azure::ARM::Compute
331
433
  #
332
434
  # @param resource_group_name [String] The name of the resource group.
333
435
  # @param vm_name [String] The name of the virtual machine.
334
- # @param expand [String] The expand expression to apply on the operation.
335
- # @param [Hash{String => String}] The hash of custom headers need to be
336
- # applied to HTTP request.
436
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
437
+ # operation. Possible values include: 'instanceView'
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
337
440
  #
338
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
339
- # response.
441
+ # @return [VirtualMachine] operation results.
340
442
  #
341
443
  def get(resource_group_name, vm_name, expand = nil, custom_headers = nil)
444
+ response = get_async(resource_group_name, vm_name, expand, custom_headers).value!
445
+ response.body unless response.nil?
446
+ end
447
+
448
+ #
449
+ # The operation to get a virtual machine.
450
+ #
451
+ # @param resource_group_name [String] The name of the resource group.
452
+ # @param vm_name [String] The name of the virtual machine.
453
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
454
+ # operation. Possible values include: 'instanceView'
455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
456
+ # will be added to the HTTP request.
457
+ #
458
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
459
+ #
460
+ def get_with_http_info(resource_group_name, vm_name, expand = nil, custom_headers = nil)
461
+ get_async(resource_group_name, vm_name, expand, custom_headers).value!
462
+ end
463
+
464
+ #
465
+ # The operation to get a virtual machine.
466
+ #
467
+ # @param resource_group_name [String] The name of the resource group.
468
+ # @param vm_name [String] The name of the virtual machine.
469
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
470
+ # operation. Possible values include: 'instanceView'
471
+ # @param [Hash{String => String}] A hash of custom headers that will be added
472
+ # to the HTTP request.
473
+ #
474
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
475
+ #
476
+ def get_async(resource_group_name, vm_name, expand = nil, custom_headers = nil)
342
477
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
343
478
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
344
479
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -355,7 +490,10 @@ module Azure::ARM::Compute
355
490
  query_params: {'$expand' => expand,'api-version' => @client.api_version},
356
491
  headers: request_headers.merge(custom_headers || {})
357
492
  }
358
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
493
+
494
+ request_url = @base_url || @client.base_url
495
+
496
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
359
497
  promise = request.run_promise do |req|
360
498
  @client.credentials.sign_request(req) unless @client.credentials.nil?
361
499
  end
@@ -401,7 +539,7 @@ module Azure::ARM::Compute
401
539
  #
402
540
  def deallocate(resource_group_name, vm_name, custom_headers = nil)
403
541
  # Send request
404
- promise = begin_deallocate(resource_group_name, vm_name, custom_headers)
542
+ promise = begin_deallocate_async(resource_group_name, vm_name, custom_headers)
405
543
 
406
544
  promise = promise.then do |response|
407
545
  # Defining deserialization method.
@@ -409,7 +547,7 @@ module Azure::ARM::Compute
409
547
  end
410
548
 
411
549
  # Waiting for response.
412
- @client.get_post_or_delete_operation_result(response, deserialize_method)
550
+ @client.get_long_running_operation_result(response, deserialize_method)
413
551
  end
414
552
 
415
553
  promise
@@ -421,13 +559,42 @@ module Azure::ARM::Compute
421
559
  #
422
560
  # @param resource_group_name [String] The name of the resource group.
423
561
  # @param vm_name [String] The name of the virtual machine.
424
- # @param [Hash{String => String}] The hash of custom headers need to be
425
- # applied to HTTP request.
562
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
+ # will be added to the HTTP request.
426
564
  #
427
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
428
- # response.
429
565
  #
430
566
  def begin_deallocate(resource_group_name, vm_name, custom_headers = nil)
567
+ response = begin_deallocate_async(resource_group_name, vm_name, custom_headers).value!
568
+ nil
569
+ end
570
+
571
+ #
572
+ # Shuts down the Virtual Machine and releases the compute resources. You are
573
+ # not billed for the compute resources that this Virtual Machine uses.
574
+ #
575
+ # @param resource_group_name [String] The name of the resource group.
576
+ # @param vm_name [String] The name of the virtual machine.
577
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
578
+ # will be added to the HTTP request.
579
+ #
580
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
581
+ #
582
+ def begin_deallocate_with_http_info(resource_group_name, vm_name, custom_headers = nil)
583
+ begin_deallocate_async(resource_group_name, vm_name, custom_headers).value!
584
+ end
585
+
586
+ #
587
+ # Shuts down the Virtual Machine and releases the compute resources. You are
588
+ # not billed for the compute resources that this Virtual Machine uses.
589
+ #
590
+ # @param resource_group_name [String] The name of the resource group.
591
+ # @param vm_name [String] The name of the virtual machine.
592
+ # @param [Hash{String => String}] A hash of custom headers that will be added
593
+ # to the HTTP request.
594
+ #
595
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
596
+ #
597
+ def begin_deallocate_async(resource_group_name, vm_name, custom_headers = nil)
431
598
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
432
599
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
433
600
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -444,7 +611,10 @@ module Azure::ARM::Compute
444
611
  query_params: {'api-version' => @client.api_version},
445
612
  headers: request_headers.merge(custom_headers || {})
446
613
  }
447
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
614
+
615
+ request_url = @base_url || @client.base_url
616
+
617
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
448
618
  promise = request.run_promise do |req|
449
619
  @client.credentials.sign_request(req) unless @client.credentials.nil?
450
620
  end
@@ -472,13 +642,40 @@ module Azure::ARM::Compute
472
642
  #
473
643
  # @param resource_group_name [String] The name of the resource group.
474
644
  # @param vm_name [String] The name of the virtual machine.
475
- # @param [Hash{String => String}] The hash of custom headers need to be
476
- # applied to HTTP request.
645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
646
+ # will be added to the HTTP request.
477
647
  #
478
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
479
- # response.
480
648
  #
481
649
  def generalize(resource_group_name, vm_name, custom_headers = nil)
650
+ response = generalize_async(resource_group_name, vm_name, custom_headers).value!
651
+ nil
652
+ end
653
+
654
+ #
655
+ # Sets the state of the VM as Generalized.
656
+ #
657
+ # @param resource_group_name [String] The name of the resource group.
658
+ # @param vm_name [String] The name of the virtual machine.
659
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
660
+ # will be added to the HTTP request.
661
+ #
662
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
663
+ #
664
+ def generalize_with_http_info(resource_group_name, vm_name, custom_headers = nil)
665
+ generalize_async(resource_group_name, vm_name, custom_headers).value!
666
+ end
667
+
668
+ #
669
+ # Sets the state of the VM as Generalized.
670
+ #
671
+ # @param resource_group_name [String] The name of the resource group.
672
+ # @param vm_name [String] The name of the virtual machine.
673
+ # @param [Hash{String => String}] A hash of custom headers that will be added
674
+ # to the HTTP request.
675
+ #
676
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
677
+ #
678
+ def generalize_async(resource_group_name, vm_name, custom_headers = nil)
482
679
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
483
680
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
484
681
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -495,7 +692,10 @@ module Azure::ARM::Compute
495
692
  query_params: {'api-version' => @client.api_version},
496
693
  headers: request_headers.merge(custom_headers || {})
497
694
  }
498
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
695
+
696
+ request_url = @base_url || @client.base_url
697
+
698
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
499
699
  promise = request.run_promise do |req|
500
700
  @client.credentials.sign_request(req) unless @client.credentials.nil?
501
701
  end
@@ -522,13 +722,39 @@ module Azure::ARM::Compute
522
722
  # The operation to list virtual machines under a resource group.
523
723
  #
524
724
  # @param resource_group_name [String] The name of the resource group.
525
- # @param [Hash{String => String}] The hash of custom headers need to be
526
- # applied to HTTP request.
725
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
726
+ # will be added to the HTTP request.
527
727
  #
528
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
529
- # response.
728
+ # @return [VirtualMachineListResult] operation results.
530
729
  #
531
730
  def list(resource_group_name, custom_headers = nil)
731
+ response = list_async(resource_group_name, custom_headers).value!
732
+ response.body unless response.nil?
733
+ end
734
+
735
+ #
736
+ # The operation to list virtual machines under a resource group.
737
+ #
738
+ # @param resource_group_name [String] The name of the resource group.
739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
+ # will be added to the HTTP request.
741
+ #
742
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
743
+ #
744
+ def list_with_http_info(resource_group_name, custom_headers = nil)
745
+ list_async(resource_group_name, custom_headers).value!
746
+ end
747
+
748
+ #
749
+ # The operation to list virtual machines under a resource group.
750
+ #
751
+ # @param resource_group_name [String] The name of the resource group.
752
+ # @param [Hash{String => String}] A hash of custom headers that will be added
753
+ # to the HTTP request.
754
+ #
755
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
756
+ #
757
+ def list_async(resource_group_name, custom_headers = nil)
532
758
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
533
759
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
534
760
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
@@ -544,7 +770,10 @@ module Azure::ARM::Compute
544
770
  query_params: {'api-version' => @client.api_version},
545
771
  headers: request_headers.merge(custom_headers || {})
546
772
  }
547
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
773
+
774
+ request_url = @base_url || @client.base_url
775
+
776
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
548
777
  promise = request.run_promise do |req|
549
778
  @client.credentials.sign_request(req) unless @client.credentials.nil?
550
779
  end
@@ -584,13 +813,41 @@ module Azure::ARM::Compute
584
813
  # in the response to get the next page of Virtual Machines. Do this till
585
814
  # nextLink is not null to fetch all the Virtual Machines.
586
815
  #
587
- # @param [Hash{String => String}] The hash of custom headers need to be
588
- # applied to HTTP request.
816
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
817
+ # will be added to the HTTP request.
589
818
  #
590
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
591
- # response.
819
+ # @return [VirtualMachineListResult] operation results.
592
820
  #
593
821
  def list_all(custom_headers = nil)
822
+ response = list_all_async(custom_headers).value!
823
+ response.body unless response.nil?
824
+ end
825
+
826
+ #
827
+ # Gets the list of Virtual Machines in the subscription. Use nextLink property
828
+ # in the response to get the next page of Virtual Machines. Do this till
829
+ # nextLink is not null to fetch all the Virtual Machines.
830
+ #
831
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
832
+ # will be added to the HTTP request.
833
+ #
834
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
835
+ #
836
+ def list_all_with_http_info(custom_headers = nil)
837
+ list_all_async(custom_headers).value!
838
+ end
839
+
840
+ #
841
+ # Gets the list of Virtual Machines in the subscription. Use nextLink property
842
+ # in the response to get the next page of Virtual Machines. Do this till
843
+ # nextLink is not null to fetch all the Virtual Machines.
844
+ #
845
+ # @param [Hash{String => String}] A hash of custom headers that will be added
846
+ # to the HTTP request.
847
+ #
848
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
849
+ #
850
+ def list_all_async(custom_headers = nil)
594
851
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
595
852
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
596
853
  request_headers = {}
@@ -605,7 +862,10 @@ module Azure::ARM::Compute
605
862
  query_params: {'api-version' => @client.api_version},
606
863
  headers: request_headers.merge(custom_headers || {})
607
864
  }
608
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
865
+
866
+ request_url = @base_url || @client.base_url
867
+
868
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
609
869
  promise = request.run_promise do |req|
610
870
  @client.credentials.sign_request(req) unless @client.credentials.nil?
611
871
  end
@@ -641,17 +901,48 @@ module Azure::ARM::Compute
641
901
  end
642
902
 
643
903
  #
644
- # Lists virtual-machine-sizes available to be used for a virtual machine.
904
+ # Lists all available virtual machine sizes it can be resized to for a virtual
905
+ # machine.
645
906
  #
646
907
  # @param resource_group_name [String] The name of the resource group.
647
908
  # @param vm_name [String] The name of the virtual machine.
648
- # @param [Hash{String => String}] The hash of custom headers need to be
649
- # applied to HTTP request.
909
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
910
+ # will be added to the HTTP request.
650
911
  #
651
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
652
- # response.
912
+ # @return [VirtualMachineSizeListResult] operation results.
653
913
  #
654
914
  def list_available_sizes(resource_group_name, vm_name, custom_headers = nil)
915
+ response = list_available_sizes_async(resource_group_name, vm_name, custom_headers).value!
916
+ response.body unless response.nil?
917
+ end
918
+
919
+ #
920
+ # Lists all available virtual machine sizes it can be resized to for a virtual
921
+ # machine.
922
+ #
923
+ # @param resource_group_name [String] The name of the resource group.
924
+ # @param vm_name [String] The name of the virtual machine.
925
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
926
+ # will be added to the HTTP request.
927
+ #
928
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
929
+ #
930
+ def list_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers = nil)
931
+ list_available_sizes_async(resource_group_name, vm_name, custom_headers).value!
932
+ end
933
+
934
+ #
935
+ # Lists all available virtual machine sizes it can be resized to for a virtual
936
+ # machine.
937
+ #
938
+ # @param resource_group_name [String] The name of the resource group.
939
+ # @param vm_name [String] The name of the virtual machine.
940
+ # @param [Hash{String => String}] A hash of custom headers that will be added
941
+ # to the HTTP request.
942
+ #
943
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
944
+ #
945
+ def list_available_sizes_async(resource_group_name, vm_name, custom_headers = nil)
655
946
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
656
947
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
657
948
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -668,7 +959,10 @@ module Azure::ARM::Compute
668
959
  query_params: {'api-version' => @client.api_version},
669
960
  headers: request_headers.merge(custom_headers || {})
670
961
  }
671
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
962
+
963
+ request_url = @base_url || @client.base_url
964
+
965
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
672
966
  promise = request.run_promise do |req|
673
967
  @client.credentials.sign_request(req) unless @client.credentials.nil?
674
968
  end
@@ -713,7 +1007,7 @@ module Azure::ARM::Compute
713
1007
  #
714
1008
  def power_off(resource_group_name, vm_name, custom_headers = nil)
715
1009
  # Send request
716
- promise = begin_power_off(resource_group_name, vm_name, custom_headers)
1010
+ promise = begin_power_off_async(resource_group_name, vm_name, custom_headers)
717
1011
 
718
1012
  promise = promise.then do |response|
719
1013
  # Defining deserialization method.
@@ -721,7 +1015,7 @@ module Azure::ARM::Compute
721
1015
  end
722
1016
 
723
1017
  # Waiting for response.
724
- @client.get_post_or_delete_operation_result(response, deserialize_method)
1018
+ @client.get_long_running_operation_result(response, deserialize_method)
725
1019
  end
726
1020
 
727
1021
  promise
@@ -732,13 +1026,40 @@ module Azure::ARM::Compute
732
1026
  #
733
1027
  # @param resource_group_name [String] The name of the resource group.
734
1028
  # @param vm_name [String] The name of the virtual machine.
735
- # @param [Hash{String => String}] The hash of custom headers need to be
736
- # applied to HTTP request.
1029
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1030
+ # will be added to the HTTP request.
737
1031
  #
738
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
739
- # response.
740
1032
  #
741
1033
  def begin_power_off(resource_group_name, vm_name, custom_headers = nil)
1034
+ response = begin_power_off_async(resource_group_name, vm_name, custom_headers).value!
1035
+ nil
1036
+ end
1037
+
1038
+ #
1039
+ # The operation to power off (stop) a virtual machine.
1040
+ #
1041
+ # @param resource_group_name [String] The name of the resource group.
1042
+ # @param vm_name [String] The name of the virtual machine.
1043
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1044
+ # will be added to the HTTP request.
1045
+ #
1046
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1047
+ #
1048
+ def begin_power_off_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1049
+ begin_power_off_async(resource_group_name, vm_name, custom_headers).value!
1050
+ end
1051
+
1052
+ #
1053
+ # The operation to power off (stop) a virtual machine.
1054
+ #
1055
+ # @param resource_group_name [String] The name of the resource group.
1056
+ # @param vm_name [String] The name of the virtual machine.
1057
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1058
+ # to the HTTP request.
1059
+ #
1060
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1061
+ #
1062
+ def begin_power_off_async(resource_group_name, vm_name, custom_headers = nil)
742
1063
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
743
1064
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
744
1065
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -755,7 +1076,10 @@ module Azure::ARM::Compute
755
1076
  query_params: {'api-version' => @client.api_version},
756
1077
  headers: request_headers.merge(custom_headers || {})
757
1078
  }
758
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1079
+
1080
+ request_url = @base_url || @client.base_url
1081
+
1082
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
759
1083
  promise = request.run_promise do |req|
760
1084
  @client.credentials.sign_request(req) unless @client.credentials.nil?
761
1085
  end
@@ -788,7 +1112,7 @@ module Azure::ARM::Compute
788
1112
  #
789
1113
  def restart(resource_group_name, vm_name, custom_headers = nil)
790
1114
  # Send request
791
- promise = begin_restart(resource_group_name, vm_name, custom_headers)
1115
+ promise = begin_restart_async(resource_group_name, vm_name, custom_headers)
792
1116
 
793
1117
  promise = promise.then do |response|
794
1118
  # Defining deserialization method.
@@ -796,7 +1120,7 @@ module Azure::ARM::Compute
796
1120
  end
797
1121
 
798
1122
  # Waiting for response.
799
- @client.get_post_or_delete_operation_result(response, deserialize_method)
1123
+ @client.get_long_running_operation_result(response, deserialize_method)
800
1124
  end
801
1125
 
802
1126
  promise
@@ -807,13 +1131,40 @@ module Azure::ARM::Compute
807
1131
  #
808
1132
  # @param resource_group_name [String] The name of the resource group.
809
1133
  # @param vm_name [String] The name of the virtual machine.
810
- # @param [Hash{String => String}] The hash of custom headers need to be
811
- # applied to HTTP request.
1134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1135
+ # will be added to the HTTP request.
812
1136
  #
813
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
814
- # response.
815
1137
  #
816
1138
  def begin_restart(resource_group_name, vm_name, custom_headers = nil)
1139
+ response = begin_restart_async(resource_group_name, vm_name, custom_headers).value!
1140
+ nil
1141
+ end
1142
+
1143
+ #
1144
+ # The operation to restart a virtual machine.
1145
+ #
1146
+ # @param resource_group_name [String] The name of the resource group.
1147
+ # @param vm_name [String] The name of the virtual machine.
1148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1149
+ # will be added to the HTTP request.
1150
+ #
1151
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1152
+ #
1153
+ def begin_restart_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1154
+ begin_restart_async(resource_group_name, vm_name, custom_headers).value!
1155
+ end
1156
+
1157
+ #
1158
+ # The operation to restart a virtual machine.
1159
+ #
1160
+ # @param resource_group_name [String] The name of the resource group.
1161
+ # @param vm_name [String] The name of the virtual machine.
1162
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1163
+ # to the HTTP request.
1164
+ #
1165
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1166
+ #
1167
+ def begin_restart_async(resource_group_name, vm_name, custom_headers = nil)
817
1168
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
818
1169
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
819
1170
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -830,7 +1181,10 @@ module Azure::ARM::Compute
830
1181
  query_params: {'api-version' => @client.api_version},
831
1182
  headers: request_headers.merge(custom_headers || {})
832
1183
  }
833
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1184
+
1185
+ request_url = @base_url || @client.base_url
1186
+
1187
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
834
1188
  promise = request.run_promise do |req|
835
1189
  @client.credentials.sign_request(req) unless @client.credentials.nil?
836
1190
  end
@@ -863,7 +1217,7 @@ module Azure::ARM::Compute
863
1217
  #
864
1218
  def start(resource_group_name, vm_name, custom_headers = nil)
865
1219
  # Send request
866
- promise = begin_start(resource_group_name, vm_name, custom_headers)
1220
+ promise = begin_start_async(resource_group_name, vm_name, custom_headers)
867
1221
 
868
1222
  promise = promise.then do |response|
869
1223
  # Defining deserialization method.
@@ -871,7 +1225,7 @@ module Azure::ARM::Compute
871
1225
  end
872
1226
 
873
1227
  # Waiting for response.
874
- @client.get_post_or_delete_operation_result(response, deserialize_method)
1228
+ @client.get_long_running_operation_result(response, deserialize_method)
875
1229
  end
876
1230
 
877
1231
  promise
@@ -882,13 +1236,40 @@ module Azure::ARM::Compute
882
1236
  #
883
1237
  # @param resource_group_name [String] The name of the resource group.
884
1238
  # @param vm_name [String] The name of the virtual machine.
885
- # @param [Hash{String => String}] The hash of custom headers need to be
886
- # applied to HTTP request.
1239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1240
+ # will be added to the HTTP request.
887
1241
  #
888
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
889
- # response.
890
1242
  #
891
1243
  def begin_start(resource_group_name, vm_name, custom_headers = nil)
1244
+ response = begin_start_async(resource_group_name, vm_name, custom_headers).value!
1245
+ nil
1246
+ end
1247
+
1248
+ #
1249
+ # The operation to start a virtual machine.
1250
+ #
1251
+ # @param resource_group_name [String] The name of the resource group.
1252
+ # @param vm_name [String] The name of the virtual machine.
1253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1254
+ # will be added to the HTTP request.
1255
+ #
1256
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1257
+ #
1258
+ def begin_start_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1259
+ begin_start_async(resource_group_name, vm_name, custom_headers).value!
1260
+ end
1261
+
1262
+ #
1263
+ # The operation to start a virtual machine.
1264
+ #
1265
+ # @param resource_group_name [String] The name of the resource group.
1266
+ # @param vm_name [String] The name of the virtual machine.
1267
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1268
+ # to the HTTP request.
1269
+ #
1270
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1271
+ #
1272
+ def begin_start_async(resource_group_name, vm_name, custom_headers = nil)
892
1273
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
893
1274
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
894
1275
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -905,7 +1286,10 @@ module Azure::ARM::Compute
905
1286
  query_params: {'api-version' => @client.api_version},
906
1287
  headers: request_headers.merge(custom_headers || {})
907
1288
  }
908
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1289
+
1290
+ request_url = @base_url || @client.base_url
1291
+
1292
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
909
1293
  promise = request.run_promise do |req|
910
1294
  @client.credentials.sign_request(req) unless @client.credentials.nil?
911
1295
  end
@@ -938,7 +1322,7 @@ module Azure::ARM::Compute
938
1322
  #
939
1323
  def redeploy(resource_group_name, vm_name, custom_headers = nil)
940
1324
  # Send request
941
- promise = begin_redeploy(resource_group_name, vm_name, custom_headers)
1325
+ promise = begin_redeploy_async(resource_group_name, vm_name, custom_headers)
942
1326
 
943
1327
  promise = promise.then do |response|
944
1328
  # Defining deserialization method.
@@ -946,7 +1330,7 @@ module Azure::ARM::Compute
946
1330
  end
947
1331
 
948
1332
  # Waiting for response.
949
- @client.get_post_or_delete_operation_result(response, deserialize_method)
1333
+ @client.get_long_running_operation_result(response, deserialize_method)
950
1334
  end
951
1335
 
952
1336
  promise
@@ -957,13 +1341,40 @@ module Azure::ARM::Compute
957
1341
  #
958
1342
  # @param resource_group_name [String] The name of the resource group.
959
1343
  # @param vm_name [String] The name of the virtual machine.
960
- # @param [Hash{String => String}] The hash of custom headers need to be
961
- # applied to HTTP request.
1344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1345
+ # will be added to the HTTP request.
962
1346
  #
963
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
964
- # response.
965
1347
  #
966
1348
  def begin_redeploy(resource_group_name, vm_name, custom_headers = nil)
1349
+ response = begin_redeploy_async(resource_group_name, vm_name, custom_headers).value!
1350
+ nil
1351
+ end
1352
+
1353
+ #
1354
+ # The operation to redeploy a virtual machine.
1355
+ #
1356
+ # @param resource_group_name [String] The name of the resource group.
1357
+ # @param vm_name [String] The name of the virtual machine.
1358
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1359
+ # will be added to the HTTP request.
1360
+ #
1361
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1362
+ #
1363
+ def begin_redeploy_with_http_info(resource_group_name, vm_name, custom_headers = nil)
1364
+ begin_redeploy_async(resource_group_name, vm_name, custom_headers).value!
1365
+ end
1366
+
1367
+ #
1368
+ # The operation to redeploy a virtual machine.
1369
+ #
1370
+ # @param resource_group_name [String] The name of the resource group.
1371
+ # @param vm_name [String] The name of the virtual machine.
1372
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1373
+ # to the HTTP request.
1374
+ #
1375
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1376
+ #
1377
+ def begin_redeploy_async(resource_group_name, vm_name, custom_headers = nil)
967
1378
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
968
1379
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
969
1380
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -980,7 +1391,10 @@ module Azure::ARM::Compute
980
1391
  query_params: {'api-version' => @client.api_version},
981
1392
  headers: request_headers.merge(custom_headers || {})
982
1393
  }
983
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1394
+
1395
+ request_url = @base_url || @client.base_url
1396
+
1397
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
984
1398
  promise = request.run_promise do |req|
985
1399
  @client.credentials.sign_request(req) unless @client.credentials.nil?
986
1400
  end
@@ -1004,62 +1418,20 @@ module Azure::ARM::Compute
1004
1418
  end
1005
1419
 
1006
1420
  #
1007
- # The operation to list virtual machines under a resource group.
1421
+ # Gets the list of Virtual Machines in the subscription. Use nextLink property
1422
+ # in the response to get the next page of Virtual Machines. Do this till
1423
+ # nextLink is not null to fetch all the Virtual Machines.
1008
1424
  #
1009
1425
  # @param next_page_link [String] The NextLink from the previous successful
1010
1426
  # call to List operation.
1011
- # @param [Hash{String => String}] The hash of custom headers need to be
1012
- # applied to HTTP request.
1427
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1428
+ # will be added to the HTTP request.
1013
1429
  #
1014
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
1015
- # response.
1430
+ # @return [VirtualMachineListResult] operation results.
1016
1431
  #
1017
- def list_next(next_page_link, custom_headers = nil)
1018
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1019
- request_headers = {}
1020
-
1021
- # Set Headers
1022
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1023
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1024
- path_template = '{nextLink}'
1025
- options = {
1026
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1027
- skip_encoding_path_params: {'nextLink' => next_page_link},
1028
- headers: request_headers.merge(custom_headers || {})
1029
- }
1030
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
1031
- promise = request.run_promise do |req|
1032
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1033
- end
1034
-
1035
- promise = promise.then do |http_response|
1036
- status_code = http_response.status
1037
- response_content = http_response.body
1038
- unless status_code == 200
1039
- error_model = JSON.load(response_content)
1040
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1041
- end
1042
-
1043
- # Create Result
1044
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1045
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1046
- # Deserialize Response
1047
- if status_code == 200
1048
- begin
1049
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1050
- unless parsed_response.nil?
1051
- parsed_response = VirtualMachineListResult.deserialize_object(parsed_response)
1052
- end
1053
- result.body = parsed_response
1054
- rescue Exception => e
1055
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1056
- end
1057
- end
1058
-
1059
- result
1060
- end
1061
-
1062
- promise.execute
1432
+ def list_all_next(next_page_link, custom_headers = nil)
1433
+ response = list_all_next_async(next_page_link, custom_headers).value!
1434
+ response.body unless response.nil?
1063
1435
  end
1064
1436
 
1065
1437
  #
@@ -1069,72 +1441,28 @@ module Azure::ARM::Compute
1069
1441
  #
1070
1442
  # @param next_page_link [String] The NextLink from the previous successful
1071
1443
  # call to List operation.
1072
- # @param [Hash{String => String}] The hash of custom headers need to be
1073
- # applied to HTTP request.
1444
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1445
+ # will be added to the HTTP request.
1074
1446
  #
1075
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
1076
- # response.
1447
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1077
1448
  #
1078
- def list_all_next(next_page_link, custom_headers = nil)
1079
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1080
- request_headers = {}
1081
-
1082
- # Set Headers
1083
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1084
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1085
- path_template = '{nextLink}'
1086
- options = {
1087
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1088
- skip_encoding_path_params: {'nextLink' => next_page_link},
1089
- headers: request_headers.merge(custom_headers || {})
1090
- }
1091
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
1092
- promise = request.run_promise do |req|
1093
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1094
- end
1095
-
1096
- promise = promise.then do |http_response|
1097
- status_code = http_response.status
1098
- response_content = http_response.body
1099
- unless status_code == 200
1100
- error_model = JSON.load(response_content)
1101
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1102
- end
1103
-
1104
- # Create Result
1105
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1106
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1107
- # Deserialize Response
1108
- if status_code == 200
1109
- begin
1110
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1111
- unless parsed_response.nil?
1112
- parsed_response = VirtualMachineListResult.deserialize_object(parsed_response)
1113
- end
1114
- result.body = parsed_response
1115
- rescue Exception => e
1116
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1117
- end
1118
- end
1119
-
1120
- result
1121
- end
1122
-
1123
- promise.execute
1449
+ def list_all_next_with_http_info(next_page_link, custom_headers = nil)
1450
+ list_all_next_async(next_page_link, custom_headers).value!
1124
1451
  end
1125
1452
 
1126
1453
  #
1127
- # Lists virtual-machine-sizes available to be used for a virtual machine.
1454
+ # Gets the list of Virtual Machines in the subscription. Use nextLink property
1455
+ # in the response to get the next page of Virtual Machines. Do this till
1456
+ # nextLink is not null to fetch all the Virtual Machines.
1128
1457
  #
1129
1458
  # @param next_page_link [String] The NextLink from the previous successful
1130
1459
  # call to List operation.
1131
- # @param [Hash{String => String}] The hash of custom headers need to be
1132
- # applied to HTTP request.
1460
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1461
+ # to the HTTP request.
1133
1462
  #
1134
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
1135
- # response.
1463
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1136
1464
  #
1137
- def list_available_sizes_next(next_page_link, custom_headers = nil)
1465
+ def list_all_next_async(next_page_link, custom_headers = nil)
1138
1466
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1139
1467
  request_headers = {}
1140
1468
 
@@ -1147,7 +1475,10 @@ module Azure::ARM::Compute
1147
1475
  skip_encoding_path_params: {'nextLink' => next_page_link},
1148
1476
  headers: request_headers.merge(custom_headers || {})
1149
1477
  }
1150
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
1478
+
1479
+ request_url = @base_url || @client.base_url
1480
+
1481
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1151
1482
  promise = request.run_promise do |req|
1152
1483
  @client.credentials.sign_request(req) unless @client.credentials.nil?
1153
1484
  end
@@ -1168,7 +1499,7 @@ module Azure::ARM::Compute
1168
1499
  begin
1169
1500
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1170
1501
  unless parsed_response.nil?
1171
- parsed_response = VirtualMachineSizeListResult.deserialize_object(parsed_response)
1502
+ parsed_response = VirtualMachineListResult.deserialize_object(parsed_response)
1172
1503
  end
1173
1504
  result.body = parsed_response
1174
1505
  rescue Exception => e