/// <summary> /// Gets the entity state (Etag) version of the Diagnostic specified by its /// identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='diagnosticId'> /// Diagnostic identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <DiagnosticGetEntityTagHeaders> GetEntityTagAsync(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, string diagnosticId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, diagnosticId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Update diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IDiagnosticOperations. /// </param> /// <param name='parameters'> /// Required. The diagnostics setting information new values. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse UpdateSettings(this IDiagnosticOperations operations, DiagnosticUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IDiagnosticOperations)s).UpdateSettingsAsync(parameters); } , 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> /// Get diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IDiagnosticOperations. /// </param> /// <returns> /// The get diagnostic settings operation response. /// </returns> public static DiagnosticGetResponse GetSettings(this IDiagnosticOperations 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.IDiagnosticOperations. /// </param> /// <param name='parameters'> /// The diagnostics setting information new values. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse UpdateSettings(this IDiagnosticOperations operations, DiagnosticUpdateParameters parameters) { try { return(operations.UpdateSettingsAsync(parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Gets the entity state (Etag) version of the Diagnostic specified by its /// identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='diagnosticId'> /// Diagnostic identifier. Must be unique in the current API Management service /// instance. /// </param> public static DiagnosticGetEntityTagHeaders GetEntityTag(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, string diagnosticId) { return(operations.GetEntityTagAsync(resourceGroupName, serviceName, diagnosticId).GetAwaiter().GetResult()); }
/// <summary> /// Lists all diagnostics of the API Management service instance. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <DiagnosticContract> ListByService(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, ODataQuery <DiagnosticContract> odataQuery = default(ODataQuery <DiagnosticContract>)) { return(operations.ListByServiceAsync(resourceGroupName, serviceName, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Lists all diagnostics of the API Management service instance. /// </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='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <DiagnosticContract> > ListByServiceNextAsync(this IDiagnosticOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByServiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists all diagnostics of the API Management service instance. /// </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> public static IPage <DiagnosticContract> ListByServiceNext(this IDiagnosticOperations operations, string nextPageLink) { return(operations.ListByServiceNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the specified Diagnostic. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='diagnosticId'> /// Diagnostic identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, diagnosticId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the specified Diagnostic. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='diagnosticId'> /// Diagnostic identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> public static void Delete(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, string diagnosticId, string ifMatch) { operations.DeleteAsync(resourceGroupName, serviceName, diagnosticId, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Updates the details of the Diagnostic specified by its identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='diagnosticId'> /// Diagnostic identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='parameters'> /// Diagnostic Update parameters. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> public static DiagnosticContract Update(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, string diagnosticId, DiagnosticContract parameters, string ifMatch) { return(operations.UpdateAsync(resourceGroupName, serviceName, diagnosticId, parameters, ifMatch).GetAwaiter().GetResult()); }
/// <summary> /// Gets the details of the Diagnostic specified by its identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='diagnosticId'> /// Diagnostic identifier. Must be unique in the current API Management service /// instance. /// </param> public static DiagnosticContract Get(this IDiagnosticOperations operations, string resourceGroupName, string serviceName, string diagnosticId) { return(operations.GetAsync(resourceGroupName, serviceName, diagnosticId).GetAwaiter().GetResult()); }
/// <summary> /// Gets status of a Diagnostic operation issued for Disk Inspection. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='location'> /// The location used to execute the diagnostic operation. /// </param> /// <param name='operationId'> /// The identifier pointing to a request for Disk Inspection. This is used for /// polling result of the request. /// </param> public static void Read(this IDiagnosticOperations operations, string location, string operationId) { operations.ReadAsync(location, operationId).GetAwaiter().GetResult(); }
/// <summary> /// Gets status of a Diagnostic operation issued for Disk Inspection. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='location'> /// The location used to execute the diagnostic operation. /// </param> /// <param name='operationId'> /// The identifier pointing to a request for Disk Inspection. This is used for /// polling result of the request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ReadAsync(this IDiagnosticOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ReadWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IDiagnosticOperations. /// </param> /// <returns> /// The get diagnostic settings operation response. /// </returns> public static Task <DiagnosticGetResponse> GetSettingsAsync(this IDiagnosticOperations operations) { return(operations.GetSettingsAsync(CancellationToken.None)); }
/// <summary> /// Update diagnostics settings. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.WebSitesExtensions.IDiagnosticOperations. /// </param> /// <param name='parameters'> /// Required. 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> UpdateSettingsAsync(this IDiagnosticOperations operations, DiagnosticUpdateParameters parameters) { return(operations.UpdateSettingsAsync(parameters, CancellationToken.None)); }