/// <summary> /// Get the list of jobs in a job collection matching a filter on job /// state. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the List Jobs with filter /// operation. /// </param> /// <returns> /// The List Jobs operation response. /// </returns> public static Task <JobListResponse> ListWithFilterAsync(this IJobOperations operations, JobListWithFilterParameters parameters) { return(operations.ListWithFilterAsync(parameters, CancellationToken.None)); }
/// <summary> /// Initiates cancel on given running job in the specified HDInsight. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobId'> /// The id of the job. /// </param> public static JobDetailRootJsonObject Kill(this IJobOperations operations, string jobId) { return(operations.KillAsync(jobId).GetAwaiter().GetResult()); }
/// <summary> /// Gets a single spark session job logs. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sessionId'> /// Identifier for the session job. /// </param> /// <param name='fromParameter'> /// Optional param specifying which index the list should begin from. /// </param> /// <param name='size'> /// Optional param specifying the size of the returned list. /// By default it is 20 and that is the maximum. /// </param> public static SparkJobLog GetSparkSessionLog(this IJobOperations operations, int sessionId, int?fromParameter = default(int?), int?size = default(int?)) { return(operations.GetSparkSessionLogAsync(sessionId, fromParameter, size).GetAwaiter().GetResult()); }
/// <summary> /// Gets application state from the specified HDInsight cluster. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='appId'> /// The id of the job. /// </param> public static AppState GetAppState(this IJobOperations operations, string appId) { return(operations.GetAppStateAsync(appId).GetAwaiter().GetResult()); }
/// <summary> /// List all spark sessions. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fromParameter'> /// Optional param specifying which index the list should begin from. /// </param> /// <param name='size'> /// Optional param specifying the size of the returned list. /// By default it is 20 and that is the maximum. /// </param> public static SparkSessionCollection ListSparkSessionJob(this IJobOperations operations, int?fromParameter = default(int?), int?size = default(int?)) { return(operations.ListSparkSessionJobAsync(fromParameter, size).GetAwaiter().GetResult()); }
/// <summary> /// Kill a statement within a session. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sessionId'> /// Identifier for the session. /// </param> /// <param name='statementId'> /// Identifier for the statement. /// </param> /// <param name='requestedBy'> /// Add default value for X-Requested-By in header. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SparkStatementCancellationResult> DeleteSparkStatementJobAsync(this IJobOperations operations, int sessionId, int statementId, string requestedBy = "ambari", CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteSparkStatementJobWithHttpMessagesAsync(sessionId, statementId, requestedBy, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Submits a MapReduce streaming job to an HDInsight cluster. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='content'> /// The content of the MapReduce job request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <JobSubmissionJsonResponse> SubmitMapReduceStreamingJobAsync(this IJobOperations operations, Stream content, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.SubmitMapReduceStreamingJobWithHttpMessagesAsync(content, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve a list of jobs. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> public static IPage <JobCollectionItem> ListByAutomationAccount(this IJobOperations operations, string resourceGroupName, string automationAccountName, ODataQuery <JobCollectionItem> odataQuery = default(ODataQuery <JobCollectionItem>), string clientRequestId = default(string)) { return(operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, odataQuery, clientRequestId).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve a list of jobs. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <JobCollectionItem> > ListByAutomationAccountAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, ODataQuery <JobCollectionItem> odataQuery = default(ODataQuery <JobCollectionItem>), string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, odataQuery, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public Scheduler(ITaskOperations taskOperations, IConfig config, IPoolOperations poolOperations, ILogTracer logTracer, IJobOperations jobOperations, IContainers containers) { _taskOperations = taskOperations; _config = config; _poolOperations = poolOperations; _logTracer = logTracer; _jobOperations = jobOperations; _containers = containers; }
/// <summary> /// Create a job of the runbook. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='parameters'> /// The parameters supplied to the create job operation. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> public static Job Create(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, JobCreateParameters parameters, string clientRequestId = default(string)) { return(operations.CreateAsync(resourceGroupName, automationAccountName, jobName, parameters, clientRequestId).GetAwaiter().GetResult()); }
/// <summary> /// Creates a new Job, allowing the service to generate a job id. Use /// CreateOrUpdate if a user-chosen job id is required. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='parameters'> /// Required. Parameters specifying the job definition for a Create Job /// operation. /// </param> /// <returns> /// The Create Job operation response. /// </returns> public static Task <JobCreateResponse> CreateAsync(this IJobOperations operations, JobCreateParameters parameters) { return(operations.CreateAsync(parameters, CancellationToken.None)); }
/// <summary> /// Update the state of a job. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='jobId'> /// Required. Id of the job to update. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Job State operation. /// </param> /// <returns> /// The Update Job State operation response. /// </returns> public static Task <JobUpdateStateResponse> UpdateStateAsync(this IJobOperations operations, string jobId, JobUpdateStateParameters parameters) { return(operations.UpdateStateAsync(jobId, parameters, CancellationToken.None)); }
/// <summary> /// Update the state of all jobs in a job collections. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Jobs State operation. /// </param> /// <returns> /// The Update Jobs State operation response. /// </returns> public static Task <JobCollectionJobsUpdateStateResponse> UpdateJobCollectionStateAsync(this IJobOperations operations, JobCollectionJobsUpdateStateParameters parameters) { return(operations.UpdateJobCollectionStateAsync(parameters, CancellationToken.None)); }
/// <summary> /// Submits a MapReduce job to an HDInsight cluster. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.HDInsight.Job.IJobOperations. /// </param> /// <param name='parameters'> /// Required. MapReduce job parameters. /// </param> /// <returns> /// The Create Job operation response. /// </returns> public static JobSubmissionJsonResponse SubmitMapReduceJob(this IJobOperations operations, MapReduceJobSubmissionParameters parameters) { return(operations.SubmitMapReduceJobAsync(parameters).GetAwaiter().GetResult()); }
/// <summary> /// Resume the job identified by jobName. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> public static void Resume(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { operations.ResumeAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); }
/// <summary> /// Gets the list of jobs from the specified HDInsight cluster. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IList <JobListJsonObject> List(this IJobOperations operations) { return(operations.ListAsync().GetAwaiter().GetResult()); }
/// <summary> /// Resume the job identified by jobName. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ResumeAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobid'> /// JobId from where to list jobs. /// </param> /// <param name='numrecords'> /// Number of jobs to fetch. /// </param> public static IList <JobListJsonObject> ListAfterJobId(this IJobOperations operations, string jobid = default(string), int?numrecords = default(int?)) { return(operations.ListAfterJobIdAsync(jobid, numrecords).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve a list of jobs. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> public static IPage <JobCollectionItem> ListByAutomationAccountNext(this IJobOperations operations, string nextPageLink, string clientRequestId = default(string)) { return(operations.ListByAutomationAccountNextAsync(nextPageLink, clientRequestId).GetAwaiter().GetResult()); }
/// <summary> /// Submits a Sqoop job to an HDInsight cluster. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='content'> /// The content of the Sqoop job request. /// </param> public static JobSubmissionJsonResponse SubmitSqoopJob(this IJobOperations operations, Stream content) { return(operations.SubmitSqoopJobAsync(content).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve a list of jobs. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <JobCollectionItem> > ListByAutomationAccountNextAsync(this IJobOperations operations, string nextPageLink, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a single spark batch state. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='batchId'> /// Identifier for the batch job. /// </param> public static SparkJobState GetSparkBatchState(this IJobOperations operations, int batchId) { return(operations.GetSparkBatchStateAsync(batchId).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve the runbook content of the job identified by job name. /// <see href="http://aka.ms/azureautomationsdk/joboperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='clientRequestId'> /// Identifies this specific client request. /// </param> public static Stream GetRunbookContent(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { return(operations.GetRunbookContentAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult()); }
/// <summary> /// Create a new spark session. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sparkSessionJobRequest'> /// Livy compatible session job request payload. /// </param> /// <param name='requestedBy'> /// Add default value for X-Requested-By in header. /// </param> public static SparkSessionJob SubmitSparkSessionJob(this IJobOperations operations, SparkSessionJobRequest sparkSessionJobRequest, string requestedBy = "ambari") { return(operations.SubmitSparkSessionJobAsync(sparkSessionJobRequest, requestedBy).GetAwaiter().GetResult()); }
/// <summary> /// Submits a Hive job to an HDInsight cluster. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.HDInsight.Job.IJobOperations. /// </param> /// <param name='parameters'> /// Required. Hive job parameters. /// </param> /// <returns> /// The Create Job operation response. /// </returns> public static JobSubmissionJsonResponse SubmitHiveJob(this IJobOperations operations, HiveJobSubmissionParameters parameters) { return(SubmitHiveJobAsync(operations, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Cancels a running spark session. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sessionId'> /// Identifier for the session. /// </param> /// <param name='requestedBy'> /// Add default value for X-Requested-By in header. /// </param> public static SparkJobDeletedResult DeleteSparkSessionJob(this IJobOperations operations, int sessionId, string requestedBy = "ambari") { return(operations.DeleteSparkSessionJobAsync(sessionId, requestedBy).GetAwaiter().GetResult()); }
/// <summary> /// Gets the error logs from the execution of an individual jobDetails. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.HDInsight.Job.IJobOperations. /// </param> /// <param name="jobId"> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <returns> /// The error logs of an individual jobDetails by jobId. /// </returns> public static Task <Stream> GetJobErrorLogsAsync(this IJobOperations operations, string jobId, IStorageAccess storageAccess) { return(operations.GetJobErrorLogsAsync(jobId, storageAccess, CancellationToken.None)); }
/// <summary> /// Gets a single spark session job state. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sessionId'> /// Identifier for the session job. /// </param> public static SparkJobState GetSparkSessionState(this IJobOperations operations, int sessionId) { return(operations.GetSparkSessionStateAsync(sessionId).GetAwaiter().GetResult()); }
/// <summary> /// Get the execution history of a Job with a filter on the job Status. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='jobId'> /// Required. Id of the job to get the history of. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Get Job History With Filter /// operation. /// </param> /// <returns> /// The Get Job History operation response. /// </returns> public static Task <JobGetHistoryResponse> GetHistoryWithFilterAsync(this IJobOperations operations, string jobId, JobGetHistoryWithFilterParameters parameters) { return(operations.GetHistoryWithFilterAsync(jobId, parameters, CancellationToken.None)); }