Click or drag to resize

IWsEndUserGetSharedStorages Method

By the method GetSharedStorages you can show your network storages

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<PagedList<SharedStorage>> GetSharedStorages(
	Pagination pagination = null,
	Sorting sorting = null
)

Parameters

pagination (Optional)
Type: Pagination
sorting (Optional)
Type: Sorting

Return Value

Type: WsResultPagedListSharedStorage
The method returns your network storages
Examples
        /// 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();
}
See Also