Computing > 11 - Private Cloud > Activate private cloud

11.7 Activate private cloud

By the method SetEnqueuePrivateCloudActivation you can activate a private cloud.


Parametres
privateCloudID
Type: Int
Id of a Private Cloud to activate.

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

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
	// call method SetEnqueuePrivateCloudActivation 
	// obtaining a WsResultOfint item
	WsResult result = client.SetEnqueuePrivateCloudActivation(privateCloudID);

	//if the call is Success print value
	if (result.Success)
	{
	    // get Value returned from server
	    stringBuilder.Append(" Operation ends 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.SetEnqueuePrivateCloudActivation Method (JAVA)
private static void SetEnqueuePrivateCloudActivation(IWsEndUser client, 
        Integer privateCloudID)
{
     //specify the account login details 
    ((BindingProvider) client).getRequestContext()
	.put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
	.put(BindingProvider.PASSWORD_PROPERTY, "0123456789");
    
    try
    {
        // call method SetEnqueuePrivateCloudActivation 
        // obtaining a WsResult item
        WsResult result = client.setEnqueuePrivateCloudActivation(privateCloudID);

        //if the call fails, the exception is relaunched 
        //with the indication of the type of error 
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //print the error 
        System.out.println(ex);
    }
}
Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl