/// <summary> /// Adds a job to the specified account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='job'> /// The job to be added. /// </param> /// <param name='jobAddOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <JobAddHeaders> AddAsync(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.AddWithHttpMessagesAsync(job, jobAddOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Adds a job to the specified account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='job'> /// The job to be added. /// </param> /// <param name='jobAddOptions'> /// Additional parameters for the operation /// </param> public static JobAddHeaders Add(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IJobOperations)s).AddAsync(job, jobAddOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
public virtual Response Add(JobAddParameter job, JobAddOptions jobAddOptions, CancellationToken cancellationToken = default) { return(RestClient.Add(job, jobAddOptions, cancellationToken).GetRawResponse()); }
/// <summary> /// Adds a Job to the specified Account. /// </summary> /// <remarks> /// The Batch service supports two ways to control the work done as part of a /// Job. In the first approach, the user specifies a Job Manager Task. The /// Batch service launches this Task when it is ready to start the Job. The Job /// Manager Task controls all other Tasks that run under this Job, by using the /// Task APIs. In the second approach, the user directly controls the execution /// of Tasks under an active Job, by using the Task APIs. Also note: when /// naming Jobs, avoid including sensitive information such as user names or /// secret project names. This information may appear in telemetry logs /// accessible to Microsoft Support engineers. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='job'> /// The Job to be added. /// </param> /// <param name='jobAddOptions'> /// Additional parameters for the operation /// </param> public static JobAddHeaders Add(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions)) { return(operations.AddAsync(job, jobAddOptions).GetAwaiter().GetResult()); }
public virtual async Task <Response> AddAsync(JobAddParameter job, JobAddOptions jobAddOptions, CancellationToken cancellationToken = default) { return((await RestClient.AddAsync(job, jobAddOptions, cancellationToken).ConfigureAwait(false)).GetRawResponse()); }