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
@@ -44,10 +44,13 @@ begin
44
44
  ###################### Create Sql Server ######################
45
45
  ########################################################################################################################
46
46
 
47
+ tags = { key1: 'value1', key2: 'value2' }
48
+
47
49
  sql_server = azure_sql_service.sql_servers.create(
48
50
  name: server_name,
49
51
  resource_group: 'TestRG-SQL',
50
52
  location: LOCATION,
53
+ tags: tags,
51
54
  version: '2.0',
52
55
  administrator_login: 'testserveradmin',
53
56
  administrator_login_password: 'db@admin=123'
@@ -67,10 +70,11 @@ begin
67
70
  ########################################################################################################################
68
71
 
69
72
  sql_database = azure_sql_service.sql_databases.create(
73
+ name: database_name,
70
74
  resource_group: 'TestRG-SQL',
71
75
  location: LOCATION,
72
- server_name: server_name,
73
- name: database_name
76
+ tags: tags,
77
+ server_name: server_name
74
78
  )
75
79
  puts "Created sql database: #{sql_database.name}"
76
80
 
@@ -112,6 +116,7 @@ begin
112
116
  firewall_rule = azure_sql_service.firewall_rules.create(
113
117
  resource_group: 'TestRG-SQL',
114
118
  server_name: server_name,
119
+ tags: tags,
115
120
  name: 'test-rule-name',
116
121
  start_ip: '10.10.10.10',
117
122
  end_ip: '10.10.10.11'
@@ -167,8 +172,11 @@ begin
167
172
  ########################################################################################################################
168
173
  ###################### CleanUp ######################
169
174
  ########################################################################################################################
175
+
170
176
  resource_group = resources.resource_groups.get('TestRG-SQL')
171
177
  resource_group.destroy
178
+
179
+ puts 'Integration test for SQL ran successfully!'
172
180
  rescue
173
181
  puts 'Integration Test for sql server is failing'
174
182
  resource_group.destroy unless resource_group.nil?
@@ -23,13 +23,24 @@ storage = Fog::Storage::AzureRM.new(
23
23
  environment: azure_credentials['environment']
24
24
  )
25
25
 
26
+ ########################################################################################################################
27
+ ###################### Resource names #####################
28
+ ########################################################################################################################
29
+
30
+ time = current_time
31
+ resource_group_name = "TestRG-SA-#{time}"
32
+ storage_account_name = "teststorage#{time}"
33
+ lrs_storage_account = "lrs#{time}"
34
+ grs_storage_account = "grs#{time}"
35
+ premium_storage_acc = "premsa#{time}"
36
+
26
37
  ########################################################################################################################
27
38
  ###################### Prerequisites ######################
28
39
  ########################################################################################################################
29
40
 
30
41
  begin
31
42
  resource_group = rs.resource_groups.create(
32
- name: 'TestRG-SA',
43
+ name: resource_group_name,
33
44
  location: LOCATION
34
45
  )
35
46
 
@@ -37,26 +48,27 @@ begin
37
48
  ###################### Check Storage Account name Availability ######################
38
49
  ########################################################################################################################
39
50
 
40
- storage_account_avail = storage.storage_accounts.check_name_availability('teststorage123')
51
+ storage_account_avail = storage.storage_accounts.check_name_availability(storage_account_name)
41
52
  puts storage_account_avail ? 'Storage Account name available' : 'Storage Account name unavailable'
42
53
 
43
54
  ########################################################################################################################
44
55
  ###################### Check Subnet Exists? ######################
45
56
  ########################################################################################################################
46
57
 
47
- lrs_storage_account = "lrs#{current_time}"
48
-
49
- flag = storage.storage_accounts.check_storage_account_exists('TestRG-SA', lrs_storage_account)
58
+ flag = storage.storage_accounts.check_storage_account_exists(resource_group_name, lrs_storage_account)
50
59
  puts "Storage Account doesn't exist." unless flag
51
60
 
52
61
  ########################################################################################################################
53
62
  ############### Create A Standard Storage Account of Replication: LRS (Locally-redundant storage) ###############
54
63
  ########################################################################################################################
55
64
 
65
+ tags = { key1: 'value1', key2: 'value2' }
66
+
56
67
  storage_account = storage.storage_accounts.create(
57
68
  name: lrs_storage_account,
58
69
  location: LOCATION,
59
- resource_group: 'TestRG-SA'
70
+ resource_group: resource_group_name,
71
+ tags: tags
60
72
  )
61
73
  puts "Created storage account for standard lrs replication: #{storage_account.name}"
62
74
 
@@ -64,15 +76,14 @@ begin
64
76
  ############### Create A Standard Storage Account of Replication: GRS (Geo-redundant storage) #################
65
77
  ########################################################################################################################
66
78
 
67
- grs_storage_account = "grs#{current_time}"
68
-
69
79
  storage_account = storage.storage_accounts.create(
70
80
  name: grs_storage_account,
71
81
  location: LOCATION,
72
- resource_group: 'TestRG-SA',
82
+ resource_group: resource_group_name,
73
83
  sku_name: Fog::ARM::Storage::Models::SkuTier::Standard,
74
84
  replication: 'GRS',
75
- encryption: true
85
+ encryption: true,
86
+ tags: tags
76
87
  )
77
88
  puts "Created storage account for standard grs replication: #{storage_account.name}"
78
89
 
@@ -80,14 +91,13 @@ begin
80
91
  ########### Create A Premium(SSD) Storage Account of its only Replication: LRS (Locally-redundant storage) ##########
81
92
  ########################################################################################################################
82
93
 
83
- premium_storage_acc = "premsa#{current_time}"
84
-
85
94
  storage_account = storage.storage_accounts.create(
86
95
  name: premium_storage_acc,
87
96
  location: LOCATION,
88
- resource_group: 'TestRG-SA',
97
+ resource_group: resource_group_name,
89
98
  sku_name: Fog::ARM::Storage::Models::SkuTier::Premium,
90
- replication: 'LRS'
99
+ replication: 'LRS',
100
+ tags: tags
91
101
  )
92
102
  puts "Created storage account for premium lrs replication: #{storage_account.name}"
93
103
 
@@ -95,28 +105,30 @@ begin
95
105
  ###################### Get and Update Storage Account ######################
96
106
  ########################################################################################################################
97
107
 
98
- premium_storage_account = storage.storage_accounts.get('TestRG-SA', premium_storage_acc)
108
+ premium_storage_account = storage.storage_accounts.get(resource_group_name, premium_storage_acc)
99
109
  puts "Get storage account: #{premium_storage_account.name}"
100
110
  premium_storage_account.update(encryption: true)
101
- puts 'Updated encrytion of storage account'
111
+ puts 'Updated encryption of storage account'
102
112
 
103
113
  ########################################################################################################################
104
114
  ###################### Get and Delete Storage Account ######################
105
115
  ########################################################################################################################
106
116
 
107
- standard_storage_account = storage.storage_accounts.get('TestRG-SA', lrs_storage_account)
117
+ standard_storage_account = storage.storage_accounts.get(resource_group_name, lrs_storage_account)
108
118
  puts "Deleted storage account for standard lrs replication: #{standard_storage_account.destroy}"
109
- standard_storage_account = storage.storage_accounts.get('TestRG-SA', grs_storage_account)
119
+ standard_storage_account = storage.storage_accounts.get(resource_group_name, grs_storage_account)
110
120
  puts "Deleted storage account for standard grs replication: #{standard_storage_account.destroy}"
111
- premium_storage_account = storage.storage_accounts.get('TestRG-SA', premium_storage_acc)
121
+ premium_storage_account = storage.storage_accounts.get(resource_group_name, premium_storage_acc)
112
122
  puts "Deleted storage account for premium lrs replication: #{premium_storage_account.destroy}"
113
123
 
114
124
  ########################################################################################################################
115
125
  ###################### CleanUp ######################
116
126
  ########################################################################################################################
117
127
 
118
- resource_group = rs.resource_groups.get('TestRG-SA')
128
+ resource_group = rs.resource_groups.get(resource_group_name)
119
129
  resource_group.destroy
130
+
131
+ puts 'Integration test for storage account ran successfully!'
120
132
  rescue
121
133
  puts 'Integration Test for storage account is failing'
122
134
  resource_group.destroy unless resource_group.nil?
@@ -43,9 +43,12 @@ begin
43
43
  ###################### Create Traffic Manager Profile ######################
44
44
  ########################################################################################################################
45
45
 
46
+ tags = { key1: 'value1', key2: 'value2' }
47
+
46
48
  traffic_manager_profile = traffic_manager.traffic_manager_profiles.create(
47
49
  name: 'test-tmp',
48
50
  resource_group: 'TestRG-TM',
51
+ tags: tags,
49
52
  traffic_routing_method: 'Performance',
50
53
  relative_name: 'testapplication',
51
54
  ttl: '30',
@@ -77,8 +80,8 @@ begin
77
80
 
78
81
  traffic_manager_end_point = traffic_manager.traffic_manager_end_points.create(
79
82
  name: 'myendpoint',
80
- traffic_manager_profile_name: 'test-tmp',
81
83
  resource_group: 'TestRG-TM',
84
+ traffic_manager_profile_name: 'test-tmp',
82
85
  type: 'externalEndpoints',
83
86
  target: 'test-app1.com',
84
87
  endpoint_location: 'eastus'
@@ -131,6 +134,8 @@ begin
131
134
 
132
135
  resource_group = resources.resource_groups.get('TestRG-TM')
133
136
  resource_group.destroy
137
+
138
+ puts 'Integration test for Traffic Manager ran successfully!'
134
139
  rescue
135
140
  puts 'Integration Test for traffic manager is failing'
136
141
  resource_group.destroy unless resource_group.nil?
@@ -52,7 +52,8 @@ begin
52
52
  address_prefix: '10.1.0.0/24'
53
53
  }],
54
54
  dns_servers: %w(10.1.0.0 10.2.0.0),
55
- address_prefixes: %w(10.1.0.0/16 10.2.0.0/16)
55
+ address_prefixes: %w(10.1.0.0/16 10.2.0.0/16),
56
+ tags: { key: 'value' }
56
57
  )
57
58
  puts "Created virtual network: #{virtual_network.name}"
58
59
 
@@ -174,7 +174,8 @@ begin
174
174
  name: 'testnetworkgateway',
175
175
  resource_group: 'TestRG-GC'
176
176
  },
177
- connection_type: 'Vnet2Vnet'
177
+ connection_type: 'Vnet2Vnet',
178
+ tags: { key: 'value' }
178
179
  )
179
180
  puts "Created virtual network gateway connection: #{virtual_network_gateway_connection.name}"
180
181
 
@@ -214,8 +215,7 @@ begin
214
215
 
215
216
  resource_group = resource.resource_groups.get('TestRG-GC')
216
217
  resource_group.destroy
217
- rescue Exception => e
218
- raise e
218
+ rescue
219
219
  puts 'Integration Test for virtual network gateway connection is failing'
220
220
  resource_group.destroy unless resource_group.nil?
221
221
  end
@@ -54,7 +54,8 @@ class TestGateway < Minitest::Test
54
54
  :backend_http_settings_list,
55
55
  :http_listeners,
56
56
  :url_path_maps,
57
- :request_routing_rules
57
+ :request_routing_rules,
58
+ :tags
58
59
  ]
59
60
  attributes.each do |attribute|
60
61
  assert_respond_to @gateway, attribute
@@ -29,7 +29,8 @@ class TestAvailabilitySet < Minitest::Test
29
29
  :platform_update_domain_count,
30
30
  :platform_fault_domain_count,
31
31
  :use_managed_disk,
32
- :sku_name
32
+ :sku_name,
33
+ :tags
33
34
  ]
34
35
  attributes.each do |attribute|
35
36
  assert_respond_to @availability_set, attribute
@@ -34,7 +34,8 @@ class TestManagedDisk < Minitest::Test
34
34
  :provisioning_state,
35
35
  :tags,
36
36
  :creation_data,
37
- :encryption_settings
37
+ :encryption_settings,
38
+ :tags
38
39
  ]
39
40
  attributes.each do |attribute|
40
41
  assert_respond_to @managed_disk, attribute
@@ -54,7 +54,12 @@ class TestServer < Minitest::Test
54
54
  :provision_vm_agent,
55
55
  :enable_automatic_updates,
56
56
  :network_interface_card_ids,
57
- :availability_set_id
57
+ :availability_set_id,
58
+ :managed_disk_storage_type,
59
+ :os_disk_size,
60
+ :tags,
61
+ :platform_update_domain,
62
+ :platform_fault_domain
58
63
  ]
59
64
  attributes.each do |attribute|
60
65
  assert_respond_to @server, attribute
@@ -64,7 +69,9 @@ class TestServer < Minitest::Test
64
69
  def test_save_method_response_for_linux_vm
65
70
  response = ApiStub::Models::Compute::Server.create_linux_virtual_machine_response(@compute_client)
66
71
  @service.stub :create_virtual_machine, response do
67
- assert_instance_of Fog::Compute::AzureRM::Server, @server.save
72
+ @service.stub :get_virtual_machine, response do
73
+ assert_instance_of Fog::Compute::AzureRM::Server, @server.save
74
+ end
68
75
  end
69
76
 
70
77
  # Async
@@ -77,8 +84,10 @@ class TestServer < Minitest::Test
77
84
  def test_save_method_response_for_windows_vm
78
85
  response = ApiStub::Models::Compute::Server.create_windows_virtual_machine_response(@compute_client)
79
86
  @service.stub :create_virtual_machine, response do
80
- assert_instance_of Fog::Compute::AzureRM::Server, @server.save
81
- refute @server.save.disable_password_authentication
87
+ @service.stub :get_virtual_machine, response do
88
+ assert_instance_of Fog::Compute::AzureRM::Server, @server.save
89
+ refute @server.save.disable_password_authentication
90
+ end
82
91
  end
83
92
  end
84
93
 
@@ -23,7 +23,8 @@ class TestZone < Minitest::Test
23
23
  attributes = [
24
24
  :name,
25
25
  :id,
26
- :resource_group
26
+ :resource_group,
27
+ :tags
27
28
  ]
28
29
  attributes.each do |attribute|
29
30
  assert_respond_to @zone, attribute
@@ -20,7 +20,8 @@ class TestVault < Minitest::Test
20
20
  :access_policies,
21
21
  :enabled_for_deployment,
22
22
  :enabled_for_disk_encryption,
23
- :enabled_for_template_deployment
23
+ :enabled_for_template_deployment,
24
+ :tags
24
25
  ]
25
26
  attributes.each do |attribute|
26
27
  assert_respond_to @vault, attribute
@@ -30,7 +30,8 @@ class TestLoadBalancer < Minitest::Test
30
30
  :load_balancing_rules,
31
31
  :probes,
32
32
  :inbound_nat_rules,
33
- :inbound_nat_pools
33
+ :inbound_nat_pools,
34
+ :tags
34
35
  ]
35
36
  attributes.each do |attribute|
36
37
  assert_respond_to @load_balancer, attribute
@@ -44,7 +44,8 @@ class TestNetworkInterface < Minitest::Test
44
44
  :dns_servers,
45
45
  :applied_dns_servers,
46
46
  :internal_dns_name_label,
47
- :internal_fqd
47
+ :internal_fqd,
48
+ :tags
48
49
  ]
49
50
  attributes.each do |attribute|
50
51
  assert_respond_to @network_interface, attribute
@@ -31,7 +31,8 @@ class TestNetworkSecurityGroup < Minitest::Test
31
31
  :network_interfaces_ids,
32
32
  :subnets_ids,
33
33
  :security_rules,
34
- :default_security_rules
34
+ :default_security_rules,
35
+ :tags
35
36
  ]
36
37
  attributes.each do |attribute|
37
38
  assert_respond_to @network_security_group, attribute
@@ -31,7 +31,8 @@ class TestPublicIp < Minitest::Test
31
31
  :ip_configuration_id,
32
32
  :domain_name_label,
33
33
  :fqdn,
34
- :reverse_fqdn
34
+ :reverse_fqdn,
35
+ :tags
35
36
  ]
36
37
  attributes.each do |attribute|
37
38
  assert_respond_to @public_ip, attribute
@@ -34,7 +34,8 @@ class TestVirtualNetwork < Minitest::Test
34
34
  :dns_servers,
35
35
  :subnets,
36
36
  :address_prefixes,
37
- :resource_group
37
+ :resource_group,
38
+ :tags
38
39
  ]
39
40
  attributes.each do |attribute|
40
41
  assert_respond_to @virtual_network, attribute
@@ -23,7 +23,8 @@ class TestResourceGroup < Minitest::Test
23
23
  attributes = [
24
24
  :id,
25
25
  :name,
26
- :location
26
+ :location,
27
+ :tags
27
28
  ]
28
29
  attributes.each do |attribute|
29
30
  assert_respond_to @resource_group, attribute
@@ -39,7 +39,8 @@ class TestDatabase < Minitest::Test
39
39
  :requested_service_objective_id,
40
40
  :requested_service_objective_name,
41
41
  :service_level_objective,
42
- :source_database_id
42
+ :source_database_id,
43
+ :tags
43
44
  ]
44
45
  attributes.each do |attribute|
45
46
  assert_respond_to @database, attribute
@@ -29,7 +29,8 @@ class TestSqlServer < Minitest::Test
29
29
  :state,
30
30
  :administrator_login,
31
31
  :administrator_login_password,
32
- :fully_qualified_domain_name
32
+ :fully_qualified_domain_name,
33
+ :tags
33
34
  ]
34
35
  attributes.each do |attribute|
35
36
  assert_respond_to @sql_server, attribute
@@ -29,7 +29,8 @@ class TestStorageAccount < Minitest::Test
29
29
  :resource_group,
30
30
  :sku_name,
31
31
  :replication,
32
- :encryption
32
+ :encryption,
33
+ :tags
33
34
  ]
34
35
  attributes.each do |attribute|
35
36
  assert_respond_to @storage_account, attribute
@@ -35,7 +35,8 @@ class TestTrafficManagerProfile < Minitest::Test
35
35
  :protocol,
36
36
  :port,
37
37
  :path,
38
- :endpoints
38
+ :endpoints,
39
+ :tags
39
40
  ]
40
41
  attributes.each do |attribute|
41
42
  assert_respond_to @traffic_manager_profile, attribute
@@ -15,15 +15,22 @@ class TestCheckAGExists < Minitest::Test
15
15
  end
16
16
  end
17
17
 
18
- def test_check_ag_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
18
+ def test_check_app_gateway_exists_failure
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
20
  @gateways.stub :get, response do
21
21
  assert !@service.check_ag_exists('fog-test-rg', 'fogRM-rg')
22
22
  end
23
23
  end
24
24
 
25
- def test_check_ag_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
25
+ def test_check_app_gateway_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
27
+ @gateways.stub :get, response do
28
+ assert !@service.check_ag_exists('fog-test-rg', 'fogRM-rg')
29
+ end
30
+ end
31
+
32
+ def test_check_app_gateway_exists_exception
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @gateways.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_ag_exists('fog-test-rg', 'fogRM-rg') }
29
36
  end