Computing > 11 - Private Cloud > Get purchased private clouds

11.1 Get purchased private clouds

By the method GetPurchasedPrivateClouds you can retrieve the list of purchased private clouds.
 
/// IWsEndUser.GetPurchsedPrivateClouds Method (c# .NET)
public static string GetPurchsedPrivateClouds(WsEndUserClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
	// call method GetPurchasedPrivateClouds 
	// obtaining a WsResultOfPrivateCloudEntities item
	WsResultOfPrivateCloudEntities result =
	    client.GetPurchasedPrivateClouds();

	// if the call is Success print returned values
	if (result.Success)
	{
	    stringBuilder.Append("Operation ends successfully\n");

	    // get Value returned from server
	    PrivateCloudEntities items = result.Value;

	    // for each items print the information
	    foreach (PrivateCloudEntity item in items.PrivateClouds)
	    {
		stringBuilder.Append("\nPrivateCloudID: ");
		stringBuilder.Append(item.PrivateCloudID);
		stringBuilder.Append("\nName: ");
		stringBuilder.Append(item.Name);
		stringBuilder.Append("\nStatus: ");
		stringBuilder.Append(item.Status);
	    }
	}
	else
	{
	    throw new ApplicationException(result.ResultMessage);
	}
    }
    catch (Exception ex)
    {
	// re-run the error
	throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// IWsEndUser.GetPurchsedPrivateClouds Method (JAVA)
public static String GetPurchasedPrivateClouds(IWsEndUser client) 
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
	.put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
	.put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder stringBuilder = new StringBuilder();

    try 
    {
        // call method GetPurchasedPrivateClouds 
        // obtaining a WsResultOfPrivateCloudEntities item
        WsResultOfPrivateCloudEntities result =
            client.getPurchasedPrivateClouds();

        //if the call is Success print values
        if (result.isSuccess()) 
	    {
	    PrivateCloudEntities items = result.getValue(); 
	    ArrayOfPrivateCloudEntity arrayOfPrivateCloudEntity = 
		items.getPrivateClouds().getValue();
            List privateCloudEntityList = 
                    arrayOfPrivateCloudEntity.getPrivateCloudEntity();
	
	    for (Iterator it = 
		privateCloudEntityList.iterator(); it.hasNext();)
	    {
	        PrivateCloudEntity item = (PrivateCloudEntity)it.next();
	        stringBuilder.append("\nPrivateCloudID: ");
	        stringBuilder.append(item.getPrivateCloudID());
                stringBuilder.append("\nName: ");
	        stringBuilder.append(item.getName());
                stringBuilder.append("\nStatus: ");
	        stringBuilder.append(item.getStatus());
	    }
        } 
	else 
	{
	    throw new Exception(result.getResultMessage());
        }
    } 
    catch (Exception ex) 
    {
        System.out.println(ex);
    }

return stringBuilder.toString();
}
Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl