Computing > 6 - Schedules Management > Editing an Operation

6.4 Editing an Operation

By using the Aruba WsEndUser method SetUpdateServerScheduledOperation it is possible to update a schedule operation.

Parameters
operationId
Type: int
VAlue of type int ith the identifier of operation to edit

operationType
Type: ScheduledOperationTypes
Value of type ScheduledOperationTypes which contains the operation type :
  • StartVirtualMachine
  • StopVirtualMachine
  • ShutdownVirtualMachine
  • UpdateVirtualMachine
  • CreateSnapshot
  • RestoreSnapShot
  • DeleteSnapshot

operationLabel
Type: string
Value of type string with a label to assign to the operation

dateStart
Type: DateTime
Value of type DateTime which contains the start date of time interval

dateEnd
Type: DateTime
Value of type DateTime which contains the end date of time interval

operationParameters
Type: OperationParameters[]
Array of OperationParameters with the parameters to send to the operation.

plan
Type: SchedulePlan
Value of type SchedulePlan with the settings of operation occurrence.


/// IWsEndUser.SetUpdateServerScheduledOperation Method (c# .NET)
public static string SetUpdateServerScheduledOperation(WsEndUserClient client,
    ScheduledOperationTypes operationType, OperationParameters[] operationParameters,
    int operationId, SchedulePlan plan)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the object SetUpdateScheduledOperationRequest  for the request 
        // with data to process
        SetUpdateScheduledOperationRequest scheduledOperationRequest = 
new SetUpdateScheduledOperationRequest();
        scheduledOperationRequest.OperationType = operationType;
        scheduledOperationRequest.OperationsParameters = operationParameters;
        scheduledOperationRequest.ScheduledOperationId = operationId;
        scheduledOperationRequest.SchedulePlan = plan;

        // call method SetUpdateServerScheduledOperation 
        // obtaining a WsResult item
        WsResult result =
            client.SetUpdateServerScheduledOperation(scheduledOperationRequest);

        //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.SetUpdateServerScheduledOperation Method (JAVA)
public static String SetUpdateServerScheduledOperation(IWsEndUser client,
    ScheduledOperationTypes operationType, 
    ArrayOfOperationParameters operationParameters,
    int operationId, SchedulePlan plan)
{
    //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 SetUpdateScheduledOperationRequest  for the request 
        // with data to process
        SetUpdateScheduledOperationRequest scheduledOperationRequest = 
            new SetUpdateScheduledOperationRequest();
        scheduledOperationRequest.setOperationType(operationType);
        scheduledOperationRequest.setOperationsParameters(operationParameters);
        scheduledOperationRequest.setScheduledOperationId(operationId);
        scheduledOperationRequest.setSchedulePlan(plan);

        // call method SetUpdateServerScheduledOperation 
        // obtaining a WsResult item
        WsResult result =
            client.setUpdateServerScheduledOperation(scheduledOperationRequest);

        //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