azure_mgmt_compute 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_compute.gemspec +4 -4
  3. data/lib/azure_mgmt_compute.rb +3 -138
  4. data/lib/generated/azure_mgmt_compute.rb +128 -0
  5. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/availability_sets.rb +24 -22
  6. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/compute_management_client.rb +12 -12
  7. data/lib/generated/azure_mgmt_compute/models/additional_unattend_content.rb +88 -0
  8. data/lib/generated/azure_mgmt_compute/models/api_entity_reference.rb +45 -0
  9. data/lib/generated/azure_mgmt_compute/models/api_error.rb +93 -0
  10. data/lib/generated/azure_mgmt_compute/models/api_error_base.rb +64 -0
  11. data/lib/generated/azure_mgmt_compute/models/availability_set.rb +136 -0
  12. data/lib/generated/azure_mgmt_compute/models/availability_set_list_result.rb +52 -0
  13. data/lib/generated/azure_mgmt_compute/models/boot_diagnostics.rb +56 -0
  14. data/lib/generated/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +54 -0
  15. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/caching_types.rb +0 -0
  16. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/component_names.rb +0 -0
  17. data/lib/generated/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +44 -0
  18. data/lib/generated/azure_mgmt_compute/models/data_disk.rb +114 -0
  19. data/lib/generated/azure_mgmt_compute/models/data_disk_image.rb +48 -0
  20. data/lib/generated/azure_mgmt_compute/models/diagnostics_profile.rb +45 -0
  21. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/disk_create_option_types.rb +0 -0
  22. data/lib/generated/azure_mgmt_compute/models/disk_encryption_settings.rb +69 -0
  23. data/lib/generated/azure_mgmt_compute/models/disk_instance_view.rb +62 -0
  24. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/hardware_profile.rb +20 -35
  25. data/lib/generated/azure_mgmt_compute/models/image_reference.rb +76 -0
  26. data/lib/generated/azure_mgmt_compute/models/inner_error.rb +54 -0
  27. data/lib/generated/azure_mgmt_compute/models/instance_view_status.rb +87 -0
  28. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/instance_view_types.rb +0 -0
  29. data/lib/generated/azure_mgmt_compute/models/key_vault_key_reference.rb +56 -0
  30. data/lib/generated/azure_mgmt_compute/models/key_vault_secret_reference.rb +56 -0
  31. data/lib/generated/azure_mgmt_compute/models/linux_configuration.rb +56 -0
  32. data/lib/generated/azure_mgmt_compute/models/list_usages_result.rb +95 -0
  33. data/lib/generated/azure_mgmt_compute/models/network_interface_reference.rb +51 -0
  34. data/lib/generated/azure_mgmt_compute/models/network_profile.rb +52 -0
  35. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/operating_system_types.rb +0 -0
  36. data/lib/generated/azure_mgmt_compute/models/osdisk.rb +127 -0
  37. data/lib/generated/azure_mgmt_compute/models/osdisk_image.rb +46 -0
  38. data/lib/generated/azure_mgmt_compute/models/osprofile.rb +116 -0
  39. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/pass_names.rb +0 -0
  40. data/lib/generated/azure_mgmt_compute/models/plan.rb +74 -0
  41. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/protocol_types.rb +0 -0
  42. data/lib/generated/azure_mgmt_compute/models/purchase_plan.rb +65 -0
  43. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/setting_names.rb +0 -0
  44. data/lib/generated/azure_mgmt_compute/models/sku.rb +64 -0
  45. data/lib/generated/azure_mgmt_compute/models/ssh_configuration.rb +53 -0
  46. data/lib/generated/azure_mgmt_compute/models/ssh_public_key.rb +59 -0
  47. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/status_level_types.rb +0 -0
  48. data/lib/generated/azure_mgmt_compute/models/storage_profile.rb +74 -0
  49. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/upgrade_mode.rb +0 -0
  50. data/lib/generated/azure_mgmt_compute/models/upgrade_policy.rb +46 -0
  51. data/lib/generated/azure_mgmt_compute/models/usage.rb +78 -0
  52. data/lib/generated/azure_mgmt_compute/models/usage_name.rb +54 -0
  53. data/lib/generated/azure_mgmt_compute/models/vault_certificate.rb +57 -0
  54. data/lib/generated/azure_mgmt_compute/models/vault_secret_group.rb +65 -0
  55. data/lib/generated/azure_mgmt_compute/models/virtual_hard_disk.rb +45 -0
  56. data/lib/generated/azure_mgmt_compute/models/virtual_machine.rb +224 -0
  57. data/lib/generated/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +81 -0
  58. data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +65 -0
  59. data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_result.rb +51 -0
  60. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension.rb +175 -0
  61. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +67 -0
  62. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +134 -0
  63. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +101 -0
  64. data/lib/generated/azure_mgmt_compute/models/virtual_machine_image.rb +109 -0
  65. data/lib/generated/azure_mgmt_compute/models/virtual_machine_image_resource.rb +78 -0
  66. data/lib/generated/azure_mgmt_compute/models/virtual_machine_instance_view.rb +142 -0
  67. data/lib/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +94 -0
  68. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +135 -0
  69. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +124 -0
  70. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +53 -0
  71. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +85 -0
  72. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +56 -0
  73. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +117 -0
  74. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +95 -0
  75. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +97 -0
  76. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +97 -0
  77. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +82 -0
  78. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +53 -0
  79. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +111 -0
  80. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +116 -0
  81. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +70 -0
  82. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +80 -0
  83. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/virtual_machine_scale_set_sku_scale_type.rb +0 -0
  84. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +56 -0
  85. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +248 -0
  86. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +66 -0
  87. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +51 -0
  88. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +52 -0
  89. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +142 -0
  90. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +96 -0
  91. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +82 -0
  92. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size.rb +95 -0
  93. data/lib/generated/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +52 -0
  94. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/virtual_machine_size_types.rb +0 -0
  95. data/lib/generated/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +58 -0
  96. data/lib/generated/azure_mgmt_compute/models/win_rmconfiguration.rb +53 -0
  97. data/lib/generated/azure_mgmt_compute/models/win_rmlistener.rb +58 -0
  98. data/lib/generated/azure_mgmt_compute/models/windows_configuration.rb +98 -0
  99. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/module_definition.rb +0 -0
  100. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/usage_operations.rb +32 -11
  101. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/version.rb +1 -1
  102. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_extension_images.rb +40 -26
  103. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_extensions.rb +59 -31
  104. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_images.rb +76 -48
  105. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_scale_set_vms.rb +169 -41
  106. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_scale_sets.rb +341 -125
  107. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_sizes.rb +4 -4
  108. data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machines.rb +340 -84
  109. metadata +126 -142
  110. data/lib/azure_mgmt_compute/models/additional_unattend_content.rb +0 -105
  111. data/lib/azure_mgmt_compute/models/api_entity_reference.rb +0 -57
  112. data/lib/azure_mgmt_compute/models/api_error.rb +0 -119
  113. data/lib/azure_mgmt_compute/models/api_error_base.rb +0 -74
  114. data/lib/azure_mgmt_compute/models/availability_set.rb +0 -92
  115. data/lib/azure_mgmt_compute/models/availability_set_list_result.rb +0 -77
  116. data/lib/azure_mgmt_compute/models/availability_set_properties.rb +0 -128
  117. data/lib/azure_mgmt_compute/models/boot_diagnostics.rb +0 -67
  118. data/lib/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +0 -65
  119. data/lib/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +0 -56
  120. data/lib/azure_mgmt_compute/models/data_disk.rb +0 -143
  121. data/lib/azure_mgmt_compute/models/data_disk_image.rb +0 -60
  122. data/lib/azure_mgmt_compute/models/diagnostics_profile.rb +0 -62
  123. data/lib/azure_mgmt_compute/models/disk_encryption_settings.rb +0 -90
  124. data/lib/azure_mgmt_compute/models/disk_instance_view.rb +0 -86
  125. data/lib/azure_mgmt_compute/models/image_reference.rb +0 -85
  126. data/lib/azure_mgmt_compute/models/inner_error.rb +0 -66
  127. data/lib/azure_mgmt_compute/models/instance_view_status.rb +0 -100
  128. data/lib/azure_mgmt_compute/models/key_vault_key_reference.rb +0 -74
  129. data/lib/azure_mgmt_compute/models/key_vault_secret_reference.rb +0 -75
  130. data/lib/azure_mgmt_compute/models/linux_configuration.rb +0 -73
  131. data/lib/azure_mgmt_compute/models/list_usages_result.rb +0 -76
  132. data/lib/azure_mgmt_compute/models/network_interface_reference.rb +0 -68
  133. data/lib/azure_mgmt_compute/models/network_interface_reference_properties.rb +0 -57
  134. data/lib/azure_mgmt_compute/models/network_profile.rb +0 -77
  135. data/lib/azure_mgmt_compute/models/osdisk.rb +0 -163
  136. data/lib/azure_mgmt_compute/models/osdisk_image.rb +0 -61
  137. data/lib/azure_mgmt_compute/models/osprofile.rb +0 -147
  138. data/lib/azure_mgmt_compute/models/plan.rb +0 -83
  139. data/lib/azure_mgmt_compute/models/purchase_plan.rb +0 -77
  140. data/lib/azure_mgmt_compute/models/sku.rb +0 -75
  141. data/lib/azure_mgmt_compute/models/ssh_configuration.rb +0 -77
  142. data/lib/azure_mgmt_compute/models/ssh_public_key.rb +0 -70
  143. data/lib/azure_mgmt_compute/models/storage_profile.rb +0 -108
  144. data/lib/azure_mgmt_compute/models/upgrade_policy.rb +0 -60
  145. data/lib/azure_mgmt_compute/models/usage.rb +0 -96
  146. data/lib/azure_mgmt_compute/models/usage_name.rb +0 -66
  147. data/lib/azure_mgmt_compute/models/vault_certificate.rb +0 -68
  148. data/lib/azure_mgmt_compute/models/vault_secret_group.rb +0 -94
  149. data/lib/azure_mgmt_compute/models/virtual_hard_disk.rb +0 -57
  150. data/lib/azure_mgmt_compute/models/virtual_machine.rb +0 -140
  151. data/lib/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +0 -117
  152. data/lib/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +0 -78
  153. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result.rb +0 -68
  154. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result_properties.rb +0 -56
  155. data/lib/azure_mgmt_compute/models/virtual_machine_extension.rb +0 -92
  156. data/lib/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +0 -83
  157. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image.rb +0 -92
  158. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image_properties.rb +0 -102
  159. data/lib/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +0 -137
  160. data/lib/azure_mgmt_compute/models/virtual_machine_extension_properties.rb +0 -141
  161. data/lib/azure_mgmt_compute/models/virtual_machine_image.rb +0 -86
  162. data/lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb +0 -108
  163. data/lib/azure_mgmt_compute/models/virtual_machine_image_resource.rb +0 -83
  164. data/lib/azure_mgmt_compute/models/virtual_machine_instance_view.rb +0 -202
  165. data/lib/azure_mgmt_compute/models/virtual_machine_list_result.rb +0 -87
  166. data/lib/azure_mgmt_compute/models/virtual_machine_properties.rb +0 -189
  167. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set.rb +0 -108
  168. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +0 -77
  169. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +0 -77
  170. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_properties.rb +0 -116
  171. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +0 -125
  172. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +0 -79
  173. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +0 -78
  174. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration_properties.rb +0 -158
  175. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +0 -77
  176. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +0 -77
  177. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +0 -88
  178. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +0 -80
  179. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_properties.rb +0 -89
  180. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +0 -77
  181. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +0 -129
  182. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +0 -147
  183. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_properties.rb +0 -99
  184. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +0 -88
  185. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +0 -90
  186. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +0 -78
  187. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +0 -165
  188. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +0 -87
  189. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +0 -57
  190. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +0 -59
  191. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +0 -202
  192. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +0 -77
  193. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +0 -114
  194. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmproperties.rb +0 -190
  195. data/lib/azure_mgmt_compute/models/virtual_machine_size.rb +0 -109
  196. data/lib/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +0 -77
  197. data/lib/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +0 -68
  198. data/lib/azure_mgmt_compute/models/win_rmconfiguration.rb +0 -77
  199. data/lib/azure_mgmt_compute/models/win_rmlistener.rb +0 -71
  200. data/lib/azure_mgmt_compute/models/windows_configuration.rb +0 -124
@@ -0,0 +1,98 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Compute
7
+ module Models
8
+ #
9
+ # Describes Windows Configuration of the OS Profile.
10
+ #
11
+ class WindowsConfiguration
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Boolean] whether VM Agent should be provisioned on the
16
+ # Virtual Machine.
17
+ attr_accessor :provision_vmagent
18
+
19
+ # @return [Boolean] whether Windows updates are automatically installed
20
+ # on the VM
21
+ attr_accessor :enable_automatic_updates
22
+
23
+ # @return [String] the Time Zone of the VM
24
+ attr_accessor :time_zone
25
+
26
+ # @return [Array<AdditionalUnattendContent>] the additional base-64
27
+ # encoded XML formatted information that can be included in the
28
+ # Unattend.xml file.
29
+ attr_accessor :additional_unattend_content
30
+
31
+ # @return [WinRMConfiguration] the Windows Remote Management
32
+ # configuration of the VM
33
+ attr_accessor :win_rm
34
+
35
+
36
+ #
37
+ # Mapper for WindowsConfiguration class as Ruby Hash.
38
+ # This will be used for serialization/deserialization.
39
+ #
40
+ def self.mapper()
41
+ {
42
+ required: false,
43
+ serialized_name: 'WindowsConfiguration',
44
+ type: {
45
+ name: 'Composite',
46
+ class_name: 'WindowsConfiguration',
47
+ model_properties: {
48
+ provision_vmagent: {
49
+ required: false,
50
+ serialized_name: 'provisionVMAgent',
51
+ type: {
52
+ name: 'Boolean'
53
+ }
54
+ },
55
+ enable_automatic_updates: {
56
+ required: false,
57
+ serialized_name: 'enableAutomaticUpdates',
58
+ type: {
59
+ name: 'Boolean'
60
+ }
61
+ },
62
+ time_zone: {
63
+ required: false,
64
+ serialized_name: 'timeZone',
65
+ type: {
66
+ name: 'String'
67
+ }
68
+ },
69
+ additional_unattend_content: {
70
+ required: false,
71
+ serialized_name: 'additionalUnattendContent',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ required: false,
76
+ serialized_name: 'AdditionalUnattendContentElementType',
77
+ type: {
78
+ name: 'Composite',
79
+ class_name: 'AdditionalUnattendContent'
80
+ }
81
+ }
82
+ }
83
+ },
84
+ win_rm: {
85
+ required: false,
86
+ serialized_name: 'winRM',
87
+ type: {
88
+ name: 'Composite',
89
+ class_name: 'WinRMConfiguration'
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
98
+ end
@@ -29,11 +29,32 @@ module Azure::ARM::Compute
29
29
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
30
  # will be added to the HTTP request.
31
31
  #
32
- # @return [ListUsagesResult] operation results.
32
+ # @return [ListUsagesResult] which provide lazy access to pages of the
33
+ # response.
33
34
  #
34
- def list(location, custom_headers = nil)
35
+ def list_as_lazy(location, custom_headers = nil)
35
36
  response = list_async(location, custom_headers).value!
36
- response.body unless response.nil?
37
+ unless response.nil?
38
+ page = response.body
39
+ page.next_method = Proc.new do |next_link|
40
+ list_next_async(next_link, custom_headers)
41
+ end
42
+ page
43
+ end
44
+ end
45
+
46
+ #
47
+ # Lists compute usages for a subscription.
48
+ #
49
+ # @param location [String] The location upon which resource usage is queried.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [Array<Usage>] operation results.
54
+ #
55
+ def list(location, custom_headers = nil)
56
+ first_page = list_as_lazy(location, custom_headers)
57
+ first_page.get_all_items
37
58
  end
38
59
 
39
60
  #
@@ -62,6 +83,8 @@ module Azure::ARM::Compute
62
83
  fail ArgumentError, 'location is nil' if location.nil?
63
84
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
64
85
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
+
87
+
65
88
  request_headers = {}
66
89
 
67
90
  # Set Headers
@@ -97,10 +120,8 @@ module Azure::ARM::Compute
97
120
  if status_code == 200
98
121
  begin
99
122
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
100
- unless parsed_response.nil?
101
- parsed_response = ListUsagesResult.deserialize_object(parsed_response)
102
- end
103
- result.body = parsed_response
123
+ result_mapper = ListUsagesResult.mapper()
124
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
104
125
  rescue Exception => e
105
126
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
127
  end
@@ -153,6 +174,8 @@ module Azure::ARM::Compute
153
174
  #
154
175
  def list_next_async(next_page_link, custom_headers = nil)
155
176
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
177
+
178
+
156
179
  request_headers = {}
157
180
 
158
181
  # Set Headers
@@ -187,10 +210,8 @@ module Azure::ARM::Compute
187
210
  if status_code == 200
188
211
  begin
189
212
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
190
- unless parsed_response.nil?
191
- parsed_response = ListUsagesResult.deserialize_object(parsed_response)
192
- end
193
- result.body = parsed_response
213
+ result_mapper = ListUsagesResult.mapper()
214
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
194
215
  rescue Exception => e
195
216
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
196
217
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Compute
7
- VERSION = '0.3.1'
7
+ VERSION = '0.4.0'
8
8
  end
@@ -74,6 +74,8 @@ module Azure::ARM::Compute
74
74
  fail ArgumentError, 'version is nil' if version.nil?
75
75
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
76
76
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
77
+
78
+
77
79
  request_headers = {}
78
80
 
79
81
  # Set Headers
@@ -109,10 +111,8 @@ module Azure::ARM::Compute
109
111
  if status_code == 200
110
112
  begin
111
113
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
- unless parsed_response.nil?
113
- parsed_response = VirtualMachineExtensionImage.deserialize_object(parsed_response)
114
- end
115
- result.body = parsed_response
114
+ result_mapper = VirtualMachineExtensionImage.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
116
116
  rescue Exception => e
117
117
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
118
  end
@@ -168,6 +168,8 @@ module Azure::ARM::Compute
168
168
  fail ArgumentError, 'publisher_name is nil' if publisher_name.nil?
169
169
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
170
170
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
171
+
172
+
171
173
  request_headers = {}
172
174
 
173
175
  # Set Headers
@@ -203,17 +205,22 @@ module Azure::ARM::Compute
203
205
  if status_code == 200
204
206
  begin
205
207
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
206
- unless parsed_response.nil?
207
- deserialized_array = []
208
- parsed_response.each do |element|
209
- unless element.nil?
210
- element = VirtualMachineExtensionImage.deserialize_object(element)
211
- end
212
- deserialized_array.push(element)
213
- end
214
- parsed_response = deserialized_array
215
- end
216
- result.body = parsed_response
208
+ result_mapper = {
209
+ required: false,
210
+ serialized_name: 'parsed_response',
211
+ type: {
212
+ name: 'Sequence',
213
+ element: {
214
+ required: false,
215
+ serialized_name: 'VirtualMachineExtensionImageElementType',
216
+ type: {
217
+ name: 'Composite',
218
+ class_name: 'VirtualMachineExtensionImage'
219
+ }
220
+ }
221
+ }
222
+ }
223
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
217
224
  rescue Exception => e
218
225
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
219
226
  end
@@ -282,6 +289,8 @@ module Azure::ARM::Compute
282
289
  fail ArgumentError, 'type is nil' if type.nil?
283
290
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
284
291
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
292
+
293
+
285
294
  request_headers = {}
286
295
 
287
296
  # Set Headers
@@ -317,17 +326,22 @@ module Azure::ARM::Compute
317
326
  if status_code == 200
318
327
  begin
319
328
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
320
- unless parsed_response.nil?
321
- deserialized_array = []
322
- parsed_response.each do |element|
323
- unless element.nil?
324
- element = VirtualMachineExtensionImage.deserialize_object(element)
325
- end
326
- deserialized_array.push(element)
327
- end
328
- parsed_response = deserialized_array
329
- end
330
- result.body = parsed_response
329
+ result_mapper = {
330
+ required: false,
331
+ serialized_name: 'parsed_response',
332
+ type: {
333
+ name: 'Sequence',
334
+ element: {
335
+ required: false,
336
+ serialized_name: 'VirtualMachineExtensionImageElementType',
337
+ type: {
338
+ name: 'Composite',
339
+ class_name: 'VirtualMachineExtensionImage'
340
+ }
341
+ }
342
+ }
343
+ }
344
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
331
345
  rescue Exception => e
332
346
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
333
347
  end
@@ -31,26 +31,38 @@ module Azure::ARM::Compute
31
31
  # @param vm_extension_name [String] The name of the virtual machine extension.
32
32
  # @param extension_parameters [VirtualMachineExtension] Parameters supplied to
33
33
  # the Create Virtual Machine Extension operation.
34
- # @param @client.api_version [String] Client Api Version.
35
- # @param @client.subscription_id [String] Gets subscription credentials which
36
- # uniquely identify Microsoft Azure subscription. The subscription ID forms
37
- # part of the URI for every service call.
38
- # @param @client.accept_language [String] Gets or sets the preferred language
39
- # for the response.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [VirtualMachineExtension] operation results.
38
+ #
39
+ def create_or_update(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers = nil)
40
+ response = create_or_update_async(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group.
46
+ # @param vm_name [String] The name of the virtual machine where the extension
47
+ # should be create or updated.
48
+ # @param vm_extension_name [String] The name of the virtual machine extension.
49
+ # @param extension_parameters [VirtualMachineExtension] Parameters supplied to
50
+ # the Create Virtual Machine Extension operation.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
40
53
  #
41
54
  # @return [Concurrent::Promise] promise which provides async access to http
42
55
  # response.
43
56
  #
44
- def create_or_update(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers = nil)
57
+ def create_or_update_async(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers = nil)
45
58
  # Send request
46
59
  promise = begin_create_or_update_async(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers)
47
60
 
48
61
  promise = promise.then do |response|
49
62
  # Defining deserialization method.
50
63
  deserialize_method = lambda do |parsed_response|
51
- unless parsed_response.nil?
52
- parsed_response = VirtualMachineExtension.deserialize_object(parsed_response)
53
- end
64
+ result_mapper = VirtualMachineExtension.mapper()
65
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
54
66
  end
55
67
 
56
68
  # Waiting for response.
@@ -116,21 +128,23 @@ module Azure::ARM::Compute
116
128
  fail ArgumentError, 'vm_name is nil' if vm_name.nil?
117
129
  fail ArgumentError, 'vm_extension_name is nil' if vm_extension_name.nil?
118
130
  fail ArgumentError, 'extension_parameters is nil' if extension_parameters.nil?
119
- extension_parameters.validate unless extension_parameters.nil?
120
131
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
121
132
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
133
+
134
+
122
135
  request_headers = {}
123
136
 
124
137
  # Set Headers
125
138
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
126
139
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
127
140
 
128
- # Serialize Request
129
141
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
130
- unless extension_parameters.nil?
131
- extension_parameters = VirtualMachineExtension.serialize_object(extension_parameters)
132
- end
133
- request_content = extension_parameters != nil ? JSON.generate(extension_parameters, quirks_mode: true) : nil
142
+
143
+ # Serialize Request
144
+ request_mapper = VirtualMachineExtension.mapper()
145
+ request_content = @client.serialize(request_mapper, extension_parameters, 'extension_parameters')
146
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
147
+
134
148
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'
135
149
  options = {
136
150
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -162,10 +176,8 @@ module Azure::ARM::Compute
162
176
  if status_code == 200
163
177
  begin
164
178
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
165
- unless parsed_response.nil?
166
- parsed_response = VirtualMachineExtension.deserialize_object(parsed_response)
167
- end
168
- result.body = parsed_response
179
+ result_mapper = VirtualMachineExtension.mapper()
180
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
169
181
  rescue Exception => e
170
182
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
171
183
  end
@@ -174,10 +186,8 @@ module Azure::ARM::Compute
174
186
  if status_code == 201
175
187
  begin
176
188
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
177
- unless parsed_response.nil?
178
- parsed_response = VirtualMachineExtension.deserialize_object(parsed_response)
179
- end
180
- result.body = parsed_response
189
+ result_mapper = VirtualMachineExtension.mapper()
190
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
181
191
  rescue Exception => e
182
192
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
183
193
  end
@@ -196,10 +206,26 @@ module Azure::ARM::Compute
196
206
  # @param vm_name [String] The name of the virtual machine where the extension
197
207
  # should be deleted.
198
208
  # @param vm_extension_name [String] The name of the virtual machine extension.
209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
210
+ # will be added to the HTTP request.
211
+ #
212
+ def delete(resource_group_name, vm_name, vm_extension_name, custom_headers = nil)
213
+ response = delete_async(resource_group_name, vm_name, vm_extension_name, custom_headers).value!
214
+ nil
215
+ end
216
+
217
+ #
218
+ # @param resource_group_name [String] The name of the resource group.
219
+ # @param vm_name [String] The name of the virtual machine where the extension
220
+ # should be deleted.
221
+ # @param vm_extension_name [String] The name of the virtual machine extension.
222
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
223
+ # will be added to the HTTP request.
224
+ #
199
225
  # @return [Concurrent::Promise] promise which provides async access to http
200
226
  # response.
201
227
  #
202
- def delete(resource_group_name, vm_name, vm_extension_name, custom_headers = nil)
228
+ def delete_async(resource_group_name, vm_name, vm_extension_name, custom_headers = nil)
203
229
  # Send request
204
230
  promise = begin_delete_async(resource_group_name, vm_name, vm_extension_name, custom_headers)
205
231
 
@@ -208,8 +234,8 @@ module Azure::ARM::Compute
208
234
  deserialize_method = lambda do |parsed_response|
209
235
  end
210
236
 
211
- # Waiting for response.
212
- @client.get_long_running_operation_result(response, deserialize_method)
237
+ # Waiting for response.
238
+ @client.get_long_running_operation_result(response, deserialize_method)
213
239
  end
214
240
 
215
241
  promise
@@ -265,6 +291,8 @@ module Azure::ARM::Compute
265
291
  fail ArgumentError, 'vm_extension_name is nil' if vm_extension_name.nil?
266
292
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
267
293
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
294
+
295
+
268
296
  request_headers = {}
269
297
 
270
298
  # Set Headers
@@ -357,6 +385,8 @@ module Azure::ARM::Compute
357
385
  fail ArgumentError, 'vm_extension_name is nil' if vm_extension_name.nil?
358
386
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
359
387
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
388
+
389
+
360
390
  request_headers = {}
361
391
 
362
392
  # Set Headers
@@ -392,10 +422,8 @@ module Azure::ARM::Compute
392
422
  if status_code == 200
393
423
  begin
394
424
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
395
- unless parsed_response.nil?
396
- parsed_response = VirtualMachineExtension.deserialize_object(parsed_response)
397
- end
398
- result.body = parsed_response
425
+ result_mapper = VirtualMachineExtension.mapper()
426
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
399
427
  rescue Exception => e
400
428
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
401
429
  end