IWsCloudStorageGetCloudStorageAccountBucketBandwidth Method |
Namespace: Aruba.Cloud.WsCloudStorage
[OperationContractAttribute] WsResult<List<UserBucketBandwidth>> GetCloudStorageAccountBucketBandwidth( int cloudStorageAccountID, Nullable<DateTime> fromTime )
//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(); }