IWsEndUserCheckEnqueueServerCreation Method |
Namespace: Aruba.Cloud.WsEndUser
private static void CreateServer() { try { NewServer serverToCreate = new NewServer() { AdministratorPassword = "Passw@ord", CPUQuantity = 4, Name = "NewServer01", OSTemplateId = 5, RAMQuantity = 8 , /* Additional licenses are used only when an existing HardDisk (loaded through FTP) is connected to VM and the user must specify the licenses used in that template. */ AdditionalLicenses = new List<TemplateLicense>() { new TemplateLicense(){TemplateLicenseID = 60, DefaultValue = 1 }, new TemplateLicense(){TemplateLicenseID = 93, DefaultValue = 5 } }, VirtualDisks = new List<VirtualDiskDetails>() { new VirtualDiskDetails (){ Size = 10, VirtualDiskType = VirtualDiskTypes.PrimaryVirtualDisk }, new VirtualDiskDetails (){ Size = 50, VirtualDiskType = VirtualDiskTypes.AdditionalVirtualDisk1 }, }.ToArray(), Note = "Server creato tramite chiamata a WSEndUser", NetworkAdaptersConfiguration = new List<NetworkAdapterConfiguration>() { new NetworkAdapterConfiguration () { NetworkAdapterType = NetworkAdapterTypes.Ethernet0, PrivateVLan = new PrivateVLanDetails() { Gateway = "82.149.68.75", IPAddress = "95.110.154.9", SubNetMask = "255.255.255.0", PrivateVLanResourceId = 2647 } } }.ToArray() }; WsResult result = client.SetEnqueueServerCreation(serverToCreate); if (!result.Success) { throw new ApplicationException(String.Format( "An error has occurred while invoking SetEnqueueServerCreation(). {0}", result.ResultMessage)); } } catch (Exception ex) { //rethrowing error throw new ApplicationException(String.Format("An error has occurred while taking a snapshot{0}", ex.Message)); } }