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

2.5 Purchasing a Public IP

How to purchase a Public IP

Using Aruba's WsEndUser SetPurchaseIpAddress method you can reserve the first free public IP address for the account specified. The registration of the IP address operation is subject to the presence of a credit equal to or greater than the purchase price of the IP address for one hour. If the registration and assigning the free IP address operation is completed correctly, the object returned by the SetPurchaseIpAddress method will contain all the information relating to resource: address, subnet mask, gateway address, etc.
//IWsEndUser.SetPurchaseIpAddress Method (c# .NET)
private static void PurchaseIpAddress(WsEndUserClient client)
{
    try
    {
        //calls the SetPurchaseIpAddress method, 
        //getting a WsResultOfIPAddress object
        WsResultOfIPAddress result = client.SetPurchaseIpAddress();

        //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.setPurchaseIpAddress Method (JAVA)
private static void PurchaseIpAddress(IWsEndUser client)
{
    try
    {
        //calls the setPurchaseIpAddress method, 
        //getting a WsResultOfIPAddress object
        WsResultOfIPAddress result = client.setPurchaseIpAddress();

        //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

Bookmark and Share