Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 
Computing > 4 - Advanced manipulation of the items > Changing the name of a Cloud Server

4.1.06 Changing the name of a Cloud Server

Using Aruba's WsEndUser SetRenameServer method you can edit the name with which the server is displayed. This will not change the identification code of the server (serverID) in any way, i.e. , the progressive code with which the server is uniquely identified within the system.

Let's look at the example of a method that renames a virtual server.
//IWsEndUser.SetRenameServer Method (c# .NET)
private void RenameVirtualServer(WsEndUserClient client, int serverId, string newName)
{
    try
    {
        //calls the SetRenameServer() method,
        //getting a WsResult object
        WsResult result = client.SetRenameServer(serverId, newName);

        //if the call fails, the exception is relaunched with the error
        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the generic error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.setRenameServer Method (JAVA)
private void RenameVirtualServer(IWsEndUser client, int serverId, String newName)
{
    try
    {
        //calls the setRenameServer() method,
        //getting a WsResult object
        WsResult result = client.setRenameServer(serverId, newName);

        //if the call fails, the exception is relaunched with the error
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error
        System.out.println(ex);
    }
}

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

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

Bookmark and Share