fog-azure-rm 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/.arclint +8 -0
  3. data/CHANGELOG.md +10 -0
  4. data/CONTRIBUTORS.md +4 -0
  5. data/lib/fog/azurerm/compute.rb +1 -0
  6. data/lib/fog/azurerm/docs/application_gateway.md +6 -7
  7. data/lib/fog/azurerm/docs/compute.md +45 -11
  8. data/lib/fog/azurerm/docs/dns.md +4 -1
  9. data/lib/fog/azurerm/docs/key_vault.md +3 -0
  10. data/lib/fog/azurerm/docs/network.md +18 -13
  11. data/lib/fog/azurerm/docs/resources.md +11 -8
  12. data/lib/fog/azurerm/docs/sql.md +18 -16
  13. data/lib/fog/azurerm/docs/storage.md +13 -78
  14. data/lib/fog/azurerm/docs/traffic_manager.md +7 -6
  15. data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
  16. data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
  17. data/lib/fog/azurerm/models/compute/creation_data.rb +4 -2
  18. data/lib/fog/azurerm/models/compute/data_disk.rb +26 -0
  19. data/lib/fog/azurerm/models/compute/managed_disk.rb +4 -4
  20. data/lib/fog/azurerm/models/compute/server.rb +31 -5
  21. data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
  22. data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
  23. data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
  24. data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
  25. data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
  26. data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
  27. data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
  28. data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
  29. data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
  30. data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
  31. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
  32. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
  33. data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
  34. data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +49 -13
  35. data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
  36. data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +38 -36
  37. data/lib/fog/azurerm/requests/compute/detach_data_disk_from_vm.rb +1 -2
  38. data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
  39. data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
  40. data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
  41. data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
  42. data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
  43. data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
  44. data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
  45. data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
  46. data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
  47. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
  48. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
  49. data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +1 -1
  50. data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
  51. data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
  52. data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
  53. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
  54. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
  55. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
  56. data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
  57. data/lib/fog/azurerm/storage.rb +0 -19
  58. data/lib/fog/azurerm/version.rb +1 -1
  59. data/test/api_stub.rb +0 -2
  60. data/test/api_stub/models/compute/server.rb +62 -0
  61. data/test/api_stub/requests/compute/virtual_machine.rb +75 -0
  62. data/test/api_stub/requests/resources/resource_group.rb +1 -1
  63. data/test/integration/application_gateway.rb +8 -1
  64. data/test/integration/availability_set.rb +9 -2
  65. data/test/integration/external_load_balancer.rb +2 -1
  66. data/test/integration/internal_load_balancer.rb +2 -1
  67. data/test/integration/key_vault.rb +2 -1
  68. data/test/integration/managed_disk.rb +10 -5
  69. data/test/integration/network_interface.rb +2 -1
  70. data/test/integration/network_security_group.rb +2 -1
  71. data/test/integration/public_ip.rb +2 -1
  72. data/test/integration/resource_group.rb +5 -2
  73. data/test/integration/resource_tag.rb +4 -2
  74. data/test/integration/server.rb +81 -3
  75. data/test/integration/sql_server.rb +10 -2
  76. data/test/integration/storage_account.rb +32 -20
  77. data/test/integration/traffic_manager.rb +6 -1
  78. data/test/integration/virtual_network.rb +2 -1
  79. data/test/integration/virtual_network_gateway_connection.rb +3 -3
  80. data/test/models/application_gateway/test_gateway.rb +2 -1
  81. data/test/models/compute/test_availability_set.rb +2 -1
  82. data/test/models/{storage → compute}/test_data_disk.rb +2 -2
  83. data/test/models/compute/test_managed_disk.rb +2 -1
  84. data/test/models/compute/test_server.rb +31 -2
  85. data/test/models/dns/test_zone.rb +2 -1
  86. data/test/models/key_vault/test_vault.rb +2 -1
  87. data/test/models/network/test_load_balancer.rb +2 -1
  88. data/test/models/network/test_network_interface.rb +2 -1
  89. data/test/models/network/test_network_security_group.rb +2 -1
  90. data/test/models/network/test_public_ip.rb +2 -1
  91. data/test/models/network/test_virtual_network.rb +2 -1
  92. data/test/models/resources/test_resource_group.rb +2 -1
  93. data/test/models/sql/test_database.rb +2 -1
  94. data/test/models/sql/test_sql_server.rb +2 -1
  95. data/test/models/storage/test_storage_account.rb +2 -1
  96. data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
  97. data/test/requests/compute/test_attach_data_disk_to_vm.rb +21 -6
  98. data/test/requests/network/test_check_express_route_cir_auth_exists.rb +1 -1
  99. data/test/requests/network/test_create_load_balancer.rb +3 -2
  100. data/test/requests/network/test_create_network_interface.rb +4 -3
  101. data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
  102. data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
  103. data/test/requests/network/test_create_public_ip.rb +3 -2
  104. data/test/requests/network/test_update_public_ip.rb +3 -2
  105. data/test/requests/resources/test_create_resource_group.rb +3 -2
  106. data/test/requests/resources/test_delete_resource_tag.rb +3 -3
  107. data/test/requests/resources/test_tag_resource.rb +3 -3
  108. data/test/test_helper.rb +0 -14
  109. metadata +5 -36
  110. data/lib/fog/azurerm/models/storage/data_disk.rb +0 -27
  111. data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
  112. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
  113. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
  114. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
  115. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
  116. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
  117. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
  118. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
  119. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
  120. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
  121. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
  122. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
  123. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
  124. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
  125. data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
  126. data/test/api_stub/models/storage/recovery_vault.rb +0 -23
  127. data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
  128. data/test/models/storage/test_recovery_vault.rb +0 -61
  129. data/test/models/storage/test_recovery_vaults.rb +0 -47
  130. data/test/requests/storage/test_create_recovery_vault.rb +0 -35
  131. data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
  132. data/test/requests/storage/test_disable_backup_protection.rb +0 -52
  133. data/test/requests/storage/test_enable_backup_protection.rb +0 -66
  134. data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
  135. data/test/requests/storage/test_get_backup_container.rb +0 -35
  136. data/test/requests/storage/test_get_backup_item.rb +0 -35
  137. data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
  138. data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
  139. data/test/requests/storage/test_get_recovery_vault.rb +0 -35
  140. data/test/requests/storage/test_list_recovery_vault.rb +0 -35
  141. data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
  142. 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
@@ -3,8 +3,8 @@ require File.expand_path '../../test_helper', __dir__
3
3
  # Test class for Data Disk Model
4
4
  class TestDataDisk < Minitest::Test
5
5
  def setup
6
- @service = Fog::Storage::AzureRM.new(credentials)
7
- @data_disk = Fog::Storage::AzureRM::DataDisk.new
6
+ @service = Fog::Compute::AzureRM.new(credentials)
7
+ @data_disk = Fog::Compute::AzureRM::DataDisk.new
8
8
  end
9
9
 
10
10
  def test_model_attributes
@@ -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
@@ -20,7 +20,9 @@ class TestServer < Minitest::Test
20
20
  :redeploy,
21
21
  :list_available_sizes,
22
22
  :attach_data_disk,
23
- :detach_data_disk
23
+ :detach_data_disk,
24
+ :attach_managed_disk,
25
+ :detach_managed_disk
24
26
  ]
25
27
  methods.each do |method|
26
28
  assert_respond_to @server, method
@@ -52,7 +54,10 @@ class TestServer < Minitest::Test
52
54
  :provision_vm_agent,
53
55
  :enable_automatic_updates,
54
56
  :network_interface_card_ids,
55
- :availability_set_id
57
+ :availability_set_id,
58
+ :managed_disk_storage_type,
59
+ :os_disk_size,
60
+ :tags
56
61
  ]
57
62
  attributes.each do |attribute|
58
63
  assert_respond_to @server, attribute
@@ -198,4 +203,28 @@ class TestServer < Minitest::Test
198
203
  assert_instance_of Fog::AzureRM::AsyncResponse, @server.detach_data_disk('disk1', true)
199
204
  end
200
205
  end
206
+
207
+ def test_attach_managed_disk_response
208
+ response = ApiStub::Models::Compute::Server.attach_managed_disk_response(@compute_client)
209
+ @service.stub :attach_data_disk_to_vm, response do
210
+ assert_instance_of Fog::Compute::AzureRM::Server, @server.attach_managed_disk('disk_name', 'resoure_group')
211
+ end
212
+
213
+ async_response = Concurrent::Promise.execute { 10 }
214
+ @service.stub :attach_data_disk_to_vm, async_response do
215
+ assert_instance_of Fog::AzureRM::AsyncResponse, @server.attach_managed_disk('managed_disk_name', 'resoure_group', true)
216
+ end
217
+ end
218
+
219
+ def test_detach_managed_disk_response
220
+ response = ApiStub::Models::Compute::Server.create_linux_virtual_machine_response(@compute_client)
221
+ @service.stub :detach_data_disk_from_vm, response do
222
+ assert_instance_of Fog::Compute::AzureRM::Server, @server.detach_managed_disk('managed_disk_name')
223
+ end
224
+
225
+ async_response = Concurrent::Promise.execute { 10 }
226
+ @service.stub :detach_data_disk_from_vm, async_response do
227
+ assert_instance_of Fog::AzureRM::AsyncResponse, @server.detach_managed_disk('managed_disk_name', true)
228
+ end
229
+ end
201
230
  end
@@ -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