Computing > 7 - Unified Storage Management > Get the list of Unified Storage

7.1 Get the list of Unified Storage

By using the Aruba WsEndUser method GetSharedStorages you can show your network storages.

/// 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();
}
// IWsEndUser.GetSharedStorages  Method (JAVA)
public static String GetSharedStorages(IWsEndUser client)
{
	//specify the account login details 
	((BindingProvider) client).getRequestContext()
		.put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
	((BindingProvider) client).getRequestContext()
		.put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

	StringBuilder stringBuilder = new StringBuilder();

	try
	{
	    // call method GetSharedStorages, 
	    // obtaining a WsResultOfArrayOfSharedStorage item               
	    WsResultOfArrayOfSharedStorage result = client.getSharedStorages();

	    System.out.println(result.isSuccess());
	    //if the call is Success print values
	    if (result.isSuccess())
	    {
		System.out.println(result.getValue().getSharedStorage().size());
		// get Value returned from server
		for (SharedStorage sharedStorage : 
                    result.getValue().getSharedStorage())  
		{
		    stringBuilder.append(" ---- Shared Storage ---- ");
		    stringBuilder.append(" CompanyID: ");
		    stringBuilder.append(sharedStorage.getCompanyID());
		    stringBuilder.append(" CreationDate: ");
		    stringBuilder.append(sharedStorage.getCreationDate());
		    stringBuilder.append(" DataCenterID: ");
		    stringBuilder.append(sharedStorage.getDataCenterID());
		    stringBuilder.append(" DeletionDate: ");
		    stringBuilder.append(sharedStorage.getDeletionDate());
		    stringBuilder.append(" MountPoint: ");
		    stringBuilder.append(sharedStorage.getMountPoint());
		    stringBuilder.append(" PrivateVlanId: ");
                    stringBuilder.append(sharedStorage.getPrivateVlan().
                        getPrivateVlanID());
		    stringBuilder.append(" PrivateVlanName: ");
		    stringBuilder.append(sharedStorage.getPrivateVlan().
                    getPrivateVlanName());
		    stringBuilder.append(" SharedStorageID: ");
		    stringBuilder.append(sharedStorage.getSharedStorageID());
		    stringBuilder.append(" SharedStorageName: ");
		    stringBuilder.append(sharedStorage.getSharedStorageName());
		    stringBuilder.append(" SharedStorageProtocolType: ");
		    stringBuilder.append(sharedStorage.getSharedStorageProtocolType());

		    if (sharedStorage.getSharedStorageIQNs().
			    getSharedStorageIQN().size() > 0)
		    {
			for (SharedStorageIQN 
				item : sharedStorage.getSharedStorageIQNs().
                                getSharedStorageIQN())
			{
			    stringBuilder.append(" SharedStorageIQN Id: ");
			    stringBuilder.append(item.getSharedStorageIQNID());
			    stringBuilder.append(" SharedStorageIQN Status: ");
			    stringBuilder.append(item.getStatus());
			    stringBuilder.append(" SharedStorageIQN Value: ");
			    stringBuilder.append(item.getValue());
			}
		    }

		    if (sharedStorage.getSharedStorageResources().
			    getSharedStorageResource().size() > 0)
		    {
			for (SharedStorageResource 
				item : sharedStorage.getSharedStorageResources().
                                getSharedStorageResource())
			{
			    stringBuilder.append(" SharedStorageResource Id: ");
			    stringBuilder.append(item.getResourceID());
			    stringBuilder.append(" SharedStorageResource ProductID: ");
			    stringBuilder.append(item.getProductID());
			    stringBuilder.append(" SharedStorageResource ProductID: ");
			    stringBuilder.append(item.getProductID());
			}
		    }

		}
	    }
	    else
	    {
		throw new Exception(result.getResultMessage());
	    }
	}
	catch (Exception ex)
	{
	    //show error
	    System.out.println(ex);
	}

	return stringBuilder.toString();
}

Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also