Click or drag to resize

IJsonpWsEndUserSetAddServerScheduledOperation 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]
[WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "SetAddServerScheduledOperation/{jsonp}/{userName}/{token}?serverId={serverId}&operationType={operationType}&operationsParameters={operationsParameters}&newSchedulePlan={newSchedulePlan}")]
Stream SetAddServerScheduledOperation(
	string jsonp,
	string userName,
	string token,
	int serverId,
	string operationType,
	string operationsParameters,
	string newSchedulePlan
)

Parameters

jsonp
Type: SystemString
userName
Type: SystemString
token
Type: SystemString
serverId
Type: SystemInt32
operationType
Type: SystemString
operationsParameters
Type: SystemString
newSchedulePlan
Type: SystemString

Return Value

Type: Stream
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