test/api_stub/models/compute/server.rb in fog-azure-rm-temp-0.0.3 vs test/api_stub/models/compute/server.rb in fog-azure-rm-temp-0.0.4
- old
+ new
@@ -122,9 +122,71 @@
}'
vm_mapper = Azure::ARM::Compute::Models::VirtualMachineSizeListResult.mapper
compute_client.deserialize(vm_mapper, Fog::JSON.decode(body), 'result.body').value
end
+ def self.attach_managed_disk_response(compute_client)
+ body = {
+ 'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server',
+ 'name' => 'fog-test-server',
+ 'location' => 'West US',
+ 'properties' => {
+ 'hardwareProfile' => {
+ 'vmSize' => 'Basic_A0'
+ },
+ 'storageProfile' => {
+ 'imageReference' => {
+ 'publisher' => 'Canonical',
+ 'offer' => 'UbuntuServer',
+ 'sku' => '14.04.2-LTS',
+ 'version' => 'latest'
+ },
+ 'osDisk' => {
+ 'name' => 'fog-test-server_os_disk',
+ 'vhd' => {
+ 'uri' => 'http://storageAccount.blob.core.windows.net/vhds/fog-test-server_os_disk.vhd'
+ }
+ },
+ 'dataDisks' => [
+ {
+ 'name' => 'disk1',
+ 'diskSizeGB' => '10',
+ 'lun' => 0,
+ 'vhd' => {
+ 'uri' => 'http://mystorage1.blob.core.windows.net/vhds/disk1.vhd'
+ }
+ },
+ {
+ 'lun' => 1, # add new managed datadisk
+ 'name' => "datadisk2",
+ 'managedDisk'=> {
+ 'id'=> '/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/disks/myDisk2',
+ 'storageAccountType'=> 'Standard_LRS'
+ },
+ 'createOption'=> 'attach'
+ }
+ ]
+ },
+ 'osProfile' => {
+ 'computerName' => 'fog-test-server',
+ 'adminUsername' => 'shaffan',
+ 'linuxConfiguration' => {
+ 'disablePasswordAuthentication' => false
+ }
+ },
+ 'networkProfile' => {
+ 'networkInterfaces' => [
+ {
+ 'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fogtestnetworkinterface'
+ }
+ ]
+ }
+ }
+ }
+ vm_mapper = Azure::ARM::Compute::Models::VirtualMachine.mapper
+ compute_client.deserialize(vm_mapper, body, 'result.body')
+ end
+
def self.attach_data_disk_response(compute_client)
body = {
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server',
'name' => 'fog-test-server',
'location' => 'West US',