IWsEndUserGetSharedStorages Method |
Namespace: Aruba.Cloud.WsEndUser
[OperationContractAttribute] WsResult<PagedList<SharedStorage>> GetSharedStorages( Pagination pagination = null, Sorting sorting = null )
/// IWsEndUser.GetSharedStorages Method (c# .NET) public static string GetSharedStorages(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 GetSharedStorages, // obtaining a WsResultOfArrayOfSharedStorage item WsResultOfArrayOfSharedStorage result = client.GetSharedStorages(); //if the call is Success print values if (result.Success) { // get Value returned from server SharedStorage[] SharedStorages = result.Value; foreach (SharedStorage storage in SharedStorages) { stringBuilder.Append(" ---- Shared Storage ---- "); stringBuilder.Append(" CompanyID: "); stringBuilder.Append(storage.CompanyID); stringBuilder.Append(" CreationDate: "); stringBuilder.Append(storage.CreationDate); stringBuilder.Append(" DataCenterID: "); stringBuilder.Append(storage.DataCenterID); stringBuilder.Append(" DeletionDate: "); stringBuilder.Append(storage.DeletionDate); stringBuilder.Append(" MountPoint: "); stringBuilder.Append(storage.MountPoint); if (storage.PrivateVlan != null) { stringBuilder.Append(" PrivateVlanId: "); stringBuilder.Append(storage.PrivateVlan.PrivateVlanID); stringBuilder.Append(" PrivateVlanName: "); stringBuilder.Append(storage.PrivateVlan.PrivateVlanName); } stringBuilder.Append(" SharedStorageID: "); stringBuilder.Append(storage.SharedStorageID); stringBuilder.Append(" SharedStorageName: "); stringBuilder.Append(storage.SharedStorageName); stringBuilder.Append(" SharedStorageProtocolType: "); stringBuilder.Append(storage.SharedStorageProtocolType); if (storage.SharedStorageIQNs.Length > 0) { foreach (SharedStorageIQN item in storage.SharedStorageIQNs) { stringBuilder.Append(" SharedStorageIQN Id: "); stringBuilder.Append(item.SharedStorageIQNID); stringBuilder.Append(" SharedStorageIQN Status: "); stringBuilder.Append(item.Status); stringBuilder.Append(" SharedStorageIQN Value: "); stringBuilder.Append(item.Value); } } if (storage.SharedStorageResources.Length > 0) { foreach (SharedStorageResource item in storage.SharedStorageResources) { stringBuilder.Append(" SharedStorageResource Id: "); stringBuilder.Append(item.ResourceID); stringBuilder.Append(" SharedStorageResource ProductID: "); stringBuilder.Append(item.ProductID); stringBuilder.Append(" SharedStorageResource ProductID: "); stringBuilder.Append(item.ProductID); } } } } else { throw new ApplicationException(result.ResultMessage); } } catch (Exception ex) { // re-run the error throw new ApplicationException(ex.Message); } return stringBuilder.ToString(); }