Informazioni commerciali +39 0575 05077
  Assistenza telefonica +39 0575 0508
 
Computing > 6 - Manipolazione Schedulazioni > Modificare una operazione

6.4 Modificare una operazione

Tramite il metodo SetUpdateServerScheduledOperation è possibile modificare un'operazione schedulata riccorente.

Parametri
operationId
Type: int
Oggetto di int che indica l'identificativo dell'operazione da modificare

operationType
Type: ScheduledOperationTypes
Oggetto di ScheduledOperationTypes che indica il tipo di operazione. Operazioni possibili sono:
  • StartVirtualMachine
  • StopVirtualMachine
  • ShutdownVirtualMachine
  • UpdateVirtualMachine
  • CreateSnapshot
  • RestoreSnapShot
  • DeleteSnapshot

operationLabel
Type: string
Oggetto di tipo string che indica una etichetta da assegnare all'operazione

dateStart
Type: DateTime
Oggetto di tipo DateTime che contiene la data di inzio dell'intervallo temporale

dateEnd
Type: DateTime
Oggetto di tipo DateTime che contiene la data finale dell'intervallo temporale

operationParameters
Type: OperationParameters[]
Array di OperationParameters contententi i parametri da inviare all'operazione da avviare.

plan
Type: SchedulePlan
Oggetto di tipo SchedulePlan contentente tutti i parametri di schedulazione.


/// 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();
}
Versione
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
Vedi anche




Bookmark and Share