Computing > 6 - Schedules Management > Deleting an Operation

6.6 Deleting an Operation

By using the Aruba WsEndUser method SetRemoveServerScheduledOperation it is possible to delete a scheduled operation.

Parameters
operationId
Type: int
Value of type int wwith the operation identifier


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

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the object SetRemoveScheduledOperationRequest  for the request 
        // with data to process
        SetRemoveScheduledOperationRequest request = 
            new SetRemoveScheduledOperationRequest();
        request.ScheduledOperationId = operationId;

        // call method SetRemoveServerScheduledOperation 
        // obtaining a WsResult item
        WsResult result =
            client.SetRemoveServerScheduledOperation(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.SetRemoveServerScheduledOperation Method (JAVA)
public static String SetRemoveServerScheduledOperation(IWsEndUser client,
    int operationId)
{
    //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 SetRemoveScheduledOperationRequest  for the request 
        // with data to process
        SetRemoveScheduledOperationRequest request = 
            new SetRemoveScheduledOperationRequest();
        request.setScheduledOperationId(operationId);

        // call method SetRemoveServerScheduledOperation 
        // obtaining a WsResult item
        WsResult result =
            client.setRemoveServerScheduledOperation(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.ResultCode);
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //show result
        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