3.1 Price List

Using Aruba's WsEndUser GetPriceList method you can get the hourly price lists applied to the account specified during authentication.
The hourly cost of the various resources can vary depending on different factors such as hypervisors and client.

In the following example a method that use a call to Aruba's WsEndUser GetPriceList method gets a list of PriceList type objects.
//IWsEndUser.GetPriceList Method (c# .NET)
private static List<string> GetPriceList(WsEndUserClient client)
{
     List<string> prices = new List<string>();

    try
    {
        //calls the GetPriceList method,
        //getting a WsResultOfArrayOfPriceList object 
        WsResultOfArrayOfPriceList result = client.GetPriceList();
        if (result.Success)
        {
            prices.Add("Price List");
                    
            //gets the price lists for the account indicated 
            foreach (PriceList priceList in result.Value)
            {
                //retrieves the prices for each price list
                foreach (Price price in priceList.Values)
                {
                    //adds the price data to the list in a string variable
                    prices.Add(String.Format("ID:{0} - Hypervisor:{1} - " +
                    "ResourceType:{2} - TimeUnitInHours:{3} - Price: {4} {5}",
                    price.ProductID.ToString(), price.HypervisorType.ToString(),
                    price.ResourceType.ToString(), price.TimeUnitInHours.ToString(),
                    price.Value.ToString(), priceList.CurrencyCode));
                }
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //relaunches the error  
        throw new ApplicationException(ex.Message);
    }

    //returns the price list prices
    return prices;
}
//IWsEndUser.getPriceList Method (JAVA)
private static List<String> GetPriceList(IWsEndUser client)
{
    List<String> prices = new ArrayList<String>();
    try
    {
        //calls the getPriceList method,
        //getting a WsResultOfArrayOfPriceList object  
        WsResultOfArrayOfPriceList result = client.getPriceList();
        if (result.isSuccess())
        {
            prices.add("Price List");
                    
            //gets the price lists for the account indicated  
            for (PriceList priceList : result.getValue().getPriceList())
            {
                //retrieves the prices for each price list
                for (Price price : priceList.getValues().getPrice())
                {
                    //adds the price data to the list in a string variable
                    prices.add(String.format("ID:{%d} - Hypervisor:{%s} - " +
                        "ResourceType:{%s} - TimeUnitInHours:{%d} - Price: {%f} {%s}",
                        price.getProductID(), price.getHypervisorType().value(),
                        price.getResourceType().value(), price.getTimeUnitInHours(),
                        price.getValue().floatValue(), 
                        priceList.getCurrencyCode()));
                }
            }
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error 
        System.out.println(ex);
    }

    //returns the price list prices
    return prices;
}

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/IWsEndUser/v2.8/IWsEndUser.svc?wsdl