fog-azure-rm 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 (251) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile +1 -1
  4. data/README.md +0 -1
  5. data/fog-azure-rm.gemspec +4 -1
  6. data/lib/fog/azurerm.rb +7 -0
  7. data/lib/fog/azurerm/application_gateway.rb +10 -2
  8. data/lib/fog/azurerm/compute.rb +14 -4
  9. data/lib/fog/azurerm/config.rb +0 -51
  10. data/lib/fog/azurerm/constants.rb +51 -0
  11. data/lib/fog/azurerm/dns.rb +12 -4
  12. data/lib/fog/azurerm/docs/application_gateway.md +38 -4
  13. data/lib/fog/azurerm/docs/compute.md +23 -4
  14. data/lib/fog/azurerm/docs/dns.md +18 -4
  15. data/lib/fog/azurerm/docs/key_vault.md +88 -0
  16. data/lib/fog/azurerm/docs/network.md +98 -9
  17. data/lib/fog/azurerm/docs/resources.md +24 -4
  18. data/lib/fog/azurerm/docs/sql.md +5 -6
  19. data/lib/fog/azurerm/docs/storage.md +12 -0
  20. data/lib/fog/azurerm/docs/traffic_manager.md +22 -4
  21. data/lib/fog/azurerm/key_vault.rb +51 -0
  22. data/lib/fog/azurerm/models/application_gateway/backend_address_pool.rb +2 -0
  23. data/lib/fog/azurerm/models/application_gateway/backend_http_setting.rb +2 -0
  24. data/lib/fog/azurerm/models/application_gateway/frontend_ip_configuration.rb +4 -0
  25. data/lib/fog/azurerm/models/application_gateway/frontend_port.rb +2 -0
  26. data/lib/fog/azurerm/models/application_gateway/gateway.rb +2 -6
  27. data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -0
  28. data/lib/fog/azurerm/models/application_gateway/http_listener.rb +2 -0
  29. data/lib/fog/azurerm/models/application_gateway/ip_configuration.rb +3 -0
  30. data/lib/fog/azurerm/models/application_gateway/probe.rb +2 -0
  31. data/lib/fog/azurerm/models/application_gateway/request_routing_rule.rb +2 -0
  32. data/lib/fog/azurerm/models/application_gateway/ssl_certificate.rb +2 -0
  33. data/lib/fog/azurerm/models/application_gateway/url_path_map.rb +2 -0
  34. data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -0
  35. data/lib/fog/azurerm/models/compute/servers.rb +4 -0
  36. data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +4 -0
  37. data/lib/fog/azurerm/models/dns/record_sets.rb +4 -0
  38. data/lib/fog/azurerm/models/dns/zones.rb +2 -2
  39. data/lib/fog/azurerm/models/key_vault/access_policy_entry.rb +31 -0
  40. data/lib/fog/azurerm/models/key_vault/vault.rb +76 -0
  41. data/lib/fog/azurerm/models/key_vault/vaults.rb +27 -0
  42. data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +4 -0
  43. data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -0
  44. data/lib/fog/azurerm/models/network/load_balancers.rb +12 -2
  45. data/lib/fog/azurerm/models/network/local_network_gateways.rb +4 -0
  46. data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -0
  47. data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -0
  48. data/lib/fog/azurerm/models/network/network_security_rules.rb +4 -0
  49. data/lib/fog/azurerm/models/network/public_ips.rb +2 -9
  50. data/lib/fog/azurerm/models/network/subnets.rb +4 -0
  51. data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +4 -0
  52. data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -0
  53. data/lib/fog/azurerm/models/network/virtual_networks.rb +9 -11
  54. data/lib/fog/azurerm/models/resources/azure_resources.rb +4 -0
  55. data/lib/fog/azurerm/models/resources/deployments.rb +4 -0
  56. data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -0
  57. data/lib/fog/azurerm/models/sql/firewall_rule.rb +5 -17
  58. data/lib/fog/azurerm/models/sql/firewall_rules.rb +4 -0
  59. data/lib/fog/azurerm/models/sql/sql_database.rb +4 -21
  60. data/lib/fog/azurerm/models/sql/sql_databases.rb +4 -0
  61. data/lib/fog/azurerm/models/sql/sql_server.rb +5 -18
  62. data/lib/fog/azurerm/models/sql/sql_servers.rb +4 -0
  63. data/lib/fog/azurerm/models/storage/directories.rb +4 -0
  64. data/lib/fog/azurerm/models/storage/storage_accounts.rb +4 -0
  65. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +4 -0
  66. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +4 -0
  67. data/lib/fog/azurerm/network.rb +22 -4
  68. data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +31 -0
  69. data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +6 -0
  70. data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +31 -0
  71. data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +31 -0
  72. data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +31 -0
  73. data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +31 -0
  74. data/lib/fog/azurerm/requests/dns/{check_for_zone.rb → check_zone_exists.rb} +4 -2
  75. data/lib/fog/azurerm/requests/dns/list_record_sets.rb +1 -1
  76. data/lib/fog/azurerm/requests/dns/list_zones.rb +2 -2
  77. data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +31 -0
  78. data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +105 -0
  79. data/lib/fog/azurerm/requests/key_vault/delete_vault.rb +28 -0
  80. data/lib/fog/azurerm/requests/key_vault/get_vault.rb +54 -0
  81. data/lib/fog/azurerm/requests/key_vault/list_vaults.rb +56 -0
  82. data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +31 -0
  83. data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +31 -0
  84. data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +31 -0
  85. data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +31 -0
  86. data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +31 -0
  87. data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +31 -0
  88. data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +31 -0
  89. data/lib/fog/azurerm/requests/network/{check_for_public_ip.rb → check_public_ip_exists.rb} +12 -5
  90. data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +32 -0
  91. data/lib/fog/azurerm/requests/network/{check_for_virtual_network.rb → check_virtual_network_exists.rb} +11 -6
  92. data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +32 -0
  93. data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +32 -0
  94. data/lib/fog/azurerm/requests/network/list_load_balancers_in_subscription.rb +31 -0
  95. data/lib/fog/azurerm/requests/network/list_virtual_networks_in_subscription.rb +74 -0
  96. data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +40 -0
  97. data/lib/fog/azurerm/requests/resources/check_deployment_exists.rb +30 -0
  98. data/lib/fog/azurerm/requests/resources/check_resource_group_exists.rb +30 -0
  99. data/lib/fog/azurerm/requests/sql/check_database_exists.rb +21 -0
  100. data/lib/fog/azurerm/requests/sql/check_firewall_rule_exists.rb +21 -0
  101. data/lib/fog/azurerm/requests/sql/check_sql_server_exists.rb +21 -0
  102. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +26 -32
  103. data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +8 -22
  104. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +14 -24
  105. data/lib/fog/azurerm/requests/sql/delete_database.rb +2 -9
  106. data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +2 -9
  107. data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +3 -9
  108. data/lib/fog/azurerm/requests/sql/get_database.rb +4 -10
  109. data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +4 -10
  110. data/lib/fog/azurerm/requests/sql/get_sql_server.rb +3 -10
  111. data/lib/fog/azurerm/requests/sql/list_databases.rb +3 -10
  112. data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +4 -10
  113. data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +3 -10
  114. data/lib/fog/azurerm/requests/storage/check_container_exists.rb +30 -0
  115. data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +31 -0
  116. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +1 -1
  117. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +1 -1
  118. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +1 -1
  119. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +1 -1
  120. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +1 -1
  121. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +1 -1
  122. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +1 -1
  123. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +1 -1
  124. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +1 -1
  125. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +1 -1
  126. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +1 -1
  127. data/lib/fog/azurerm/requests/storage/start_backup.rb +1 -1
  128. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +31 -0
  129. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +31 -0
  130. data/lib/fog/azurerm/resources.rb +10 -2
  131. data/lib/fog/azurerm/sql.rb +18 -10
  132. data/lib/fog/azurerm/storage.rb +4 -0
  133. data/lib/fog/azurerm/traffic_manager.rb +9 -2
  134. data/lib/fog/azurerm/version.rb +1 -1
  135. data/rake-script.sh +3 -10
  136. data/test/api_stub.rb +8 -0
  137. data/test/api_stub/models/key_vault/vault.rb +39 -0
  138. data/test/api_stub/models/sql/sql_database.rb +18 -16
  139. data/test/api_stub/models/sql/sql_firewall_rule.rb +12 -10
  140. data/test/api_stub/models/sql/sql_server.rb +12 -10
  141. data/test/api_stub/requests/key_vault/vault.rb +95 -0
  142. data/test/api_stub/requests/sql/database.rb +8 -6
  143. data/test/api_stub/requests/sql/firewall_rule.rb +8 -4
  144. data/test/api_stub/requests/sql/sql_server.rb +8 -4
  145. data/test/integration/Virtual_network_gateway_connection.rb +7 -0
  146. data/test/integration/application_gateway.rb +8 -0
  147. data/test/integration/availability_set.rb +13 -2
  148. data/test/integration/blob.rb +0 -6
  149. data/test/integration/container.rb +7 -0
  150. data/test/integration/deployment.rb +7 -0
  151. data/test/integration/express_route_circuit.rb +16 -0
  152. data/test/integration/external_load_balancer.rb +18 -0
  153. data/test/integration/key_vault.rb +98 -0
  154. data/test/integration/local_network_gateway.rb +8 -0
  155. data/test/integration/network_interface.rb +8 -0
  156. data/test/integration/network_security_group.rb +8 -0
  157. data/test/integration/network_security_rule.rb +8 -0
  158. data/test/integration/public_ip.rb +3 -2
  159. data/test/integration/record_set.rb +8 -0
  160. data/test/integration/resource_group.rb +12 -4
  161. data/test/integration/resource_tag.rb +7 -0
  162. data/test/integration/server.rb +8 -0
  163. data/test/integration/sql_server.rb +23 -3
  164. data/test/integration/storage_account.rb +8 -1
  165. data/test/integration/subnet.rb +7 -0
  166. data/test/integration/traffic_manager.rb +14 -0
  167. data/test/integration/virtual_machine_extension.rb +8 -0
  168. data/test/integration/virtual_network.rb +13 -4
  169. data/test/integration/virtual_network_gateway.rb +7 -0
  170. data/test/integration/zone.rb +8 -0
  171. data/test/models/application_gateway/test_gateway.rb +1 -0
  172. data/test/models/application_gateway/test_gateways.rb +14 -1
  173. data/test/models/compute/test_availability_sets.rb +14 -1
  174. data/test/models/compute/test_servers.rb +14 -1
  175. data/test/models/compute/test_virtual_machine_extensions.rb +14 -1
  176. data/test/models/dns/test_record_sets.rb +14 -1
  177. data/test/models/dns/test_zones.rb +7 -7
  178. data/test/models/key_vault/test_vault.rb +39 -0
  179. data/test/models/key_vault/test_vaults.rb +55 -0
  180. data/test/models/network/test_express_route_circuit_authorizations.rb +14 -1
  181. data/test/models/network/test_express_route_circuits.rb +14 -1
  182. data/test/models/network/test_load_balancers.rb +14 -1
  183. data/test/models/network/test_local_network_gateways.rb +14 -1
  184. data/test/models/network/test_network_interfaces.rb +14 -1
  185. data/test/models/network/test_network_security_groups.rb +14 -1
  186. data/test/models/network/test_network_security_rules.rb +14 -1
  187. data/test/models/network/test_public_ips.rb +6 -6
  188. data/test/models/network/test_subnets.rb +14 -1
  189. data/test/models/network/test_virtual_network_gateway_connections.rb +14 -1
  190. data/test/models/network/test_virtual_network_gateways.rb +14 -1
  191. data/test/models/network/test_virtual_networks.rb +20 -8
  192. data/test/models/resources/test_deployments.rb +14 -1
  193. data/test/models/resources/test_resource_groups.rb +14 -1
  194. data/test/models/resources/test_resources.rb +16 -3
  195. data/test/models/sql/test_database.rb +3 -4
  196. data/test/models/sql/test_databases.rb +5 -5
  197. data/test/models/sql/test_firewall_rule.rb +2 -1
  198. data/test/models/sql/test_firewall_rules.rb +3 -2
  199. data/test/models/sql/test_sql_server.rb +2 -1
  200. data/test/models/sql/test_sql_servers.rb +5 -5
  201. data/test/models/storage/test_directories.rb +14 -1
  202. data/test/models/storage/test_storage_accounts.rb +14 -1
  203. data/test/models/traffic_manager/test_traffic_manager_end_points.rb +14 -1
  204. data/test/models/traffic_manager/test_traffic_manager_profiles.rb +14 -1
  205. data/test/requests/application_gateway/test_check_ag_exists.rb +31 -0
  206. data/test/requests/compute/test_check_availability_set_exists.rb +31 -0
  207. data/test/requests/compute/test_check_vm_exists.rb +31 -0
  208. data/test/requests/compute/test_check_vm_extension_exists.rb +31 -0
  209. data/test/requests/dns/test_check_record_set_exists.rb +31 -0
  210. data/test/requests/dns/test_check_zone_exists.rb +35 -0
  211. data/test/requests/dns/test_list_record_sets.rb +35 -0
  212. data/test/requests/dns/{test_check_for_zone.rb → test_list_zones.rb} +10 -8
  213. data/test/requests/key_vault/test_check_vault_exists.rb +31 -0
  214. data/test/requests/key_vault/test_create_or_update_vault.rb +25 -0
  215. data/test/requests/key_vault/test_delete_vault.rb +23 -0
  216. data/test/requests/key_vault/test_get_vault.rb +24 -0
  217. data/test/requests/key_vault/test_list_vaults.rb +24 -0
  218. data/test/requests/network/test_check_express_route_cir_auth_exists.rb +31 -0
  219. data/test/requests/network/test_check_express_route_circuit_exists.rb +31 -0
  220. data/test/requests/network/test_check_load_balancer_exists.rb +31 -0
  221. data/test/requests/network/test_check_local_net_gateway_exists.rb +31 -0
  222. data/test/requests/network/test_check_net_sec_group_exists.rb +31 -0
  223. data/test/requests/network/test_check_net_sec_rule_exists.rb +31 -0
  224. data/test/requests/network/test_check_network_interface_exists.rb +31 -0
  225. data/test/requests/network/{test_check_for_public_ip.rb → test_check_public_ip_exists.rb} +8 -8
  226. data/test/requests/network/test_check_subnet_exists.rb +31 -0
  227. data/test/requests/network/{test_check_for_virtual_network.rb → test_check_virtual_network_exists.rb} +8 -8
  228. data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +31 -0
  229. data/test/requests/network/test_check_vnet_gateway_exists.rb +31 -0
  230. data/test/requests/network/test_list_virtual_networks_in_subscription.rb +24 -0
  231. data/test/requests/resources/test_check_azure_resource_exists.rb +22 -0
  232. data/test/requests/resources/test_check_deployment_exists.rb +29 -0
  233. data/test/requests/resources/test_check_resource_group_exists.rb +29 -0
  234. data/test/requests/sql/test_create_or_update_database.rb +9 -12
  235. data/test/requests/sql/test_create_or_update_firewall_rule.rb +9 -11
  236. data/test/requests/sql/test_create_or_update_sql_server.rb +9 -12
  237. data/test/requests/sql/test_delete_database.rb +6 -17
  238. data/test/requests/sql/test_delete_firewall_rule.rb +6 -17
  239. data/test/requests/sql/test_delete_sql_server.rb +6 -17
  240. data/test/requests/sql/test_get_database.rb +7 -18
  241. data/test/requests/sql/test_get_firewall_rule.rb +7 -18
  242. data/test/requests/sql/test_get_sql_server.rb +7 -18
  243. data/test/requests/sql/test_list_databases.rb +7 -18
  244. data/test/requests/sql/test_list_firewall_rules.rb +7 -18
  245. data/test/requests/sql/test_list_sql_servers.rb +7 -18
  246. data/test/requests/storage/test_check_container_exists.rb +18 -0
  247. data/test/requests/storage/test_check_storage_account_exists.rb +32 -0
  248. data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +31 -0
  249. data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +31 -0
  250. data/test/test_helper.rb +39 -4
  251. metadata +125 -10
@@ -4,11 +4,13 @@ module Fog
4
4
  # Backend Address Pool model class for Application Gateway Service
5
5
  class BackendAddressPool < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :ip_addresses
8
9
 
9
10
  def self.parse(backend_address_pool)
10
11
  hash = {}
11
12
  backend_addresses = backend_address_pool.backend_addresses
13
+ hash['id'] = backend_address_pool.id
12
14
  hash['name'] = backend_address_pool.name
13
15
  hash['ip_addresses'] = []
14
16
  backend_addresses.each do |ip_address|
@@ -4,6 +4,7 @@ module Fog
4
4
  # Backend Http Settings model class for Application Gateway Service
5
5
  class BackendHttpSetting < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :port
8
9
  attribute :protocol
9
10
  attribute :cookie_based_affinity
@@ -12,6 +13,7 @@ module Fog
12
13
 
13
14
  def self.parse(backend_http_setting)
14
15
  hash = {}
16
+ hash['id'] = backend_http_setting.id
15
17
  hash['name'] = backend_http_setting.name
16
18
  hash['port'] = backend_http_setting.port
17
19
  hash['protocol'] = backend_http_setting.protocol
@@ -4,16 +4,20 @@ module Fog
4
4
  # Frontend IP Configuration model class for Application Gateway Service
5
5
  class FrontendIPConfiguration < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :public_ip_address_id
8
9
  attribute :private_ip_allocation_method
9
10
  attribute :private_ip_address
11
+ attribute :subnet_id
10
12
  def self.parse(frontend_ip_configuration)
11
13
  hash = {}
14
+ hash['id'] = frontend_ip_configuration.id
12
15
  hash['name'] = frontend_ip_configuration.name
13
16
  hash['public_ip_address_id'] = frontend_ip_configuration.public_ipaddress.id unless frontend_ip_configuration.public_ipaddress.nil?
14
17
  hash['private_ip_allocation_method'] = frontend_ip_configuration.private_ipallocation_method
15
18
  private_ip_address = frontend_ip_configuration.private_ipaddress
16
19
  hash['private_ip_address'] = private_ip_address
20
+ hash['subnet_id'] = frontend_ip_configuration.subnet.id unless frontend_ip_configuration.subnet.nil?
17
21
  hash
18
22
  end
19
23
  end
@@ -4,10 +4,12 @@ module Fog
4
4
  # Frontenf Port model class for Application Gateway Service
5
5
  class FrontendPort < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :port
8
9
 
9
10
  def self.parse(frontend_port)
10
11
  hash = {}
12
+ hash['id'] = frontend_port.id
11
13
  hash['name'] = frontend_port.name
12
14
  hash['port'] = frontend_port.port
13
15
  hash
@@ -221,10 +221,7 @@ module Fog
221
221
 
222
222
  def validate_frontend_ip_configuration_params(frontend_ip_configuration)
223
223
  required_params = [
224
- :name,
225
- :public_ip_address_id,
226
- :private_ip_allocation_method,
227
- :private_ip_address
224
+ :name
228
225
  ]
229
226
  missing = required_params.select { |p| p unless frontend_ip_configuration.key?(p) }
230
227
  if missing.length == 1
@@ -355,8 +352,7 @@ module Fog
355
352
  :name,
356
353
  :port,
357
354
  :protocol,
358
- :cookie_based_affinity,
359
- :request_timeout
355
+ :cookie_based_affinity
360
356
  ]
361
357
  missing = required_params.select { |p| p unless backend_http_settings.key?(p) }
362
358
  if missing.length == 1
@@ -20,6 +20,10 @@ module Fog
20
20
  application_gateway = Fog::ApplicationGateway::AzureRM::Gateway.new(service: service)
21
21
  application_gateway.merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
22
22
  end
23
+
24
+ def check_application_gateway_exists(resource_group_name, application_gateway_name)
25
+ service.check_ag_exists(resource_group_name, application_gateway_name)
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -4,6 +4,7 @@ module Fog
4
4
  # Http Listener class for Application Gateway Service
5
5
  class HttpListener < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :frontend_ip_config_id
8
9
  attribute :frontend_port_id
9
10
  attribute :protocol
@@ -13,6 +14,7 @@ module Fog
13
14
 
14
15
  def self.parse(http_listener)
15
16
  hash = {}
17
+ hash['id'] = http_listener.id
16
18
  hash['name'] = http_listener.name
17
19
  hash['frontend_ip_config_id'] = http_listener.frontend_ipconfiguration.id unless http_listener.frontend_ipconfiguration.nil?
18
20
  hash['frontend_port_id'] = http_listener.frontend_port.id unless http_listener.frontend_port.nil?
@@ -4,14 +4,17 @@ module Fog
4
4
  # GatewayIPConfiguration model class for Application Gateway Service
5
5
  class IPConfiguration < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :subnet_id
8
9
 
9
10
  def self.parse(gateway_ip_configuration)
10
11
  hash = {}
11
12
  if gateway_ip_configuration.is_a? Hash
13
+ hash['id'] = gateway_ip_configuration['id']
12
14
  hash['name'] = gateway_ip_configuration['name']
13
15
  hash['subnet_id'] = gateway_ip_configuration['subnet']['id'] unless gateway_ip_configuration['subnet'].nil?
14
16
  else
17
+ hash['id'] = gateway_ip_configuration.id
15
18
  hash['name'] = gateway_ip_configuration.name
16
19
  hash['subnet_id'] = gateway_ip_configuration.subnet.id unless gateway_ip_configuration.subnet.nil?
17
20
  end
@@ -4,6 +4,7 @@ module Fog
4
4
  # Probe model class for Application Gateway Service
5
5
  class Probe < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :protocol
8
9
  attribute :host
9
10
  attribute :path
@@ -13,6 +14,7 @@ module Fog
13
14
 
14
15
  def self.parse(probe)
15
16
  hash = {}
17
+ hash['id'] = probe.id
16
18
  hash['name'] = probe.name
17
19
  hash['protocol'] = probe.protocol
18
20
  hash['host'] = probe.host
@@ -4,6 +4,7 @@ module Fog
4
4
  # Request Routing Rule model class for Application Gateway Service
5
5
  class RequestRoutingRule < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :type
8
9
  attribute :http_listener_id
9
10
  attribute :backend_address_pool_id
@@ -12,6 +13,7 @@ module Fog
12
13
 
13
14
  def self.parse(request_routing_rule)
14
15
  hash = {}
16
+ hash['id'] = request_routing_rule.id
15
17
  hash['name'] = request_routing_rule.name
16
18
  hash['type'] = request_routing_rule.rule_type
17
19
  hash['http_listener_id'] = request_routing_rule.http_listener.id unless request_routing_rule.http_listener.nil?
@@ -4,12 +4,14 @@ module Fog
4
4
  # SSL Certificate model class for Application Gateway Service
5
5
  class SslCertificate < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :data
8
9
  attribute :password
9
10
  attribute :public_cert_data
10
11
 
11
12
  def self.parse(ssl_certificate)
12
13
  hash = {}
14
+ hash['id'] = ssl_certificate.id
13
15
  hash['name'] = ssl_certificate.name
14
16
  hash['data'] = ssl_certificate.data
15
17
  hash['password'] = ssl_certificate.password
@@ -4,12 +4,14 @@ module Fog
4
4
  # URL Path Map model class for Application Gateway Service
5
5
  class UrlPathMap < Fog::Model
6
6
  identity :name
7
+ attribute :id
7
8
  attribute :default_backend_address_pool_id
8
9
  attribute :default_backend_http_settings_id
9
10
  attribute :path_rules
10
11
 
11
12
  def self.parse(url_path_map)
12
13
  hash = {}
14
+ hash['id'] = url_path_map.id
13
15
  hash['name'] = url_path_map.name
14
16
  hash['default_backend_address_pool_id'] = url_path_map.default_backend_address_pool.id unless url_path_map.default_backend_address_pool.nil?
15
17
  hash['default_backend_http_settings_id'] = url_path_map.default_backend_http_settings.id unless url_path_map.default_backend_http_settings.nil?
@@ -25,6 +25,10 @@ module Fog
25
25
  availability_set_fog = Fog::Compute::AzureRM::AvailabilitySet.new(service: service)
26
26
  availability_set_fog.merge_attributes(Fog::Compute::AzureRM::AvailabilitySet.parse(availability_set))
27
27
  end
28
+
29
+ def check_availability_set_exists(resource_group, name)
30
+ service.check_availability_set_exists(resource_group, name)
31
+ end
28
32
  end
29
33
  end
30
34
  end
@@ -21,6 +21,10 @@ module Fog
21
21
  virtual_machine_fog = Fog::Compute::AzureRM::Server.new(service: service)
22
22
  virtual_machine_fog.merge_attributes(Fog::Compute::AzureRM::Server.parse(virtual_machine))
23
23
  end
24
+
25
+ def check_vm_exists(resource_group, name)
26
+ service.check_vm_exists(resource_group, name)
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -21,6 +21,10 @@ module Fog
21
21
  vm_extension_fog = Fog::Compute::AzureRM::VirtualMachineExtension.new(service: service)
22
22
  vm_extension_fog.merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
23
23
  end
24
+
25
+ def check_vm_extension_exists(resource_group_name, virtual_machine_name, vm_extension_name)
26
+ service.check_vm_extension_exists(resource_group_name, virtual_machine_name, vm_extension_name)
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -24,6 +24,10 @@ module Fog
24
24
  record_set_fog = Fog::DNS::AzureRM::RecordSet.new(service: service)
25
25
  record_set_fog.merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
26
26
  end
27
+
28
+ def check_record_set_exists(resource_group, name, zone_name, record_type)
29
+ service.check_record_set_exists(resource_group, name, zone_name, record_type)
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -20,8 +20,8 @@ module Fog
20
20
  zone_fog.merge_attributes(Fog::DNS::AzureRM::Zone.parse(zone))
21
21
  end
22
22
 
23
- def check_for_zone(resource_group, name)
24
- service.check_for_zone(resource_group, name)
23
+ def check_zone_exists(resource_group, name)
24
+ service.check_zone_exists(resource_group, name)
25
25
  end
26
26
  end
27
27
  end
@@ -0,0 +1,31 @@
1
+ module Fog
2
+ module KeyVault
3
+ class AzureRM
4
+ # AccessPolicyEntry Model for Storage Service
5
+ class AccessPolicyEntry < Fog::Model
6
+ identity :object_id
7
+ attribute :tenant_id
8
+ attribute :application_id
9
+ attribute :keys
10
+ attribute :secrets
11
+ attribute :certificates
12
+
13
+ def self.parse(access_policy_entry)
14
+ access_policy_entry_hash = get_hash_from_object(access_policy_entry)
15
+ permissions = access_policy_entry.permissions
16
+ unless permissions.nil?
17
+ access_policy_entry_hash['keys'] = permissions.keys
18
+ access_policy_entry_hash['secrets'] = permissions.secrets
19
+ access_policy_entry_hash['certificates'] = permissions.certificates
20
+ end
21
+
22
+ access_policy_entry_hash
23
+ end
24
+
25
+ def save
26
+ requires :object_id, :tenant_id, :keys, :secrets
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,76 @@
1
+ module Fog
2
+ module KeyVault
3
+ class AzureRM
4
+ # Vault model for KeyVault Service
5
+ class Vault < Fog::Model
6
+ identity :name
7
+ attribute :id
8
+ attribute :resource_group
9
+ attribute :location
10
+ attribute :vault_uri
11
+ attribute :tenant_id
12
+ attribute :sku_family
13
+ attribute :sku_name
14
+ attribute :access_policies
15
+ attribute :enabled_for_deployment
16
+ attribute :enabled_for_disk_encryption
17
+ attribute :enabled_for_template_deployment
18
+
19
+ def self.parse(vault)
20
+ vault_hash = get_hash_from_object(vault)
21
+ vault_properties = vault.properties
22
+
23
+ unless vault_properties.nil?
24
+ vault_hash['vault_uri'] = vault_properties.vault_uri
25
+ vault_hash['tenant_id'] = vault_properties.tenant_id
26
+
27
+ unless vault_properties.sku.nil?
28
+ vault_hash['sku_family'] = vault_properties.sku.family
29
+ vault_hash['sku_name'] = vault_properties.sku.name
30
+ end
31
+
32
+ vault_hash['access_policies'] = []
33
+ unless vault_properties.access_policies.nil?
34
+ vault_properties.access_policies.each do |access_policy|
35
+ access_policy_entry = Fog::KeyVault::AzureRM::AccessPolicyEntry.new
36
+ vault_hash['access_policies'] << access_policy_entry.merge_attributes(Fog::KeyVault::AzureRM::AccessPolicyEntry.parse(access_policy))
37
+ end
38
+ end
39
+
40
+ vault_hash['enabled_for_deployment'] = vault_properties.enabled_for_deployment
41
+ vault_hash['enabled_for_disk_encryption'] = vault_properties.enabled_for_disk_encryption
42
+ vault_hash['enabled_for_template_deployment'] = vault_properties.enabled_for_template_deployment
43
+
44
+ vault_hash['resource_group'] = get_resource_group_from_id(vault.id)
45
+ end
46
+
47
+ vault_hash
48
+ end
49
+
50
+ def save
51
+ requires :name, :resource_group, :location, :tenant_id, :sku_family, :sku_name, :access_policies
52
+ vault = service.create_or_update_vault(vault_hash)
53
+ merge_attributes(Fog::KeyVault::AzureRM::Vault.parse(vault))
54
+ end
55
+
56
+ def destroy
57
+ service.delete_vault(resource_group, name)
58
+ end
59
+
60
+ private
61
+
62
+ def vault_hash
63
+ {
64
+ resource_group: resource_group,
65
+ name: name,
66
+ location: location,
67
+ tenant_id: tenant_id,
68
+ sku_family: sku_family,
69
+ sku_name: sku_name,
70
+ access_policies: access_policies
71
+ }
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,27 @@
1
+ module Fog
2
+ module KeyVault
3
+ class AzureRM
4
+ # This class is giving implementation of all/list and get for key vault.
5
+ class Vaults < Fog::Collection
6
+ attribute :resource_group
7
+ model Fog::KeyVault::AzureRM::Vault
8
+
9
+ def all
10
+ requires :resource_group
11
+ vaults = service.list_vaults(resource_group).map { |vault| Fog::KeyVault::AzureRM::Vault.parse(vault) }
12
+ load(vaults)
13
+ end
14
+
15
+ def get(resource_group, vault_name)
16
+ vault = service.get_vault(resource_group, vault_name)
17
+ vault_obj = Fog::KeyVault::AzureRM::Vault.new(service: service)
18
+ vault_obj.merge_attributes(Fog::KeyVault::AzureRM::Vault.parse(vault))
19
+ end
20
+
21
+ def check_vault_exists(resource_group, vault_name)
22
+ service.check_vault_exists(resource_group, vault_name)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -18,6 +18,10 @@ module Fog
18
18
  express_route_circuit_authorization = Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.new(service: service)
19
19
  express_route_circuit_authorization.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.parse(circuit_authorization))
20
20
  end
21
+
22
+ def check_express_route_cir_auth_exists(resource_group_name, circuit_name, authorization_name)
23
+ service.check_express_route_cir_auth_exists(resource_group_name, circuit_name, authorization_name)
24
+ end
21
25
  end
22
26
  end
23
27
  end
@@ -20,6 +20,10 @@ module Fog
20
20
  express_route_circuit = Fog::Network::AzureRM::ExpressRouteCircuit.new(service: service)
21
21
  express_route_circuit.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit))
22
22
  end
23
+
24
+ def check_express_route_circuit_exists(resource_group_name, name)
25
+ service.check_express_route_circuit_exists(resource_group_name, name)
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -7,9 +7,15 @@ module Fog
7
7
  attribute :resource_group
8
8
 
9
9
  def all
10
- requires :resource_group
11
10
  load_balancers = []
12
- service.list_load_balancers(resource_group).each do |load_balancer|
11
+ if !resource_group.nil?
12
+ requires :resource_group
13
+ l_balancers = service.list_load_balancers(resource_group)
14
+ else
15
+ l_balancers = service.list_load_balancers_in_subscription
16
+ end
17
+
18
+ l_balancers.each do |load_balancer|
13
19
  load_balancers << Fog::Network::AzureRM::LoadBalancer.parse(load_balancer)
14
20
  end
15
21
  load(load_balancers)
@@ -20,6 +26,10 @@ module Fog
20
26
  load_balancer_fog = Fog::Network::AzureRM::LoadBalancer.new(service: service)
21
27
  load_balancer_fog.merge_attributes(Fog::Network::AzureRM::LoadBalancer.parse(load_balancer))
22
28
  end
29
+
30
+ def check_load_balancer_exists(resource_group_name, load_balancer_name)
31
+ service.check_load_balancer_exists(resource_group_name, load_balancer_name)
32
+ end
23
33
  end
24
34
  end
25
35
  end