azure_mgmt_compute 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/azure_mgmt_compute.gemspec +3 -11
  3. data/lib/azure_mgmt_compute/availability_sets.rb +226 -241
  4. data/lib/azure_mgmt_compute/compute_management_client.rb +26 -11
  5. data/lib/azure_mgmt_compute/models/additional_unattend_content.rb +8 -11
  6. data/lib/azure_mgmt_compute/models/api_entity_reference.rb +58 -0
  7. data/lib/azure_mgmt_compute/models/api_error.rb +4 -6
  8. data/lib/azure_mgmt_compute/models/api_error_base.rb +1 -3
  9. data/lib/azure_mgmt_compute/models/availability_set.rb +1 -3
  10. data/lib/azure_mgmt_compute/models/availability_set_list_result.rb +4 -6
  11. data/lib/azure_mgmt_compute/models/availability_set_properties.rb +9 -11
  12. data/lib/azure_mgmt_compute/models/boot_diagnostics.rb +67 -0
  13. data/lib/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +65 -0
  14. data/lib/azure_mgmt_compute/models/caching_types.rb +1 -1
  15. data/lib/azure_mgmt_compute/models/component_names.rb +1 -1
  16. data/lib/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +1 -3
  17. data/lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb +3 -6
  18. data/lib/azure_mgmt_compute/models/compute_operation_status.rb +1 -1
  19. data/lib/azure_mgmt_compute/models/data_disk.rb +27 -26
  20. data/lib/azure_mgmt_compute/models/data_disk_image.rb +1 -3
  21. data/lib/azure_mgmt_compute/models/delete_operation_result.rb +6 -5
  22. data/lib/azure_mgmt_compute/models/diagnostics_profile.rb +62 -0
  23. data/lib/azure_mgmt_compute/models/disk_create_option_types.rb +1 -1
  24. data/lib/azure_mgmt_compute/models/disk_encryption_settings.rb +81 -0
  25. data/lib/azure_mgmt_compute/models/disk_instance_view.rb +4 -6
  26. data/lib/azure_mgmt_compute/models/hardware_profile.rb +15 -9
  27. data/lib/azure_mgmt_compute/models/image_reference.rb +1 -3
  28. data/lib/azure_mgmt_compute/models/inner_error.rb +1 -3
  29. data/lib/azure_mgmt_compute/models/instance_view_status.rb +3 -5
  30. data/lib/azure_mgmt_compute/models/key_vault_key_reference.rb +74 -0
  31. data/lib/azure_mgmt_compute/models/key_vault_secret_reference.rb +75 -0
  32. data/lib/azure_mgmt_compute/models/linux_configuration.rb +1 -3
  33. data/lib/azure_mgmt_compute/models/list_usages_result.rb +4 -6
  34. data/lib/azure_mgmt_compute/models/network_interface_reference.rb +1 -3
  35. data/lib/azure_mgmt_compute/models/network_interface_reference_properties.rb +1 -3
  36. data/lib/azure_mgmt_compute/models/network_profile.rb +4 -6
  37. data/lib/azure_mgmt_compute/models/operating_system_types.rb +1 -1
  38. data/lib/azure_mgmt_compute/models/operation_status.rb +1 -1
  39. data/lib/azure_mgmt_compute/models/osdisk.rb +54 -26
  40. data/lib/azure_mgmt_compute/models/osdisk_image.rb +4 -6
  41. data/lib/azure_mgmt_compute/models/osprofile.rb +4 -6
  42. data/lib/azure_mgmt_compute/models/pass_names.rb +1 -1
  43. data/lib/azure_mgmt_compute/models/plan.rb +1 -3
  44. data/lib/azure_mgmt_compute/models/protocol_types.rb +1 -1
  45. data/lib/azure_mgmt_compute/models/purchase_plan.rb +4 -4
  46. data/lib/azure_mgmt_compute/models/setting_names.rb +1 -1
  47. data/lib/azure_mgmt_compute/models/sku.rb +75 -0
  48. data/lib/azure_mgmt_compute/models/ssh_configuration.rb +4 -6
  49. data/lib/azure_mgmt_compute/models/ssh_public_key.rb +1 -3
  50. data/lib/azure_mgmt_compute/models/status_level_types.rb +1 -1
  51. data/lib/azure_mgmt_compute/models/storage_profile.rb +4 -6
  52. data/lib/azure_mgmt_compute/models/{usage_unit.rb → upgrade_mode.rb} +5 -4
  53. data/lib/azure_mgmt_compute/models/upgrade_policy.rb +60 -0
  54. data/lib/azure_mgmt_compute/models/usage.rb +7 -9
  55. data/lib/azure_mgmt_compute/models/usage_name.rb +1 -3
  56. data/lib/azure_mgmt_compute/models/vault_certificate.rb +1 -3
  57. data/lib/azure_mgmt_compute/models/vault_secret_group.rb +6 -8
  58. data/lib/azure_mgmt_compute/models/virtual_hard_disk.rb +1 -3
  59. data/lib/azure_mgmt_compute/models/virtual_machine.rb +4 -6
  60. data/lib/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +7 -9
  61. data/lib/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +4 -4
  62. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result.rb +68 -0
  63. data/lib/azure_mgmt_compute/models/virtual_machine_capture_result_properties.rb +56 -0
  64. data/lib/azure_mgmt_compute/models/virtual_machine_extension.rb +1 -3
  65. data/lib/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +1 -3
  66. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image.rb +15 -15
  67. data/lib/azure_mgmt_compute/models/virtual_machine_extension_image_properties.rb +4 -4
  68. data/lib/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +7 -9
  69. data/lib/azure_mgmt_compute/models/virtual_machine_extension_properties.rb +11 -3
  70. data/lib/azure_mgmt_compute/models/virtual_machine_image.rb +15 -15
  71. data/lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb +4 -6
  72. data/lib/azure_mgmt_compute/models/virtual_machine_image_resource.rb +9 -9
  73. data/lib/azure_mgmt_compute/models/virtual_machine_instance_view.rb +28 -14
  74. data/lib/azure_mgmt_compute/models/virtual_machine_list_result.rb +4 -6
  75. data/lib/azure_mgmt_compute/models/virtual_machine_properties.rb +29 -5
  76. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set.rb +108 -0
  77. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +77 -0
  78. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +77 -0
  79. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_properties.rb +116 -0
  80. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +125 -0
  81. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +79 -0
  82. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +78 -0
  83. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration_properties.rb +127 -0
  84. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +77 -0
  85. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +77 -0
  86. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +88 -0
  87. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +80 -0
  88. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_properties.rb +89 -0
  89. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +77 -0
  90. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +129 -0
  91. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +147 -0
  92. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_properties.rb +89 -0
  93. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +88 -0
  94. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +90 -0
  95. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_scale_type.rb +16 -0
  96. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +78 -0
  97. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +165 -0
  98. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +87 -0
  99. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +57 -0
  100. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +59 -0
  101. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +202 -0
  102. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +77 -0
  103. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +114 -0
  104. data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmproperties.rb +190 -0
  105. data/lib/azure_mgmt_compute/models/virtual_machine_size.rb +1 -3
  106. data/lib/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +4 -6
  107. data/lib/azure_mgmt_compute/models/virtual_machine_size_types.rb +53 -45
  108. data/lib/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +68 -0
  109. data/lib/azure_mgmt_compute/models/win_rmconfiguration.rb +4 -6
  110. data/lib/azure_mgmt_compute/models/win_rmlistener.rb +3 -5
  111. data/lib/azure_mgmt_compute/models/windows_configuration.rb +4 -6
  112. data/lib/azure_mgmt_compute/module_definition.rb +5 -3
  113. data/lib/azure_mgmt_compute/usage_operations.rb +75 -42
  114. data/lib/azure_mgmt_compute/version.rb +5 -3
  115. data/lib/azure_mgmt_compute/virtual_machine_extension_images.rb +71 -158
  116. data/lib/azure_mgmt_compute/virtual_machine_extensions.rb +66 -149
  117. data/lib/azure_mgmt_compute/virtual_machine_images.rb +121 -264
  118. data/lib/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +750 -0
  119. data/lib/azure_mgmt_compute/virtual_machine_scale_sets.rb +1327 -0
  120. data/lib/azure_mgmt_compute/virtual_machine_sizes.rb +75 -42
  121. data/lib/azure_mgmt_compute/virtual_machines.rb +397 -623
  122. data/lib/azure_mgmt_compute.rb +57 -18
  123. metadata +50 -128
  124. data/.gitignore +0 -10
  125. data/.travis.yml +0 -3
  126. data/Gemfile +0 -17
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Compute
7
7
  #
8
- # VirtualMachineSizes
8
+ # The Compute Management Client.
9
9
  #
10
10
  class VirtualMachineSizes
11
11
  include Azure::ARM::Compute::Models
@@ -24,6 +24,7 @@ module Azure::ARM::Compute
24
24
 
25
25
  #
26
26
  # Lists virtual-machine-sizes available in a location for a subscription.
27
+ #
27
28
  # @param location [String] The location upon which virtual-machine-sizes is
28
29
  # queried.
29
30
  # @param [Hash{String => String}] The hash of custom headers need to be
@@ -36,71 +37,103 @@ module Azure::ARM::Compute
36
37
  fail ArgumentError, 'location is nil' if location.nil?
37
38
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
38
39
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
39
- # Construct URL
40
- path = "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes"
41
- path['{location}'] = ERB::Util.url_encode(location) if path.include?('{location}')
42
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
43
- url = URI.join(@client.base_url, path)
44
- properties = {}
45
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
46
- unless url.query.nil?
47
- url.query.split('&').each do |url_item|
48
- url_items_parts = url_item.split('=')
49
- properties[url_items_parts[0]] = url_items_parts[1]
50
- end
51
- end
52
- properties.reject!{ |key, value| value.nil? }
53
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
54
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
55
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
56
- url = URI.parse(corrected_url)
57
-
58
- connection = Faraday.new(:url => url) do |faraday|
59
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
60
- faraday.use :cookie_jar
61
- faraday.adapter Faraday.default_adapter
62
- end
63
- request_headers = Hash.new
40
+ request_headers = {}
64
41
 
65
42
  # Set Headers
66
43
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
44
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
45
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'
46
+ options = {
47
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
48
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
49
+ query_params: {'api-version' => @client.api_version},
50
+ headers: request_headers.merge(custom_headers || {})
51
+ }
52
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
53
+ promise = request.run_promise do |req|
54
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
55
+ end
68
56
 
69
- unless custom_headers.nil?
70
- custom_headers.each do |key, value|
71
- request_headers[key] = value
57
+ promise = promise.then do |http_response|
58
+ status_code = http_response.status
59
+ response_content = http_response.body
60
+ unless status_code == 200
61
+ error_model = JSON.load(response_content)
62
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
72
63
  end
73
- end
74
64
 
75
- # Send Request
76
- promise = Concurrent::Promise.new do
77
- connection.get do |request|
78
- request.headers = request_headers
79
- @client.credentials.sign_request(request) unless @client.credentials.nil?
65
+ # Create Result
66
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
67
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
68
+ # Deserialize Response
69
+ if status_code == 200
70
+ begin
71
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
72
+ unless parsed_response.nil?
73
+ parsed_response = VirtualMachineSizeListResult.deserialize_object(parsed_response)
74
+ end
75
+ result.body = parsed_response
76
+ rescue Exception => e
77
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
78
+ end
80
79
  end
80
+
81
+ result
82
+ end
83
+
84
+ promise.execute
85
+ end
86
+
87
+ #
88
+ # Lists virtual-machine-sizes available in a location for a subscription.
89
+ #
90
+ # @param next_page_link [String] The NextLink from the previous successful
91
+ # call to List operation.
92
+ # @param [Hash{String => String}] The hash of custom headers need to be
93
+ # applied to HTTP request.
94
+ #
95
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
96
+ # response.
97
+ #
98
+ def list_next(next_page_link, custom_headers = nil)
99
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
100
+ request_headers = {}
101
+
102
+ # Set Headers
103
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
104
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
105
+ path_template = '{nextLink}'
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ skip_encoding_path_params: {'nextLink' => next_page_link},
109
+ headers: request_headers.merge(custom_headers || {})
110
+ }
111
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
112
+ promise = request.run_promise do |req|
113
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
81
114
  end
82
115
 
83
116
  promise = promise.then do |http_response|
84
117
  status_code = http_response.status
85
118
  response_content = http_response.body
86
- unless (status_code == 200)
119
+ unless status_code == 200
87
120
  error_model = JSON.load(response_content)
88
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
121
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
89
122
  end
90
123
 
91
124
  # Create Result
92
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
125
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
93
126
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
127
  # Deserialize Response
95
128
  if status_code == 200
96
129
  begin
97
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
98
131
  unless parsed_response.nil?
99
132
  parsed_response = VirtualMachineSizeListResult.deserialize_object(parsed_response)
100
133
  end
101
134
  result.body = parsed_response
102
135
  rescue Exception => e
103
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
136
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
104
137
  end
105
138
  end
106
139