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
)
<OperationContractAttribute>
Function GetVirtualMachineCost (
server As NewServer,
virtualMachineID As Nullable(Of Integer)
) As WsResult(Of VirtualMachineCost)
[OperationContractAttribute]
WsResult<VirtualMachineCost^>^ GetVirtualMachineCost(
NewServer^ server,
Nullable<int> virtualMachineID
)
[<OperationContractAttribute>]
abstract GetVirtualMachineCost :
server : NewServer *
virtualMachineID : Nullable<int> -> WsResult<VirtualMachineCost>
function GetVirtualMachineCost(
server : NewServer,
virtualMachineID : Nullable<int>
) : WsResult<VirtualMachineCost>
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:
WsResultVirtualMachineCostThe method returns an object of type VirtualMachineCost, giving the cost of the machine requested separated by billing type.
Examplespublic VirtualMachineCost GetVirtualMachineCost()
{
using (var client = this.WsEndUserClient)
{
NewServer myServer = new NewServer()
{
AdministratorPassword = "abc123",
Name = "myNewServer",
OSTemplateId = 12,
SmartVMWarePackageID = 1,
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