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
@@ -23,7 +23,7 @@ module Fog
23
23
  def save
24
24
  requires :name, :resource_group, :circuit_name
25
25
  circuit_authorization = service.create_or_update_express_route_circuit_authorization(express_route_circuit_authorization_params)
26
- merge_attributes(ExpressRouteCircuitAuthorization.parse(circuit_authorization))
26
+ merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.parse(circuit_authorization))
27
27
  end
28
28
 
29
29
  def destroy
@@ -3,20 +3,20 @@ module Fog
3
3
  class AzureRM
4
4
  # ExpressRouteCircuitAuthorization collection class for Network Service
5
5
  class ExpressRouteCircuitAuthorizations < Fog::Collection
6
- model ExpressRouteCircuitAuthorization
6
+ model Fog::Network::AzureRM::ExpressRouteCircuitAuthorization
7
7
  attribute :resource_group
8
8
  attribute :circuit_name
9
9
 
10
10
  def all
11
11
  requires :resource_group, :circuit_name
12
- circuit_authorizations = service.list_express_route_circuit_authorizations(resource_group, circuit_name).map { |circuit_authorization| ExpressRouteCircuitAuthorization.parse(circuit_authorization) }
12
+ circuit_authorizations = service.list_express_route_circuit_authorizations(resource_group, circuit_name).map { |circuit_authorization| Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.parse(circuit_authorization) }
13
13
  load(circuit_authorizations)
14
14
  end
15
15
 
16
16
  def get(resource_group_name, circuit_name, authorization_name)
17
17
  circuit_authorization = service.get_express_route_circuit_authorization(resource_group_name, circuit_name, authorization_name)
18
- express_route_circuit_authorization = ExpressRouteCircuitAuthorization.new(service: service)
19
- express_route_circuit_authorization.merge_attributes(ExpressRouteCircuitAuthorization.parse(circuit_authorization))
18
+ express_route_circuit_authorization = Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.new(service: service)
19
+ express_route_circuit_authorization.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.parse(circuit_authorization))
20
20
  end
21
21
  end
22
22
  end
@@ -29,7 +29,7 @@ module Fog
29
29
  express_route_circuit_peering['id'] = circuit_peering.id
30
30
  express_route_circuit_peering['name'] = circuit_peering.name
31
31
  express_route_circuit_peering['resource_group'] = get_resource_group_from_id(circuit_peering.id)
32
- express_route_circuit_peering['circuit_name'] = circuit_peering.id.split('/')[8]
32
+ express_route_circuit_peering['circuit_name'] = get_circuit_name_from_id(circuit_peering.id)
33
33
  express_route_circuit_peering['provisioning_state'] = circuit_peering.provisioning_state
34
34
  express_route_circuit_peering['peering_type'] = circuit_peering.peering_type
35
35
  express_route_circuit_peering['peer_asn'] = circuit_peering.peer_asn
@@ -59,8 +59,7 @@ module Fog
59
59
  def save
60
60
  requires :name, :resource_group, :circuit_name, :peering_type, :peer_asn, :primary_peer_address_prefix, :secondary_peer_address_prefix, :vlan_id
61
61
  requires :advertised_public_prefixes if peering_type.casecmp(MICROSOFT_PEERING) == 0
62
- circuit_peering_parameters = express_route_circuit_peering_params
63
- circuit_peering = service.create_or_update_express_route_circuit_peering(circuit_peering_parameters)
62
+ circuit_peering = service.create_or_update_express_route_circuit_peering(express_route_circuit_peering_params)
64
63
  merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitPeering.parse(circuit_peering))
65
64
  end
66
65
 
@@ -71,7 +70,7 @@ module Fog
71
70
  private
72
71
 
73
72
  def express_route_circuit_peering_params
74
- circuit_peering_parameters = {
73
+ {
75
74
  resource_group_name: resource_group,
76
75
  peering_name: name,
77
76
  circuit_name: circuit_name,
@@ -85,7 +84,6 @@ module Fog
85
84
  customer_asn: customer_asn,
86
85
  routing_registry_name: routing_registry_name
87
86
  }
88
- circuit_peering_parameters
89
87
  end
90
88
  end
91
89
  end
@@ -3,7 +3,7 @@ module Fog
3
3
  class AzureRM
4
4
  # ExpressRouteCircuitPeering collection class for Network Service
5
5
  class ExpressRouteCircuitPeerings < Fog::Collection
6
- model ExpressRouteCircuitPeering
6
+ model Fog::Network::AzureRM::ExpressRouteCircuitPeering
7
7
  attribute :resource_group
8
8
  attribute :circuit_name
9
9
 
@@ -11,15 +11,15 @@ module Fog
11
11
  requires :resource_group, :circuit_name
12
12
  circuit_peerings = []
13
13
  service.list_express_route_circuit_peerings(resource_group, circuit_name).each do |circuit_peering|
14
- circuit_peerings << ExpressRouteCircuitPeering.parse(circuit_peering)
14
+ circuit_peerings << Fog::Network::AzureRM::ExpressRouteCircuitPeering.parse(circuit_peering)
15
15
  end
16
16
  load(circuit_peerings)
17
17
  end
18
18
 
19
19
  def get(resource_group_name, peering_name, circuit_name)
20
20
  circuit_peering = service.get_express_route_circuit_peering(resource_group_name, peering_name, circuit_name)
21
- express_route_circuit_peering = ExpressRouteCircuitPeering.new(service: service)
22
- express_route_circuit_peering.merge_attributes(ExpressRouteCircuitPeering.parse(circuit_peering))
21
+ express_route_circuit_peering = Fog::Network::AzureRM::ExpressRouteCircuitPeering.new(service: service)
22
+ express_route_circuit_peering.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitPeering.parse(circuit_peering))
23
23
  end
24
24
  end
25
25
  end
@@ -3,22 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # ExpressRouteCircuit collection class for Network Service
5
5
  class ExpressRouteCircuits < Fog::Collection
6
- model ExpressRouteCircuit
6
+ model Fog::Network::AzureRM::ExpressRouteCircuit
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
11
  express_route_circuits = []
12
12
  service.list_express_route_circuits(resource_group).each do |circuit|
13
- express_route_circuits << ExpressRouteCircuit.parse(circuit)
13
+ express_route_circuits << Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit)
14
14
  end
15
15
  load(express_route_circuits)
16
16
  end
17
17
 
18
18
  def get(resource_group_name, name)
19
19
  circuit = service.get_express_route_circuit(resource_group_name, name)
20
- express_route_circuit = ExpressRouteCircuit.new(service: service)
21
- express_route_circuit.merge_attributes(ExpressRouteCircuit.parse(circuit))
20
+ express_route_circuit = Fog::Network::AzureRM::ExpressRouteCircuit.new(service: service)
21
+ express_route_circuit.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit))
22
22
  end
23
23
  end
24
24
  end
@@ -3,12 +3,12 @@ module Fog
3
3
  class AzureRM
4
4
  # ExpressRouteServiceProvider collection class for Network Service
5
5
  class ExpressRouteServiceProviders < Fog::Collection
6
- model ExpressRouteServiceProvider
6
+ model Fog::Network::AzureRM::ExpressRouteServiceProvider
7
7
 
8
8
  def all
9
9
  express_route_service_providers = []
10
10
  service.list_express_route_service_providers.each do |service_provider|
11
- express_route_service_providers << ExpressRouteServiceProvider.parse(service_provider)
11
+ express_route_service_providers << Fog::Network::AzureRM::ExpressRouteServiceProvider.parse(service_provider)
12
12
  end
13
13
  load(express_route_service_providers)
14
14
  end
@@ -3,22 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # LoadBalancers collection class for Network Service
5
5
  class LoadBalancers < Fog::Collection
6
- model LoadBalancer
6
+ model Fog::Network::AzureRM::LoadBalancer
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
11
  load_balancers = []
12
12
  service.list_load_balancers(resource_group).each do |load_balancer|
13
- load_balancers << LoadBalancer.parse(load_balancer)
13
+ load_balancers << Fog::Network::AzureRM::LoadBalancer.parse(load_balancer)
14
14
  end
15
15
  load(load_balancers)
16
16
  end
17
17
 
18
18
  def get(resource_group_name, load_balancer_name)
19
- lb = service.get_load_balancer(resource_group_name, load_balancer_name)
20
- load_balancer = LoadBalancer.new(service: service)
21
- load_balancer.merge_attributes(LoadBalancer.parse(lb))
19
+ load_balancer = service.get_load_balancer(resource_group_name, load_balancer_name)
20
+ load_balancer_fog = Fog::Network::AzureRM::LoadBalancer.new(service: service)
21
+ load_balancer_fog.merge_attributes(Fog::Network::AzureRM::LoadBalancer.parse(load_balancer))
22
22
  end
23
23
  end
24
24
  end
@@ -33,7 +33,7 @@ module Fog
33
33
  def save
34
34
  requires :name, :location, :resource_group, :local_network_address_space_prefixes, :gateway_ip_address, :asn, :bgp_peering_address, :peer_weight
35
35
  local_network_gateway = service.create_or_update_local_network_gateway(local_network_gateway_parameters)
36
- merge_attributes(LocalNetworkGateway.parse(local_network_gateway))
36
+ merge_attributes(Fog::Network::AzureRM::LocalNetworkGateway.parse(local_network_gateway))
37
37
  end
38
38
 
39
39
  def destroy
@@ -3,19 +3,19 @@ module Fog
3
3
  class AzureRM
4
4
  # LocalNetworkGateways collection class for Network Service
5
5
  class LocalNetworkGateways < Fog::Collection
6
- model LocalNetworkGateway
6
+ model Fog::Network::AzureRM::LocalNetworkGateway
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
- local_network_gateways = service.list_local_network_gateways(resource_group).map { |gateway| LocalNetworkGateway.parse(gateway) }
11
+ local_network_gateways = service.list_local_network_gateways(resource_group).map { |gateway| Fog::Network::AzureRM::LocalNetworkGateway.parse(gateway) }
12
12
  load(local_network_gateways)
13
13
  end
14
14
 
15
15
  def get(resource_group_name, name)
16
16
  local_network_gateway = service.get_local_network_gateway(resource_group_name, name)
17
- local_network_gateway_obj = LocalNetworkGateway.new(service: service)
18
- local_network_gateway_obj.merge_attributes(LocalNetworkGateway.parse(local_network_gateway))
17
+ local_network_gateway_fog = Fog::Network::AzureRM::LocalNetworkGateway.new(service: service)
18
+ local_network_gateway_fog.merge_attributes(Fog::Network::AzureRM::LocalNetworkGateway.parse(local_network_gateway))
19
19
  end
20
20
  end
21
21
  end
@@ -3,22 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # NetworkInterfaces collection class for Network Service
5
5
  class NetworkInterfaces < Fog::Collection
6
- model NetworkInterface
6
+ model Fog::Network::AzureRM::NetworkInterface
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
11
  network_interfaces = []
12
12
  service.list_network_interfaces(resource_group).each do |nic|
13
- network_interfaces << NetworkInterface.parse(nic)
13
+ network_interfaces << Fog::Network::AzureRM::NetworkInterface.parse(nic)
14
14
  end
15
15
  load(network_interfaces)
16
16
  end
17
17
 
18
18
  def get(resource_group_name, name)
19
- nic = service.get_network_interface(resource_group_name, name)
20
- network_interface_card = NetworkInterface.new(service: service)
21
- network_interface_card.merge_attributes(NetworkInterface.parse(nic))
19
+ network_interface_card = service.get_network_interface(resource_group_name, name)
20
+ network_interface_card_fog = Fog::Network::AzureRM::NetworkInterface.new(service: service)
21
+ network_interface_card_fog.merge_attributes(Fog::Network::AzureRM::NetworkInterface.parse(network_interface_card))
22
22
  end
23
23
  end
24
24
  end
@@ -3,22 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # collection class for Network Security Group
5
5
  class NetworkSecurityGroups < Fog::Collection
6
- model NetworkSecurityGroup
6
+ model Fog::Network::AzureRM::NetworkSecurityGroup
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
11
  network_security_groups = []
12
12
  service.list_network_security_groups(resource_group).each do |nsg|
13
- network_security_groups << NetworkSecurityGroup.parse(nsg)
13
+ network_security_groups << Fog::Network::AzureRM::NetworkSecurityGroup.parse(nsg)
14
14
  end
15
15
  load(network_security_groups)
16
16
  end
17
17
 
18
18
  def get(resource_group, name)
19
- nsg = service.get_network_security_group(resource_group, name)
20
- network_security_group = NetworkSecurityGroup.new(service: service)
21
- network_security_group.merge_attributes(NetworkSecurityGroup.parse(nsg))
19
+ network_security_group = service.get_network_security_group(resource_group, name)
20
+ network_security_group_fog = Fog::Network::AzureRM::NetworkSecurityGroup.new(service: service)
21
+ network_security_group_fog.merge_attributes(Fog::Network::AzureRM::NetworkSecurityGroup.parse(network_security_group))
22
22
  end
23
23
  end
24
24
  end
@@ -21,7 +21,7 @@ module Fog
21
21
  hash = {}
22
22
  hash['id'] = nsr.id
23
23
  hash['name'] = nsr.name
24
- hash['resource_group'] = get_resource_from_resource_id(nsr.id, RESOURCE_GROUP_NAME)
24
+ hash['resource_group'] = get_resource_group_from_id(nsr.id)
25
25
  hash['network_security_group_name'] = get_resource_from_resource_id(nsr.id, RESOURCE_NAME)
26
26
  hash['description'] = nsr.description
27
27
  hash['protocol'] = nsr.protocol
@@ -37,12 +37,11 @@ module Fog
37
37
 
38
38
  def save
39
39
  requires :name, :network_security_group_name, :resource_group, :protocol, :source_port_range, :destination_port_range, :source_address_prefix, :destination_address_prefix, :access, :priority, :direction
40
- security_rule_params = get_security_rule_params
41
40
  network_security_rule = service.create_or_update_network_security_rule(security_rule_params)
42
- merge_attributes(NetworkSecurityRule.parse(network_security_rule))
41
+ merge_attributes(Fog::Network::AzureRM::NetworkSecurityRule.parse(network_security_rule))
43
42
  end
44
43
 
45
- def get_security_rule_params
44
+ def security_rule_params
46
45
  {
47
46
  name: name,
48
47
  resource_group: resource_group,
@@ -3,7 +3,7 @@ module Fog
3
3
  class AzureRM
4
4
  # collection class for Network Security Rule
5
5
  class NetworkSecurityRules < Fog::Collection
6
- model NetworkSecurityRule
6
+ model Fog::Network::AzureRM::NetworkSecurityRule
7
7
  attribute :resource_group
8
8
  attribute :network_security_group_name
9
9
 
@@ -11,15 +11,15 @@ module Fog
11
11
  requires :resource_group, :network_security_group_name
12
12
  network_security_rules = []
13
13
  service.list_network_security_rules(resource_group, network_security_group_name).each do |nsr|
14
- network_security_rules << NetworkSecurityRule.parse(nsr)
14
+ network_security_rules << Fog::Network::AzureRM::NetworkSecurityRule.parse(nsr)
15
15
  end
16
16
  load(network_security_rules)
17
17
  end
18
18
 
19
19
  def get(resource_group, network_security_group_name, name)
20
20
  network_security_rule = service.get_network_security_rule(resource_group, network_security_group_name, name)
21
- network_security_rule_obj = NetworkSecurityRule.new(service: service)
22
- network_security_rule_obj.merge_attributes(NetworkSecurityRule.parse(network_security_rule))
21
+ network_security_rule_fog = Fog::Network::AzureRM::NetworkSecurityRule.new(service: service)
22
+ network_security_rule_fog.merge_attributes(Fog::Network::AzureRM::NetworkSecurityRule.parse(network_security_rule))
23
23
  end
24
24
  end
25
25
  end
@@ -3,22 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # PublicIPs collection class for Network Service
5
5
  class PublicIps < Fog::Collection
6
- model PublicIp
6
+ model Fog::Network::AzureRM::PublicIp
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
11
  public_ips = []
12
12
  service.list_public_ips(resource_group).each do |pip|
13
- public_ips << PublicIp.parse(pip)
13
+ public_ips << Fog::Network::AzureRM::PublicIp.parse(pip)
14
14
  end
15
15
  load(public_ips)
16
16
  end
17
17
 
18
18
  def get(resource_group_name, public_ip_name)
19
19
  public_ip = service.get_public_ip(resource_group_name, public_ip_name)
20
- public_ip_object = PublicIp.new(service: service)
21
- public_ip_object.merge_attributes(PublicIp.parse(public_ip))
20
+ public_ip_fog = Fog::Network::AzureRM::PublicIp.new(service: service)
21
+ public_ip_fog.merge_attributes(Fog::Network::AzureRM::PublicIp.parse(public_ip))
22
22
  end
23
23
 
24
24
  def check_if_exists(resource_group, name)
@@ -3,7 +3,7 @@ module Fog
3
3
  class AzureRM
4
4
  # Subnet collection for network service
5
5
  class Subnets < Fog::Collection
6
- model Subnet
6
+ model Fog::Network::AzureRM::Subnet
7
7
  attribute :resource_group
8
8
  attribute :virtual_network_name
9
9
 
@@ -11,15 +11,15 @@ module Fog
11
11
  requires :resource_group, :virtual_network_name
12
12
  subnets = []
13
13
  service.list_subnets(resource_group, virtual_network_name).each do |subnet|
14
- subnets << Subnet.parse(subnet)
14
+ subnets << Fog::Network::AzureRM::Subnet.parse(subnet)
15
15
  end
16
16
  load(subnets)
17
17
  end
18
18
 
19
19
  def get(resource_group, virtual_network_name, subnet_name)
20
20
  subnet = service.get_subnet(resource_group, virtual_network_name, subnet_name)
21
- subnet_object = Subnet.new(service: service)
22
- subnet_object.merge_attributes(Subnet.parse(subnet))
21
+ subnet_fog = Fog::Network::AzureRM::Subnet.new(service: service)
22
+ subnet_fog.merge_attributes(Fog::Network::AzureRM::Subnet.parse(subnet))
23
23
  end
24
24
  end
25
25
  end
@@ -52,13 +52,13 @@ module Fog
52
52
 
53
53
  hash['ip_configurations'] = []
54
54
  network_gateway.ip_configurations.each do |ip_config|
55
- ip_configuration = FrontendIPConfiguration.new
56
- hash['ip_configurations'] << ip_configuration.merge_attributes(FrontendIPConfiguration.parse(ip_config))
55
+ ip_configuration = Fog::Network::AzureRM::FrontendIPConfiguration.new
56
+ hash['ip_configurations'] << ip_configuration.merge_attributes(Fog::Network::AzureRM::FrontendIPConfiguration.parse(ip_config))
57
57
  end unless network_gateway.ip_configurations.nil?
58
58
 
59
59
  unless network_gateway.vpn_client_configuration.nil?
60
- vpn_client_configuration = VpnClientConfiguration.new
61
- hash['vpn_client_configuration'] = vpn_client_configuration.merge_attributes(VpnClientConfiguration.parse(network_gateway.vpn_client_configuration))
60
+ vpn_client_configuration = Fog::Network::AzureRM::VpnClientConfiguration.new
61
+ hash['vpn_client_configuration'] = vpn_client_configuration.merge_attributes(Fog::Network::AzureRM::VpnClientConfiguration.parse(network_gateway.vpn_client_configuration))
62
62
  end
63
63
 
64
64
  hash
@@ -67,9 +67,8 @@ module Fog
67
67
  def save
68
68
  requires :name, :location, :resource_group, :gateway_type, :enable_bgp
69
69
  validate_ip_configurations(ip_configurations) unless ip_configurations.nil?
70
- virtual_network_params = virtual_gateway_parameters
71
- network_gateway = service.create_or_update_virtual_network_gateway(virtual_network_params)
72
- merge_attributes(VirtualNetworkGateway.parse(network_gateway))
70
+ network_gateway = service.create_or_update_virtual_network_gateway(virtual_gateway_parameters)
71
+ merge_attributes(Fog::Network::AzureRM::VirtualNetworkGateway.parse(network_gateway))
73
72
  end
74
73
 
75
74
  def destroy
@@ -27,13 +27,13 @@ module Fog
27
27
  connection = get_hash_from_object(gateway_connection)
28
28
 
29
29
  unless gateway_connection.virtual_network_gateway1.nil?
30
- gateway1 = VirtualNetworkGateway.new
31
- connection['virtual_network_gateway1'] = gateway1.merge_attributes(VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway1))
30
+ gateway1 = Fog::Network::AzureRM::VirtualNetworkGateway.new
31
+ connection['virtual_network_gateway1'] = gateway1.merge_attributes(Fog::Network::AzureRM::VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway1))
32
32
  end
33
33
 
34
34
  unless gateway_connection.virtual_network_gateway2.nil?
35
- gateway2 = VirtualNetworkGateway.new
36
- connection['virtual_network_gateway2'] = gateway2.merge_attributes(VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway2))
35
+ gateway2 = Fog::Network::AzureRM::VirtualNetworkGateway.new
36
+ connection['virtual_network_gateway2'] = gateway2.merge_attributes(Fog::Network::AzureRM::VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway2))
37
37
  end
38
38
  connection['resource_group'] = get_resource_group_from_id(gateway_connection.id)
39
39
  connection
@@ -42,7 +42,7 @@ module Fog
42
42
  def save
43
43
  requires :name, :location, :resource_group, :connection_type
44
44
  gateway_connection = service.create_or_update_virtual_network_gateway_connection(gateway_connection_parameters)
45
- merge_attributes(VirtualNetworkGatewayConnection.parse(gateway_connection))
45
+ merge_attributes(Fog::Network::AzureRM::VirtualNetworkGatewayConnection.parse(gateway_connection))
46
46
  end
47
47
 
48
48
  def destroy
@@ -3,19 +3,19 @@ module Fog
3
3
  class AzureRM
4
4
  # VirtualNetworkGatewayConnections collection class for Network Service
5
5
  class VirtualNetworkGatewayConnections < Fog::Collection
6
- model VirtualNetworkGatewayConnection
6
+ model Fog::Network::AzureRM::VirtualNetworkGatewayConnection
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
10
  requires :resource_group
11
- gateway_connections = service.list_virtual_network_gateway_connections(resource_group).map { |connection| VirtualNetworkGatewayConnection.parse(connection) }
11
+ gateway_connections = service.list_virtual_network_gateway_connections(resource_group).map { |connection| Fog::Network::AzureRM::VirtualNetworkGatewayConnection.parse(connection) }
12
12
  load(gateway_connections)
13
13
  end
14
14
 
15
15
  def get(resource_group_name, name)
16
16
  connection = service.get_virtual_network_gateway_connection(resource_group_name, name)
17
- gateway_connection = VirtualNetworkGatewayConnection.new(service: service)
18
- gateway_connection.merge_attributes(VirtualNetworkGatewayConnection.parse(connection))
17
+ gateway_connection = Fog::Network::AzureRM::VirtualNetworkGatewayConnection.new(service: service)
18
+ gateway_connection.merge_attributes(Fog::Network::AzureRM::VirtualNetworkGatewayConnection.parse(connection))
19
19
  end
20
20
  end
21
21
  end