/// <summary> /// List all existing alerts, where the results can be filtered on the basis of /// multiple parameters (e.g. time range). The results can then be sorted on /// the basis specific fields, with the default being lastModifiedDateTime. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='targetResource'> /// Filter by target resource( which is full ARM ID) Default value is select /// all. /// </param> /// <param name='targetResourceType'> /// Filter by target resource type. Default value is select all. /// </param> /// <param name='targetResourceGroup'> /// Filter by target resource group name. Default value is select all. /// </param> /// <param name='monitorService'> /// Filter by monitor service which generates the alert instance. Default value /// is select all. Possible values include: 'Application Insights', /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', /// 'VM Insights', 'Zabbix' /// </param> /// <param name='monitorCondition'> /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default /// value is to select all. Possible values include: 'Fired', 'Resolved' /// </param> /// <param name='severity'> /// Filter by severity. Default value is select all. Possible values include: /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' /// </param> /// <param name='alertState'> /// Filter by state of the alert instance. Default value is to select all. /// Possible values include: 'New', 'Acknowledged', 'Closed' /// </param> /// <param name='alertRule'> /// Filter by specific alert rule. Default value is to select all. /// </param> /// <param name='smartGroupId'> /// Filter the alerts list by the Smart Group Id. Default value is none. /// </param> /// <param name='includeContext'> /// Include context which has contextual data specific to the monitor service. /// Default value is false' /// </param> /// <param name='includeEgressConfig'> /// Include egress config which would be used for displaying the content in /// portal. Default value is 'false'. /// </param> /// <param name='pageCount'> /// Determines number of alerts returned per page in response. Permissible /// value is between 1 to 250. When the "includeContent" filter is selected, /// maximum value allowed is 25. Default value is 25. /// </param> /// <param name='sortBy'> /// Sort the query results by input field, Default value is /// 'lastModifiedDateTime'. Possible values include: 'name', 'severity', /// 'alertState', 'monitorCondition', 'targetResource', 'targetResourceName', /// 'targetResourceGroup', 'targetResourceType', 'startDateTime', /// 'lastModifiedDateTime' /// </param> /// <param name='sortOrder'> /// Sort the query results order in either ascending or descending. Default /// value is 'desc' for time fields and 'asc' for others. Possible values /// include: 'asc', 'desc' /// </param> /// <param name='select'> /// This filter allows to selection of the fields(comma separated) which would /// be part of the essential section. This would allow to project only the /// required fields rather than getting entire content. Default is to fetch /// all the fields in the essentials section. /// </param> /// <param name='timeRange'> /// Filter by time range by below listed values. Default value is 1 day. /// Possible values include: '1h', '1d', '7d', '30d' /// </param> /// <param name='customTimeRange'> /// Filter by custom time range in the format /// <start-time>/<end-time> where time is in (ISO-8601 format)'. /// Permissible values is within 30 days from query time. Either timeRange or /// customTimeRange could be used but not both. Default is none. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Alert> > GetAllAsync(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool?includeContext = default(bool?), bool?includeEgressConfig = default(bool?), int?pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List all the alerts that are associated with the subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='filter'> /// OData filter. Optional. /// </param> /// <param name='select'> /// OData select. Optional. /// </param> /// <param name='expand'> /// OData expand. Optional. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Alert> > ListAsync(this IAlertsOperations operations, string filter = default(string), string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(filter, select, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get an alert that is associated a resource group or a resource in a /// resource group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Alert> GetResourceGroupLevelAlertsAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetResourceGroupLevelAlertsWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List all the alerts alerts that are associated with the resource group /// </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 <Alert> > ListByResourceGroupNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get a summarized count of your alerts grouped by various parameters (e.g. /// grouping by 'Severity' returns the count of alerts for each severity). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='groupby'> /// This parameter allows the result set to be grouped by input fields (Maximum /// 2 comma separated fields supported). For example, groupby=severity or /// groupby=severity,alertstate. Possible values include: 'severity', /// 'alertState', 'monitorCondition', 'monitorService', 'signalType', /// 'alertRule' /// </param> /// <param name='includeSmartGroupsCount'> /// Include count of the SmartGroups as part of the summary. Default value is /// 'false'. /// </param> /// <param name='targetResource'> /// Filter by target resource( which is full ARM ID) Default value is select /// all. /// </param> /// <param name='targetResourceType'> /// Filter by target resource type. Default value is select all. /// </param> /// <param name='targetResourceGroup'> /// Filter by target resource group name. Default value is select all. /// </param> /// <param name='monitorService'> /// Filter by monitor service which generates the alert instance. Default value /// is select all. Possible values include: 'Application Insights', /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', /// 'VM Insights', 'Zabbix' /// </param> /// <param name='monitorCondition'> /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default /// value is to select all. Possible values include: 'Fired', 'Resolved' /// </param> /// <param name='severity'> /// Filter by severity. Default value is select all. Possible values include: /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' /// </param> /// <param name='alertState'> /// Filter by state of the alert instance. Default value is to select all. /// Possible values include: 'New', 'Acknowledged', 'Closed' /// </param> /// <param name='alertRule'> /// Filter by specific alert rule. Default value is to select all. /// </param> /// <param name='timeRange'> /// Filter by time range by below listed values. Default value is 1 day. /// Possible values include: '1h', '1d', '7d', '30d' /// </param> /// <param name='customTimeRange'> /// Filter by custom time range in the format /// <start-time>/<end-time> where time is in (ISO-8601 format)'. /// Permissible values is within 30 days from query time. Either timeRange or /// customTimeRange could be used but not both. Default is none. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AlertsSummary> GetSummaryAsync(this IAlertsOperations operations, string groupby, bool?includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetSummaryWithHttpMessagesAsync(groupby, includeSmartGroupsCount, targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get the history of an alert, which captures any monitor condition changes /// (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertId'> /// Unique ID of an alert instance. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AlertModification> GetHistoryAsync(this IAlertsOperations operations, string alertId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetHistoryWithHttpMessagesAsync(alertId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Change the state of an alert. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertId'> /// Unique ID of an alert instance. /// </param> /// <param name='newState'> /// New state of the alert. Possible values include: 'New', 'Acknowledged', /// 'Closed' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Alert> ChangeStateAsync(this IAlertsOperations operations, string alertId, string newState, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ChangeStateWithHttpMessagesAsync(alertId, newState, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List alerts meta data information based on value of identifier parameter. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AlertsMetaData> MetaDataAsync(this IAlertsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.MetaDataWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all the alerts for a data box edge/gateway device. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='deviceName'> /// The device name. /// </param> /// <param name='resourceGroupName'> /// The resource group name. /// </param> public static IPage <Alert> ListByDataBoxEdgeDevice(this IAlertsOperations operations, string deviceName, string resourceGroupName) { return(operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// List all the alerts that are associated with the subscription that are /// stored in a specific location /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <Alert> ListSubscriptionLevelAlertsByRegion(this IAlertsOperations operations) { return(operations.ListSubscriptionLevelAlertsByRegionAsync().GetAwaiter().GetResult()); }
/// <summary> /// List all the alerts that are associated with the resource group that are /// stored in a specific location /// </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 <Alert> ListResourceGroupLevelAlertsByRegionNext(this IAlertsOperations operations, string nextPageLink) { return(operations.ListResourceGroupLevelAlertsByRegionNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Update the alert's state /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> public static void UpdateResourceGroupLevelAlertStateToReactivate(this IAlertsOperations operations, string alertName, string resourceGroupName) { operations.UpdateResourceGroupLevelAlertStateToReactivateAsync(alertName, resourceGroupName).GetAwaiter().GetResult(); }
/// <summary> /// Update the alert's state /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task UpdateSubscriptionLevelStateToResolveAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.UpdateSubscriptionLevelStateToResolveWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get an alert that is associated a resource group or a resource in a /// resource group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> public static Alert GetResourceGroupLevelAlerts(this IAlertsOperations operations, string alertName, string resourceGroupName) { return(operations.GetResourceGroupLevelAlertsAsync(alertName, resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Sends a test alert email. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='deviceName'> /// The device name /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> /// <param name='emailList'> /// The list of email IDs to send the test alert email /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task SendTestEmailAsync(this IAlertsOperations operations, string deviceName, string resourceGroupName, string managerName, IList <string> emailList, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.SendTestEmailWithHttpMessagesAsync(deviceName, resourceGroupName, managerName, emailList, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// List all the alerts that are associated with the subscription that are /// stored in a specific location /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Alert> > ListSubscriptionLevelAlertsByRegionAsync(this IAlertsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get an alert that is associated with a subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> public static Alert GetSubscriptionLevelAlert(this IAlertsOperations operations, string alertName) { return(operations.GetSubscriptionLevelAlertAsync(alertName).GetAwaiter().GetResult()); }
/// <summary> /// Closes the given alert. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='location'> /// Name of the region /// </param> /// <param name='alertName'> /// Name of the alert. /// </param> /// <param name='user'> /// The username used to perform the operation. /// </param> /// <param name='alert'> /// Updated alert parameter. /// </param> public static Alert Close(this IAlertsOperations operations, string resourceGroupName, string location, string alertName, string user, Alert alert) { return(operations.CloseAsync(resourceGroupName, location, alertName, user, alert).GetAwaiter().GetResult()); }
/// <summary> /// List all the alerts that are associated with the subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <Alert> List(this IAlertsOperations operations) { return(operations.ListAsync().GetAwaiter().GetResult()); }
/// <summary> /// Repairs an alert. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='location'> /// Name of the region /// </param> /// <param name='alertName'> /// Name of the alert. /// </param> public static void BeginRepair(this IAlertsOperations operations, string resourceGroupName, string location, string alertName) { operations.BeginRepairAsync(resourceGroupName, location, alertName).GetAwaiter().GetResult(); }
/// <summary> /// Update the alert's state /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> public static void UpdateSubscriptionLevelAlertStateToReactivate(this IAlertsOperations operations, string alertName) { operations.UpdateSubscriptionLevelAlertStateToReactivateAsync(alertName).GetAwaiter().GetResult(); }
/// <summary> /// Repairs an alert. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='location'> /// Name of the region /// </param> /// <param name='alertName'> /// Name of the alert. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginRepairAsync(this IAlertsOperations operations, string resourceGroupName, string location, string alertName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginRepairWithHttpMessagesAsync(resourceGroupName, location, alertName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Update the alert's state /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='alertName'> /// Name of the alert object /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task UpdateResourceGroupLevelAlertStateToReactivateAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.UpdateResourceGroupLevelAlertStateToReactivateWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Returns the list of all alerts in a given region. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='location'> /// Name of the region /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <Alert> List(this IAlertsOperations operations, string resourceGroupName, string location, ODataQuery <Alert> odataQuery = default(ODataQuery <Alert>)) { return(operations.ListAsync(resourceGroupName, location, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// List all the alerts that are associated with the resource group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> public static IPage <Alert> ListByResourceGroup(this IAlertsOperations operations, string resourceGroupName) { return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Returns the requested an alert. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='location'> /// Name of the region /// </param> /// <param name='alertName'> /// Name of the alert. /// </param> public static Alert Get(this IAlertsOperations operations, string resourceGroupName, string location, string alertName) { return(operations.GetAsync(resourceGroupName, location, alertName).GetAwaiter().GetResult()); }
/// <summary> /// Gets all the alerts for a data box edge/gateway device. /// </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 <Alert> ListByDataBoxEdgeDeviceNext(this IAlertsOperations operations, string nextPageLink) { return(operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// List all the alerts that are associated with the subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='filter'> /// OData filter. Optional. /// </param> /// <param name='select'> /// OData select. Optional. /// </param> /// <param name='expand'> /// OData expand. Optional. /// </param> public static IPage <Alert> List(this IAlertsOperations operations, string filter = default(string), string select = default(string), string expand = default(string)) { return(operations.ListAsync(filter, select, expand).GetAwaiter().GetResult()); }
/// <summary> /// Gets an alert by name. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='deviceName'> /// The device name. /// </param> /// <param name='name'> /// The alert name. /// </param> /// <param name='resourceGroupName'> /// The resource group name. /// </param> public static Alert Get(this IAlertsOperations operations, string deviceName, string name, string resourceGroupName) { return(operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// List all the alerts that are associated with the resource group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='filter'> /// OData filter. Optional. /// </param> /// <param name='select'> /// OData select. Optional. /// </param> /// <param name='expand'> /// OData expand. Optional. /// </param> public static IPage <Alert> ListByResourceGroup(this IAlertsOperations operations, string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string)) { return(operations.ListByResourceGroupAsync(resourceGroupName, filter, select, expand).GetAwaiter().GetResult()); }