Computing > 7 - Unified Storage Management > Rename a Unified Storage

7.5 Rename a Unified Storage

By using the Aruba WsEndUser method SetRenameSharedStorage you can change the name of a network storage.

Parameters
storageId
Type: int
Value of type int with the storage identifier.


/// IWsEndUser.SetRenameSharedStorage Method (c# .NET)
public static string SetRenameSharedStorage(WsEndUserClient client,
    int storageId, String storageName)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the object RenameSharedStorageRequest  for the request 
        // with data to process
        RenameSharedStorageRequest request = 
            new RenameSharedStorageRequest();
        request.SharedStorageID = storageId;
        request.SharedStorageName = storageName;

        // call method SetRenameSharedStorage 
        // obtaining a WsResult item
        WsResult result = client.SetRenameSharedStorage(request);

        //if the call is Success print history values
        if (result.Success)
        {
            // get Value returned from server
            stringBuilder.Append(" Operation successfully. Result Code : ");
            stringBuilder.Append(result.ResultCode);
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
// IWsEndUser.SetRenameSharedStorage Method (JAVA)
public static String SetRenameSharedStorage(IWsEndUser client,
   int storageId, String storageName)
{
//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
    {
	// create the object RenameSharedStorageRequest  for the request 
	// with data to process
	RenameSharedStorageRequest request = new RenameSharedStorageRequest();
	request.setSharedStorageID(storageId);
	request.setSharedStorageName(storageName);

	// call method SetRenameSharedStorage 
	// obtaining a WsResult item
	WsResult result = client.setRenameSharedStorage(request);

	//if the call is Success print history values
	if (result.isSuccess())
	{
	    // get Value returned from server
	    stringBuilder.append(" Operation successfully. Result Code : ");
	    stringBuilder.append(result.getResultCode());
	}
	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