Click or drag to resize

IWsEndUserGetVirtualMachineCost Method

The method return the cost of the requested server. If the parameter "server" is specified, it calculates the cost based on the object specification. If the parameter "virtualMachineID" is speicifed, it calculates the cost based on the VM existing specifications. NOTE: It's not possible to use both parameters together.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<VirtualMachineCost> GetVirtualMachineCost(
	NewServer server,
	Nullable<int> virtualMachineID
)

Parameters

server
Type: Aruba.Cloud.Provisioning.EntitiesNewServer
Object of type NewServer specifing the Virtual Machine details
virtualMachineID
Type: SystemNullableInt32
The ID of the existing Virtual Machine

Return Value

Type: WsResultVirtualMachineCost
The method returns an object of type VirtualMachineCost, giving the cost of the machine requested separated by billing type.
Examples
public VirtualMachineCost GetVirtualMachineCost()
{
    using (var client = this.WsEndUserClient)
    {
        NewServer myServer = new NewServer()
        {
            AdministratorPassword = "abc123",
            Name = "myNewServer",
            OSTemplateId = 12,  //you must retrieve a valid ID
            SmartVMWarePackageID = 1, //you must retrieve a valid ID
            ConfigureIPv6 = false,
            IsLuckySmart = true
        };

        WsResultOfVirtualMachineCost result = client.GetVirtualMachineCost(myServer, null);
        if (result.Success)
            return result.Value;
        else
        {
            throw new CodedException(GetErrorCode(result.ResultCode), result.ResultMessage);
        }
    }
}
See Also