MonitorExtensions.GetAlertRules Method

Definition

Overloads

GetAlertRules(ResourceGroupResource)

Gets a collection of AlertRuleResources in the ResourceGroupResource. MockingTo mock this method, please mock GetAlertRules() instead.

GetAlertRules(SubscriptionResource, CancellationToken)

List the classic metric alert rules within a subscription.

  • Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules
  • Operation Id: AlertRules_ListBySubscription
  • Default Api Version: 2016-03-01
  • Resource: AlertRuleResource

GetAlertRules(ResourceGroupResource)

Source:
MonitorExtensions.cs
Source:
MonitorExtensions.cs

Gets a collection of AlertRuleResources in the ResourceGroupResource. MockingTo mock this method, please mock GetAlertRules() instead.

public static Azure.ResourceManager.Monitor.AlertRuleCollection GetAlertRules (this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource);
static member GetAlertRules : Azure.ResourceManager.Resources.ResourceGroupResource -> Azure.ResourceManager.Monitor.AlertRuleCollection
<Extension()>
Public Function GetAlertRules (resourceGroupResource As ResourceGroupResource) As AlertRuleCollection

Parameters

resourceGroupResource
ResourceGroupResource

The ResourceGroupResource instance the method will execute against.

Returns

An object representing collection of AlertRuleResources and their operations over a AlertRuleResource.

Exceptions

resourceGroupResource is null.

Applies to

GetAlertRules(SubscriptionResource, CancellationToken)

Source:
MonitorExtensions.cs
Source:
MonitorExtensions.cs

List the classic metric alert rules within a subscription.

  • Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules
  • Operation Id: AlertRules_ListBySubscription
  • Default Api Version: 2016-03-01
  • Resource: AlertRuleResource
public static Azure.Pageable<Azure.ResourceManager.Monitor.AlertRuleResource> GetAlertRules (this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default);
static member GetAlertRules : Azure.ResourceManager.Resources.SubscriptionResource * System.Threading.CancellationToken -> Azure.Pageable<Azure.ResourceManager.Monitor.AlertRuleResource>
<Extension()>
Public Function GetAlertRules (subscriptionResource As SubscriptionResource, Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of AlertRuleResource)

Parameters

subscriptionResource
SubscriptionResource

The SubscriptionResource instance the method will execute against.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

A collection of AlertRuleResource that may take multiple service requests to iterate over.

Exceptions

subscriptionResource is null.

Applies to