fog-azure-rm 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +2 -1
  4. data/fog-azure-rm.gemspec +11 -9
  5. data/lib/fog/azurerm.rb +1 -0
  6. data/lib/fog/azurerm/compute.rb +3 -3
  7. data/lib/fog/azurerm/config.rb +33 -0
  8. data/lib/fog/azurerm/credentials.rb +1 -1
  9. data/lib/fog/azurerm/dns.rb +2 -2
  10. data/lib/fog/azurerm/docs/storage.md +120 -66
  11. data/lib/fog/azurerm/models/application_gateway/gateway.rb +30 -31
  12. data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -4
  13. data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -4
  14. data/lib/fog/azurerm/models/compute/server.rb +14 -14
  15. data/lib/fog/azurerm/models/compute/servers.rb +4 -4
  16. data/lib/fog/azurerm/models/compute/virtual_machine_extension.rb +3 -5
  17. data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +5 -5
  18. data/lib/fog/azurerm/models/dns/record_sets.rb +4 -4
  19. data/lib/fog/azurerm/models/dns/zones.rb +4 -4
  20. data/lib/fog/azurerm/models/network/express_route_circuit.rb +2 -5
  21. data/lib/fog/azurerm/models/network/express_route_circuit_authorization.rb +1 -1
  22. data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +4 -4
  23. data/lib/fog/azurerm/models/network/express_route_circuit_peering.rb +3 -5
  24. data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +4 -4
  25. data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -4
  26. data/lib/fog/azurerm/models/network/express_route_service_providers.rb +2 -2
  27. data/lib/fog/azurerm/models/network/load_balancers.rb +5 -5
  28. data/lib/fog/azurerm/models/network/local_network_gateway.rb +1 -1
  29. data/lib/fog/azurerm/models/network/local_network_gateways.rb +4 -4
  30. data/lib/fog/azurerm/models/network/network_interfaces.rb +5 -5
  31. data/lib/fog/azurerm/models/network/network_security_groups.rb +5 -5
  32. data/lib/fog/azurerm/models/network/network_security_rule.rb +3 -4
  33. data/lib/fog/azurerm/models/network/network_security_rules.rb +4 -4
  34. data/lib/fog/azurerm/models/network/public_ips.rb +4 -4
  35. data/lib/fog/azurerm/models/network/subnets.rb +4 -4
  36. data/lib/fog/azurerm/models/network/virtual_network_gateway.rb +6 -7
  37. data/lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb +5 -5
  38. data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +4 -4
  39. data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -4
  40. data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -4
  41. data/lib/fog/azurerm/models/resources/azure_resources.rb +2 -2
  42. data/lib/fog/azurerm/models/resources/deployments.rb +4 -4
  43. data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -4
  44. data/lib/fog/azurerm/models/sql/firewall_rule.rb +1 -1
  45. data/lib/fog/azurerm/models/sql/firewall_rules.rb +4 -4
  46. data/lib/fog/azurerm/models/sql/sql_database.rb +28 -24
  47. data/lib/fog/azurerm/models/sql/sql_databases.rb +5 -6
  48. data/lib/fog/azurerm/models/sql/sql_servers.rb +4 -4
  49. data/lib/fog/azurerm/models/storage/directories.rb +49 -24
  50. data/lib/fog/azurerm/models/storage/directory.rb +126 -40
  51. data/lib/fog/azurerm/models/storage/file.rb +226 -114
  52. data/lib/fog/azurerm/models/storage/files.rb +168 -13
  53. data/lib/fog/azurerm/models/storage/recovery_vault.rb +1 -1
  54. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +4 -4
  55. data/lib/fog/azurerm/models/storage/storage_account.rb +5 -5
  56. data/lib/fog/azurerm/models/storage/storage_accounts.rb +4 -4
  57. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb +1 -1
  58. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +4 -4
  59. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +4 -4
  60. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +4 -4
  61. data/lib/fog/azurerm/network.rb +1 -1
  62. data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +17 -13
  63. data/lib/fog/azurerm/requests/network/list_virtual_networks.rb +1 -1
  64. data/lib/fog/azurerm/requests/resources/create_deployment.rb +1 -1
  65. data/lib/fog/azurerm/requests/resources/create_resource_group.rb +1 -1
  66. data/lib/fog/azurerm/requests/resources/delete_deployment.rb +1 -1
  67. data/lib/fog/azurerm/requests/resources/delete_resource_group.rb +1 -1
  68. data/lib/fog/azurerm/requests/resources/get_deployment.rb +1 -1
  69. data/lib/fog/azurerm/requests/resources/get_resource_group.rb +1 -1
  70. data/lib/fog/azurerm/requests/resources/list_deployments.rb +1 -1
  71. data/lib/fog/azurerm/requests/resources/list_resource_groups.rb +1 -1
  72. data/lib/fog/azurerm/requests/resources/list_tagged_resources.rb +1 -1
  73. data/lib/fog/azurerm/requests/resources/tag_resource.rb +1 -1
  74. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +3 -3
  75. data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +3 -3
  76. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +3 -3
  77. data/lib/fog/azurerm/requests/sql/delete_database.rb +2 -2
  78. data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +4 -4
  79. data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +4 -4
  80. data/lib/fog/azurerm/requests/sql/get_database.rb +3 -3
  81. data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +3 -3
  82. data/lib/fog/azurerm/requests/sql/get_sql_server.rb +3 -3
  83. data/lib/fog/azurerm/requests/sql/list_databases.rb +3 -3
  84. data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +3 -3
  85. data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +3 -3
  86. data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +5 -2
  87. data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +5 -2
  88. data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +30 -0
  89. data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +148 -0
  90. data/lib/fog/azurerm/requests/storage/copy_blob.rb +8 -8
  91. data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +8 -8
  92. data/lib/fog/azurerm/requests/storage/create_block_blob.rb +108 -0
  93. data/lib/fog/azurerm/requests/storage/create_container.rb +12 -10
  94. data/lib/fog/azurerm/requests/storage/create_disk.rb +45 -19
  95. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +2 -2
  96. data/lib/fog/azurerm/requests/storage/create_page_blob.rb +31 -0
  97. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +2 -2
  98. data/lib/fog/azurerm/requests/storage/delete_blob.rb +10 -5
  99. data/lib/fog/azurerm/requests/storage/delete_container.rb +6 -2
  100. data/lib/fog/azurerm/requests/storage/delete_disk.rb +19 -16
  101. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +2 -2
  102. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +2 -2
  103. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +2 -2
  104. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +1 -1
  105. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +2 -2
  106. data/lib/fog/azurerm/requests/storage/get_blob.rb +163 -0
  107. data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +39 -0
  108. data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +39 -0
  109. data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +37 -35
  110. data/lib/fog/azurerm/requests/storage/get_blob_url.rb +28 -0
  111. data/lib/fog/azurerm/requests/storage/get_container_acl.rb +30 -0
  112. data/lib/fog/azurerm/requests/storage/get_container_properties.rb +16 -12
  113. data/lib/fog/azurerm/requests/storage/get_container_url.rb +34 -0
  114. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +2 -2
  115. data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +4 -3
  116. data/lib/fog/azurerm/requests/storage/get_storage_account.rb +2 -2
  117. data/lib/fog/azurerm/requests/storage/list_blobs.rb +110 -24
  118. data/lib/fog/azurerm/requests/storage/list_containers.rb +46 -23
  119. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +2 -2
  120. data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +2 -2
  121. data/lib/fog/azurerm/requests/storage/list_storage_accounts.rb +2 -2
  122. data/lib/fog/azurerm/requests/storage/multipart_save_block_blob.rb +110 -0
  123. data/lib/fog/azurerm/requests/storage/put_blob_block.rb +30 -0
  124. data/lib/fog/azurerm/requests/storage/{set_blob_metadata.rb → put_blob_metadata.rb} +7 -3
  125. data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +30 -0
  126. data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +31 -0
  127. data/lib/fog/azurerm/requests/storage/put_container_acl.rb +31 -0
  128. data/lib/fog/azurerm/requests/storage/{set_container_metadata.rb → put_container_metadata.rb} +7 -3
  129. data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +4 -1
  130. data/lib/fog/azurerm/requests/storage/release_container_lease.rb +4 -1
  131. data/lib/fog/azurerm/requests/storage/save_page_blob.rb +111 -0
  132. data/lib/fog/azurerm/requests/storage/start_backup.rb +1 -1
  133. data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +56 -0
  134. data/lib/fog/azurerm/resources.rb +2 -2
  135. data/lib/fog/azurerm/storage.rb +33 -19
  136. data/lib/fog/azurerm/traffic_manager.rb +1 -1
  137. data/lib/fog/azurerm/utilities/general.rb +70 -3
  138. data/lib/fog/azurerm/version.rb +1 -1
  139. data/rake-script.sh +5 -2
  140. data/test/api_stub/models/application_gateway/gateway.rb +1 -1
  141. data/test/api_stub/models/compute/server.rb +1 -1
  142. data/test/api_stub/models/dns/record_set.rb +2 -2
  143. data/test/api_stub/models/dns/zone.rb +1 -1
  144. data/test/api_stub/models/network/express_route_circuit.rb +1 -1
  145. data/test/api_stub/models/network/express_route_circuit_authorization.rb +1 -1
  146. data/test/api_stub/models/network/express_route_circuit_peering.rb +1 -1
  147. data/test/api_stub/models/network/express_route_service_provider.rb +1 -1
  148. data/test/api_stub/models/network/load_balancer.rb +1 -1
  149. data/test/api_stub/models/network/network_interface.rb +1 -1
  150. data/test/api_stub/models/network/network_security_group.rb +1 -1
  151. data/test/api_stub/models/network/network_security_rule.rb +1 -1
  152. data/test/api_stub/models/network/public_ip.rb +1 -1
  153. data/test/api_stub/models/network/subnet.rb +1 -1
  154. data/test/api_stub/models/network/virtual_network.rb +1 -1
  155. data/test/api_stub/models/network/virtual_network_gateway.rb +1 -1
  156. data/test/api_stub/models/network/virtual_network_gateway_connection.rb +1 -1
  157. data/test/api_stub/models/resources/resource.rb +2 -2
  158. data/test/api_stub/models/resources/resource_group.rb +1 -1
  159. data/test/api_stub/models/storage/directory.rb +148 -62
  160. data/test/api_stub/models/storage/file.rb +122 -119
  161. data/test/api_stub/models/traffic_manager/traffic_manager_end_point.rb +1 -1
  162. data/test/api_stub/models/traffic_manager/traffic_manager_profile.rb +1 -1
  163. data/test/api_stub/requests/application_gateway/gateway.rb +2 -2
  164. data/test/api_stub/requests/compute/availability_set.rb +3 -3
  165. data/test/api_stub/requests/compute/virtual_machine.rb +9 -9
  166. data/test/api_stub/requests/dns/record_set.rb +3 -3
  167. data/test/api_stub/requests/dns/zone.rb +18 -18
  168. data/test/api_stub/requests/network/express_route_circuit.rb +2 -2
  169. data/test/api_stub/requests/network/express_route_circuit_authorization.rb +1 -1
  170. data/test/api_stub/requests/network/express_route_circuit_peering.rb +2 -2
  171. data/test/api_stub/requests/network/express_route_service_provider.rb +1 -1
  172. data/test/api_stub/requests/network/load_balancer.rb +2 -2
  173. data/test/api_stub/requests/network/network_interface.rb +4 -4
  174. data/test/api_stub/requests/network/network_security_group.rb +3 -3
  175. data/test/api_stub/requests/network/network_security_rule.rb +2 -2
  176. data/test/api_stub/requests/network/public_ip.rb +2 -2
  177. data/test/api_stub/requests/network/subnet.rb +2 -2
  178. data/test/api_stub/requests/network/virtual_network.rb +2 -2
  179. data/test/api_stub/requests/network/virtual_network_gateway.rb +2 -2
  180. data/test/api_stub/requests/network/virtual_network_gateway_connection.rb +3 -3
  181. data/test/api_stub/requests/resources/resource.rb +2 -2
  182. data/test/api_stub/requests/resources/resource_group.rb +2 -2
  183. data/test/api_stub/requests/storage/directory.rb +59 -65
  184. data/test/api_stub/requests/storage/file.rb +183 -113
  185. data/test/api_stub/requests/storage/storageaccount.rb +1 -1
  186. data/test/api_stub/requests/traffic_manager/traffic_manager_endpoint.rb +1 -1
  187. data/test/api_stub/requests/traffic_manager/traffic_manager_profile.rb +2 -2
  188. data/test/integration/Virtual_network_gateway_connection.rb +189 -182
  189. data/test/integration/application_gateway.rb +208 -183
  190. data/test/integration/availability_set.rb +44 -27
  191. data/test/integration/blob.rb +293 -169
  192. data/test/integration/container.rb +93 -42
  193. data/test/integration/data_disk.rb +57 -46
  194. data/test/integration/deployment.rb +40 -32
  195. data/test/integration/express_route_circuit.rb +86 -82
  196. data/test/integration/external_load_balancer.rb +108 -100
  197. data/test/integration/internal_load_balancer.rb +115 -106
  198. data/test/integration/local_network_gateway.rb +46 -39
  199. data/test/integration/network_interface.rb +119 -107
  200. data/test/integration/network_security_group.rb +86 -74
  201. data/test/integration/network_security_rule.rb +65 -57
  202. data/test/integration/public_ip.rb +50 -42
  203. data/test/integration/record_set.rb +90 -78
  204. data/test/integration/resource_group.rb +26 -14
  205. data/test/integration/resource_tag.rb +56 -45
  206. data/test/integration/server.rb +152 -135
  207. data/test/integration/server_custom_image.rb +85 -76
  208. data/test/integration/sql_server.rb +130 -117
  209. data/test/integration/storage_account.rb +82 -70
  210. data/test/integration/subnet.rb +87 -74
  211. data/test/integration/traffic_manager.rb +86 -74
  212. data/test/integration/virtual_machine_extension.rb +115 -106
  213. data/test/integration/virtual_network.rb +121 -100
  214. data/test/integration/virtual_network_gateway.rb +86 -79
  215. data/test/integration/virtual_network_gateway_connection_to_express_route.rb +94 -87
  216. data/test/integration/zone.rb +36 -28
  217. data/test/models/storage/test_directories.rb +26 -71
  218. data/test/models/storage/test_directory.rb +111 -58
  219. data/test/models/storage/test_file.rb +179 -143
  220. data/test/models/storage/test_files.rb +197 -30
  221. data/test/models/storage/test_storage_account.rb +1 -1
  222. data/test/requests/compute/test_attach_data_disk_to_vm.rb +15 -17
  223. data/test/requests/storage/test_acquire_blob_lease.rb +23 -4
  224. data/test/requests/storage/test_acquire_container_lease.rb +24 -5
  225. data/test/requests/storage/test_commit_blob_blocks.rb +34 -0
  226. data/test/requests/storage/test_compare_container_blobs.rb +36 -0
  227. data/test/requests/storage/test_copy_blob.rb +22 -3
  228. data/test/requests/storage/test_copy_blob_from_uri.rb +23 -4
  229. data/test/requests/storage/test_create_block_blob.rb +80 -0
  230. data/test/requests/storage/test_create_container.rb +18 -13
  231. data/test/requests/storage/test_create_disk.rb +57 -4
  232. data/test/requests/storage/test_create_page_blob.rb +34 -0
  233. data/test/requests/storage/test_delete_blob.rb +25 -5
  234. data/test/requests/storage/test_delete_container.rb +21 -9
  235. data/test/requests/storage/test_delete_disk.rb +14 -7
  236. data/test/requests/storage/test_get_blob.rb +141 -0
  237. data/test/requests/storage/test_get_blob_http_url.rb +30 -0
  238. data/test/requests/storage/test_get_blob_https_url.rb +30 -0
  239. data/test/requests/storage/test_get_blob_properties.rb +29 -7
  240. data/test/requests/storage/test_get_blob_url.rb +33 -0
  241. data/test/requests/storage/test_get_container_acl.rb +37 -0
  242. data/test/requests/storage/test_get_container_properties.rb +25 -11
  243. data/test/requests/storage/test_get_container_url.rb +33 -0
  244. data/test/requests/storage/test_list_blobs.rb +77 -0
  245. data/test/requests/storage/test_list_containers.rb +38 -7
  246. data/test/requests/storage/test_multipart_save_block_blob.rb +105 -0
  247. data/test/requests/storage/test_put_blob_block.rb +34 -0
  248. data/test/requests/storage/test_put_blob_metadata.rb +36 -0
  249. data/test/requests/storage/test_put_blob_pages.rb +34 -0
  250. data/test/requests/storage/test_put_blob_properties.rb +39 -0
  251. data/test/requests/storage/test_put_container_acl.rb +34 -0
  252. data/test/requests/storage/test_put_container_metadata.rb +36 -0
  253. data/test/requests/storage/test_release_blob_lease.rb +20 -2
  254. data/test/requests/storage/test_release_container_lease.rb +21 -3
  255. data/test/requests/storage/test_save_page_blob.rb +115 -0
  256. data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +148 -0
  257. data/test/test_helper.rb +34 -21
  258. metadata +92 -46
  259. data/lib/fog/azurerm/requests/storage/check_blob_exist.rb +0 -25
  260. data/lib/fog/azurerm/requests/storage/compare_blob.rb +0 -73
  261. data/lib/fog/azurerm/requests/storage/download_blob_to_file.rb +0 -56
  262. data/lib/fog/azurerm/requests/storage/get_blob_metadata.rb +0 -59
  263. data/lib/fog/azurerm/requests/storage/get_container_access_control_list.rb +0 -30
  264. data/lib/fog/azurerm/requests/storage/get_container_metadata.rb +0 -32
  265. data/lib/fog/azurerm/requests/storage/set_blob_properties.rb +0 -26
  266. data/lib/fog/azurerm/requests/storage/upload_block_blob_from_file.rb +0 -60
  267. data/test/requests/storage/test_check_blob_exist.rb +0 -17
  268. data/test/requests/storage/test_compare_blob.rb +0 -17
  269. data/test/requests/storage/test_download_blob_to_file.rb +0 -25
  270. data/test/requests/storage/test_get_blob_metadata.rb +0 -18
  271. data/test/requests/storage/test_get_container_access_control_list.rb +0 -31
  272. data/test/requests/storage/test_get_container_metadata.rb +0 -18
  273. data/test/requests/storage/test_list_blobs_in_container.rb +0 -23
  274. data/test/requests/storage/test_set_blob_metadata.rb +0 -17
  275. data/test/requests/storage/test_set_blob_properties.rb +0 -16
  276. data/test/requests/storage/test_set_container_metadata.rb +0 -17
  277. data/test/requests/storage/test_upload_block_blob_from_file.rb +0 -23
@@ -39,62 +39,62 @@ module Fog
39
39
 
40
40
  hash['gateway_ip_configurations'] = []
41
41
  gateway.gateway_ipconfigurations.each do |ip_configuration|
42
- gateway_ip_configuration = IPConfiguration.new
43
- hash['gateway_ip_configurations'] << gateway_ip_configuration.merge_attributes(IPConfiguration.parse(ip_configuration))
42
+ gateway_ip_configuration = Fog::ApplicationGateway::AzureRM::IPConfiguration.new
43
+ hash['gateway_ip_configurations'] << gateway_ip_configuration.merge_attributes(Fog::ApplicationGateway::AzureRM::IPConfiguration.parse(ip_configuration))
44
44
  end unless gateway.gateway_ipconfigurations.nil?
45
45
 
46
46
  hash['ssl_certificates'] = []
47
47
  gateway.ssl_certificates.each do |certificate|
48
- ssl_certificate = SslCertificate.new
49
- hash['ssl_certificates'] << ssl_certificate.merge_attributes(SslCertificate.parse(certificate))
48
+ ssl_certificate = Fog::ApplicationGateway::AzureRM::SslCertificate.new
49
+ hash['ssl_certificates'] << ssl_certificate.merge_attributes(Fog::ApplicationGateway::AzureRM::SslCertificate.parse(certificate))
50
50
  end unless gateway.ssl_certificates.nil?
51
51
 
52
52
  hash['frontend_ip_configurations'] = []
53
53
  gateway.frontend_ipconfigurations.each do |frontend_ip_config|
54
- frontend_ip_configuration = FrontendIPConfiguration.new
55
- hash['frontend_ip_configurations'] << frontend_ip_configuration.merge_attributes(FrontendIPConfiguration.parse(frontend_ip_config))
54
+ frontend_ip_configuration = Fog::ApplicationGateway::AzureRM::FrontendIPConfiguration.new
55
+ hash['frontend_ip_configurations'] << frontend_ip_configuration.merge_attributes(Fog::ApplicationGateway::AzureRM::FrontendIPConfiguration.parse(frontend_ip_config))
56
56
  end unless gateway.frontend_ipconfigurations.nil?
57
57
 
58
58
  hash['frontend_ports'] = []
59
59
  gateway.frontend_ports.each do |port|
60
- frontend_port = FrontendPort.new
61
- hash['frontend_ports'] << frontend_port.merge_attributes(FrontendPort.parse(port))
60
+ frontend_port = Fog::ApplicationGateway::AzureRM::FrontendPort.new
61
+ hash['frontend_ports'] << frontend_port.merge_attributes(Fog::ApplicationGateway::AzureRM::FrontendPort.parse(port))
62
62
  end unless gateway.frontend_ports.nil?
63
63
 
64
64
  hash['probes'] = []
65
65
  gateway.probes.each do |probe|
66
- gateway_probe = Probe.new
67
- hash['probes'] << gateway_probe.merge_attributes(Probe.parse(probe))
66
+ gateway_probe = Fog::ApplicationGateway::AzureRM::Probe.new
67
+ hash['probes'] << gateway_probe.merge_attributes(Fog::ApplicationGateway::AzureRM::Probe.parse(probe))
68
68
  end unless gateway.probes.nil?
69
69
 
70
70
  hash['backend_address_pools'] = []
71
71
  gateway.backend_address_pools.each do |address|
72
- backend_address_pool = BackendAddressPool.new
73
- hash['backend_address_pools'] << backend_address_pool.merge_attributes(BackendAddressPool.parse(address))
72
+ backend_address_pool = Fog::ApplicationGateway::AzureRM::BackendAddressPool.new
73
+ hash['backend_address_pools'] << backend_address_pool.merge_attributes(Fog::ApplicationGateway::AzureRM::BackendAddressPool.parse(address))
74
74
  end unless gateway.backend_address_pools.nil?
75
75
 
76
76
  hash['backend_http_settings_list'] = []
77
77
  gateway.backend_http_settings_collection.each do |http_setting|
78
- backend_http_setting = BackendHttpSetting.new
79
- hash['backend_http_settings_list'] << backend_http_setting.merge_attributes(BackendHttpSetting.parse(http_setting))
78
+ backend_http_setting = Fog::ApplicationGateway::AzureRM::BackendHttpSetting.new
79
+ hash['backend_http_settings_list'] << backend_http_setting.merge_attributes(Fog::ApplicationGateway::AzureRM::BackendHttpSetting.parse(http_setting))
80
80
  end unless gateway.backend_http_settings_collection.nil?
81
81
 
82
82
  hash['http_listeners'] = []
83
83
  gateway.http_listeners.each do |listener|
84
- http_listener = HttpListener.new
85
- hash['http_listeners'] << http_listener.merge_attributes(HttpListener.parse(listener))
84
+ http_listener = Fog::ApplicationGateway::AzureRM::HttpListener.new
85
+ hash['http_listeners'] << http_listener.merge_attributes(Fog::ApplicationGateway::AzureRM::HttpListener.parse(listener))
86
86
  end unless gateway.http_listeners.nil?
87
87
 
88
88
  hash['url_path_maps'] = []
89
89
  gateway.url_path_maps.each do |map|
90
- url_path_map = UrlPathMap.new
91
- hash['url_path_maps'] << url_path_map.merge_attributes(UrlPathMap.parse(map))
90
+ url_path_map = Fog::ApplicationGateway::AzureRM::UrlPathMap.new
91
+ hash['url_path_maps'] << url_path_map.merge_attributes(Fog::ApplicationGateway::AzureRM::UrlPathMap.parse(map))
92
92
  end unless gateway.url_path_maps.nil?
93
93
 
94
94
  hash['request_routing_rules'] = []
95
95
  gateway.request_routing_rules.each do |rule|
96
- request_routing_rule = RequestRoutingRule.new
97
- hash['request_routing_rules'] << request_routing_rule.merge_attributes(RequestRoutingRule.parse(rule))
96
+ request_routing_rule = Fog::ApplicationGateway::AzureRM::RequestRoutingRule.new
97
+ hash['request_routing_rules'] << request_routing_rule.merge_attributes(Fog::ApplicationGateway::AzureRM::RequestRoutingRule.parse(rule))
98
98
  end unless gateway.request_routing_rules.nil?
99
99
  hash
100
100
  end
@@ -112,12 +112,11 @@ module Fog
112
112
  validate_http_listeners(http_listeners) unless http_listeners.nil?
113
113
  validate_url_path_maps(url_path_maps) unless url_path_maps.nil?
114
114
  validate_request_routing_rules(request_routing_rules) unless request_routing_rules.nil?
115
- gateway_params = get_gateway_params
116
- gateway = service.create_or_update_application_gateway(gateway_params)
115
+ gateway = service.create_or_update_application_gateway(application_gateway_params)
117
116
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
118
117
  end
119
118
 
120
- def get_gateway_params
119
+ def application_gateway_params
121
120
  {
122
121
  name: name,
123
122
  location: location,
@@ -548,54 +547,54 @@ module Fog
548
547
  end
549
548
 
550
549
  def update_sku(sku_name, sku_capacity = nil)
551
- gateway_hash = serialize_sub_resources(get_gateway_params)
550
+ gateway_hash = serialize_sub_resources(application_gateway_params)
552
551
  gateway = service.update_sku_attributes(gateway_hash, sku_name, sku_capacity)
553
552
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
554
553
  end
555
554
 
556
555
  def update_gateway_ip_configuration(subnet_id)
557
- gateway_hash = serialize_sub_resources(get_gateway_params)
556
+ gateway_hash = serialize_sub_resources(application_gateway_params)
558
557
  gateway = service.update_subnet_id_in_gateway_ip_configuration(gateway_hash, subnet_id)
559
558
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
560
559
  end
561
560
 
562
561
  def add_ssl_certificate(ssl_certificate_obj)
563
- gateway_hash = serialize_sub_resources(get_gateway_params)
562
+ gateway_hash = serialize_sub_resources(application_gateway_params)
564
563
  gateway_hash[:ssl_certificates] << ssl_certificate_obj
565
564
  gateway = service.create_or_update_application_gateway(gateway_hash)
566
565
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
567
566
  end
568
567
 
569
568
  def remove_ssl_certificate(ssl_certificate_obj)
570
- gateway_hash = serialize_sub_resources(get_gateway_params)
569
+ gateway_hash = serialize_sub_resources(application_gateway_params)
571
570
  gateway_hash[:ssl_certificates].delete(ssl_certificate_obj)
572
571
  gateway = service.create_or_update_application_gateway(gateway_hash)
573
572
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
574
573
  end
575
574
 
576
575
  def add_frontend_port(frontend_port_obj)
577
- gateway_hash = serialize_sub_resources(get_gateway_params)
576
+ gateway_hash = serialize_sub_resources(application_gateway_params)
578
577
  gateway_hash[:frontend_ports] << frontend_port_obj
579
578
  gateway = service.create_or_update_application_gateway(gateway_hash)
580
579
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
581
580
  end
582
581
 
583
582
  def remove_frontend_port(frontend_port_obj)
584
- gateway_hash = serialize_sub_resources(get_gateway_params)
583
+ gateway_hash = serialize_sub_resources(application_gateway_params)
585
584
  gateway_hash[:frontend_ports].delete(frontend_port_obj)
586
585
  gateway = service.create_or_update_application_gateway(gateway_hash)
587
586
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
588
587
  end
589
588
 
590
589
  def add_probe(probe_obj)
591
- gateway_hash = serialize_sub_resources(get_gateway_params)
590
+ gateway_hash = serialize_sub_resources(application_gateway_params)
592
591
  gateway_hash[:probes] << probe_obj
593
592
  gateway = service.create_or_update_application_gateway(gateway_hash)
594
593
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
595
594
  end
596
595
 
597
596
  def remove_probe(probe_obj)
598
- gateway_hash = serialize_sub_resources(get_gateway_params)
597
+ gateway_hash = serialize_sub_resources(application_gateway_params)
599
598
  gateway_hash[:probes].delete(probe_obj)
600
599
  gateway = service.create_or_update_application_gateway(gateway_hash)
601
600
  merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
@@ -3,22 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # Application Gateway collection class for Application Gateway Service
5
5
  class Gateways < Fog::Collection
6
- model Gateway
6
+ model Fog::ApplicationGateway::AzureRM::Gateway
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
11
  application_gateways = []
12
12
  service.list_application_gateways(resource_group).each do |gateway|
13
- application_gateways << Gateway.parse(gateway)
13
+ application_gateways << Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)
14
14
  end
15
15
  load(application_gateways)
16
16
  end
17
17
 
18
18
  def get(resource_group_name, application_gateway_name)
19
19
  gateway = service.get_application_gateway(resource_group_name, application_gateway_name)
20
- application_gateway = Gateway.new(service: service)
21
- application_gateway.merge_attributes(Gateway.parse(gateway))
20
+ application_gateway = Fog::ApplicationGateway::AzureRM::Gateway.new(service: service)
21
+ application_gateway.merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
22
22
  end
23
23
  end
24
24
  end
@@ -4,7 +4,7 @@ module Fog
4
4
  # This class is giving implementation of all/list, get and
5
5
  # check name availability for storage account.
6
6
  class AvailabilitySets < Fog::Collection
7
- model AvailabilitySet
7
+ model Fog::Compute::AzureRM::AvailabilitySet
8
8
  attribute :resource_group
9
9
  def all
10
10
  accounts = []
@@ -13,7 +13,7 @@ module Fog
13
13
  service.list_availability_sets(resource_group)
14
14
  unless list_of_availability_sets.nil?
15
15
  list_of_availability_sets.each do |account|
16
- parse_response = AvailabilitySet.parse(account)
16
+ parse_response = Fog::Compute::AzureRM::AvailabilitySet.parse(account)
17
17
  accounts << parse_response
18
18
  end
19
19
  end
@@ -22,8 +22,8 @@ module Fog
22
22
 
23
23
  def get(resource_group, identity)
24
24
  availability_set = service.get_availability_set(resource_group, identity)
25
- availability_set_obj = AvailabilitySet.new(service: service)
26
- availability_set_obj.merge_attributes(AvailabilitySet.parse(availability_set))
25
+ availability_set_fog = Fog::Compute::AzureRM::AvailabilitySet.new(service: service)
26
+ availability_set_fog.merge_attributes(Fog::Compute::AzureRM::AvailabilitySet.parse(availability_set))
27
27
  end
28
28
  end
29
29
  end
@@ -1,4 +1,3 @@
1
- require 'fog/azurerm/models/storage/data_disk'
2
1
  module Fog
3
2
  module Compute
4
3
  class AzureRM
@@ -37,14 +36,16 @@ module Fog
37
36
  hash['name'] = vm.name
38
37
  hash['location'] = vm.location
39
38
  hash['resource_group'] = get_resource_group_from_id(vm.id)
40
- hash['vm_size'] = vm.hardware_profile.vm_size
41
- hash['os_disk_name'] = vm.storage_profile.os_disk.name
42
- hash['os_disk_vhd_uri'] = vm.storage_profile.os_disk.vhd.uri
43
- unless vm.storage_profile.image_reference.nil?
44
- hash['publisher'] = vm.storage_profile.image_reference.publisher
45
- hash['offer'] = vm.storage_profile.image_reference.offer
46
- hash['sku'] = vm.storage_profile.image_reference.sku
47
- hash['version'] = vm.storage_profile.image_reference.version
39
+ hash['vm_size'] = vm.hardware_profile.vm_size unless vm.hardware_profile.vm_size.nil?
40
+ unless vm.storage_profile.nil?
41
+ hash['os_disk_name'] = vm.storage_profile.os_disk.name
42
+ hash['os_disk_vhd_uri'] = vm.storage_profile.os_disk.vhd.uri
43
+ unless vm.storage_profile.image_reference.nil?
44
+ hash['publisher'] = vm.storage_profile.image_reference.publisher
45
+ hash['offer'] = vm.storage_profile.image_reference.offer
46
+ hash['sku'] = vm.storage_profile.image_reference.sku
47
+ hash['version'] = vm.storage_profile.image_reference.version
48
+ end
48
49
  end
49
50
  hash['username'] = vm.os_profile.admin_username
50
51
  hash['custom_data'] = vm.os_profile.custom_data
@@ -73,8 +74,7 @@ module Fog
73
74
  requires :disable_password_authentication if platform.casecmp('linux').zero?
74
75
  requires :publisher, :offer, :sku, :version if vhd_path.nil?
75
76
  ssh_key_path = "/home/#{username}/.ssh/authorized_keys" unless ssh_key_data.nil?
76
- virtual_machine_params = get_virtual_machine_params(ssh_key_path)
77
- vm = service.create_virtual_machine(virtual_machine_params)
77
+ vm = service.create_virtual_machine(virtual_machine_params(ssh_key_path))
78
78
  merge_attributes(Server.parse(vm))
79
79
  end
80
80
 
@@ -116,17 +116,17 @@ module Fog
116
116
 
117
117
  def attach_data_disk(disk_name, disk_size, storage_account_name)
118
118
  vm = service.attach_data_disk_to_vm(resource_group, name, disk_name, disk_size, storage_account_name)
119
- merge_attributes(Server.parse(vm))
119
+ merge_attributes(Fog::Compute::AzureRM::Server.parse(vm))
120
120
  end
121
121
 
122
122
  def detach_data_disk(disk_name)
123
123
  vm = service.detach_data_disk_from_vm(resource_group, name, disk_name)
124
- merge_attributes(Server.parse(vm))
124
+ merge_attributes(Fog::Compute::AzureRM::Server.parse(vm))
125
125
  end
126
126
 
127
127
  private
128
128
 
129
- def get_virtual_machine_params(ssh_key_path)
129
+ def virtual_machine_params(ssh_key_path)
130
130
  {
131
131
  resource_group: resource_group,
132
132
  name: name,
@@ -5,21 +5,21 @@ module Fog
5
5
  # for Server.
6
6
  class Servers < Fog::Collection
7
7
  attribute :resource_group
8
- model Server
8
+ model Fog::Compute::AzureRM::Server
9
9
 
10
10
  def all
11
11
  requires :resource_group
12
12
  virtual_machines = []
13
13
  service.list_virtual_machines(resource_group).each do |vm|
14
- virtual_machines << Server.parse(vm)
14
+ virtual_machines << Fog::Compute::AzureRM::Server.parse(vm)
15
15
  end
16
16
  load(virtual_machines)
17
17
  end
18
18
 
19
19
  def get(resource_group_name, virtual_machine_name)
20
20
  virtual_machine = service.get_virtual_machine(resource_group_name, virtual_machine_name)
21
- virtual_machine_obj = Server.new(service: service)
22
- virtual_machine_obj.merge_attributes(Server.parse(virtual_machine))
21
+ virtual_machine_fog = Fog::Compute::AzureRM::Server.new(service: service)
22
+ virtual_machine_fog.merge_attributes(Fog::Compute::AzureRM::Server.parse(virtual_machine))
23
23
  end
24
24
  end
25
25
  end
@@ -33,17 +33,15 @@ module Fog
33
33
 
34
34
  def save
35
35
  requires :resource_group, :location, :name, :vm_name, :type, :publisher, :type_handler_version, :settings
36
- vm_extension_params = get_vm_extension_params
37
36
  vm_extension = service.create_or_update_vm_extension(vm_extension_params)
38
- merge_attributes(VirtualMachineExtension.parse(vm_extension))
37
+ merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
39
38
  end
40
39
 
41
40
  def update(vm_extension_input)
42
41
  validate_input(vm_extension_input)
43
42
  merge_attributes(vm_extension_input) unless vm_extension_input.empty?
44
- vm_extension_params = get_vm_extension_params
45
43
  vm_extension = service.create_or_update_vm_extension(vm_extension_params)
46
- merge_attributes(VirtualMachineExtension.parse(vm_extension))
44
+ merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
47
45
  end
48
46
 
49
47
  def destroy
@@ -58,7 +56,7 @@ module Fog
58
56
  raise 'Cannot modify the given attribute(s)' unless result.empty?
59
57
  end
60
58
 
61
- def get_vm_extension_params
59
+ def vm_extension_params
62
60
  {
63
61
  resource_group: resource_group,
64
62
  location: location,
@@ -3,23 +3,23 @@ module Fog
3
3
  class AzureRM
4
4
  # This class gives the implementation for get for virtual machine extension
5
5
  class VirtualMachineExtensions < Fog::Collection
6
- model VirtualMachineExtension
6
+ model Fog::Compute::AzureRM::VirtualMachineExtension
7
7
  attribute :resource_group
8
8
  attribute :vm_name
9
9
 
10
10
  def all
11
11
  requires :resource_group, :vm_name
12
12
  vm_extensions = []
13
- service.get_virtual_machine(resource_group, vm_name).resources.each do |extension|
14
- vm_extensions << VirtualMachineExtension.parse(extension)
13
+ service.get_virtual_machine(resource_group, vm_name).resources.compact.each do |extension|
14
+ vm_extensions << Fog::Compute::AzureRM::VirtualMachineExtension.parse(extension)
15
15
  end
16
16
  load(vm_extensions)
17
17
  end
18
18
 
19
19
  def get(resource_group_name, virtual_machine_name, vm_extension_name)
20
20
  vm_extension = service.get_vm_extension(resource_group_name, virtual_machine_name, vm_extension_name)
21
- vm_extension_obj = VirtualMachineExtension.new(service: service)
22
- vm_extension_obj.merge_attributes(VirtualMachineExtension.parse(vm_extension))
21
+ vm_extension_fog = Fog::Compute::AzureRM::VirtualMachineExtension.new(service: service)
22
+ vm_extension_fog.merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
23
23
  end
24
24
  end
25
25
  end
@@ -8,21 +8,21 @@ module Fog
8
8
  attribute :zone_name
9
9
  attribute :type
10
10
 
11
- model RecordSet
11
+ model Fog::DNS::AzureRM::RecordSet
12
12
 
13
13
  def all
14
14
  requires :resource_group, :zone_name
15
15
  record_sets = []
16
16
  service.list_record_sets(resource_group, zone_name).each do |r|
17
- record_sets << RecordSet.parse(r)
17
+ record_sets << Fog::DNS::AzureRM::RecordSet.parse(r)
18
18
  end
19
19
  load(record_sets)
20
20
  end
21
21
 
22
22
  def get(resource_group, name, zone_name, record_type)
23
23
  record_set = service.get_record_set(resource_group, name, zone_name, record_type)
24
- record_set_obj = RecordSet.new(service: service)
25
- record_set_obj.merge_attributes(RecordSet.parse(record_set))
24
+ record_set_fog = Fog::DNS::AzureRM::RecordSet.new(service: service)
25
+ record_set_fog.merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
26
26
  end
27
27
  end
28
28
  end
@@ -4,20 +4,20 @@ module Fog
4
4
  # This class is giving implementation of
5
5
  # all/get for Zones.
6
6
  class Zones < Fog::Collection
7
- model Zone
7
+ model Fog::DNS::AzureRM::Zone
8
8
 
9
9
  def all
10
10
  zones = []
11
11
  service.list_zones.each do |z|
12
- zones << Zone.parse(z)
12
+ zones << Fog::DNS::AzureRM::Zone.parse(z)
13
13
  end
14
14
  load(zones)
15
15
  end
16
16
 
17
17
  def get(resource_group, name)
18
18
  zone = service.get_zone(resource_group, name)
19
- zone_obj = Zone.new(service: service)
20
- zone_obj.merge_attributes(Zone.parse(zone))
19
+ zone_fog = Fog::DNS::AzureRM::Zone.new(service: service)
20
+ zone_fog.merge_attributes(Fog::DNS::AzureRM::Zone.parse(zone))
21
21
  end
22
22
 
23
23
  def check_for_zone(resource_group, name)
@@ -29,7 +29,6 @@ module Fog
29
29
  express_route_circuit['service_key'] = circuit.service_key
30
30
  express_route_circuit['service_provider_notes'] = circuit.service_provider_notes
31
31
  express_route_circuit['resource_group'] = get_resource_group_from_id(circuit.id)
32
- express_route_circuit['resource_group'] = circuit.id.split('/')[4]
33
32
  express_route_circuit['tags'] = circuit.tags
34
33
  sku = circuit.sku
35
34
  unless sku.nil?
@@ -56,8 +55,7 @@ module Fog
56
55
 
57
56
  def save
58
57
  requires :location, :tags, :resource_group, :service_provider_name, :peering_location, :bandwidth_in_mbps
59
- express_route_parameters = express_route_circuit_params
60
- circuit = service.create_or_update_express_route_circuit(express_route_parameters)
58
+ circuit = service.create_or_update_express_route_circuit(express_route_circuit_params)
61
59
  merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit))
62
60
  end
63
61
 
@@ -68,7 +66,7 @@ module Fog
68
66
  private
69
67
 
70
68
  def express_route_circuit_params
71
- express_route_parameters = {
69
+ {
72
70
  resource_group_name: resource_group,
73
71
  circuit_name: name,
74
72
  location: location,
@@ -81,7 +79,6 @@ module Fog
81
79
  bandwidth_in_mbps: bandwidth_in_mbps,
82
80
  peerings: peerings
83
81
  }
84
- express_route_parameters
85
82
  end
86
83
  end
87
84
  end