Click or drag to resize

IWsEndUserSetAddServerScheduledOperation Method

Create a new scheduled task. By the method SetAddServerScheduledOperation () of Aruba is WsEndUser can create a new scheduled task by specifying the type and date.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult SetAddServerScheduledOperation(
	SetAddScheduledOperationRequest operationRequest
)

Parameters

operationRequest
Type: Aruba.Cloud.Provisioning.EntitiesSetAddScheduledOperationRequest
An object of type ScheduledOperationRequest containing the data of the transaction scheduled to be created. Must be given ScheduleStartDate (execution date), Operation (type of operation), ServerID (if any ServerID) ScheduleOperationLabel (any label), ScheduleOperationsParameters (any parameters for the operation).

Return Value

Type: WsResult
The method returns an object WsResult containing information on the outcome of the method call.
Examples
Below is an example of a method call SetAddServerScheduledOperation() to Aruba WsEndUser:
private void AddScheduledOperation()
{
  ScheduledOperationRequest operationRequest = new ScheduledOperationRequest()
  {
    Operation = ScheduledOperationTypes.StartVirtualMachine,
    ScheduleOperationLabel = "Accensione server Test",
    ScheduleStartDate = DateTime.Now.AddDays(1),
    ServerID = 46
  };

  using (WsEndUserClient client = this.WsEndUserClient)
  {
    WsResult result = client.SetAddServerScheduledOperation(operationRequest);

    if (result.Success)
      return;

    this.LogError("SetAddServerScheduledOperation", new Exception(result.ResultMessage));
    throw new CodedException(result.ResultCode, result.ResultMessage);
  }
}
See Also