MonitorExtensions.GetMetricAlerts Method

Definition

Overloads

GetMetricAlerts(ResourceGroupResource)

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

GetMetricAlerts(SubscriptionResource, CancellationToken)

Retrieve alert rule definitions in a subscription.

  • Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts
  • Operation Id: MetricAlerts_ListBySubscription
  • Default Api Version: 2018-03-01
  • Resource: MetricAlertResource

GetMetricAlerts(ResourceGroupResource)

Source:
MonitorExtensions.cs
Source:
MonitorExtensions.cs

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

C#
public static Azure.ResourceManager.Monitor.MetricAlertCollection GetMetricAlerts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource);

Parameters

resourceGroupResource
ResourceGroupResource

The ResourceGroupResource instance the method will execute against.

Returns

An object representing collection of MetricAlertResources and their operations over a MetricAlertResource.

Exceptions

resourceGroupResource is null.

Applies to

Azure SDK for .NET Preview and Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest, Preview

GetMetricAlerts(SubscriptionResource, CancellationToken)

Source:
MonitorExtensions.cs
Source:
MonitorExtensions.cs

Retrieve alert rule definitions in a subscription.

  • Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts
  • Operation Id: MetricAlerts_ListBySubscription
  • Default Api Version: 2018-03-01
  • Resource: MetricAlertResource
C#
public static Azure.Pageable<Azure.ResourceManager.Monitor.MetricAlertResource> GetMetricAlerts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default);

Parameters

subscriptionResource
SubscriptionResource

The SubscriptionResource instance the method will execute against.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

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

Exceptions

subscriptionResource is null.

Applies to

Azure SDK for .NET Preview and Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest, Preview