/// <summary> /// Delete the repository identified by `name` /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='name'> /// Name of the image (including the namespace) /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <DeletedRepository> DeleteAsync(this IRepositoryOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List repositories /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='last'> /// Query parameter for the last item in previous query. Result set will /// include values lexically after last. /// </param> /// <param name='n'> /// query parameter for max number of items /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Repositories> GetListAsync(this IRepositoryOperations operations, string last = default(string), int?n = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetListWithHttpMessagesAsync(last, n, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Construct a <see cref="LocalRepositoryManager"/> /// </summary> /// <param name="ioManager">The value of <see cref="ioManager"/></param> /// <param name="localRepositoryFactory">The value of <see cref="localRepositoryFactory"/></param> /// <param name="repositoryOperations">The value of <see cref="repositoryOperations"/></param> /// <param name="logger">The value of <see cref="logger"/></param> public LocalRepositoryManager(IIOManager ioManager, ILocalRepositoryFactory localRepositoryFactory, IRepositoryOperations repositoryOperations, ILogger <LocalRepositoryManager> logger) { this.ioManager = new ResolvingIOManager(ioManager ?? throw new ArgumentNullException(nameof(ioManager)), "Repositories"); this.localRepositoryFactory = localRepositoryFactory ?? throw new ArgumentNullException(nameof(localRepositoryFactory)); this.repositoryOperations = repositoryOperations ?? throw new ArgumentNullException(nameof(repositoryOperations)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); activeRepositories = new Dictionary <string, Task>(); }
/// <summary> /// Deletes the repository. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse Delete(this IRepositoryOperations operations) { return(Task.Factory.StartNew((object s) => { return ((IRepositoryOperations)s).DeleteAsync(); } , 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> /// Initializes a new instance of the WebSiteExtensionsClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> private WebSiteExtensionsClient(HttpClient httpClient) : base(httpClient) { this._continuousWebJobs = new ContinuousWebJobOperations(this); this._deployments = new DeploymentOperations(this); this._diagnostics = new DiagnosticOperations(this); this._repository = new RepositoryOperations(this); this._settings = new SettingsOperations(this); this._triggeredWebJobs = new TriggeredWebJobOperations(this); this._apiVersion = "2"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Deletes the repository. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse Delete(this IRepositoryOperations operations) { try { return operations.DeleteAsync().Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Get diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <returns> /// The get diagnostic settings operation response. /// </returns> public static DiagnosticGetResponse GetSettings(this IRepositoryOperations operations) { try { return(operations.GetSettingsAsync().Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Update diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <param name='settings'> /// The diagnostics setting information new values. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse Update(this IRepositoryOperations operations, IDictionary <string, string> settings) { try { return(operations.UpdateAsync(settings).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Construct a <see cref="LocalRepository"/> /// </summary> /// <param name="repositoryLib">The value of <see cref="repositoryLib"/></param> /// <param name="repositoryOperations">The value of <see cref="repositoryOperations"/></param> /// <param name="onDisposal">The value of <see cref="onDisposal"/></param> public LocalRepository(IRepository repositoryLib, IRepositoryOperations repositoryOperations, TaskCompletionSource <object> onDisposal) { this.repositoryLib = repositoryLib ?? throw new ArgumentNullException(nameof(repositoryLib)); this.repositoryOperations = repositoryOperations ?? throw new ArgumentNullException(nameof(repositoryOperations)); this.onDisposal = onDisposal ?? throw new ArgumentNullException(nameof(onDisposal)); }
/// <summary> /// Deletes the repository. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<OperationResponse> DeleteAsync(this IRepositoryOperations operations) { return operations.DeleteAsync(CancellationToken.None); }
/// <summary> /// Update diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <param name='settings'> /// The diagnostics setting information new values. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> UpdateAsync(this IRepositoryOperations operations, IDictionary <string, string> settings) { return(operations.UpdateAsync(settings, CancellationToken.None)); }
/// <summary> /// Get diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IRepositoryOperations. /// </param> /// <returns> /// The get diagnostic settings operation response. /// </returns> public static Task <DiagnosticGetResponse> GetSettingsAsync(this IRepositoryOperations operations) { return(operations.GetSettingsAsync(CancellationToken.None)); }
/// <summary> /// Update the attribute identified by `name` where `reference` is the name of /// the repository. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='name'> /// Name of the image (including the namespace) /// </param> /// <param name='value'> /// Repository attribute value /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task UpdateAttributesAsync(this IRepositoryOperations operations, string name, ChangeableAttributes value = default(ChangeableAttributes), CancellationToken cancellationToken = default(CancellationToken)) { (await operations.UpdateAttributesWithHttpMessagesAsync(name, value, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Construct a <see cref="LocalRepositoryFactory"/> /// </summary> /// <param name="reposiotoryOperations">The value of <see cref="repositoryOperations"/></param> public LocalRepositoryFactory(IRepositoryOperations reposiotoryOperations) => this.repositoryOperations = reposiotoryOperations ?? throw new ArgumentNullException(nameof(reposiotoryOperations));