1.3 Accounts

By the method GetCloudStorageAccounts you can retrieve the data for a specific Cloud Storage Account.

Returns
The method returns a WsResult item with information on the result of the call to the method and the data for a specific Cloud Storage Account.
 
//WsCloudStorage.GetCloudStorageAccounts Method (c# .NET)
private static String GetCloudStorageAccounts(WsCloudStorageClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetCloudStorageAccounts,
        //obtaining a WsResultOfArrayOfCloudStorageAccount item
        WsResultOfArrayOfCloudStorageAccount result =
        client.GetCloudStorageAccounts();
        System.Console.WriteLine("result.Success " + result.Success);
        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            CloudStorageAccount[] arrayOfCloudStorageAccount = result.Value;
            //browse the list and print the values
            foreach (CloudStorageAccount cloudStorageAccount in               
                arrayOfCloudStorageAccount)
            {
                int cloudStorageAccountID = 
                    cloudStorageAccount.CloudStorageAccountID;
                stringBuilder.Append(" cloudStorageAccountID: ");
                stringBuilder.Append(cloudStorageAccountID);
            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }

    return stringBuilder.ToString();
}
//IWsCloudStorage.GetCloudStorageAccounts Method (JAVA)
private static String GetCloudStorageAccounts(IWsCloudStorage client)
{
    //specify the account login details 
     /*
     ((BindingProvider) client).getRequestContext()
     .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
     ((BindingProvider) client).getRequestContext()
     .put(BindingProvider.PASSWORD_PROPERTY, "1234567890");
     */

    StringBuilder sb = new StringBuilder();

    try
    {
        // call method GetCloudStorageAccounts,
        // obtaining a WsResultOfArrayOfCloudStorageAccount item
        WsResultOfArrayOfCloudStorageAccount result = 
            client.getCloudStorageAccounts();
        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess())
        {
            ArrayOfCloudStorageAccount arrayOfCloudStorageAccount = 
                result.getValue();

            List<CloudStorageAccount> listOfCloudStorageAccount = 
                arrayOfCloudStorageAccount.getCloudStorageAccount();

            //browse the list and print the values
            for (Iterator<CloudStorageAccount> it = 
                listOfCloudStorageAccount.iterator(); it.hasNext();)
            {
                CloudStorageAccount cloudStorageAccount = it.next();
                Integer cloudStorageAccountID = 
                    cloudStorageAccount.getCloudStorageAccountID();
                Integer regionID = cloudStorageAccount.getRegionID();
                Integer userID = cloudStorageAccount.getUserID();
                String userName = cloudStorageAccount.getUserName();
                OverLimitBehavior overLimitBehavior = 
                    cloudStorageAccount.getOverLimitBehavior();
                sb.append("cloudStorageAccountID: ");
                sb.append(cloudStorageAccountID);
                sb.append(" regionID: ");
                sb.append(regionID);
                sb.append(" userID: ");
                sb.append(userID);
                sb.append(" userName: ");
                sb.append(userName);
                sb.append(" overLimitBehavior: ");
                sb.append(overLimitBehavior);
            }
        } else
        {
            throw new Exception(result.getResultMessage().getValue());
        }
    } catch (Exception ex)
    {
        //show error
        System.out.println(ex);
    }

    //show result
    System.out.println("sb: " + sb.toString());
    return sb.toString();
}

Versione
API: v2.8 URL: https://api.services.cloud.it/wsCloudStorage/v2.8/WsCloudStorage.svc?wsdl