1.4 Usage Statistics

By the method GetCloudStorageAccountBucketFullVolume you can show the statistics of occupation of space in your cloud storage account.

Returns
The method returns a WsResultOfArrayOfUserBucketFullVolume item with information on the result of the call to the method and statistics of occupation of space.
 
//WsCloudStorage.GetCloudStorageAccountBucketFullVolume Method (c# .NET)
private static String GetCloudStorageAccountBucketFullVolume(WsCloudStorageClient 
    client, int cloudStoraceAccountId, DateTime fromTime)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetCloudStorageAccountBucketFullVolume,
        //obtaining a WsResultOfArrayOfUserBucketFullVolume item
        WsResultOfArrayOfUserBucketFullVolume result =
        client.GetCloudStorageAccountBucketFullVolume(cloudStoraceAccountId, 
            fromTime);

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            UserBucketFullVolume[] arrayOfUserBucketFullVolume = result.Value;
            //browse the list and print the values
            foreach (UserBucketFullVolume userBucketFullVolume in 
                arrayOfUserBucketFullVolume)
            {
                String bucketName = userBucketFullVolume.BucketName;
                stringBuilder.Append(" bucketName: ");
                stringBuilder.Append(bucketName);
            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }

    return stringBuilder.ToString();
}
}
//IWsCloudStorage.GetCloudStorageAccountBucketFullVolume Method Method (JAVA)
private static String GetCloudStorageAccountBucketFullVolume(IWsCloudStorage 
    client, Integer cloudStoraceAccountId, XMLGregorianCalendar fromTime)
{
    StringBuilder sb = new StringBuilder();
    try
    {
        // call method GetCloudStorageAccountBucketFullVolume,
        // obtaining a WsResultOfArrayOfUserBucketFullVolume item
        WsResultOfArrayOfUserBucketFullVolume result = 
            client.getCloudStorageAccountBucketFullVolume(cloudStoraceAccountId, 
            fromTime);
        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess())
        {
            ArrayOfUserBucketFullVolume arrayOfUserBucketFullVolume = 
                result.getValue();

            List<UserBucketFullVolume> listOfArrayOfUserBucketFullVolume = 
                arrayOfUserBucketFullVolume.getUserBucketFullVolume();

            //browse the list and print the values
            for (Iterator<UserBucketFullVolume> it = 
                listOfArrayOfUserBucketFullVolume.iterator(); it.hasNext();)
            {
                UserBucketFullVolume userBucketFullVolume = it.next();
                String bucketName = userBucketFullVolume.getBucketName();
                String bucketOwnerName = userBucketFullVolume.getBucketOwnerName();
                Long fullVolume = userBucketFullVolume.getFullVolume();
                sb.append("BucketName: ");
                sb.append(bucketName);
                sb.append(" bucketOwnerName: ");
                sb.append(bucketOwnerName);
                sb.append(" fullVolume: ");
                sb.append(fullVolume);
            }
        } else
        {
            throw new Exception(result.getResultMessage().getValue());
        }
    } catch (Exception ex)
    {
        //show result
        System.out.println(ex);
    }
    System.out.println("info:" + sb.toString());
    return sb.toString();
}



By the method GetCloudStorageAccountBucketBandwidth you can show the statistics of bandwidth consumption in your cloud storage account.

Returns
The method returns a WsResultOfArrayOfUserBucketBandwidth item with information on the result of the call to the method and the statistics of bandwidth consumption.
 
//WsCloudStorage.GetCloudStorageAccountBucketBandwidth Method (c# .NET)
private static String GetCloudStorageAccountBucketBandwidth(WsCloudStorageClient 
    client, int cloudStoraceAccountId, DateTime fromTime)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetCloudStorageAccountBucketBandwidth,
        //obtaining a WsResultOfArrayOfUserBucketBandwidth item
        WsResultOfArrayOfUserBucketBandwidth result =
        client.GetCloudStorageAccountBucketBandwidth(cloudStoraceAccountId, 
            fromTime);

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            UserBucketBandwidth[] arrayOfUserBucketBandwidth = result.Value;
            //browse the list and print the values
            foreach (UserBucketBandwidth userBucketBandwidth in 
                arrayOfUserBucketBandwidth)
            {
                long volume = userBucketBandwidth.Volume;
                stringBuilder.Append(" volume: ");
                stringBuilder.Append(volume);
            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }

    return stringBuilder.ToString();
}
//IWsCloudStorage.GetCloudStorageAccountBucketBandwidth Method Method (JAVA)
private static String GetCloudStorageAccountBucketBandwidth(IWsCloudStorage client, 
    Integer cloudStoraceAccountId, XMLGregorianCalendar fromTime)
{
    StringBuilder sb = new StringBuilder();
    try
    {
        // call method GetCloudStorageAccountBucketBandwidth,
        // obtaining a WsResultOfArrayOfUserBucketBandwidth item
        WsResultOfArrayOfUserBucketBandwidth result =  
            client.getCloudStorageAccountBucketBandwidth(cloudStoraceAccountId, 
            fromTime);
        if (result.isSuccess())
        {
            ArrayOfUserBucketBandwidth arrayOfUserBucketBandwidth = 
                result.getValue();

            List<UserBucketBandwidth> listOfArrayOfUserBucketBandwidth = 
                arrayOfUserBucketBandwidth.getUserBucketBandwidth();

            //browse the list and print the values
            for (Iterator<UserBucketBandwidth> it = 
                listOfArrayOfUserBucketBandwidth.iterator(); it.hasNext();)
            {
                UserBucketBandwidth userBucketBandwidth = it.next();
                Long bandwidthVolume = userBucketBandwidth.getVolume();
                sb.append("bandwidthVolume: ");
                sb.append(bandwidthVolume);

            }
            //if the call is not successful, re-run the error indicating the 
            //message
        } else
        {
            throw new Exception(result.getResultMessage().getValue());
        }
    } catch (Exception ex)
    {
        //show result
        System.out.println(ex);
    }
    System.out.println("info Bandwidth:" + sb.toString());
    return sb.toString();
}


By the method GetCloudStorageUserBucketRequestsNumber you can show the statistics of number of requests in your cloud storage account.

Returns
The method returns a WsResultOfArrayOfUserBucketRequestsNumber item with information on the result of the call to the method and the statistics of number of requests in your cloud storage account.
 
//WsCloudStorage.GetCloudStorageUserBucketRequestsNumber Method (c# .NET)
private static String GetCloudStorageUserBucketRequestsNumber(WsCloudStorageClient 
    client, int cloudStoraceAccountId, DateTime fromTime)
{

    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetCloudStorageUserBucketRequestsNumber,
        //obtaining a WsResultOfArrayOfUserBucketRequestsNumber item
        WsResultOfArrayOfUserBucketRequestsNumber result =
        client.GetCloudStorageUserBucketRequestsNumber(cloudStoraceAccountId, 
            fromTime);

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            UserBucketRequestsNumber[] arrayOfUserBucketRequestsNumber = 
                result.Value;
            //browse the list and print the values
            foreach (UserBucketRequestsNumber userBucketRequestsNumber in 
                arrayOfUserBucketRequestsNumber)
            {
                long number = userBucketRequestsNumber.Number;
                stringBuilder.Append(" number: ");
                stringBuilder.Append(number);
                System.Console.WriteLine("number" + number);
            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }

    return stringBuilder.ToString();
}
//IWsCloudStorage.GetCloudStorageUserBucketRequestsNumber Method Method (JAVA)
private static String GetCloudStorageUserBucketRequestsNumber(IWsCloudStorage 
    client, Integer cloudStoraceAccountId, XMLGregorianCalendar fromTime)
{
    StringBuilder sb = new StringBuilder();
    try
    {
        // call method GetCloudStorageUserBucketRequestsNumber,
        // obtaining a WsResultOfArrayOfUserBucketRequestsNumber item
        WsResultOfArrayOfUserBucketRequestsNumber result = 
            client.getCloudStorageUserBucketRequestsNumber(cloudStoraceAccountId, 
            fromTime);
        if (result.isSuccess())
        {
            ArrayOfUserBucketRequestsNumber arrayOfUserBucketRequestsNumber = 
                result.getValue();

            List<UserBucketRequestsNumber> 
                listOfArrayOfUserBucketRequestsNumber = 
                arrayOfUserBucketRequestsNumber.getUserBucketRequestsNumber();

            //browse the list and print the values
            for (Iterator<UserBucketRequestsNumber> it = 
                listOfArrayOfUserBucketRequestsNumber.iterator(); it.hasNext();)
            {
                UserBucketRequestsNumber userBucketRequestsNumber = it.next();
                String bucketName = userBucketRequestsNumber.getBucketName();
                String bucketOwnerName = 
                    userBucketRequestsNumber.getBucketOwnerName();
                Long requestsNumber = userBucketRequestsNumber.getNumber();
                sb.append("requestsNumber: ");
                sb.append(requestsNumber);

            }
            //if the call is not successful, re-run the error indicating the 
            //message
        } else
        {
            throw new Exception(result.getResultMessage().getValue());
        }
    } catch (Exception ex)
    {
        //show result
        System.out.println(ex);
    }
    System.out.println("info number:" + sb.toString());
    return sb.toString();
}

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