/// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IRuleOperations. /// </param> /// <param name='ruleId'> /// The id of the rule to retrieve. /// </param> /// <returns> /// The Get Rule operation response. /// </returns> public static RuleGetResponse Get(this IRuleOperations operations, string ruleId) { try { return(operations.GetAsync(ruleId).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IRuleOperations. /// </param> /// <param name='ruleId'> /// Required. The id of the rule to retrieve. /// </param> /// <returns> /// The Get Rule operation response. /// </returns> public static Task <RuleGetResponse> GetAsync(this IRuleOperations operations, string ruleId) { return(operations.GetAsync(ruleId, CancellationToken.None)); }