private static IAsyncResult BeginJobAction(Job job, OrchestratorApi orchestratorApi, string action, AsyncCallback callback, object state, params OperationParameter[] operationParameters) { if (job == null || job.JobID == Guid.Empty) { throw new ArgumentNullException("job"); } if (orchestratorApi == null) { throw new ArgumentNullException("orchestratorApi"); } if (!ActionExtensions.JobActions.Contains(action)) { throw new ArgumentOutOfRangeException("action", action, "An invalid job action was requested."); } return(orchestratorApi.BeginExecute <Guid>(ActionExtensions.GetActionUri(orchestratorApi.Jobs.RequestUri, job.JobID, action), callback, state, "POST", true, operationParameters)); }
private static IAsyncResult BeginRunbookAction <TElement>(Runbook runbook, OrchestratorApi orchestratorApi, string action, AsyncCallback callback, object state, params OperationParameter[] operationParameters) { if (runbook == null || runbook.RunbookID == Guid.Empty) { throw new ArgumentNullException("runbook"); } if (orchestratorApi == null) { throw new ArgumentNullException("orchestratorApi"); } if (!ActionExtensions.RunbookActions.Contains(action)) { throw new ArgumentOutOfRangeException("action", action, "An invalid Runbook action was requested."); } return(orchestratorApi.BeginExecute <TElement>(ActionExtensions.GetActionUri(orchestratorApi.Runbooks.RequestUri, runbook.RunbookID, action), callback, state, "POST", true, operationParameters)); }