/// <summary> /// Get a web job run. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// Required. The job name. /// </param> /// <param name='jobRunId'> /// Required. The job run identifier. /// </param> /// <returns> /// The Get Web Job Run operation response. /// </returns> public static WebJobGetRunResponse GetRun(this IWebJobOperations operations, string jobName, string jobRunId) { return(Task.Factory.StartNew((object s) => { return ((IWebJobOperations)s).GetRunAsync(jobName, jobRunId); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Upload a triggered web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// Required. The job name. /// </param> /// <param name='jobContent'> /// Required. The job content. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse UploadTriggered(this IWebJobOperations operations, string jobName, Stream jobContent) { return(Task.Factory.StartNew((object s) => { return ((IWebJobOperations)s).UploadTriggeredAsync(jobName, jobContent); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Stop a continuous web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// Required. The job name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse StopContinuous(this IWebJobOperations operations, string jobName) { return(Task.Factory.StartNew((object s) => { return ((IWebJobOperations)s).StopContinuousAsync(jobName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// List the triggered web jobs. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='parameters'> /// Optional. Additional parameters. /// </param> /// <returns> /// The list of jobs operation response. /// </returns> public static WebJobListResponse ListTriggered(this IWebJobOperations operations, WebJobListParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IWebJobOperations)s).ListTriggeredAsync(parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Delete a triggered job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// Required. The job name. /// </param> /// <param name='recursive'> /// Required. Removing the specified directory and all its files and /// subdirectories. The value must be set to true. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse DeleteTriggered(this IWebJobOperations operations, string jobName, bool recursive) { return(Task.Factory.StartNew((object s) => { return ((IWebJobOperations)s).DeleteTriggeredAsync(jobName, recursive); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the WebSiteExtensionsClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> private WebSiteExtensionsClient(HttpClient httpClient) : base(httpClient) { this._deployments = new DeploymentOperations(this); this._diagnostics = new DiagnosticOperations(this); this._repository = new RepositoryOperations(this); this._settings = new SettingsOperations(this); this._webJobs = new WebJobOperations(this); this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Delete a triggered job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='recursive'> /// Removing the specified directory and all its files and /// subdirectories. The value must be set to true. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse DeleteTriggered(this IWebJobOperations operations, string jobName, bool recursive) { try { return(operations.DeleteTriggeredAsync(jobName, recursive).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Get a triggered web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <returns> /// The get Web Job Operation Response. /// </returns> public static WebJobGetResponse GetTriggered(this IWebJobOperations operations, string jobName) { try { return(operations.GetTriggeredAsync(jobName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Upload a triggered web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='jobContent'> /// The job content. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse UploadTriggered(this IWebJobOperations operations, string jobName, Stream jobContent) { try { return(operations.UploadTriggeredAsync(jobName, jobContent).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// List the web job runs. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The Web Job run list operation response. /// </returns> public static WebJobRunListResponse ListRuns(this IWebJobOperations operations, string jobName, WebJobRunListParameters parameters) { try { return(operations.ListRunsAsync(jobName, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Stop a continuous web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse StopContinuous(this IWebJobOperations operations, string jobName) { try { return(operations.StopContinuousAsync(jobName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// If a continuous job is set as singleton it'll run only on a single /// instance opposed to running on all instances. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='isSingleton'> /// Boolean value indicating if the job is singleton or not. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse SetSingleton(this IWebJobOperations operations, string jobName, bool isSingleton) { try { return(operations.SetSingletonAsync(jobName, isSingleton).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// List the triggered web jobs. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The list of jobs operation response. /// </returns> public static WebJobListResponse ListTriggered(this IWebJobOperations operations, WebJobListParameters parameters) { try { return(operations.ListTriggeredAsync(parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Stop a continuous web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> StopContinuousAsync(this IWebJobOperations operations, string jobName) { return(operations.StopContinuousAsync(jobName, CancellationToken.None)); }
/// <summary> /// If a continuous job is set as singleton it'll run only on a single /// instance opposed to running on all instances. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='isSingleton'> /// Boolean value indicating if the job is singleton or not. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> SetSingletonAsync(this IWebJobOperations operations, string jobName, bool isSingleton) { return(operations.SetSingletonAsync(jobName, isSingleton, CancellationToken.None)); }
/// <summary> /// Run a triggered web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> RunTriggeredAsync(this IWebJobOperations operations, string jobName) { return(operations.RunTriggeredAsync(jobName, CancellationToken.None)); }
/// <summary> /// List the triggered web jobs. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The list of jobs operation response. /// </returns> public static Task <WebJobListResponse> ListTriggeredAsync(this IWebJobOperations operations, WebJobListParameters parameters) { return(operations.ListTriggeredAsync(parameters, CancellationToken.None)); }
/// <summary> /// Get a web job run. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='jobRunId'> /// The job run identifier. /// </param> /// <returns> /// The Get Web Job Run operation response. /// </returns> public static Task <WebJobGetRunResponse> GetRunAsync(this IWebJobOperations operations, string jobName, string jobRunId) { return(operations.GetRunAsync(jobName, jobRunId, CancellationToken.None)); }
/// <summary> /// Upload a triggered web job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='jobContent'> /// The job content. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> UploadTriggeredAsync(this IWebJobOperations operations, string jobName, Stream jobContent) { return(operations.UploadTriggeredAsync(jobName, jobContent, CancellationToken.None)); }
/// <summary> /// Delete a continuous job. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='recursive'> /// Removing the specified directory and all its files and /// subdirectories. The value must be set to true. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> DeleteContinuousAsync(this IWebJobOperations operations, string jobName, bool recursive) { return(operations.DeleteContinuousAsync(jobName, recursive, CancellationToken.None)); }
/// <summary> /// List the web job runs. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IWebJobOperations. /// </param> /// <param name='jobName'> /// The job name. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The Web Job run list operation response. /// </returns> public static Task <WebJobRunListResponse> ListRunsAsync(this IWebJobOperations operations, string jobName, WebJobRunListParameters parameters) { return(operations.ListRunsAsync(jobName, parameters, CancellationToken.None)); }