/// <summary> /// List the alert rules within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <AlertRuleResource> > ListBySubscriptionAsync(this IAlertRulesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates an alert rule. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='parameters'> /// The parameters of the rule to create or update. /// </param> public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, ruleName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// List the alert rules within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> public static IEnumerable <AlertRuleResource> ListByResourceGroup(this IAlertRulesOperations operations, string resourceGroupName) { return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// List the alert rules within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IEnumerable <AlertRuleResource> ListBySubscription(this IAlertRulesOperations operations) { return(operations.ListBySubscriptionAsync().GetAwaiter().GetResult()); }
/// <summary> /// Gets all alert rules. /// </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='workspaceName'> /// The name of the workspace. /// </param> public static IPage <AlertRule> List(this IAlertRulesOperations operations, string resourceGroupName, string workspaceName) { return(operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult()); }
/// <summary> /// Updates an existing AlertRuleResource. To update other fields use the /// CreateOrUpdate method. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='alertRulesResource'> /// Parameters supplied to the operation. /// </param> public static AlertRuleResource Update(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResourcePatch alertRulesResource) { return(operations.UpdateAsync(resourceGroupName, ruleName, alertRulesResource).GetAwaiter().GetResult()); }
/// <summary> /// Deletes an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> public static void Delete(this IAlertRulesOperations operations, string resourceGroupName, string ruleName) { System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).DeleteAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Delete the alert rule. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='ruleId'> /// Alert rule ID /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IAlertRulesOperations operations, string resourceGroupName, string workspaceName, string ruleId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, ruleId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Creates or updates an alert rule. /// Request method: PUT Request URI: /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='parameters'> /// The parameters of the rule to create or update. /// </param> public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, ruleName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Creates or updates an alert rule. /// Request method: PUT Request URI: /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='parameters'> /// The parameters of the rule to create or update. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <AlertRuleResource> CreateOrUpdateAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ruleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List the alert rules within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <System.Collections.Generic.IEnumerable <AlertRuleResource> > ListByResourceGroupAsync(this IAlertRulesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery <AlertRuleResource> odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery <AlertRuleResource>), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List the alert rules within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static System.Collections.Generic.IEnumerable <AlertRuleResource> ListByResourceGroup(this IAlertRulesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery <AlertRuleResource> odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery <AlertRuleResource>)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).ListByResourceGroupAsync(resourceGroupName, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Deletes an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task DeleteAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Creates or updates the alert rule. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='ruleId'> /// Alert rule ID /// </param> /// <param name='alertRule'> /// The alert rule /// </param> public static AlertRule CreateOrUpdate(this IAlertRulesOperations operations, string resourceGroupName, string workspaceName, string ruleId, AlertRule alertRule) { return(operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, ruleId, alertRule).GetAwaiter().GetResult()); }
/// <summary> /// List the alert rules within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <AlertRuleResourceInner> > ListByResourceGroupAsync(this IAlertRulesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Delete the alert rule. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='ruleId'> /// Alert rule ID /// </param> public static void Delete(this IAlertRulesOperations operations, string resourceGroupName, string workspaceName, string ruleId) { operations.DeleteAsync(resourceGroupName, workspaceName, ruleId).GetAwaiter().GetResult(); }
/// <summary> /// Gets an alert rule /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='ruleName'> /// The name of the rule. /// </param> public static AlertRuleResource Get(this IAlertRulesOperations operations, string resourceGroupName, string ruleName) { return(operations.GetAsync(resourceGroupName, ruleName).GetAwaiter().GetResult()); }
/// <summary> /// Gets all alert rules. /// </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 <AlertRule> ListNext(this IAlertRulesOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Creates or updates the action of alert rule. /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='ruleId'> /// Alert rule ID /// </param> /// <param name='actionId'> /// Action ID /// </param> /// <param name='action'> /// The action /// </param> public static ActionResponse CreateOrUpdateAction(this IAlertRulesOperations operations, string resourceGroupName, string workspaceName, string ruleId, string actionId, ActionRequest action) { return(operations.CreateOrUpdateActionAsync(resourceGroupName, workspaceName, ruleId, actionId, action).GetAwaiter().GetResult()); }