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
 
@@ -25,11 +25,11 @@ module Azure::ARM::Compute
25
25
  #
26
26
  # Gets a virtual machine image.
27
27
  #
28
- # @param location [String]
29
- # @param publisher_name [String]
30
- # @param offer [String]
31
- # @param skus [String]
32
- # @param version [String]
28
+ # @param location [String] The name of a supported Azure region.
29
+ # @param publisher_name [String] A valid image publisher.
30
+ # @param offer [String] A valid image publisher offer.
31
+ # @param skus [String] A valid image SKU.
32
+ # @param version [String] A valid image SKU version.
33
33
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
34
  # will be added to the HTTP request.
35
35
  #
@@ -43,11 +43,11 @@ module Azure::ARM::Compute
43
43
  #
44
44
  # Gets a virtual machine image.
45
45
  #
46
- # @param location [String]
47
- # @param publisher_name [String]
48
- # @param offer [String]
49
- # @param skus [String]
50
- # @param version [String]
46
+ # @param location [String] The name of a supported Azure region.
47
+ # @param publisher_name [String] A valid image publisher.
48
+ # @param offer [String] A valid image publisher offer.
49
+ # @param skus [String] A valid image SKU.
50
+ # @param version [String] A valid image SKU version.
51
51
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
52
  # will be added to the HTTP request.
53
53
  #
@@ -60,11 +60,11 @@ module Azure::ARM::Compute
60
60
  #
61
61
  # Gets a virtual machine image.
62
62
  #
63
- # @param location [String]
64
- # @param publisher_name [String]
65
- # @param offer [String]
66
- # @param skus [String]
67
- # @param version [String]
63
+ # @param location [String] The name of a supported Azure region.
64
+ # @param publisher_name [String] A valid image publisher.
65
+ # @param offer [String] A valid image publisher offer.
66
+ # @param skus [String] A valid image SKU.
67
+ # @param version [String] A valid image SKU version.
68
68
  # @param [Hash{String => String}] A hash of custom headers that will be added
69
69
  # to the HTTP request.
70
70
  #
@@ -126,12 +126,13 @@ module Azure::ARM::Compute
126
126
  end
127
127
 
128
128
  #
129
- # Gets a list of virtual machine images.
129
+ # Gets a list of all virtual machine image versions for the specified location,
130
+ # publisher, offer, and SKU.
130
131
  #
131
- # @param location [String]
132
- # @param publisher_name [String]
133
- # @param offer [String]
134
- # @param skus [String]
132
+ # @param location [String] The name of a supported Azure region.
133
+ # @param publisher_name [String] A valid image publisher.
134
+ # @param offer [String] A valid image publisher offer.
135
+ # @param skus [String] A valid image SKU.
135
136
  # @param filter [String] The filter to apply on the operation.
136
137
  # @param top [Integer]
137
138
  # @param orderby [String]
@@ -146,12 +147,13 @@ module Azure::ARM::Compute
146
147
  end
147
148
 
148
149
  #
149
- # Gets a list of virtual machine images.
150
+ # Gets a list of all virtual machine image versions for the specified location,
151
+ # publisher, offer, and SKU.
150
152
  #
151
- # @param location [String]
152
- # @param publisher_name [String]
153
- # @param offer [String]
154
- # @param skus [String]
153
+ # @param location [String] The name of a supported Azure region.
154
+ # @param publisher_name [String] A valid image publisher.
155
+ # @param offer [String] A valid image publisher offer.
156
+ # @param skus [String] A valid image SKU.
155
157
  # @param filter [String] The filter to apply on the operation.
156
158
  # @param top [Integer]
157
159
  # @param orderby [String]
@@ -165,12 +167,13 @@ module Azure::ARM::Compute
165
167
  end
166
168
 
167
169
  #
168
- # Gets a list of virtual machine images.
170
+ # Gets a list of all virtual machine image versions for the specified location,
171
+ # publisher, offer, and SKU.
169
172
  #
170
- # @param location [String]
171
- # @param publisher_name [String]
172
- # @param offer [String]
173
- # @param skus [String]
173
+ # @param location [String] The name of a supported Azure region.
174
+ # @param publisher_name [String] A valid image publisher.
175
+ # @param offer [String] A valid image publisher offer.
176
+ # @param skus [String] A valid image SKU.
174
177
  # @param filter [String] The filter to apply on the operation.
175
178
  # @param top [Integer]
176
179
  # @param orderby [String]
@@ -248,10 +251,11 @@ module Azure::ARM::Compute
248
251
  end
249
252
 
250
253
  #
251
- # Gets a list of virtual machine image offers.
254
+ # Gets a list of virtual machine image offers for the specified location and
255
+ # publisher.
252
256
  #
253
- # @param location [String]
254
- # @param publisher_name [String]
257
+ # @param location [String] The name of a supported Azure region.
258
+ # @param publisher_name [String] A valid image publisher.
255
259
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
256
260
  # will be added to the HTTP request.
257
261
  #
@@ -263,10 +267,11 @@ module Azure::ARM::Compute
263
267
  end
264
268
 
265
269
  #
266
- # Gets a list of virtual machine image offers.
270
+ # Gets a list of virtual machine image offers for the specified location and
271
+ # publisher.
267
272
  #
268
- # @param location [String]
269
- # @param publisher_name [String]
273
+ # @param location [String] The name of a supported Azure region.
274
+ # @param publisher_name [String] A valid image publisher.
270
275
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
276
  # will be added to the HTTP request.
272
277
  #
@@ -277,10 +282,11 @@ module Azure::ARM::Compute
277
282
  end
278
283
 
279
284
  #
280
- # Gets a list of virtual machine image offers.
285
+ # Gets a list of virtual machine image offers for the specified location and
286
+ # publisher.
281
287
  #
282
- # @param location [String]
283
- # @param publisher_name [String]
288
+ # @param location [String] The name of a supported Azure region.
289
+ # @param publisher_name [String] A valid image publisher.
284
290
  # @param [Hash{String => String}] A hash of custom headers that will be added
285
291
  # to the HTTP request.
286
292
  #
@@ -353,9 +359,10 @@ module Azure::ARM::Compute
353
359
  end
354
360
 
355
361
  #
356
- # Gets a list of virtual machine image publishers.
362
+ # Gets a list of virtual machine image publishers for the specified Azure
363
+ # location.
357
364
  #
358
- # @param location [String]
365
+ # @param location [String] The name of a supported Azure region.
359
366
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
360
367
  # will be added to the HTTP request.
361
368
  #
@@ -367,9 +374,10 @@ module Azure::ARM::Compute
367
374
  end
368
375
 
369
376
  #
370
- # Gets a list of virtual machine image publishers.
377
+ # Gets a list of virtual machine image publishers for the specified Azure
378
+ # location.
371
379
  #
372
- # @param location [String]
380
+ # @param location [String] The name of a supported Azure region.
373
381
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
374
382
  # will be added to the HTTP request.
375
383
  #
@@ -380,9 +388,10 @@ module Azure::ARM::Compute
380
388
  end
381
389
 
382
390
  #
383
- # Gets a list of virtual machine image publishers.
391
+ # Gets a list of virtual machine image publishers for the specified Azure
392
+ # location.
384
393
  #
385
- # @param location [String]
394
+ # @param location [String] The name of a supported Azure region.
386
395
  # @param [Hash{String => String}] A hash of custom headers that will be added
387
396
  # to the HTTP request.
388
397
  #
@@ -454,11 +463,12 @@ module Azure::ARM::Compute
454
463
  end
455
464
 
456
465
  #
457
- # Gets a list of virtual machine image skus.
466
+ # Gets a list of virtual machine image SKUs for the specified location,
467
+ # publisher, and offer.
458
468
  #
459
- # @param location [String]
460
- # @param publisher_name [String]
461
- # @param offer [String]
469
+ # @param location [String] The name of a supported Azure region.
470
+ # @param publisher_name [String] A valid image publisher.
471
+ # @param offer [String] A valid image publisher offer.
462
472
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
463
473
  # will be added to the HTTP request.
464
474
  #
@@ -470,11 +480,12 @@ module Azure::ARM::Compute
470
480
  end
471
481
 
472
482
  #
473
- # Gets a list of virtual machine image skus.
483
+ # Gets a list of virtual machine image SKUs for the specified location,
484
+ # publisher, and offer.
474
485
  #
475
- # @param location [String]
476
- # @param publisher_name [String]
477
- # @param offer [String]
486
+ # @param location [String] The name of a supported Azure region.
487
+ # @param publisher_name [String] A valid image publisher.
488
+ # @param offer [String] A valid image publisher offer.
478
489
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
490
  # will be added to the HTTP request.
480
491
  #
@@ -485,11 +496,12 @@ module Azure::ARM::Compute
485
496
  end
486
497
 
487
498
  #
488
- # Gets a list of virtual machine image skus.
499
+ # Gets a list of virtual machine image SKUs for the specified location,
500
+ # publisher, and offer.
489
501
  #
490
- # @param location [String]
491
- # @param publisher_name [String]
492
- # @param offer [String]
502
+ # @param location [String] The name of a supported Azure region.
503
+ # @param publisher_name [String] A valid image publisher.
504
+ # @param offer [String] A valid image publisher offer.
493
505
  # @param [Hash{String => String}] A hash of custom headers that will be added
494
506
  # to the HTTP request.
495
507
  #
@@ -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
 
@@ -23,12 +23,12 @@ module Azure::ARM::Compute
23
23
  attr_reader :client
24
24
 
25
25
  #
26
- # Allows you to re-image(update the version of the installed operating system)
27
- # a virtual machine scale set instance.
26
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
27
+ # scale set.
28
28
  #
29
29
  # @param resource_group_name [String] The name of the resource group.
30
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
31
- # @param instance_id [String] The instance id of the virtual machine.
30
+ # @param vm_scale_set_name [String] The name of the VM scale set.
31
+ # @param instance_id [String] The instance ID of the virtual machine.
32
32
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
33
  # will be added to the HTTP request.
34
34
  #
@@ -39,8 +39,8 @@ module Azure::ARM::Compute
39
39
 
40
40
  #
41
41
  # @param resource_group_name [String] The name of the resource group.
42
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
43
- # @param instance_id [String] The instance id of the virtual machine.
42
+ # @param vm_scale_set_name [String] The name of the VM scale set.
43
+ # @param instance_id [String] The instance ID of the virtual machine.
44
44
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
45
  # will be added to the HTTP request.
46
46
  #
@@ -64,50 +64,131 @@ module Azure::ARM::Compute
64
64
  end
65
65
 
66
66
  #
67
- # Allows you to re-image(update the version of the installed operating system)
68
- # a virtual machine scale set instance.
67
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
68
+ # virtual machine and releases the compute resources it uses. You are not
69
+ # billed for the compute resources of this virtual machine once it is
70
+ # deallocated.
69
71
  #
70
72
  # @param resource_group_name [String] The name of the resource group.
71
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
72
- # @param instance_id [String] The instance id of the virtual machine.
73
+ # @param vm_scale_set_name [String] The name of the VM scale set.
74
+ # @param instance_id [String] The instance ID of the virtual machine.
73
75
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
74
76
  # will be added to the HTTP request.
75
77
  #
78
+ def deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
79
+ response = deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
80
+ nil
81
+ end
82
+
76
83
  #
77
- def begin_reimage(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
78
- response = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
84
+ # @param resource_group_name [String] The name of the resource group.
85
+ # @param vm_scale_set_name [String] The name of the VM scale set.
86
+ # @param instance_id [String] The instance ID of the virtual machine.
87
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
88
+ # will be added to the HTTP request.
89
+ #
90
+ # @return [Concurrent::Promise] promise which provides async access to http
91
+ # response.
92
+ #
93
+ def deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
94
+ # Send request
95
+ promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
96
+
97
+ promise = promise.then do |response|
98
+ # Defining deserialization method.
99
+ deserialize_method = lambda do |parsed_response|
100
+ end
101
+
102
+ # Waiting for response.
103
+ @client.get_long_running_operation_result(response, deserialize_method)
104
+ end
105
+
106
+ promise
107
+ end
108
+
109
+ #
110
+ # Deletes a virtual machine from a VM scale set.
111
+ #
112
+ # @param resource_group_name [String] The name of the resource group.
113
+ # @param vm_scale_set_name [String] The name of the VM scale set.
114
+ # @param instance_id [String] The instance ID of the virtual machine.
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ def delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
119
+ response = delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
79
120
  nil
80
121
  end
81
122
 
82
123
  #
83
- # Allows you to re-image(update the version of the installed operating system)
84
- # a virtual machine scale set instance.
124
+ # @param resource_group_name [String] The name of the resource group.
125
+ # @param vm_scale_set_name [String] The name of the VM scale set.
126
+ # @param instance_id [String] The instance ID of the virtual machine.
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [Concurrent::Promise] promise which provides async access to http
131
+ # response.
132
+ #
133
+ def delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
134
+ # Send request
135
+ promise = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
136
+
137
+ promise = promise.then do |response|
138
+ # Defining deserialization method.
139
+ deserialize_method = lambda do |parsed_response|
140
+ end
141
+
142
+ # Waiting for response.
143
+ @client.get_long_running_operation_result(response, deserialize_method)
144
+ end
145
+
146
+ promise
147
+ end
148
+
149
+ #
150
+ # Gets a virtual machine from a VM scale set.
151
+ #
152
+ # @param resource_group_name [String] The name of the resource group.
153
+ # @param vm_scale_set_name [String] The name of the VM scale set.
154
+ # @param instance_id [String] The instance ID of the virtual machine.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [VirtualMachineScaleSetVM] operation results.
159
+ #
160
+ def get(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
161
+ response = get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
162
+ response.body unless response.nil?
163
+ end
164
+
165
+ #
166
+ # Gets a virtual machine from a VM scale set.
85
167
  #
86
168
  # @param resource_group_name [String] The name of the resource group.
87
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
88
- # @param instance_id [String] The instance id of the virtual machine.
169
+ # @param vm_scale_set_name [String] The name of the VM scale set.
170
+ # @param instance_id [String] The instance ID of the virtual machine.
89
171
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
90
172
  # will be added to the HTTP request.
91
173
  #
92
174
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
93
175
  #
94
- def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
95
- begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
176
+ def get_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
177
+ get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
96
178
  end
97
179
 
98
180
  #
99
- # Allows you to re-image(update the version of the installed operating system)
100
- # a virtual machine scale set instance.
181
+ # Gets a virtual machine from a VM scale set.
101
182
  #
102
183
  # @param resource_group_name [String] The name of the resource group.
103
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
104
- # @param instance_id [String] The instance id of the virtual machine.
184
+ # @param vm_scale_set_name [String] The name of the VM scale set.
185
+ # @param instance_id [String] The instance ID of the virtual machine.
105
186
  # @param [Hash{String => String}] A hash of custom headers that will be added
106
187
  # to the HTTP request.
107
188
  #
108
189
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
109
190
  #
110
- def begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
191
+ def get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
111
192
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
112
193
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
113
194
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
@@ -120,7 +201,7 @@ module Azure::ARM::Compute
120
201
  # Set Headers
121
202
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
122
203
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
123
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'
204
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
124
205
 
125
206
  request_url = @base_url || @client.base_url
126
207
 
@@ -131,18 +212,28 @@ module Azure::ARM::Compute
131
212
  headers: request_headers.merge(custom_headers || {}),
132
213
  base_url: request_url
133
214
  }
134
- promise = @client.make_request_async(:post, path_template, options)
215
+ promise = @client.make_request_async(:get, path_template, options)
135
216
 
136
217
  promise = promise.then do |result|
137
218
  http_response = result.response
138
219
  status_code = http_response.status
139
220
  response_content = http_response.body
140
- unless status_code == 202
221
+ unless status_code == 200
141
222
  error_model = JSON.load(response_content)
142
223
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
143
224
  end
144
225
 
145
226
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
227
+ # Deserialize Response
228
+ if status_code == 200
229
+ begin
230
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
231
+ result_mapper = VirtualMachineScaleSetVM.mapper()
232
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
233
+ rescue Exception => e
234
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
235
+ end
236
+ end
146
237
 
147
238
  result
148
239
  end
@@ -151,98 +242,151 @@ module Azure::ARM::Compute
151
242
  end
152
243
 
153
244
  #
154
- # Allows you to deallocate a virtual machine scale set virtual machine. Shuts
155
- # down the virtual machine and releases the compute resources. You are not
156
- # billed for the compute resources that this virtual machine uses.
245
+ # Gets the status of a virtual machine from a VM scale set.
157
246
  #
158
247
  # @param resource_group_name [String] The name of the resource group.
159
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
160
- # @param instance_id [String] The instance id of the virtual machine.
248
+ # @param vm_scale_set_name [String] The name of the VM scale set.
249
+ # @param instance_id [String] The instance ID of the virtual machine.
161
250
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
251
  # will be added to the HTTP request.
163
252
  #
164
- def deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
165
- response = deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
166
- nil
253
+ # @return [VirtualMachineScaleSetVMInstanceView] operation results.
254
+ #
255
+ def get_instance_view(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
256
+ response = get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
257
+ response.body unless response.nil?
167
258
  end
168
259
 
260
+ #
261
+ # Gets the status of a virtual machine from a VM scale set.
169
262
  #
170
263
  # @param resource_group_name [String] The name of the resource group.
171
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
172
- # @param instance_id [String] The instance id of the virtual machine.
264
+ # @param vm_scale_set_name [String] The name of the VM scale set.
265
+ # @param instance_id [String] The instance ID of the virtual machine.
173
266
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
174
267
  # will be added to the HTTP request.
175
268
  #
176
- # @return [Concurrent::Promise] promise which provides async access to http
177
- # response.
269
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
178
270
  #
179
- def deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
180
- # Send request
181
- promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
271
+ def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
272
+ get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
273
+ end
182
274
 
183
- promise = promise.then do |response|
184
- # Defining deserialization method.
185
- deserialize_method = lambda do |parsed_response|
275
+ #
276
+ # Gets the status of a virtual machine from a VM scale set.
277
+ #
278
+ # @param resource_group_name [String] The name of the resource group.
279
+ # @param vm_scale_set_name [String] The name of the VM scale set.
280
+ # @param instance_id [String] The instance ID of the virtual machine.
281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
282
+ # to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
285
+ #
286
+ def get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
287
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
288
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
289
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
290
+ api_version = '2016-03-30'
291
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
292
+
293
+
294
+ request_headers = {}
295
+
296
+ # Set Headers
297
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
298
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
299
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'
300
+
301
+ request_url = @base_url || @client.base_url
302
+
303
+ options = {
304
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
305
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
306
+ query_params: {'api-version' => api_version},
307
+ headers: request_headers.merge(custom_headers || {}),
308
+ base_url: request_url
309
+ }
310
+ promise = @client.make_request_async(:get, path_template, options)
311
+
312
+ promise = promise.then do |result|
313
+ http_response = result.response
314
+ status_code = http_response.status
315
+ response_content = http_response.body
316
+ unless status_code == 200
317
+ error_model = JSON.load(response_content)
318
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
186
319
  end
187
320
 
188
- # Waiting for response.
189
- @client.get_long_running_operation_result(response, deserialize_method)
321
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
322
+ # Deserialize Response
323
+ if status_code == 200
324
+ begin
325
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
326
+ result_mapper = VirtualMachineScaleSetVMInstanceView.mapper()
327
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
328
+ rescue Exception => e
329
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
330
+ end
331
+ end
332
+
333
+ result
190
334
  end
191
335
 
192
- promise
336
+ promise.execute
193
337
  end
194
338
 
195
339
  #
196
- # Allows you to deallocate a virtual machine scale set virtual machine. Shuts
197
- # down the virtual machine and releases the compute resources. You are not
198
- # billed for the compute resources that this virtual machine uses.
340
+ # Gets a list of all virtual machines in a VM scale sets.
199
341
  #
200
342
  # @param resource_group_name [String] The name of the resource group.
201
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
202
- # @param instance_id [String] The instance id of the virtual machine.
343
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
344
+ # @param filter [String] The filter to apply to the operation.
345
+ # @param select [String] The list parameters.
346
+ # @param expand [String] The expand expression to apply to the operation.
203
347
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
204
348
  # will be added to the HTTP request.
205
349
  #
350
+ # @return [Array<VirtualMachineScaleSetVM>] operation results.
206
351
  #
207
- def begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
208
- response = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
209
- nil
352
+ def list(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
353
+ first_page = list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, custom_headers)
354
+ first_page.get_all_items
210
355
  end
211
356
 
212
357
  #
213
- # Allows you to deallocate a virtual machine scale set virtual machine. Shuts
214
- # down the virtual machine and releases the compute resources. You are not
215
- # billed for the compute resources that this virtual machine uses.
358
+ # Gets a list of all virtual machines in a VM scale sets.
216
359
  #
217
360
  # @param resource_group_name [String] The name of the resource group.
218
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
219
- # @param instance_id [String] The instance id of the virtual machine.
361
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
362
+ # @param filter [String] The filter to apply to the operation.
363
+ # @param select [String] The list parameters.
364
+ # @param expand [String] The expand expression to apply to the operation.
220
365
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
221
366
  # will be added to the HTTP request.
222
367
  #
223
368
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
224
369
  #
225
- def begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
226
- begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
370
+ def list_with_http_info(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
371
+ list_async(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, custom_headers).value!
227
372
  end
228
373
 
229
374
  #
230
- # Allows you to deallocate a virtual machine scale set virtual machine. Shuts
231
- # down the virtual machine and releases the compute resources. You are not
232
- # billed for the compute resources that this virtual machine uses.
375
+ # Gets a list of all virtual machines in a VM scale sets.
233
376
  #
234
377
  # @param resource_group_name [String] The name of the resource group.
235
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
236
- # @param instance_id [String] The instance id of the virtual machine.
378
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
379
+ # @param filter [String] The filter to apply to the operation.
380
+ # @param select [String] The list parameters.
381
+ # @param expand [String] The expand expression to apply to the operation.
237
382
  # @param [Hash{String => String}] A hash of custom headers that will be added
238
383
  # to the HTTP request.
239
384
  #
240
385
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
241
386
  #
242
- def begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
387
+ def list_async(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
243
388
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
244
- fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
245
- fail ArgumentError, 'instance_id is nil' if instance_id.nil?
389
+ fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
246
390
  api_version = '2016-03-30'
247
391
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
248
392
 
@@ -252,29 +396,39 @@ module Azure::ARM::Compute
252
396
  # Set Headers
253
397
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
254
398
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
255
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'
399
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'
256
400
 
257
401
  request_url = @base_url || @client.base_url
258
402
 
259
403
  options = {
260
404
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
261
- path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
262
- query_params: {'api-version' => api_version},
405
+ path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'subscriptionId' => @client.subscription_id},
406
+ query_params: {'$filter' => filter,'$select' => select,'$expand' => expand,'api-version' => api_version},
263
407
  headers: request_headers.merge(custom_headers || {}),
264
408
  base_url: request_url
265
409
  }
266
- promise = @client.make_request_async(:post, path_template, options)
410
+ promise = @client.make_request_async(:get, path_template, options)
267
411
 
268
412
  promise = promise.then do |result|
269
413
  http_response = result.response
270
414
  status_code = http_response.status
271
415
  response_content = http_response.body
272
- unless status_code == 202
416
+ unless status_code == 200
273
417
  error_model = JSON.load(response_content)
274
418
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
275
419
  end
276
420
 
277
421
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
422
+ # Deserialize Response
423
+ if status_code == 200
424
+ begin
425
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
426
+ result_mapper = VirtualMachineScaleSetVMListResult.mapper()
427
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
428
+ rescue Exception => e
429
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
430
+ end
431
+ end
278
432
 
279
433
  result
280
434
  end
@@ -283,32 +437,34 @@ module Azure::ARM::Compute
283
437
  end
284
438
 
285
439
  #
286
- # Allows you to delete a virtual machine scale set.
440
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
441
+ # still attached and you are getting charged for the resources. Instead, use
442
+ # deallocate to release resources and avoid charges.
287
443
  #
288
444
  # @param resource_group_name [String] The name of the resource group.
289
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
290
- # @param instance_id [String] The instance id of the virtual machine.
445
+ # @param vm_scale_set_name [String] The name of the VM scale set.
446
+ # @param instance_id [String] The instance ID of the virtual machine.
291
447
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
448
  # will be added to the HTTP request.
293
449
  #
294
- def delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
295
- response = delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
450
+ def power_off(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
451
+ response = power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
296
452
  nil
297
453
  end
298
454
 
299
455
  #
300
456
  # @param resource_group_name [String] The name of the resource group.
301
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
302
- # @param instance_id [String] The instance id of the virtual machine.
457
+ # @param vm_scale_set_name [String] The name of the VM scale set.
458
+ # @param instance_id [String] The instance ID of the virtual machine.
303
459
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
460
  # will be added to the HTTP request.
305
461
  #
306
462
  # @return [Concurrent::Promise] promise which provides async access to http
307
463
  # response.
308
464
  #
309
- def delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
465
+ def power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
310
466
  # Send request
311
- promise = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
467
+ promise = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
312
468
 
313
469
  promise = promise.then do |response|
314
470
  # Defining deserialization method.
@@ -323,132 +479,130 @@ module Azure::ARM::Compute
323
479
  end
324
480
 
325
481
  #
326
- # Allows you to delete a virtual machine scale set.
482
+ # Restarts a virtual machine in a VM scale set.
327
483
  #
328
484
  # @param resource_group_name [String] The name of the resource group.
329
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
330
- # @param instance_id [String] The instance id of the virtual machine.
485
+ # @param vm_scale_set_name [String] The name of the VM scale set.
486
+ # @param instance_id [String] The instance ID of the virtual machine.
331
487
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
488
  # will be added to the HTTP request.
333
489
  #
334
- #
335
- def begin_delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
336
- response = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
490
+ def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
491
+ response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
337
492
  nil
338
493
  end
339
494
 
340
- #
341
- # Allows you to delete a virtual machine scale set.
342
495
  #
343
496
  # @param resource_group_name [String] The name of the resource group.
344
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
345
- # @param instance_id [String] The instance id of the virtual machine.
497
+ # @param vm_scale_set_name [String] The name of the VM scale set.
498
+ # @param instance_id [String] The instance ID of the virtual machine.
346
499
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
500
  # will be added to the HTTP request.
348
501
  #
349
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
502
+ # @return [Concurrent::Promise] promise which provides async access to http
503
+ # response.
350
504
  #
351
- def begin_delete_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
352
- begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
505
+ def restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
506
+ # Send request
507
+ promise = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
508
+
509
+ promise = promise.then do |response|
510
+ # Defining deserialization method.
511
+ deserialize_method = lambda do |parsed_response|
512
+ end
513
+
514
+ # Waiting for response.
515
+ @client.get_long_running_operation_result(response, deserialize_method)
516
+ end
517
+
518
+ promise
353
519
  end
354
520
 
355
521
  #
356
- # Allows you to delete a virtual machine scale set.
522
+ # Starts a virtual machine in a VM scale set.
357
523
  #
358
524
  # @param resource_group_name [String] The name of the resource group.
359
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
360
- # @param instance_id [String] The instance id of the virtual machine.
361
- # @param [Hash{String => String}] A hash of custom headers that will be added
362
- # to the HTTP request.
363
- #
364
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
525
+ # @param vm_scale_set_name [String] The name of the VM scale set.
526
+ # @param instance_id [String] The instance ID of the virtual machine.
527
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
528
+ # will be added to the HTTP request.
365
529
  #
366
- def begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
367
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
368
- fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
369
- fail ArgumentError, 'instance_id is nil' if instance_id.nil?
370
- api_version = '2016-03-30'
371
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
372
-
373
-
374
- request_headers = {}
375
-
376
- # Set Headers
377
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
378
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
379
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
380
-
381
- request_url = @base_url || @client.base_url
382
-
383
- options = {
384
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
385
- path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
386
- query_params: {'api-version' => api_version},
387
- headers: request_headers.merge(custom_headers || {}),
388
- base_url: request_url
389
- }
390
- promise = @client.make_request_async(:delete, path_template, options)
530
+ def start(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
531
+ response = start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
532
+ nil
533
+ end
391
534
 
392
- promise = promise.then do |result|
393
- http_response = result.response
394
- status_code = http_response.status
395
- response_content = http_response.body
396
- unless status_code == 200 || status_code == 202 || status_code == 204
397
- error_model = JSON.load(response_content)
398
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
399
- end
535
+ #
536
+ # @param resource_group_name [String] The name of the resource group.
537
+ # @param vm_scale_set_name [String] The name of the VM scale set.
538
+ # @param instance_id [String] The instance ID of the virtual machine.
539
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
540
+ # will be added to the HTTP request.
541
+ #
542
+ # @return [Concurrent::Promise] promise which provides async access to http
543
+ # response.
544
+ #
545
+ def start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
546
+ # Send request
547
+ promise = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
400
548
 
401
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
549
+ promise = promise.then do |response|
550
+ # Defining deserialization method.
551
+ deserialize_method = lambda do |parsed_response|
552
+ end
402
553
 
403
- result
554
+ # Waiting for response.
555
+ @client.get_long_running_operation_result(response, deserialize_method)
404
556
  end
405
557
 
406
- promise.execute
558
+ promise
407
559
  end
408
560
 
409
561
  #
410
- # Displays information about a virtual machine scale set virtual machine.
562
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
563
+ # scale set.
411
564
  #
412
565
  # @param resource_group_name [String] The name of the resource group.
413
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
414
- # @param instance_id [String] The instance id of the virtual machine.
566
+ # @param vm_scale_set_name [String] The name of the VM scale set.
567
+ # @param instance_id [String] The instance ID of the virtual machine.
415
568
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
416
569
  # will be added to the HTTP request.
417
570
  #
418
- # @return [VirtualMachineScaleSetVM] operation results.
419
571
  #
420
- def get(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
421
- response = get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
422
- response.body unless response.nil?
572
+ def begin_reimage(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
573
+ response = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
574
+ nil
423
575
  end
424
576
 
425
577
  #
426
- # Displays information about a virtual machine scale set virtual machine.
578
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
579
+ # scale set.
427
580
  #
428
581
  # @param resource_group_name [String] The name of the resource group.
429
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
430
- # @param instance_id [String] The instance id of the virtual machine.
582
+ # @param vm_scale_set_name [String] The name of the VM scale set.
583
+ # @param instance_id [String] The instance ID of the virtual machine.
431
584
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
585
  # will be added to the HTTP request.
433
586
  #
434
587
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
435
588
  #
436
- def get_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
437
- get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
589
+ def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
590
+ begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
438
591
  end
439
592
 
440
593
  #
441
- # Displays information about a virtual machine scale set virtual machine.
594
+ # Reimages (upgrade the operating system) a specific virtual machine in a VM
595
+ # scale set.
442
596
  #
443
597
  # @param resource_group_name [String] The name of the resource group.
444
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
445
- # @param instance_id [String] The instance id of the virtual machine.
598
+ # @param vm_scale_set_name [String] The name of the VM scale set.
599
+ # @param instance_id [String] The instance ID of the virtual machine.
446
600
  # @param [Hash{String => String}] A hash of custom headers that will be added
447
601
  # to the HTTP request.
448
602
  #
449
603
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
450
604
  #
451
- def get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
605
+ def begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
452
606
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
453
607
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
454
608
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
@@ -461,7 +615,7 @@ module Azure::ARM::Compute
461
615
  # Set Headers
462
616
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
463
617
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
464
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
618
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'
465
619
 
466
620
  request_url = @base_url || @client.base_url
467
621
 
@@ -472,28 +626,18 @@ module Azure::ARM::Compute
472
626
  headers: request_headers.merge(custom_headers || {}),
473
627
  base_url: request_url
474
628
  }
475
- promise = @client.make_request_async(:get, path_template, options)
629
+ promise = @client.make_request_async(:post, path_template, options)
476
630
 
477
631
  promise = promise.then do |result|
478
632
  http_response = result.response
479
633
  status_code = http_response.status
480
634
  response_content = http_response.body
481
- unless status_code == 200
635
+ unless status_code == 202
482
636
  error_model = JSON.load(response_content)
483
637
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
484
638
  end
485
639
 
486
640
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
487
- # Deserialize Response
488
- if status_code == 200
489
- begin
490
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
491
- result_mapper = VirtualMachineScaleSetVM.mapper()
492
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
493
- rescue Exception => e
494
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
495
- end
496
- end
497
641
 
498
642
  result
499
643
  end
@@ -502,48 +646,56 @@ module Azure::ARM::Compute
502
646
  end
503
647
 
504
648
  #
505
- # Displays the status of a virtual machine scale set virtual machine.
649
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
650
+ # virtual machine and releases the compute resources it uses. You are not
651
+ # billed for the compute resources of this virtual machine once it is
652
+ # deallocated.
506
653
  #
507
654
  # @param resource_group_name [String] The name of the resource group.
508
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
509
- # @param instance_id [String] The instance id of the virtual machine.
655
+ # @param vm_scale_set_name [String] The name of the VM scale set.
656
+ # @param instance_id [String] The instance ID of the virtual machine.
510
657
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
511
658
  # will be added to the HTTP request.
512
659
  #
513
- # @return [VirtualMachineScaleSetVMInstanceView] operation results.
514
660
  #
515
- def get_instance_view(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
516
- response = get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
517
- response.body unless response.nil?
661
+ def begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
662
+ response = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
663
+ nil
518
664
  end
519
665
 
520
666
  #
521
- # Displays the status of a virtual machine scale set virtual machine.
667
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
668
+ # virtual machine and releases the compute resources it uses. You are not
669
+ # billed for the compute resources of this virtual machine once it is
670
+ # deallocated.
522
671
  #
523
672
  # @param resource_group_name [String] The name of the resource group.
524
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
525
- # @param instance_id [String] The instance id of the virtual machine.
673
+ # @param vm_scale_set_name [String] The name of the VM scale set.
674
+ # @param instance_id [String] The instance ID of the virtual machine.
526
675
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
527
676
  # will be added to the HTTP request.
528
677
  #
529
678
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
530
679
  #
531
- def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
532
- get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
680
+ def begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
681
+ begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
533
682
  end
534
683
 
535
684
  #
536
- # Displays the status of a virtual machine scale set virtual machine.
685
+ # Deallocates a specific virtual machine in a VM scale set. Shuts down the
686
+ # virtual machine and releases the compute resources it uses. You are not
687
+ # billed for the compute resources of this virtual machine once it is
688
+ # deallocated.
537
689
  #
538
690
  # @param resource_group_name [String] The name of the resource group.
539
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
540
- # @param instance_id [String] The instance id of the virtual machine.
691
+ # @param vm_scale_set_name [String] The name of the VM scale set.
692
+ # @param instance_id [String] The instance ID of the virtual machine.
541
693
  # @param [Hash{String => String}] A hash of custom headers that will be added
542
694
  # to the HTTP request.
543
695
  #
544
696
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
545
697
  #
546
- def get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
698
+ def begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
547
699
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
548
700
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
549
701
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
@@ -556,7 +708,7 @@ module Azure::ARM::Compute
556
708
  # Set Headers
557
709
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
558
710
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
559
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'
711
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'
560
712
 
561
713
  request_url = @base_url || @client.base_url
562
714
 
@@ -567,28 +719,18 @@ module Azure::ARM::Compute
567
719
  headers: request_headers.merge(custom_headers || {}),
568
720
  base_url: request_url
569
721
  }
570
- promise = @client.make_request_async(:get, path_template, options)
722
+ promise = @client.make_request_async(:post, path_template, options)
571
723
 
572
724
  promise = promise.then do |result|
573
725
  http_response = result.response
574
726
  status_code = http_response.status
575
727
  response_content = http_response.body
576
- unless status_code == 200
728
+ unless status_code == 202
577
729
  error_model = JSON.load(response_content)
578
730
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
579
731
  end
580
732
 
581
733
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
582
- # Deserialize Response
583
- if status_code == 200
584
- begin
585
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
- result_mapper = VirtualMachineScaleSetVMInstanceView.mapper()
587
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
588
- rescue Exception => e
589
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
- end
591
- end
592
734
 
593
735
  result
594
736
  end
@@ -597,85 +739,50 @@ module Azure::ARM::Compute
597
739
  end
598
740
 
599
741
  #
600
- # Lists all virtual machines in a VM scale sets.
601
- #
602
- # @param resource_group_name [String] The name of the resource group.
603
- # @param virtual_machine_scale_set_name [String] The name of the virtual
604
- # machine scale set.
605
- # @param filter [String] The filter to apply on the operation.
606
- # @param select [String] The list parameters.
607
- # @param expand [String] The expand expression to apply on the operation.
608
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
609
- # will be added to the HTTP request.
610
- #
611
- # @return [VirtualMachineScaleSetVMListResult] which provide lazy access to
612
- # pages of the response.
613
- #
614
- def list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
615
- response = list_async(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, custom_headers).value!
616
- unless response.nil?
617
- page = response.body
618
- page.next_method = Proc.new do |next_page_link|
619
- list_next_async(next_page_link, custom_headers)
620
- end
621
- page
622
- end
623
- end
624
-
625
- #
626
- # Lists all virtual machines in a VM scale sets.
742
+ # Deletes a virtual machine from a VM scale set.
627
743
  #
628
744
  # @param resource_group_name [String] The name of the resource group.
629
- # @param virtual_machine_scale_set_name [String] The name of the virtual
630
- # machine scale set.
631
- # @param filter [String] The filter to apply on the operation.
632
- # @param select [String] The list parameters.
633
- # @param expand [String] The expand expression to apply on the operation.
745
+ # @param vm_scale_set_name [String] The name of the VM scale set.
746
+ # @param instance_id [String] The instance ID of the virtual machine.
634
747
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
635
748
  # will be added to the HTTP request.
636
749
  #
637
- # @return [Array<VirtualMachineScaleSetVM>] operation results.
638
750
  #
639
- def list(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
640
- first_page = list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, custom_headers)
641
- first_page.get_all_items
751
+ def begin_delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
752
+ response = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
753
+ nil
642
754
  end
643
755
 
644
756
  #
645
- # Lists all virtual machines in a VM scale sets.
757
+ # Deletes a virtual machine from a VM scale set.
646
758
  #
647
759
  # @param resource_group_name [String] The name of the resource group.
648
- # @param virtual_machine_scale_set_name [String] The name of the virtual
649
- # machine scale set.
650
- # @param filter [String] The filter to apply on the operation.
651
- # @param select [String] The list parameters.
652
- # @param expand [String] The expand expression to apply on the operation.
760
+ # @param vm_scale_set_name [String] The name of the VM scale set.
761
+ # @param instance_id [String] The instance ID of the virtual machine.
653
762
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
654
763
  # will be added to the HTTP request.
655
764
  #
656
765
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
657
766
  #
658
- def list_with_http_info(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
659
- list_async(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, custom_headers).value!
767
+ def begin_delete_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
768
+ begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
660
769
  end
661
770
 
662
771
  #
663
- # Lists all virtual machines in a VM scale sets.
772
+ # Deletes a virtual machine from a VM scale set.
664
773
  #
665
774
  # @param resource_group_name [String] The name of the resource group.
666
- # @param virtual_machine_scale_set_name [String] The name of the virtual
667
- # machine scale set.
668
- # @param filter [String] The filter to apply on the operation.
669
- # @param select [String] The list parameters.
670
- # @param expand [String] The expand expression to apply on the operation.
775
+ # @param vm_scale_set_name [String] The name of the VM scale set.
776
+ # @param instance_id [String] The instance ID of the virtual machine.
671
777
  # @param [Hash{String => String}] A hash of custom headers that will be added
672
778
  # to the HTTP request.
673
779
  #
674
780
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
675
781
  #
676
- def list_async(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
782
+ def begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
677
783
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
678
- fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
784
+ fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
785
+ fail ArgumentError, 'instance_id is nil' if instance_id.nil?
679
786
  api_version = '2016-03-30'
680
787
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
681
788
 
@@ -685,39 +792,29 @@ module Azure::ARM::Compute
685
792
  # Set Headers
686
793
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
687
794
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
688
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'
795
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'
689
796
 
690
797
  request_url = @base_url || @client.base_url
691
798
 
692
799
  options = {
693
800
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
694
- path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'subscriptionId' => @client.subscription_id},
695
- query_params: {'$filter' => filter,'$select' => select,'$expand' => expand,'api-version' => api_version},
801
+ path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
802
+ query_params: {'api-version' => api_version},
696
803
  headers: request_headers.merge(custom_headers || {}),
697
804
  base_url: request_url
698
805
  }
699
- promise = @client.make_request_async(:get, path_template, options)
806
+ promise = @client.make_request_async(:delete, path_template, options)
700
807
 
701
808
  promise = promise.then do |result|
702
809
  http_response = result.response
703
810
  status_code = http_response.status
704
811
  response_content = http_response.body
705
- unless status_code == 200
812
+ unless status_code == 200 || status_code == 202 || status_code == 204
706
813
  error_model = JSON.load(response_content)
707
814
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
708
815
  end
709
816
 
710
817
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
711
- # Deserialize Response
712
- if status_code == 200
713
- begin
714
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
715
- result_mapper = VirtualMachineScaleSetVMListResult.mapper()
716
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
717
- rescue Exception => e
718
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
719
- end
720
- end
721
818
 
722
819
  result
723
820
  end
@@ -726,51 +823,13 @@ module Azure::ARM::Compute
726
823
  end
727
824
 
728
825
  #
729
- # Allows you to power off (stop) a virtual machine in a VM scale set.
730
- #
731
- # @param resource_group_name [String] The name of the resource group.
732
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
733
- # @param instance_id [String] The instance id of the virtual machine.
734
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
735
- # will be added to the HTTP request.
736
- #
737
- def power_off(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
738
- response = power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
739
- nil
740
- end
741
-
742
- #
743
- # @param resource_group_name [String] The name of the resource group.
744
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
745
- # @param instance_id [String] The instance id of the virtual machine.
746
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
747
- # will be added to the HTTP request.
748
- #
749
- # @return [Concurrent::Promise] promise which provides async access to http
750
- # response.
751
- #
752
- def power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
753
- # Send request
754
- promise = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
755
-
756
- promise = promise.then do |response|
757
- # Defining deserialization method.
758
- deserialize_method = lambda do |parsed_response|
759
- end
760
-
761
- # Waiting for response.
762
- @client.get_long_running_operation_result(response, deserialize_method)
763
- end
764
-
765
- promise
766
- end
767
-
768
- #
769
- # Allows you to power off (stop) a virtual machine in a VM scale set.
826
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
827
+ # still attached and you are getting charged for the resources. Instead, use
828
+ # deallocate to release resources and avoid charges.
770
829
  #
771
830
  # @param resource_group_name [String] The name of the resource group.
772
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
773
- # @param instance_id [String] The instance id of the virtual machine.
831
+ # @param vm_scale_set_name [String] The name of the VM scale set.
832
+ # @param instance_id [String] The instance ID of the virtual machine.
774
833
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
775
834
  # will be added to the HTTP request.
776
835
  #
@@ -781,11 +840,13 @@ module Azure::ARM::Compute
781
840
  end
782
841
 
783
842
  #
784
- # Allows you to power off (stop) a virtual machine in a VM scale set.
843
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
844
+ # still attached and you are getting charged for the resources. Instead, use
845
+ # deallocate to release resources and avoid charges.
785
846
  #
786
847
  # @param resource_group_name [String] The name of the resource group.
787
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
788
- # @param instance_id [String] The instance id of the virtual machine.
848
+ # @param vm_scale_set_name [String] The name of the VM scale set.
849
+ # @param instance_id [String] The instance ID of the virtual machine.
789
850
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
790
851
  # will be added to the HTTP request.
791
852
  #
@@ -796,11 +857,13 @@ module Azure::ARM::Compute
796
857
  end
797
858
 
798
859
  #
799
- # Allows you to power off (stop) a virtual machine in a VM scale set.
860
+ # Power off (stop) a virtual machine in a VM scale set. Note that resources are
861
+ # still attached and you are getting charged for the resources. Instead, use
862
+ # deallocate to release resources and avoid charges.
800
863
  #
801
864
  # @param resource_group_name [String] The name of the resource group.
802
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
803
- # @param instance_id [String] The instance id of the virtual machine.
865
+ # @param vm_scale_set_name [String] The name of the VM scale set.
866
+ # @param instance_id [String] The instance ID of the virtual machine.
804
867
  # @param [Hash{String => String}] A hash of custom headers that will be added
805
868
  # to the HTTP request.
806
869
  #
@@ -850,51 +913,11 @@ module Azure::ARM::Compute
850
913
  end
851
914
 
852
915
  #
853
- # Allows you to restart a virtual machine in a VM scale set.
854
- #
855
- # @param resource_group_name [String] The name of the resource group.
856
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
857
- # @param instance_id [String] The instance id of the virtual machine.
858
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
859
- # will be added to the HTTP request.
860
- #
861
- def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
862
- response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
863
- nil
864
- end
865
-
866
- #
867
- # @param resource_group_name [String] The name of the resource group.
868
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
869
- # @param instance_id [String] The instance id of the virtual machine.
870
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
871
- # will be added to the HTTP request.
872
- #
873
- # @return [Concurrent::Promise] promise which provides async access to http
874
- # response.
875
- #
876
- def restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
877
- # Send request
878
- promise = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
879
-
880
- promise = promise.then do |response|
881
- # Defining deserialization method.
882
- deserialize_method = lambda do |parsed_response|
883
- end
884
-
885
- # Waiting for response.
886
- @client.get_long_running_operation_result(response, deserialize_method)
887
- end
888
-
889
- promise
890
- end
891
-
892
- #
893
- # Allows you to restart a virtual machine in a VM scale set.
916
+ # Restarts a virtual machine in a VM scale set.
894
917
  #
895
918
  # @param resource_group_name [String] The name of the resource group.
896
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
897
- # @param instance_id [String] The instance id of the virtual machine.
919
+ # @param vm_scale_set_name [String] The name of the VM scale set.
920
+ # @param instance_id [String] The instance ID of the virtual machine.
898
921
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
899
922
  # will be added to the HTTP request.
900
923
  #
@@ -905,11 +928,11 @@ module Azure::ARM::Compute
905
928
  end
906
929
 
907
930
  #
908
- # Allows you to restart a virtual machine in a VM scale set.
931
+ # Restarts a virtual machine in a VM scale set.
909
932
  #
910
933
  # @param resource_group_name [String] The name of the resource group.
911
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
912
- # @param instance_id [String] The instance id of the virtual machine.
934
+ # @param vm_scale_set_name [String] The name of the VM scale set.
935
+ # @param instance_id [String] The instance ID of the virtual machine.
913
936
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
914
937
  # will be added to the HTTP request.
915
938
  #
@@ -920,11 +943,11 @@ module Azure::ARM::Compute
920
943
  end
921
944
 
922
945
  #
923
- # Allows you to restart a virtual machine in a VM scale set.
946
+ # Restarts a virtual machine in a VM scale set.
924
947
  #
925
948
  # @param resource_group_name [String] The name of the resource group.
926
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
927
- # @param instance_id [String] The instance id of the virtual machine.
949
+ # @param vm_scale_set_name [String] The name of the VM scale set.
950
+ # @param instance_id [String] The instance ID of the virtual machine.
928
951
  # @param [Hash{String => String}] A hash of custom headers that will be added
929
952
  # to the HTTP request.
930
953
  #
@@ -974,51 +997,11 @@ module Azure::ARM::Compute
974
997
  end
975
998
 
976
999
  #
977
- # Allows you to start a virtual machine in a VM scale set.
978
- #
979
- # @param resource_group_name [String] The name of the resource group.
980
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
981
- # @param instance_id [String] The instance id of the virtual machine.
982
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
983
- # will be added to the HTTP request.
984
- #
985
- def start(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
986
- response = start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
987
- nil
988
- end
989
-
990
- #
991
- # @param resource_group_name [String] The name of the resource group.
992
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
993
- # @param instance_id [String] The instance id of the virtual machine.
994
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
995
- # will be added to the HTTP request.
996
- #
997
- # @return [Concurrent::Promise] promise which provides async access to http
998
- # response.
999
- #
1000
- def start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
1001
- # Send request
1002
- promise = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)
1003
-
1004
- promise = promise.then do |response|
1005
- # Defining deserialization method.
1006
- deserialize_method = lambda do |parsed_response|
1007
- end
1008
-
1009
- # Waiting for response.
1010
- @client.get_long_running_operation_result(response, deserialize_method)
1011
- end
1012
-
1013
- promise
1014
- end
1015
-
1016
- #
1017
- # Allows you to start a virtual machine in a VM scale set.
1000
+ # Starts a virtual machine in a VM scale set.
1018
1001
  #
1019
1002
  # @param resource_group_name [String] The name of the resource group.
1020
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1021
- # @param instance_id [String] The instance id of the virtual machine.
1003
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1004
+ # @param instance_id [String] The instance ID of the virtual machine.
1022
1005
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1023
1006
  # will be added to the HTTP request.
1024
1007
  #
@@ -1029,11 +1012,11 @@ module Azure::ARM::Compute
1029
1012
  end
1030
1013
 
1031
1014
  #
1032
- # Allows you to start a virtual machine in a VM scale set.
1015
+ # Starts a virtual machine in a VM scale set.
1033
1016
  #
1034
1017
  # @param resource_group_name [String] The name of the resource group.
1035
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1036
- # @param instance_id [String] The instance id of the virtual machine.
1018
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1019
+ # @param instance_id [String] The instance ID of the virtual machine.
1037
1020
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1038
1021
  # will be added to the HTTP request.
1039
1022
  #
@@ -1044,11 +1027,11 @@ module Azure::ARM::Compute
1044
1027
  end
1045
1028
 
1046
1029
  #
1047
- # Allows you to start a virtual machine in a VM scale set.
1030
+ # Starts a virtual machine in a VM scale set.
1048
1031
  #
1049
1032
  # @param resource_group_name [String] The name of the resource group.
1050
- # @param vm_scale_set_name [String] The name of the virtual machine scale set.
1051
- # @param instance_id [String] The instance id of the virtual machine.
1033
+ # @param vm_scale_set_name [String] The name of the VM scale set.
1034
+ # @param instance_id [String] The instance ID of the virtual machine.
1052
1035
  # @param [Hash{String => String}] A hash of custom headers that will be added
1053
1036
  # to the HTTP request.
1054
1037
  #
@@ -1098,10 +1081,10 @@ module Azure::ARM::Compute
1098
1081
  end
1099
1082
 
1100
1083
  #
1101
- # Lists all virtual machines in a VM scale sets.
1084
+ # Gets a list of all virtual machines in a VM scale sets.
1102
1085
  #
1103
- # @param next_page_link [String] The NextLink from the previous successful
1104
- # call to List operation.
1086
+ # @param next_page_link [String] The NextLink from the previous successful call
1087
+ # to List operation.
1105
1088
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1106
1089
  # will be added to the HTTP request.
1107
1090
  #
@@ -1113,10 +1096,10 @@ module Azure::ARM::Compute
1113
1096
  end
1114
1097
 
1115
1098
  #
1116
- # Lists all virtual machines in a VM scale sets.
1099
+ # Gets a list of all virtual machines in a VM scale sets.
1117
1100
  #
1118
- # @param next_page_link [String] The NextLink from the previous successful
1119
- # call to List operation.
1101
+ # @param next_page_link [String] The NextLink from the previous successful call
1102
+ # to List operation.
1120
1103
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1121
1104
  # will be added to the HTTP request.
1122
1105
  #
@@ -1127,10 +1110,10 @@ module Azure::ARM::Compute
1127
1110
  end
1128
1111
 
1129
1112
  #
1130
- # Lists all virtual machines in a VM scale sets.
1113
+ # Gets a list of all virtual machines in a VM scale sets.
1131
1114
  #
1132
- # @param next_page_link [String] The NextLink from the previous successful
1133
- # call to List operation.
1115
+ # @param next_page_link [String] The NextLink from the previous successful call
1116
+ # to List operation.
1134
1117
  # @param [Hash{String => String}] A hash of custom headers that will be added
1135
1118
  # to the HTTP request.
1136
1119
  #
@@ -1184,5 +1167,30 @@ module Azure::ARM::Compute
1184
1167
  promise.execute
1185
1168
  end
1186
1169
 
1170
+ #
1171
+ # Gets a list of all virtual machines in a VM scale sets.
1172
+ #
1173
+ # @param resource_group_name [String] The name of the resource group.
1174
+ # @param virtual_machine_scale_set_name [String] The name of the VM scale set.
1175
+ # @param filter [String] The filter to apply to the operation.
1176
+ # @param select [String] The list parameters.
1177
+ # @param expand [String] The expand expression to apply to the operation.
1178
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1179
+ # will be added to the HTTP request.
1180
+ #
1181
+ # @return [VirtualMachineScaleSetVMListResult] which provide lazy access to
1182
+ # pages of the response.
1183
+ #
1184
+ def list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
1185
+ response = list_async(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, custom_headers).value!
1186
+ unless response.nil?
1187
+ page = response.body
1188
+ page.next_method = Proc.new do |next_page_link|
1189
+ list_next_async(next_page_link, custom_headers)
1190
+ end
1191
+ page
1192
+ end
1193
+ end
1194
+
1187
1195
  end
1188
1196
  end