Click or drag to resize

IWsCloudStorageGetCloudStorageAccountBucketBandwidth Method

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

Namespace:  Aruba.Cloud.WsCloudStorage
Assembly:  WsCloudStorage (in WsCloudStorage.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<UserBucketBandwidth>> GetCloudStorageAccountBucketBandwidth(
	int cloudStorageAccountID,
	Nullable<DateTime> fromTime
)

Parameters

cloudStorageAccountID
Type: SystemInt32
fromTime
Type: SystemNullableDateTime

Return Value

Type: WsResultListUserBucketBandwidth
Examples
        //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();
}
See Also