fog-azure-rm-temp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.arclint +8 -0
  3. data/.travis.yml +28 -14
  4. data/CHANGELOG.md +77 -0
  5. data/CONTRIBUTORS.md +4 -0
  6. data/fog-azure-rm.gemspec +3 -2
  7. data/lib/fog/azurerm.rb +1 -0
  8. data/lib/fog/azurerm/async_response.rb +9 -1
  9. data/lib/fog/azurerm/compute.rb +3 -1
  10. data/lib/fog/azurerm/constants.rb +11 -3
  11. data/lib/fog/azurerm/dns.rb +3 -1
  12. data/lib/fog/azurerm/docs/application_gateway.md +119 -117
  13. data/lib/fog/azurerm/docs/compute.md +299 -202
  14. data/lib/fog/azurerm/docs/dns.md +44 -43
  15. data/lib/fog/azurerm/docs/key_vault.md +31 -28
  16. data/lib/fog/azurerm/docs/network.md +407 -404
  17. data/lib/fog/azurerm/docs/resources.md +52 -49
  18. data/lib/fog/azurerm/docs/sql.md +56 -54
  19. data/lib/fog/azurerm/docs/storage.md +92 -157
  20. data/lib/fog/azurerm/docs/traffic_manager.md +55 -53
  21. data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
  22. data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
  23. data/lib/fog/azurerm/models/compute/managed_disk.rb +0 -1
  24. data/lib/fog/azurerm/models/compute/server.rb +61 -11
  25. data/lib/fog/azurerm/models/compute/servers.rb +2 -2
  26. data/lib/fog/azurerm/models/dns/a_record.rb +15 -0
  27. data/lib/fog/azurerm/models/dns/cname_record.rb +15 -0
  28. data/lib/fog/azurerm/models/dns/record_set.rb +20 -8
  29. data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
  30. data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
  31. data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
  32. data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
  33. data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
  34. data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
  35. data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
  36. data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
  37. data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
  38. data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
  39. data/lib/fog/azurerm/models/storage/directories.rb +6 -1
  40. data/lib/fog/azurerm/models/storage/file.rb +2 -0
  41. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
  42. data/lib/fog/azurerm/models/storage/storage_accounts.rb +7 -0
  43. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
  44. data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +1 -1
  45. data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
  46. data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +2 -2
  47. data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +1 -1
  48. data/lib/fog/azurerm/requests/compute/check_managed_disk_exists.rb +1 -1
  49. data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +1 -1
  50. data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +2 -2
  51. data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
  52. data/lib/fog/azurerm/requests/compute/create_image.rb +68 -0
  53. data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +302 -135
  54. data/lib/fog/azurerm/requests/compute/delete_image.rb +29 -0
  55. data/lib/fog/azurerm/requests/compute/get_image.rb +45 -0
  56. data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +4 -2
  57. data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +1 -1
  58. data/lib/fog/azurerm/requests/dns/check_zone_exists.rb +3 -2
  59. data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +3 -2
  60. data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
  61. data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +1 -1
  62. data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
  63. data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
  64. data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +1 -1
  65. data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +1 -1
  66. data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +1 -1
  67. data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +1 -1
  68. data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +1 -1
  69. data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +1 -1
  70. data/lib/fog/azurerm/requests/network/check_public_ip_exists.rb +1 -1
  71. data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +1 -1
  72. data/lib/fog/azurerm/requests/network/check_virtual_network_exists.rb +1 -1
  73. data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +1 -1
  74. data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +1 -1
  75. data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
  76. data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
  77. data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
  78. data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
  79. data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
  80. data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
  81. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
  82. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
  83. data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +4 -4
  84. data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
  85. data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
  86. data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
  87. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
  88. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
  89. data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +1 -1
  90. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
  91. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +1 -1
  92. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +1 -1
  93. data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
  94. data/lib/fog/azurerm/storage.rb +0 -18
  95. data/lib/fog/azurerm/utilities/general.rb +21 -10
  96. data/lib/fog/azurerm/version.rb +1 -1
  97. data/rake-script.sh +7 -1
  98. data/rakefile +1 -1
  99. data/test/api_stub.rb +19 -2
  100. data/test/api_stub/models/compute/server.rb +21 -5
  101. data/test/api_stub/requests/compute/image.rb +41 -0
  102. data/test/api_stub/requests/compute/virtual_machine.rb +60 -62
  103. data/test/api_stub/requests/resources/resource_group.rb +1 -1
  104. data/test/integration/application_gateway.rb +8 -1
  105. data/test/integration/availability_set.rb +9 -2
  106. data/test/integration/external_load_balancer.rb +2 -1
  107. data/test/integration/internal_load_balancer.rb +2 -1
  108. data/test/integration/key_vault.rb +2 -1
  109. data/test/integration/managed_disk.rb +10 -5
  110. data/test/integration/network_interface.rb +2 -1
  111. data/test/integration/network_security_group.rb +2 -1
  112. data/test/integration/public_ip.rb +2 -1
  113. data/test/integration/record_set.rb +5 -5
  114. data/test/integration/resource_group.rb +5 -2
  115. data/test/integration/resource_tag.rb +4 -2
  116. data/test/integration/server.rb +113 -23
  117. data/test/integration/server_custom_image.rb +120 -20
  118. data/test/integration/sql_server.rb +10 -2
  119. data/test/integration/storage_account.rb +32 -20
  120. data/test/integration/traffic_manager.rb +6 -1
  121. data/test/integration/virtual_network.rb +2 -1
  122. data/test/integration/virtual_network_gateway_connection.rb +3 -3
  123. data/test/models/application_gateway/test_gateway.rb +2 -1
  124. data/test/models/compute/test_availability_set.rb +2 -1
  125. data/test/models/compute/test_managed_disk.rb +2 -1
  126. data/test/models/compute/test_server.rb +13 -4
  127. data/test/models/dns/test_zone.rb +2 -1
  128. data/test/models/key_vault/test_vault.rb +2 -1
  129. data/test/models/network/test_load_balancer.rb +2 -1
  130. data/test/models/network/test_network_interface.rb +2 -1
  131. data/test/models/network/test_network_security_group.rb +2 -1
  132. data/test/models/network/test_public_ip.rb +2 -1
  133. data/test/models/network/test_virtual_network.rb +2 -1
  134. data/test/models/resources/test_resource_group.rb +2 -1
  135. data/test/models/sql/test_database.rb +2 -1
  136. data/test/models/sql/test_sql_server.rb +2 -1
  137. data/test/models/storage/test_storage_account.rb +2 -1
  138. data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
  139. data/test/requests/application_gateway/test_check_ag_exists.rb +11 -4
  140. data/test/requests/compute/test_attach_data_disk_to_vm.rb +2 -2
  141. data/test/requests/compute/test_check_availability_set_exists.rb +9 -2
  142. data/test/requests/compute/test_check_managed_disk_exists.rb +9 -2
  143. data/test/requests/compute/test_check_vm_exists.rb +9 -2
  144. data/test/requests/compute/test_check_vm_extension_exists.rb +9 -2
  145. data/test/requests/compute/test_create_image.rb +27 -0
  146. data/test/requests/compute/test_create_virtual_machine.rb +41 -17
  147. data/test/requests/compute/test_delete_image.rb +23 -0
  148. data/test/requests/compute/test_get_image.rb +23 -0
  149. data/test/requests/dns/test_check_record_set_exists.rb +9 -2
  150. data/test/requests/dns/test_check_zone_exists.rb +16 -2
  151. data/test/requests/key_vault/test_check_vault_exists.rb +9 -2
  152. data/test/requests/network/test_check_express_route_cir_auth_exists.rb +9 -2
  153. data/test/requests/network/test_check_express_route_circuit_exists.rb +9 -2
  154. data/test/requests/network/test_check_load_balancer_exists.rb +9 -2
  155. data/test/requests/network/test_check_local_net_gateway_exists.rb +11 -4
  156. data/test/requests/network/test_check_net_sec_group_exists.rb +9 -2
  157. data/test/requests/network/test_check_net_sec_rule_exists.rb +9 -2
  158. data/test/requests/network/test_check_network_interface_exists.rb +9 -2
  159. data/test/requests/network/test_check_public_ip_exists.rb +9 -2
  160. data/test/requests/network/test_check_subnet_exists.rb +9 -2
  161. data/test/requests/network/test_check_virtual_network_exists.rb +10 -4
  162. data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +9 -2
  163. data/test/requests/network/test_check_vnet_gateway_exists.rb +9 -2
  164. data/test/requests/network/test_create_load_balancer.rb +3 -2
  165. data/test/requests/network/test_create_network_interface.rb +4 -3
  166. data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
  167. data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
  168. data/test/requests/network/test_create_public_ip.rb +3 -2
  169. data/test/requests/network/test_update_public_ip.rb +3 -2
  170. data/test/requests/resources/test_create_resource_group.rb +3 -2
  171. data/test/requests/resources/test_delete_resource_tag.rb +3 -3
  172. data/test/requests/resources/test_tag_resource.rb +3 -3
  173. data/test/requests/storage/test_check_storage_account_exists.rb +8 -1
  174. data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +9 -2
  175. data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +9 -2
  176. data/test/test_helper.rb +5 -14
  177. metadata +67 -75
  178. data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
  179. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
  180. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
  181. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
  182. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
  183. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
  184. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
  185. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
  186. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
  187. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
  188. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
  189. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
  190. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
  191. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
  192. data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
  193. data/test/api_stub/models/storage/recovery_vault.rb +0 -23
  194. data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
  195. data/test/models/storage/test_recovery_vault.rb +0 -61
  196. data/test/models/storage/test_recovery_vaults.rb +0 -47
  197. data/test/requests/storage/test_create_recovery_vault.rb +0 -35
  198. data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
  199. data/test/requests/storage/test_disable_backup_protection.rb +0 -52
  200. data/test/requests/storage/test_enable_backup_protection.rb +0 -66
  201. data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
  202. data/test/requests/storage/test_get_backup_container.rb +0 -35
  203. data/test/requests/storage/test_get_backup_item.rb +0 -35
  204. data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
  205. data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
  206. data/test/requests/storage/test_get_recovery_vault.rb +0 -35
  207. data/test/requests/storage/test_list_recovery_vault.rb +0 -35
  208. data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
  209. data/test/requests/storage/test_start_backup.rb +0 -55
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3289ed97aa95d2ba48f1753d19326183d1a6958b
4
- data.tar.gz: 678a07be7e5409dc09659899a6565afef836c402
3
+ metadata.gz: 8a5dc36c698b58237c9cb5eb8c30b3b0aec94169
4
+ data.tar.gz: 0bda6033bb7da5d2225738239c829c79c1b7f217
5
5
  SHA512:
6
- metadata.gz: b603a55dad7948963ef74e730e74caa5780332f90876ec4dae070f8cf2d97c8d818293e64a0dd89b593f6f479c6e7e11acc2a08817df1430f830eeeb0d680f1a
7
- data.tar.gz: 286cc87a71d1d82b723706cde2f73fbf4f05f7275adee37dda60613e0c59d94f19bf9ceb6197c47220bc6ac53c9e56ae593824cc22605f7efe2c8e602aef8572
6
+ metadata.gz: 730c145e96454b933f6cdbebea147599b275950f086d67b178d8bebbb9dd7b48a11c9551ecef486ddde7de437cfa9f9486e4eca98fe78c05042e1d3855dc3f9d
7
+ data.tar.gz: d66dae285b3269e412575c1d453d4f567e648228af4b7592e2a74dcc1db64b5c5ab0e543fefbdf14f6b6702ab6f35ff8dfd7779563b75d52b21ceb0ab6024665
@@ -0,0 +1,8 @@
1
+ {
2
+ "linters": {
3
+ "ruby": {
4
+ "type": "rubocop",
5
+ "include": "/\\.(rb|rake)$/"
6
+ }
7
+ }
8
+ }
@@ -4,30 +4,44 @@ sudo: false
4
4
  before_install:
5
5
  - gem install bundler
6
6
  - gem update bundler
7
+ - gem uninstall -aIx nokogiri -i /home/travis/.rvm/gems/ruby-2.4.1@global nokogiri
7
8
 
8
- script: sh rake-script.sh
9
+ script: bash ./rake-script.sh
10
+
11
+ rvm:
12
+ - 2.0.0
13
+ - 2.1.0
14
+ - 2.1.1
15
+ - 2.1.5
16
+ - 2.2.0
17
+ - 2.3.0
18
+ - jruby-head
9
19
 
10
20
  matrix:
11
21
  fast_finish: true
12
- include:
13
- - rvm: 2.0.0
14
- - rvm: 2.1.0
15
- - rvm: 2.1.1
16
- - rvm: 2.1.5
17
- - rvm: 2.2.0
18
- - rvm: 2.3.0
19
- - rvm: jruby-head
20
22
  allow_failures:
21
23
  - rvm: jruby-head
22
24
 
23
25
  notifications:
24
26
  email:
25
27
  recipients:
26
- - oneops_azure@confiz.com
28
+ - dev-oneops@confiz.com
27
29
  on_success: always
28
30
  on_failure: always
29
-
30
-
31
+
31
32
  addons:
32
- code_climate:
33
- repo_token: b1401494baa004d90402414cb33a7fc6420fd3693e60c677a120ddefd7d84cfd
33
+ code_climate:
34
+ repo_token: b1401494baa004d90402414cb33a7fc6420fd3693e60c677a120ddefd7d84cfd
35
+
36
+ jobs:
37
+ include:
38
+ - stage: gem release
39
+ deploy:
40
+ provider: rubygems
41
+ api_key:
42
+ secure: "aKIOqa6gFMQOcwdNBNsfRoAQm+LVCRf9JpEFnDH8YLRp9A+roj0BL3hZ+pP+pb2sQSEQqU46bfBBrhB2b6Xmjnmv5d0878bl+eYOXeu90CfqRf+v/y+2k/pMsVsKs3Su7M0bHGOeHYT+segRqDHaZaJHkAW8RwLLm5A+0TyEeVjkkpFcyX8fjr5sfvD+XbEmXmmPWPuShQjKTTj1HFYJknRLLNXVYd7ZM9eKgiQfuyomdUTk8yguqNDBWW1BjiEE/0JYqx4wJxdGKPHYT+enP1xIebJVx1gEEnc/OgyBZqtmOirlh2Rnuk58NZfArzwMzIvVclJvPmynmEAlHEWtXwUgQMW5Wu/RYpxRRpr5tDRfru99hll4N9bcA439GlsNHTNJf82zmGNFIdDJ8kUJ08tVPwTvEnWGzLIdKAKWyRV+SESmZb5u3m9e4VTd06/q8gdbW9pG9UGmoes/j32lKzk9DkheCVzQjdxfRs81Z/7uTB3OhhpQnrRlf7qa2OnMDZKrip67UQHiruzAX6naQ7D5fEHR64DGZG7fQ/xRi0oG21UdNl1n/Bioj6ChFXLyInKeA0fiEwwquWK2S/2Sr5ERTBzbv9TkvbJ/1vv8FWcYYmb7bL22699V9yWcsOxEdZEYDucg71g6OrPeNeFZDsJ1749fZzW2X444+4Xtwys="
43
+ gem: fog-azure-rm
44
+ gemspec: fog-azure-rm.gemspec
45
+ on:
46
+ tags: true
47
+ branch: master
@@ -1,3 +1,80 @@
1
+ ## 0.4.4
2
+
3
+ **Fixed:**
4
+ - Compute Service - Fixed customData Update Issue
5
+
6
+ ## 0.4.3
7
+
8
+ **Fixed:**
9
+ - Compute Service - Fixed Server Update Scenario
10
+
11
+ ## 0.4.2
12
+
13
+ **Fixed:**
14
+ - Fixed 'raise_azure_exception' method
15
+
16
+ ## 0.4.1
17
+
18
+ **Fixed:**
19
+ - Fixed check existence methods for all resources
20
+ - Fixed mime-types dependency issue
21
+
22
+ ## 0.4.0
23
+
24
+ **Added**
25
+ - Support added for custom vm image reference
26
+
27
+ ## 0.3.9
28
+
29
+ **Changed**
30
+ - Fixed Fog::Storage issue of requiring the 'mime-types' gem
31
+
32
+ ## 0.3.8
33
+
34
+ **Changed:**
35
+ - Updated documentation
36
+
37
+ **Fixed:**
38
+ - Compute Service - Fixed issue with fault/update domain not populating
39
+
40
+ ## 0.3.7
41
+
42
+ **Fixed:**
43
+ - DNS Service - Fixed bug in DNS service
44
+
45
+ ## 0.3.6
46
+
47
+ **Added:**
48
+ - Compute Service - Added support for custom image provisioning with managed disk
49
+ - DNS Service - Fog Models for RecordSet Types 'A' and 'CNAME'
50
+ - Automated gem publishing on release tagging
51
+
52
+ **Changed:**
53
+ - Loosened dependency on fog-core
54
+ - Updated documentation
55
+
56
+ ## 0.3.5
57
+
58
+ **Added:**
59
+ - Compute Service - Added platform update domain and platform fault domain propertied in server model
60
+ - Compute Service - Added custom image support for managed VM
61
+
62
+ **Changed:**
63
+ - Compute Service - Changed required arguments for server create method
64
+
65
+ **Fixed**
66
+ - Compute Service - Fixed issue with creating VM with custom image
67
+
68
+ ## 0.3.4
69
+
70
+ **Added:**
71
+ - Compute Service - Added support for custom OS disk size during VM creation
72
+ - Compute Service - Added support to attach Managed Disk to VM
73
+ - Added resource tagging support on creation
74
+
75
+ **Removed:**
76
+ - Recovery Vault Support
77
+
1
78
  ## 0.3.3
2
79
 
3
80
  **Added:**
@@ -6,3 +6,7 @@
6
6
  * Haider Ali <haider.ali@confiz.com>
7
7
  * Waqar Haider <waqar.haider@confiz.com>
8
8
  * Bilal Naeem <bilal.naeem@confiz.com>
9
+ * Azeem Sajid <azeem.sajid@confiz.com>
10
+ * Maham Nazir <maham.nazir@confiz.com>
11
+ * Muhammad Asad <muhammad.asad@confiz.com>
12
+ * Muhammad Abbas Sheikh <abbas.sheikh@confiz.com>
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency 'minitest', '~> 5.8.4'
23
23
  spec.add_development_dependency 'simplecov'
24
24
  spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0'
25
- spec.add_dependency 'fog-core', '~> 1.43.0'
26
- spec.add_dependency 'fog-json', '~> 1.0'
25
+ spec.add_dependency 'fog-core', '~> 1.43'
26
+ spec.add_dependency 'fog-json', '~> 1.0.2'
27
27
  spec.add_dependency 'azure_mgmt_compute', '~> 0.9.0'
28
28
  spec.add_dependency 'azure_mgmt_resources', '~> 0.9.0'
29
29
  spec.add_dependency 'azure_mgmt_storage', '~> 0.9.0'
@@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency 'azure_mgmt_key_vault', '~> 0.9.0'
35
35
  spec.add_dependency 'azure-storage', '= 0.11.5.preview'
36
36
  spec.add_dependency 'vhd', '0.0.4'
37
+ spec.add_dependency 'mime-types', '~> 1.25'
37
38
  end
@@ -1,4 +1,5 @@
1
1
  require 'ms_rest_azure'
2
+ require 'azure/core/http/http_error'
2
3
  require 'erb'
3
4
  require 'fog/azurerm/config'
4
5
  require 'fog/azurerm/constants'
@@ -2,14 +2,22 @@ module Fog
2
2
  module AzureRM
3
3
  # class for Async Response
4
4
  class AsyncResponse
5
- def initialize(model, promise)
5
+ def initialize(model, promise, delete_extra_resource = false, post_method_execute = nil)
6
6
  @fog_model = model
7
7
  @promise = promise
8
+ @delete_extra_resource = delete_extra_resource
9
+ @post_method_execute = post_method_execute
8
10
  end
9
11
 
10
12
  def value
11
13
  response = @promise.value.body
12
14
  @fog_model.merge_attributes(@fog_model.class.parse(response))
15
+ @fog_model.delete_extra_resources if @delete_extra_resource
16
+ # This code block will execute the method mentioned in post_method_execute after getting the response
17
+ unless @post_method_execute.nil?
18
+ @fog_model.public_send(@post_method_execute) if @fog_model.respond_to? @post_method_execute
19
+ end
20
+ @fog_model
13
21
  end
14
22
 
15
23
  def state
@@ -41,7 +41,9 @@ module Fog
41
41
  request :list_managed_disks_in_subscription
42
42
  request :revoke_access_to_managed_disk
43
43
  request :grant_access_to_managed_disk
44
-
44
+ request :create_image
45
+ request :delete_image
46
+ request :get_image
45
47
 
46
48
  model_path 'fog/azurerm/models/compute'
47
49
  model :availability_set
@@ -5,7 +5,7 @@ PUBLIC_IP = 'Public-IP-Address'.freeze
5
5
  NETWORK_SECURITY_GROUP = 'Network-Security-Group'.freeze
6
6
  STANDARD_STORAGE = 'Standard'.freeze
7
7
  PREMIUM_STORAGE = 'Premium'.freeze
8
- ALLOWED_STANDARD_REPLICATION = %w(LRS ZRS GRS RAGRS).freeze
8
+ ALLOWED_STANDARD_REPLICATION = %w[LRS ZRS GRS RAGRS].freeze
9
9
  API_VERSION = '2016-06-01'.freeze
10
10
  FAULT_DOMAIN_COUNT = 2
11
11
  UPDATE_DOMAIN_COUNT = 5
@@ -17,7 +17,7 @@ RESOURCE_PROVIDER_NAMESPACE = 6
17
17
  RESOURCE_TYPE = 7
18
18
  RESOURCE_NAME = 8
19
19
  ENDPOINT_PREFIX = 'Microsoft.Network/trafficManagerProfiles'.freeze
20
- DISK_PREFIX = 'Microsoft.Compute/disks'
20
+ DISK_PREFIX = 'Microsoft.Compute/disks'.freeze
21
21
  AZURE_ENDPOINTS = 'azureEndpoints'.freeze
22
22
  EXTERNAL_ENDPOINTS = 'externalEndpoints'.freeze
23
23
  NESTED_ENDPOINTS = 'nestedEndpoints'.freeze
@@ -34,6 +34,8 @@ ENVIRONMENT_AZURE_GERMAN_CLOUD = 'AzureGermanCloud'.freeze
34
34
  # MsRestAzure::AzureOperationError class Error Codes
35
35
  ERROR_CODE_RESOURCE_NOT_FOUND = 'ResourceNotFound'.freeze
36
36
  ERROR_CODE_NOT_FOUND = 'NotFound'.freeze
37
+ ERROR_CODE_RESOURCE_GROUP_NOT_FOUND = 'ResourceGroupNotFound'.freeze
38
+ ERROR_CODE_PARENT_RESOURCE_NOT_FOUND = 'ParentResourceNotFound'.freeze
37
39
 
38
40
  PLATFORM_LINUX = 'linux'.freeze
39
41
 
@@ -58,6 +60,12 @@ MAXIMUM_CHUNK_SIZE = 4 * 1024 * 1024
58
60
 
59
61
  # The hash value of 4MB empty content
60
62
  HASH_OF_4MB_EMPTY_CONTENT = 'b5cfa9d6c8febd618f91ac2843d50a1c'.freeze
61
- REST_CLIENT_API_VERSION = %w(2014-04-01-preview 2016-05-01).freeze
63
+ REST_CLIENT_API_VERSION = %w[2014-04-01-preview 2016-05-01].freeze
62
64
  AS_SKU_CLASSIC = 'Classic'.freeze
63
65
  AS_SKU_ALIGNED = 'Aligned'.freeze
66
+
67
+ # The tag key and tag value for creating a temporary storage account for generalized image
68
+ TEMPORARY_STORAGE_ACCOUNT_TAG_KEY = 'generalized_image'.freeze
69
+ TEMPORARY_STORAGE_ACCOUNT_TAG_VALUE = 'delete'.freeze
70
+
71
+ HTTP_NOT_FOUND = 404
@@ -26,7 +26,9 @@ module Fog
26
26
  collection :zones
27
27
  model :record_set
28
28
  collection :record_sets
29
-
29
+ model :a_record
30
+ model :cname_record
31
+
30
32
  # This class provides the mock implementation for unit tests.
31
33
  class Mock
32
34
  def initialize(_options = {})
@@ -1,6 +1,6 @@
1
1
  # Application Gateway
2
2
 
3
- This document explains how to get started using Azure Network Service with Fog to manage Application Gateway. With this gem you can create/update/list/delete Application Gateway.
3
+ This document explains how to get started using Azure Network Service with Fog to manage Application Gateway. With this gem you can create, update, list or delete Application Gateway.
4
4
 
5
5
  ## Usage
6
6
 
@@ -14,19 +14,20 @@ require 'fog/azurerm'
14
14
  Next, create a connection to the Application Gateway Service:
15
15
 
16
16
  ```ruby
17
- azure_application_gateway_service = Fog::ApplicationGateway::AzureRM.new(
18
- tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
19
- client_id: '<Clientid>', # Client id of Azure Active Directory Application
20
- client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
21
- subscription_id: '<Subscriptionid>', # Subscription id of an Azure Account
22
- :environment => '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
17
+ fog_application_gateway_service = Fog::ApplicationGateway::AzureRM.new(
18
+ tenant_id: '<Tenant Id>', # Tenant Id of Azure Active Directory Application
19
+ client_id: '<Client Id>', # Client Id of Azure Active Directory Application
20
+ client_secret: '<Client Secret>', # Client Secret of Azure Active Directory Application
21
+ subscription_id: '<Subscription Id>', # Subscription Id of an Azure Account
22
+ environment: '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
23
23
  )
24
24
  ```
25
25
 
26
26
  ## Check Application Gateway Existence
27
27
 
28
28
  ```ruby
29
- azure_application_gateway_service.gateways.check_application_gateway_exists(<Resource Group name>, <Gateway Name>)
29
+ fog_application_gateway_service.gateways.check_application_gateway_exists('<Resource Group Name>', '<Gateway Name>')
30
+
30
31
  ```
31
32
 
32
33
  ## Create Application Gateway
@@ -34,43 +35,44 @@ azure_application_gateway_service.gateways.check_application_gateway_exists(<Res
34
35
  Create a new Application Gateway.
35
36
 
36
37
  ```ruby
37
- gateway = azure_application_gateway_service.gateways.create(
38
+ gateway = fog_application_gateway_service.gateways.create(
39
+
38
40
  name: '<Gateway Name>',
39
- location: 'eastus',
41
+ location: '<Location>',
40
42
  resource_group: '<Resource Group name>',
41
- sku_name: 'Standard_Medium',
42
- sku_tier: 'Standard',
43
- sku_capacity: '2',
43
+ sku_name: '<SKU Name>',
44
+ sku_tier: '<SKU Tier>',
45
+ sku_capacity: '<SKU Capacity>',
44
46
  gateway_ip_configurations:
45
47
  [
46
48
  {
47
- name: 'gatewayIpConfigName',
48
- subnet_id: '/subscriptions/<Subscription_id>/resourcegroups/<Resource Group name>/providers/Microsoft.Network/virtualNetworks/<Virtual Network Name>/subnets/<Subnet Name>'
49
+ name: '<Gateway IP Config Name>',
50
+ subnet_id: '/subscriptions/<Subscription Id>/resourcegroups/<Resource Group Name>/providers/Microsoft.Network/virtualNetworks/<Virtual Network Name>/subnets/<Subnet Name>'
49
51
  }
50
52
  ],
51
53
  frontend_ip_configurations:
52
54
  [
53
55
  {
54
- name: 'frontendIpConfig',
55
- private_ip_allocation_method: Fog::ARM::Network::Models::IPAllocationMethod::Dynamic,
56
- public_ip_address_id: '/subscriptions/<Subscription_id>/resourcegroups/<Resource Group name>/providers/Microsoft.Network/publicIPAddresses/<Public IP Address Name>',
57
- private_ip_address: '10.0.1.5'
56
+ name: '<Frontend IP Config Name>',
57
+ private_ip_allocation_method: '<IP Allocation Method>',
58
+ public_ip_address_id: '/subscriptions/<Subscription Id>/resourcegroups/<Resource Group Name>/providers/Microsoft.Network/publicIPAddresses/<Public IP Address Name>',
59
+ private_ip_address: '<IP Address>'
58
60
  }
59
61
  ],
60
62
  frontend_ports:
61
63
  [
62
64
  {
63
- name: 'frontendPort',
64
- port: 443
65
+ name: '<Frontend Port Name>',
66
+ port: <Port Number>
65
67
  }
66
68
  ],
67
69
  backend_address_pools:
68
70
  [
69
71
  {
70
- name: 'backendAddressPool',
72
+ name: '<Backend Address Pool Name>',
71
73
  ip_addresses: [
72
74
  {
73
- ipAddress: '10.0.1.6'
75
+ ipAddress: '<IP Address>'
74
76
  }
75
77
  ]
76
78
  }
@@ -78,76 +80,74 @@ Create a new Application Gateway.
78
80
  backend_http_settings_list:
79
81
  [
80
82
  {
81
- name: 'gateway_settings',
82
- port: 80,
83
- protocol: 'Http',
84
- cookie_based_affinity: 'Enabled',
85
- request_timeout: '30'
83
+ name: '<Gateway Settings Name>',
84
+ port: <Port Number>,
85
+ protocol: '<Protocol Name>',
86
+ cookie_based_affinity: '<Enabled/Disabled>',
87
+ request_timeout: '<Timeout Time>'
86
88
  }
87
89
  ],
88
90
  http_listeners:
89
91
  [
90
92
  {
91
- name: 'gateway_listener',
92
- frontend_ip_config_id: '/subscriptions/<Subscription_id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/frontendIPConfigurations/frontendIpConfig',
93
- frontend_port_id: '/subscriptions/<Subscription_id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/frontendPorts/frontendPort',
94
- protocol: 'Http',
93
+ name: '<Gateway Listener Name>',
94
+ frontend_ip_config_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/frontendIPConfigurations/<Frontend IP Config Name>',
95
+ frontend_port_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/frontendPorts/<Frontend Port Name>',
96
+ protocol: '<Protocol Name>',
95
97
  host_name: '',
96
- require_server_name_indication: 'false'
98
+ require_server_name_indication: '<True/False>'
97
99
  }
98
100
  ],
99
101
  request_routing_rules:
100
102
  [
101
103
  {
102
- name: 'gateway_request_route_rule',
103
- type: 'Basic',
104
- http_listener_id: '/subscriptions/<Subscription_id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/httpListeners/gateway_listener',
105
- backend_address_pool_id: '/subscriptions/<Subscription_id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/backendAddressPools/backendAddressPool',
106
- backend_http_settings_id: '/subscriptions/<Subscription_id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/backendHttpSettingsCollection/gateway_settings',
104
+ name: '<Gateway Request Route Rule Name>',
105
+ type: '<Type>',
106
+ http_listener_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/httpListeners/<Gateway Listener Name>',
107
+ backend_address_pool_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/backendAddressPools/<Backend Address Pool Name>',
108
+ backend_http_settings_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/applicationGateways/<Gateway Name>/backendHttpSettingsCollection/<Gateway Settings Name>',
107
109
  url_path_map: ''
108
110
  }
109
- ]
110
-
111
-
112
- )
111
+ ],
112
+ tags: { key1: 'value1', key2: 'value2', keyN: 'valueN' } # [Optional]
113
+ )
113
114
  ```
114
115
 
115
116
  There can be two ways of giving `frontend_ip_configurations` while creating application gateway
116
117
 
117
- 1. When giving public ip, then we need to provide `public_ip_address_id` as follows
118
-
119
- `frontend_ip_configurations:
120
- [
121
- {
122
- name: 'frontendIpConfig',
123
- private_ip_allocation_method: Fog::ARM::Network::Models::IPAllocationMethod::Dynamic,
124
- public_ip_address_id: '/subscriptions/<Subscription_id>/resourcegroups/<Resource Group name>/providers/Microsoft.Network/publicIPAddresses/<Public IP Address Name>',
125
- private_ip_address: '10.0.1.5'
126
- }
127
- ]`
128
-
118
+ 1. When giving public IP, then we need to provide `public_ip_address_id` as follows
119
+
120
+ ```ruby
121
+ frontend_ip_configurations:
122
+ [
123
+ {
124
+ name: '<Frontend IP Config Name>',
125
+ private_ip_allocation_method: '<IP Allocation Method>',
126
+ public_ip_address_id: '/subscriptions/<Subscription Id>/resourcegroups/<Resource Group Name>/providers/Microsoft.Network/publicIPAddresses/<Public IP Address Name>',
127
+ private_ip_address: '<IP Address>'
128
+ }
129
+ ]
129
130
  2. When giving subnet id, then we need to provide `subnet_id` as follows
130
131
 
131
- `frontend_ip_configurations:
132
- [
133
- {
134
- name: 'frontendIpConfig',
135
- private_ip_allocation_method: Fog::ARM::Network::Models::IPAllocationMethod::Dynamic,
136
- subnet_id: '<Subnet ID',
137
- private_ip_address: '10.0.1.5'
138
- }
139
- ]`
140
-
141
-
132
+ ```ruby
133
+ frontend_ip_configurations:
134
+ [
135
+ {
136
+ name: '<Frontend IP Config Name>',
137
+ private_ip_allocation_method: '<IP Allocation Method>',
138
+ subnet_id: '<Subnet ID>',
139
+ private_ip_address: '<IP Address>'
140
+ }
141
+ ]
142
142
  ## List Application Gateways
143
143
 
144
144
  List all application gateways in a resource group
145
145
 
146
146
  ```ruby
147
- gateways = azure_application_gateway_service.gateways(resource_group: '<Resource Group Name>')
148
- gateways.each do |gateway|
149
- puts "#{gateway.name}"
150
- end
147
+ gateways = fog_application_gateway_service.gateways(resource_group: '<Resource Group Name>')
148
+ gateways.each do |gateway|
149
+ puts "#{gateway.name}"
150
+ end
151
151
  ```
152
152
 
153
153
  ## Retrieve a single Application Gateway
@@ -155,79 +155,81 @@ List all application gateways in a resource group
155
155
  Get a single record of Application Gateway
156
156
 
157
157
  ```ruby
158
- gateway = azure_application_gateway_service
158
+ gateway = fog_application_gateway_service
159
159
  .gateways
160
- .get('<Resource Group name>', '<Application Gateway Name>')
161
- puts "#{gateway.name}"
160
+ .get('<Resource Group Name>', '<Application Gateway Name>')
161
+ puts "#{gateway.name}"
162
162
  ```
163
163
 
164
164
 
165
- ## Update sku attributes (Name and Capacity)
165
+ ## Update SKU attributes (Name and Capacity)
166
166
 
167
167
  ```ruby
168
- ag.update_sku('Standard_Small', '1')
168
+ ag.update_sku('<SKU Name>', '<SKU Capacity>')
169
169
  ```
170
170
 
171
- ## Update gateway ip configuration (Subnet id)
171
+ ## Update gateway IP configuration (Subnet Id)
172
+
172
173
 
173
174
  ```ruby
174
- ag.update_gateway_ip_configuration("/subscriptions/<Subscription_id>/<Resource Group name>/<Gateway Name>/providers/Microsoft.Network/virtualNetworks/<Virtual Network Name>/subnets/<Subnet Name>")
175
+ ag.update_gateway_ip_configuration('/subscriptions/<Subscription Id>/<Resource Group Name>/<Gateway Name>/providers/Microsoft.Network/virtualNetworks/<Virtual Network Name>/subnets/<Subnet Name>')
175
176
  ```
176
177
 
177
- ## Add/Remove SSL Certificates
178
+ ## Add/ Remove SSL Certificates
178
179
 
179
180
  ```ruby
180
- ag.add_ssl_certificate(
181
- {
182
- name: '<SSL Certificate name>',
183
- data: 'Base-64 encoded pfx certificate',
184
- password: 'azure',
185
- public_cert_data: 'Base-64 encoded Public cert data corresponding to pfx specified in data.'
186
- }
187
- )
181
+ ag.add_ssl_certificate(
182
+ {
183
+ name: '<SSL Certificate Name>',
184
+ data: '<SSL Certificate Data>',
185
+ password: '<Password>',
186
+ public_cert_data: '<Public Certificate Data>'
187
+ }
188
+ )
188
189
 
189
- ag.remove_ssl_certificate(
190
- {
191
- name: '<SSL Certificate name>',
192
- data: 'Base-64 encoded pfx certificate',
193
- password: 'azure',
194
- public_cert_data: 'Base-64 encoded Public cert data corresponding to pfx specified in data.'
195
- }
196
- )
190
+ ag.remove_ssl_certificate(
191
+ {
192
+ name: '<SSL Certificate Name>',
193
+ data: '<SSL Certificate Data>',
194
+ password: '<Password>',
195
+ public_cert_data: '<Public Certificate Data>'
196
+ }
197
+ )
197
198
  ```
198
199
 
199
- ## Add/Remove Frontend ports
200
+ ## Add/ Remove Frontend ports
200
201
 
201
202
  ```ruby
202
- ag.add_frontend_port({name: '<Frontend port name>', port: 80})
203
+ ag.add_frontend_port({name: '<Frontend Port Name>', port: <Port Number>})
203
204
 
204
- ag.remove_frontend_port({name: '<Frontend port name>', port: 80})
205
+ ag.remove_frontend_port({name: '<Frontend Port Name>', port: <Port Number>})
205
206
  ```
206
207
 
207
- ## Add/Remove Probes
208
+ ## Add/ Remove Probes
208
209
 
209
210
  ```ruby
210
- ag.add_probe(
211
+ ag.add_probe(
211
212
  {
212
- name: '<Probe name>',
213
- protocol: 'http',
214
- host: 'localhost',
215
- path: '/fog-test',
216
- interval: 60,
217
- timeout: 300,
218
- unhealthy_threshold: 5
219
- }
220
- )
221
- ag.remove__probe(
213
+ name: '<Probe Name>',
214
+ protocol: '<Protocol Name>',
215
+ host: '<Host Name>',
216
+ path: '<Probe Path>',
217
+ interval: <Interval Time>,
218
+ timeout: <Timeout Time>,
219
+ unhealthy_threshold: <Threshold Value>
220
+ }
221
+ )
222
+
223
+ ag.remove__probe(
222
224
  {
223
225
  name: '<Probe name>',
224
- protocol: 'http',
225
- host: 'localhost',
226
- path: '/fog-test',
227
- interval: 60,
228
- timeout: 300,
229
- unhealthy_threshold: 5
230
- }
226
+ protocol: '<Protocol Name>',
227
+ host: '<Protocol Name>',
228
+ path: '<Probe Path>',
229
+ interval: <Interval Time>,
230
+ timeout: <Timeout Time>,
231
+ unhealthy_threshold: <Threshold Value>
232
+ }
231
233
  )
232
234
  ```
233
235
 
@@ -236,8 +238,8 @@ Get a single record of Application Gateway
236
238
  Get a application gateway object from the get method and then destroy that application gateway.
237
239
 
238
240
  ```ruby
239
- gateway.destroy
241
+ gateway.destroy
240
242
  ```
241
243
 
242
244
  ## Support and Feedback
243
- Your feedback is highly appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
245
+ Your feedback is highly appreciated! If you have specific issues with the Fog ARM, you should file an issue via Github.