/// <summary> /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given /// subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertsSuppressionRuleName'> /// The unique name of the suppression alert rule /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AlertsSuppressionRule> GetAsync(this IAlertsSuppressionRulesOperations operations, string alertsSuppressionRuleName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(alertsSuppressionRuleName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List of all the dismiss rules for the given subscription /// </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 <AlertsSuppressionRule> > ListNextAsync(this IAlertsSuppressionRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given /// subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertsSuppressionRuleName'> /// The unique name of the suppression alert rule /// </param> public static AlertsSuppressionRule Get(this IAlertsSuppressionRulesOperations operations, string alertsSuppressionRuleName) { return(operations.GetAsync(alertsSuppressionRuleName).GetAwaiter().GetResult()); }
/// <summary> /// List of all the dismiss rules for the given subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertType'> /// Type of the alert to get rules for /// </param> public static IPage <AlertsSuppressionRule> List(this IAlertsSuppressionRulesOperations operations, string alertType = default(string)) { return(operations.ListAsync(alertType).GetAwaiter().GetResult()); }
/// <summary> /// List of all the dismiss rules for the given subscription /// </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 <AlertsSuppressionRule> ListNext(this IAlertsSuppressionRulesOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Delete dismiss alert rule for this subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertsSuppressionRuleName'> /// The unique name of the suppression alert rule /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IAlertsSuppressionRulesOperations operations, string alertsSuppressionRuleName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(alertsSuppressionRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Delete dismiss alert rule for this subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertsSuppressionRuleName'> /// The unique name of the suppression alert rule /// </param> public static void Delete(this IAlertsSuppressionRulesOperations operations, string alertsSuppressionRuleName) { operations.DeleteAsync(alertsSuppressionRuleName).GetAwaiter().GetResult(); }
/// <summary> /// Update existing rule or create new rule if it doesn't exist /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertsSuppressionRuleName'> /// The unique name of the suppression alert rule /// </param> /// <param name='alertsSuppressionRule'> /// Suppression rule object /// </param> public static AlertsSuppressionRule Update(this IAlertsSuppressionRulesOperations operations, string alertsSuppressionRuleName, AlertsSuppressionRule alertsSuppressionRule) { return(operations.UpdateAsync(alertsSuppressionRuleName, alertsSuppressionRule).GetAwaiter().GetResult()); }