/// <summary>
 /// Deletes a job.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='jobId'>
 /// Id of the job to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse Delete(this IJobOperations operations, string jobId)
 {
     try
     {
         return(operations.DeleteAsync(jobId).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Deletes a job.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='jobId'>
 /// Id of the job to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> DeleteAsync(this IJobOperations operations, string jobId)
 {
     return(operations.DeleteAsync(jobId, CancellationToken.None));
 }
示例#3
0
 /// <summary>
 /// Deletes a Job.
 /// </summary>
 /// <remarks>
 /// Deleting a Job also deletes all Tasks that are part of that Job, and all
 /// Job statistics. This also overrides the retention period for Task data;
 /// that is, if the Job contains Tasks which are still retained on Compute
 /// Nodes, the Batch services deletes those Tasks' working directories and all
 /// their contents.  When a Delete Job request is received, the Batch service
 /// sets the Job to the deleting state. All update operations on a Job that is
 /// in deleting state will fail with status code 409 (Conflict), with
 /// additional information indicating that the Job is being deleted.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job to delete.
 /// </param>
 /// <param name='jobDeleteOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static JobDeleteHeaders Delete(this IJobOperations operations, string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions))
 {
     return(operations.DeleteAsync(jobId, jobDeleteOptions).GetAwaiter().GetResult());
 }
示例#4
0
 /// <summary>
 /// Delete a stream analytics job.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.StreamAnalytics.IJobOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the stream analytics job.
 /// </param>
 /// <param name='jobName'>
 /// Required. A unique stream analytics job name.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static Task <LongRunningOperationResponse> DeleteAsync(this IJobOperations operations, string resourceGroupName, string jobName)
 {
     return(operations.DeleteAsync(resourceGroupName, jobName, CancellationToken.None));
 }