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

4.2.8 Initialize a Cloud Server Smart

By the method WsEndUser SetEnqueueReinitializeServer you can reinitialize the server. All data and applications will be lost.

Parameters
serverId
Type: int
Server identification number

administratorPassword
Type: String
The administrator password of the server

    //IWsEndUser.SetEnqueueReinitializeServer Method (c# .NET)
    private static void SetEnqueueReinitializeServer(
        WsEndUserClient client, int serverId,
            String administratorPassword)
    {
        try
        {
            // create the object ReinitializeServerRequest for the request 
            // with data to process
            ReinitializeServerRequest request = new ReinitializeServerRequest();
            request.ServerId = serverId;
            request.AdministratorPassword = administratorPassword;

            //calls the SetEnqueueReinitializeServer method,
            //getting a WsResult object
            WsResult result = client.SetEnqueueReinitializeServer(request);

            //if the call fails; it relaunches the error indicating the message
            if (!result.Success)
                throw new ApplicationException(result.ResultMessage);
        }
        catch (Exception ex)
        {
            //relaunches the generic error
            throw new ApplicationException(ex.Message);
        }
    }
    
    //IWsEndUser.SetEnqueueReinitializeServer Method (Java)
    private static void SetEnqueueReinitializeServer(
        IWsEndUser client, int serverId, String administratorPassword)
    {
        try
        {
            // create the object ReinitializeServerRequest for the request 
            // with data to process
            ReinitializeServerRequest request = new ReinitializeServerRequest();
            request.ServerId = serverId;
            request.AdministratorPassword = administratorPassword;

            //calls the SetEnqueueReinitializeServer method,
            //getting a WsResult object
            WsResult result = client.SetEnqueueReinitializeServer(request);

            //if the call fails; it relaunches the error indicating the message
            if (!result.Success)
               throw new Exception(result.getResultMessage());
        }
        catch (Exception ex)
        {
             System.out.println(ex);
        }
    }
    
Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc