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.
- checksums.yaml +4 -4
- data/.arclint +8 -0
- data/.travis.yml +28 -14
- data/CHANGELOG.md +77 -0
- data/CONTRIBUTORS.md +4 -0
- data/fog-azure-rm.gemspec +3 -2
- data/lib/fog/azurerm.rb +1 -0
- data/lib/fog/azurerm/async_response.rb +9 -1
- data/lib/fog/azurerm/compute.rb +3 -1
- data/lib/fog/azurerm/constants.rb +11 -3
- data/lib/fog/azurerm/dns.rb +3 -1
- data/lib/fog/azurerm/docs/application_gateway.md +119 -117
- data/lib/fog/azurerm/docs/compute.md +299 -202
- data/lib/fog/azurerm/docs/dns.md +44 -43
- data/lib/fog/azurerm/docs/key_vault.md +31 -28
- data/lib/fog/azurerm/docs/network.md +407 -404
- data/lib/fog/azurerm/docs/resources.md +52 -49
- data/lib/fog/azurerm/docs/sql.md +56 -54
- data/lib/fog/azurerm/docs/storage.md +92 -157
- data/lib/fog/azurerm/docs/traffic_manager.md +55 -53
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
- data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
- data/lib/fog/azurerm/models/compute/managed_disk.rb +0 -1
- data/lib/fog/azurerm/models/compute/server.rb +61 -11
- data/lib/fog/azurerm/models/compute/servers.rb +2 -2
- data/lib/fog/azurerm/models/dns/a_record.rb +15 -0
- data/lib/fog/azurerm/models/dns/cname_record.rb +15 -0
- data/lib/fog/azurerm/models/dns/record_set.rb +20 -8
- data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
- data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
- data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
- data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
- data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
- data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
- data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
- data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
- data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
- data/lib/fog/azurerm/models/storage/directories.rb +6 -1
- data/lib/fog/azurerm/models/storage/file.rb +2 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +7 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
- data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +1 -1
- data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
- data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +2 -2
- data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +1 -1
- data/lib/fog/azurerm/requests/compute/check_managed_disk_exists.rb +1 -1
- data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +1 -1
- data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +2 -2
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
- data/lib/fog/azurerm/requests/compute/create_image.rb +68 -0
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +302 -135
- data/lib/fog/azurerm/requests/compute/delete_image.rb +29 -0
- data/lib/fog/azurerm/requests/compute/get_image.rb +45 -0
- data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +4 -2
- data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +1 -1
- data/lib/fog/azurerm/requests/dns/check_zone_exists.rb +3 -2
- data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +3 -2
- data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
- data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +1 -1
- data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
- data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_public_ip_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_virtual_network_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
- data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
- data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
- data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +4 -4
- data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
- data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +1 -1
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +1 -1
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +1 -1
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
- data/lib/fog/azurerm/storage.rb +0 -18
- data/lib/fog/azurerm/utilities/general.rb +21 -10
- data/lib/fog/azurerm/version.rb +1 -1
- data/rake-script.sh +7 -1
- data/rakefile +1 -1
- data/test/api_stub.rb +19 -2
- data/test/api_stub/models/compute/server.rb +21 -5
- data/test/api_stub/requests/compute/image.rb +41 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +60 -62
- data/test/api_stub/requests/resources/resource_group.rb +1 -1
- data/test/integration/application_gateway.rb +8 -1
- data/test/integration/availability_set.rb +9 -2
- data/test/integration/external_load_balancer.rb +2 -1
- data/test/integration/internal_load_balancer.rb +2 -1
- data/test/integration/key_vault.rb +2 -1
- data/test/integration/managed_disk.rb +10 -5
- data/test/integration/network_interface.rb +2 -1
- data/test/integration/network_security_group.rb +2 -1
- data/test/integration/public_ip.rb +2 -1
- data/test/integration/record_set.rb +5 -5
- data/test/integration/resource_group.rb +5 -2
- data/test/integration/resource_tag.rb +4 -2
- data/test/integration/server.rb +113 -23
- data/test/integration/server_custom_image.rb +120 -20
- data/test/integration/sql_server.rb +10 -2
- data/test/integration/storage_account.rb +32 -20
- data/test/integration/traffic_manager.rb +6 -1
- data/test/integration/virtual_network.rb +2 -1
- data/test/integration/virtual_network_gateway_connection.rb +3 -3
- data/test/models/application_gateway/test_gateway.rb +2 -1
- data/test/models/compute/test_availability_set.rb +2 -1
- data/test/models/compute/test_managed_disk.rb +2 -1
- data/test/models/compute/test_server.rb +13 -4
- data/test/models/dns/test_zone.rb +2 -1
- data/test/models/key_vault/test_vault.rb +2 -1
- data/test/models/network/test_load_balancer.rb +2 -1
- data/test/models/network/test_network_interface.rb +2 -1
- data/test/models/network/test_network_security_group.rb +2 -1
- data/test/models/network/test_public_ip.rb +2 -1
- data/test/models/network/test_virtual_network.rb +2 -1
- data/test/models/resources/test_resource_group.rb +2 -1
- data/test/models/sql/test_database.rb +2 -1
- data/test/models/sql/test_sql_server.rb +2 -1
- data/test/models/storage/test_storage_account.rb +2 -1
- data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
- data/test/requests/application_gateway/test_check_ag_exists.rb +11 -4
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +2 -2
- data/test/requests/compute/test_check_availability_set_exists.rb +9 -2
- data/test/requests/compute/test_check_managed_disk_exists.rb +9 -2
- data/test/requests/compute/test_check_vm_exists.rb +9 -2
- data/test/requests/compute/test_check_vm_extension_exists.rb +9 -2
- data/test/requests/compute/test_create_image.rb +27 -0
- data/test/requests/compute/test_create_virtual_machine.rb +41 -17
- data/test/requests/compute/test_delete_image.rb +23 -0
- data/test/requests/compute/test_get_image.rb +23 -0
- data/test/requests/dns/test_check_record_set_exists.rb +9 -2
- data/test/requests/dns/test_check_zone_exists.rb +16 -2
- data/test/requests/key_vault/test_check_vault_exists.rb +9 -2
- data/test/requests/network/test_check_express_route_cir_auth_exists.rb +9 -2
- data/test/requests/network/test_check_express_route_circuit_exists.rb +9 -2
- data/test/requests/network/test_check_load_balancer_exists.rb +9 -2
- data/test/requests/network/test_check_local_net_gateway_exists.rb +11 -4
- data/test/requests/network/test_check_net_sec_group_exists.rb +9 -2
- data/test/requests/network/test_check_net_sec_rule_exists.rb +9 -2
- data/test/requests/network/test_check_network_interface_exists.rb +9 -2
- data/test/requests/network/test_check_public_ip_exists.rb +9 -2
- data/test/requests/network/test_check_subnet_exists.rb +9 -2
- data/test/requests/network/test_check_virtual_network_exists.rb +10 -4
- data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +9 -2
- data/test/requests/network/test_check_vnet_gateway_exists.rb +9 -2
- data/test/requests/network/test_create_load_balancer.rb +3 -2
- data/test/requests/network/test_create_network_interface.rb +4 -3
- data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
- data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
- data/test/requests/network/test_create_public_ip.rb +3 -2
- data/test/requests/network/test_update_public_ip.rb +3 -2
- data/test/requests/resources/test_create_resource_group.rb +3 -2
- data/test/requests/resources/test_delete_resource_tag.rb +3 -3
- data/test/requests/resources/test_tag_resource.rb +3 -3
- data/test/requests/storage/test_check_storage_account_exists.rb +8 -1
- data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +9 -2
- data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +9 -2
- data/test/test_helper.rb +5 -14
- metadata +67 -75
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
- data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
- data/test/api_stub/models/storage/recovery_vault.rb +0 -23
- data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
- data/test/models/storage/test_recovery_vault.rb +0 -61
- data/test/models/storage/test_recovery_vaults.rb +0 -47
- data/test/requests/storage/test_create_recovery_vault.rb +0 -35
- data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
- data/test/requests/storage/test_disable_backup_protection.rb +0 -52
- data/test/requests/storage/test_enable_backup_protection.rb +0 -66
- data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
- data/test/requests/storage/test_get_backup_container.rb +0 -35
- data/test/requests/storage/test_get_backup_item.rb +0 -35
- data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
- data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
- data/test/requests/storage/test_get_recovery_vault.rb +0 -35
- data/test/requests/storage/test_list_recovery_vault.rb +0 -35
- data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
- data/test/requests/storage/test_start_backup.rb +0 -55
@@ -49,6 +49,10 @@ module ApiStub
|
|
49
49
|
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fogtestnetworkinterface'
|
50
50
|
}
|
51
51
|
]
|
52
|
+
},
|
53
|
+
'instanceView' => {
|
54
|
+
'platformUpgradeDomain' => 5,
|
55
|
+
'platformFaultDomain' => 2
|
52
56
|
}
|
53
57
|
}
|
54
58
|
}
|
@@ -100,6 +104,10 @@ module ApiStub
|
|
100
104
|
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fogtestnetworkinterface'
|
101
105
|
}
|
102
106
|
]
|
107
|
+
},
|
108
|
+
'instanceView' => {
|
109
|
+
'platformUpgradeDomain' => 5,
|
110
|
+
'platformFaultDomain' => 2
|
103
111
|
}
|
104
112
|
}
|
105
113
|
}
|
@@ -157,12 +165,12 @@ module ApiStub
|
|
157
165
|
},
|
158
166
|
{
|
159
167
|
'lun' => 1, # add new managed datadisk
|
160
|
-
'name' =>
|
161
|
-
'managedDisk'=> {
|
162
|
-
'id'=> '/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/disks/myDisk2',
|
163
|
-
'storageAccountType'=> 'Standard_LRS'
|
168
|
+
'name' => 'datadisk2',
|
169
|
+
'managedDisk' => {
|
170
|
+
'id' => '/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/disks/myDisk2',
|
171
|
+
'storageAccountType' => 'Standard_LRS'
|
164
172
|
},
|
165
|
-
'createOption'=> 'attach'
|
173
|
+
'createOption' => 'attach'
|
166
174
|
}
|
167
175
|
]
|
168
176
|
},
|
@@ -179,6 +187,10 @@ module ApiStub
|
|
179
187
|
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fogtestnetworkinterface'
|
180
188
|
}
|
181
189
|
]
|
190
|
+
},
|
191
|
+
'instanceView' => {
|
192
|
+
'platformUpgradeDomain' => 5,
|
193
|
+
'platformFaultDomain' => 2
|
182
194
|
}
|
183
195
|
}
|
184
196
|
}
|
@@ -240,6 +252,10 @@ module ApiStub
|
|
240
252
|
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fogtestnetworkinterface'
|
241
253
|
}
|
242
254
|
]
|
255
|
+
},
|
256
|
+
'instanceView' => {
|
257
|
+
'platformUpgradeDomain' => 5,
|
258
|
+
'platformFaultDomain' => 2
|
243
259
|
}
|
244
260
|
}
|
245
261
|
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Compute
|
4
|
+
# Mock class for Virtual Machine Requests
|
5
|
+
class Image
|
6
|
+
def self.image_params
|
7
|
+
{
|
8
|
+
resource_group: 'fog-test-rg',
|
9
|
+
vm_name: 'fog-test-server',
|
10
|
+
location: 'westus',
|
11
|
+
platform: 'Linux',
|
12
|
+
new_vhd_path: 'https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd'
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.create_image(compute_client)
|
17
|
+
body = {
|
18
|
+
'location' => 'West US',
|
19
|
+
'tags' => {
|
20
|
+
'key' => 'value'
|
21
|
+
},
|
22
|
+
'properties' => {
|
23
|
+
'storageProfile' => {
|
24
|
+
'osDisk' => {
|
25
|
+
'osType' => 'Linux',
|
26
|
+
'blobUri' => 'https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd',
|
27
|
+
'osState' => 'generalized',
|
28
|
+
'hostCaching' => 'readwrite',
|
29
|
+
'storageAccountType' => 'Standard_LRS'
|
30
|
+
},
|
31
|
+
'provisioningState' => 'Succeeded'
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
image_mapper = Azure::ARM::Compute::Models::Image.mapper
|
36
|
+
compute_client.deserialize(image_mapper, body, 'result.body')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -142,80 +142,78 @@ module ApiStub
|
|
142
142
|
vhd_path: 'https://fogstrg.blob.core.windows.net/customvhd/windows-image.vhd'
|
143
143
|
}
|
144
144
|
end
|
145
|
-
|
145
|
+
|
146
146
|
def self.get_managed_disk_response(compute_client)
|
147
147
|
body = {
|
148
|
-
'id'=> '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Compute/disks/ManagedDataDisk1',
|
149
|
-
'name'=> 'ManagedDataDisk1',
|
150
|
-
'type'=> 'Microsoft.Compute/disks',
|
151
|
-
'location'=> 'eastus',
|
152
|
-
'account_type'=> 'Premium_LRS',
|
153
|
-
|
154
|
-
'time_created'=> {
|
155
|
-
'datetime'=> '((2458025j,52461s,709327300n),+0s,2299161j)'
|
148
|
+
'id' => '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Compute/disks/ManagedDataDisk1',
|
149
|
+
'name' => 'ManagedDataDisk1',
|
150
|
+
'type' => 'Microsoft.Compute/disks',
|
151
|
+
'location' => 'eastus',
|
152
|
+
'account_type' => 'Premium_LRS',
|
153
|
+
|
154
|
+
'time_created' => {
|
155
|
+
'datetime' => '((2458025j,52461s,709327300n),+0s,2299161j)'
|
156
156
|
},
|
157
|
-
|
158
|
-
'creation_data'=> {
|
159
|
-
'create_option'=> 'Empty'
|
160
|
-
},
|
161
|
-
|
162
|
-
'disk_size_gb'=> 100,
|
163
|
-
'provisioning_state'=> 'Succeeded'
|
157
|
+
|
158
|
+
'creation_data' => {
|
159
|
+
'create_option' => 'Empty'
|
160
|
+
},
|
161
|
+
|
162
|
+
'disk_size_gb' => 100,
|
163
|
+
'provisioning_state' => 'Succeeded'
|
164
164
|
}
|
165
165
|
vm_mapper = Azure::ARM::Compute::Models::Disk.mapper
|
166
166
|
compute_client.deserialize(vm_mapper, body, 'result.body')
|
167
167
|
end
|
168
|
-
|
168
|
+
|
169
169
|
def self.get_vm_with_managed_disk_response(compute_client)
|
170
|
-
body = {
|
171
|
-
'id' => '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Compute/virtualMachines/ManagedVM',
|
172
|
-
'name' => 'ManagedVM',
|
173
|
-
'type' => 'Microsoft.Compute/virtualMachines',
|
174
|
-
'location' => 'eastus',
|
175
|
-
'hardware_profile' =>
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
'image_reference'=>
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
},
|
185
|
-
'os_disk'=>
|
186
|
-
{
|
187
|
-
'os_type' => 'Linux',
|
188
|
-
'name' => 'ManagedVM_OsDisk_1_d00cc277b8904c79ae5a777aa3fa5ac3',
|
189
|
-
'caching' => 'ReadWrite',
|
190
|
-
'create_option' => 'FromImage',
|
191
|
-
'disk_size_gb' =>30,
|
192
|
-
'managed_disk' => {
|
193
|
-
'id' => '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Compute/disks/ManagedVM_OsDisk_1_d00cc277b8904c79ae5a777aa3fa5ac3',
|
194
|
-
'storage_account_type' => 'Premium_LRS'
|
195
|
-
}
|
170
|
+
body = {
|
171
|
+
'id' => '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Compute/virtualMachines/ManagedVM',
|
172
|
+
'name' => 'ManagedVM',
|
173
|
+
'type' => 'Microsoft.Compute/virtualMachines',
|
174
|
+
'location' => 'eastus',
|
175
|
+
'hardware_profile' => {
|
176
|
+
'vm_size' => 'Standard_D2s_v3'
|
177
|
+
},
|
178
|
+
'storage_profile' => {
|
179
|
+
'image_reference' => {
|
180
|
+
'publisher' => 'Canonical',
|
181
|
+
'offer' => 'UbuntuServer',
|
182
|
+
'sku' => '16.04-LTS',
|
183
|
+
'version' => 'latest'
|
196
184
|
},
|
197
|
-
'
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
185
|
+
'os_disk' => {
|
186
|
+
'os_type' => 'Linux',
|
187
|
+
'name' => 'ManagedVM_OsDisk_1_d00cc277b8904c79ae5a777aa3fa5ac3',
|
188
|
+
'caching' => 'ReadWrite',
|
189
|
+
'create_option' => 'FromImage',
|
190
|
+
'disk_size_gb' => 30,
|
191
|
+
'managed_disk' => {
|
192
|
+
'id' => '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Compute/disks/ManagedVM_OsDisk_1_d00cc277b8904c79ae5a777aa3fa5ac3',
|
193
|
+
'storage_account_type' => 'Premium_LRS'
|
194
|
+
}
|
195
|
+
},
|
196
|
+
'data_disks' => [{
|
197
|
+
'lun' => 0,
|
198
|
+
'name' => 'ManagedDataDisk1',
|
199
|
+
'caching' => 'None',
|
200
|
+
'create_option' => 'Attach',
|
201
|
+
'disk_size_gb' => 100,
|
202
|
+
'managed_disk' => {
|
203
|
+
'id' => '/subscriptions/{subscription_id}/resourceGroups/MANAGEDRG/providers/Microsoft.Compute/disks/ManagedDataDisk1',
|
204
|
+
'storage_account_type' => 'Premium_LRS'
|
213
205
|
}
|
214
|
-
]
|
215
|
-
},
|
216
|
-
'
|
206
|
+
}]
|
207
|
+
},
|
208
|
+
'network_profile' => {
|
209
|
+
'network_interfaces' => [{
|
210
|
+
'id' => '/subscriptions/{subscription_id}/resourceGroups/ManagedRG/providers/Microsoft.Network/networkInterfaces/managedvm992'
|
211
|
+
}]
|
212
|
+
},
|
213
|
+
'provisioning_state' => 'Succeeded',
|
217
214
|
'vm_id' => '73f38ae6-4767-4325-bd78-9ba4e74337d9'
|
218
215
|
}
|
216
|
+
|
219
217
|
vm_mapper = Azure::ARM::Compute::Models::VirtualMachine.mapper
|
220
218
|
compute_client.deserialize(vm_mapper, body, 'result.body')
|
221
219
|
end
|
@@ -28,12 +28,13 @@ network = Fog::Network::AzureRM.new(
|
|
28
28
|
client_secret: azure_credentials['client_secret'],
|
29
29
|
subscription_id: azure_credentials['subscription_id']
|
30
30
|
)
|
31
|
+
|
31
32
|
########################################################################################################################
|
32
33
|
###################### Resource names #####################
|
33
34
|
########################################################################################################################
|
34
35
|
|
35
36
|
time = current_time
|
36
|
-
resource_group_name = "AG
|
37
|
+
resource_group_name = "TestRG-AG-#{time}"
|
37
38
|
virtual_network_name = "Vnet#{time}"
|
38
39
|
subnet_name = "Sub#{time}"
|
39
40
|
public_ip_name = "Pip#{time}"
|
@@ -82,10 +83,13 @@ begin
|
|
82
83
|
##################### Create Application Gateway ######################
|
83
84
|
#######################################################################################################################
|
84
85
|
|
86
|
+
tags = { key1: 'value1', key2: 'value2' }
|
87
|
+
|
85
88
|
app_gateway = application_gateway.gateways.create(
|
86
89
|
name: app_gateway_name,
|
87
90
|
location: LOCATION,
|
88
91
|
resource_group: resource_group_name,
|
92
|
+
tags: tags,
|
89
93
|
sku_name: 'Standard_Medium',
|
90
94
|
sku_tier: 'Standard',
|
91
95
|
sku_capacity: '2',
|
@@ -151,6 +155,7 @@ begin
|
|
151
155
|
]
|
152
156
|
)
|
153
157
|
puts "Created application gateway #{app_gateway.name}"
|
158
|
+
|
154
159
|
########################################################################################################################
|
155
160
|
###################### Get Application Gateway ######################
|
156
161
|
########################################################################################################################
|
@@ -217,6 +222,7 @@ begin
|
|
217
222
|
unhealthy_threshold: 5
|
218
223
|
)
|
219
224
|
puts 'Added probe in application gateway'
|
225
|
+
|
220
226
|
app_gateway.remove_probe(
|
221
227
|
name: 'Probe1',
|
222
228
|
protocol: 'http',
|
@@ -246,6 +252,7 @@ begin
|
|
246
252
|
|
247
253
|
resource_group = resource.resource_groups.get(resource_group_name)
|
248
254
|
resource_group.destroy
|
255
|
+
|
249
256
|
puts 'Integration Test for application gateway ran successfully'
|
250
257
|
rescue
|
251
258
|
puts 'Integration Test for application gateway is failing'
|
@@ -29,7 +29,7 @@ compute = Fog::Compute::AzureRM.new(
|
|
29
29
|
########################################################################################################################
|
30
30
|
|
31
31
|
time = current_time
|
32
|
-
resource_group_name = "AS
|
32
|
+
resource_group_name = "TestRG-AS-#{time}"
|
33
33
|
unmanaged_as_name_default = "ASUnmanagedDefault#{time}"
|
34
34
|
unmanaged_as_name_custom = "ASUnmanagedCustom#{time}"
|
35
35
|
managed_as_name_default = "ASManagedDefault#{time}"
|
@@ -71,11 +71,14 @@ begin
|
|
71
71
|
###################### Create Unmanaged Availability Set (Default) ######################
|
72
72
|
########################################################################################################################
|
73
73
|
|
74
|
+
tags = { key1: 'value1', key2: 'value2' }
|
75
|
+
|
74
76
|
puts "Create unmanaged default availability set (#{unmanaged_as_name_default}):"
|
75
77
|
avail_set = compute.availability_sets.create(
|
76
78
|
name: unmanaged_as_name_default,
|
77
79
|
location: LOCATION,
|
78
|
-
resource_group: resource_group_name
|
80
|
+
resource_group: resource_group_name,
|
81
|
+
tags: tags
|
79
82
|
)
|
80
83
|
name = avail_set.name
|
81
84
|
fault_domains = avail_set.platform_fault_domain_count
|
@@ -91,6 +94,7 @@ begin
|
|
91
94
|
name: unmanaged_as_name_custom,
|
92
95
|
location: LOCATION,
|
93
96
|
resource_group: resource_group_name,
|
97
|
+
tags: tags,
|
94
98
|
platform_fault_domain_count: 3,
|
95
99
|
platform_update_domain_count: 10
|
96
100
|
)
|
@@ -108,6 +112,7 @@ begin
|
|
108
112
|
name: managed_as_name_default,
|
109
113
|
location: LOCATION,
|
110
114
|
resource_group: resource_group_name,
|
115
|
+
tags: tags,
|
111
116
|
use_managed_disk: true
|
112
117
|
)
|
113
118
|
name = avail_set.name
|
@@ -124,6 +129,7 @@ begin
|
|
124
129
|
name: managed_as_name_custom,
|
125
130
|
location: LOCATION,
|
126
131
|
resource_group: resource_group_name,
|
132
|
+
tags: tags,
|
127
133
|
platform_fault_domain_count: 2,
|
128
134
|
platform_update_domain_count: 10,
|
129
135
|
use_managed_disk: true
|
@@ -170,6 +176,7 @@ begin
|
|
170
176
|
|
171
177
|
rg = rs.resource_groups.get(resource_group_name)
|
172
178
|
rg.destroy
|
179
|
+
|
173
180
|
puts 'Integration test for availability set ran successfully!'
|
174
181
|
rescue
|
175
182
|
puts 'Integration Test for availability set is failing!!!'
|
@@ -61,7 +61,8 @@ begin
|
|
61
61
|
tenant_id: azure_credentials['tenant_id'],
|
62
62
|
sku_family: 'A',
|
63
63
|
sku_name: 'standard',
|
64
|
-
access_policies: access_policies_arr
|
64
|
+
access_policies: access_policies_arr,
|
65
|
+
tags: { key: 'value' }
|
65
66
|
)
|
66
67
|
|
67
68
|
########################################################################################################################
|
@@ -28,9 +28,9 @@ compute = Fog::Compute::AzureRM.new(
|
|
28
28
|
###################### Resource names #####################
|
29
29
|
########################################################################################################################
|
30
30
|
|
31
|
-
time
|
32
|
-
resource_group_name = "MD
|
33
|
-
disk_name
|
31
|
+
time = current_time
|
32
|
+
resource_group_name = "TestRG-MD-#{time}"
|
33
|
+
disk_name = "MD#{time}"
|
34
34
|
|
35
35
|
########################################################################################################################
|
36
36
|
###################### Prerequisites ######################
|
@@ -53,10 +53,13 @@ begin
|
|
53
53
|
###################### Create Managed Disk ######################
|
54
54
|
########################################################################################################################
|
55
55
|
|
56
|
+
tags = { key1: 'value1', key2: 'value2' }
|
57
|
+
|
56
58
|
disk = compute.managed_disks.create(
|
57
59
|
name: disk_name,
|
58
60
|
location: LOCATION,
|
59
61
|
resource_group_name: resource_group_name,
|
62
|
+
tags: tags,
|
60
63
|
account_type: 'Premium_LRS',
|
61
64
|
disk_size_gb: 1023,
|
62
65
|
creation_data: {
|
@@ -78,6 +81,7 @@ begin
|
|
78
81
|
########################################################################################################################
|
79
82
|
###################### List Managed Disks ######################
|
80
83
|
########################################################################################################################
|
84
|
+
|
81
85
|
puts 'List managed disks:'
|
82
86
|
compute.managed_disks(resource_group: resource_group_name).each do |managed_disk|
|
83
87
|
puts managed_disk.name
|
@@ -106,8 +110,9 @@ begin
|
|
106
110
|
|
107
111
|
rg = rs.resource_groups.get(resource_group_name)
|
108
112
|
rg.destroy
|
109
|
-
|
113
|
+
|
114
|
+
puts 'Integration Test for managed disk ran successfully!'
|
110
115
|
rescue
|
111
|
-
puts 'Integration Test for managed disk is failing'
|
116
|
+
puts 'Integration Test for managed disk is failing!'
|
112
117
|
resource_group.destroy unless resource_group.nil?
|
113
118
|
end
|
@@ -106,7 +106,8 @@ begin
|
|
106
106
|
subnet_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-NI/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/mysubnet",
|
107
107
|
public_ip_address_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-NI/providers/Microsoft.Network/publicIPAddresses/mypubip",
|
108
108
|
ip_configuration_name: 'testIpConfiguration',
|
109
|
-
private_ip_allocation_method: 'Dynamic'
|
109
|
+
private_ip_allocation_method: 'Dynamic',
|
110
|
+
tags: { key: 'value' }
|
110
111
|
)
|
111
112
|
puts "Created network interface: #{network_interface.name}"
|
112
113
|
|