Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 
Computing > 2 - Manipulating the items > Purchasing a Virtual Switch

2.7 Purchasing a Virtual Switch

How to purchase a Virtual Switch

Using Aruba's WsEndUser SetPurchaseVLan method you can purchase a named VLAN. The VLAN registration and association with the account operation is subject to the presence of a credit equal to or greater than the purchase price of this resource. If the registration and assigning of the VLAN operation is completed correctly, the object returned by the SetPurchaseVLan method will contain all the information relating to the resource: name, code, etc.

Parameters
vLanName
Type: string
System.String type value that represents the VLAN name you want to purchase (only letters, numbers and characters -)

Return Value
The method returns a WsResultOfVLan object containing information on the VLAN reserved and assigned to the account
//IWsEndUser.SetPurchaseVLan Method (c# .NET)
private static void PurchaseVLan(WsEndUserClient client)
{
    try
    {
        //calls the SetPurchaseVLan method,
        //getting a WsResult object 
        WsResultOfVLan result = client.SetPurchaseVLan("NewVLan");

        //if the call fails; it relaunches the error indicating the message 
        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the generic error 
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.setPurchaseVLan Method (JAVA)
private static void PurchaseVLan(IWsEndUser client)
{
    try
    {
        //calls the setPurchaseVLan method,
        //getting a WsResult object
        WsResultOfVLan result = client.setPurchaseVLan("NewVLan");

        //if the call fails; it relaunches the error indicating the message 
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error 
        System.out.println(ex);
    }
}

Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also

API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl