/// <summary> /// List the alert rules within a subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IRuleOperations. /// </param> /// <returns> /// The List Rules operation response. /// </returns> public static RuleListResponse List(this IRuleOperations operations) { try { return(operations.ListAsync().Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// List the alert rules within a subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IRuleOperations. /// </param> /// <returns> /// The List Rules operation response. /// </returns> public static Task <RuleListResponse> ListAsync(this IRuleOperations operations) { return(operations.ListAsync(CancellationToken.None)); }