/// <summary> /// Gets a list of incidents associated to an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <IncidentInner> > ListByAlertRuleAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByAlertRuleWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets an incident associated to an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='incidentName'> /// The name of the incident to retrieve. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <Incident> GetAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ruleName, incidentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a list of incidents associated to an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> public static IEnumerable <Incident> ListByAlertRule(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName) { return(operations.ListByAlertRuleAsync(resourceGroupName, ruleName).GetAwaiter().GetResult()); }
/// <summary> /// Gets an incident associated to an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='incidentName'> /// The name of the incident to retrieve. /// </param> public static Incident Get(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName) { return(operations.GetAsync(resourceGroupName, ruleName, incidentName).GetAwaiter().GetResult()); }
/// <summary> /// Gets a list of incidents associated to an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> public static System.Collections.Generic.IEnumerable <Incident> ListByAlertRule(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).ListByAlertRuleAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets an incident associated to an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='incidentName'> /// The name of the incident to retrieve. /// </param> public static Incident Get(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).GetAsync(resourceGroupName, ruleName, incidentName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }