/// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IRuleOperations.
 /// </param>
 /// <param name='ruleId'>
 /// The id of the rule to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse Delete(this IRuleOperations operations, string ruleId)
 {
     try
     {
         return(operations.DeleteAsync(ruleId).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemplo n.º 2
0
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IRuleOperations.
 /// </param>
 /// <param name='ruleId'>
 /// Required. The id of the rule to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> DeleteAsync(this IRuleOperations operations, string ruleId)
 {
     return(operations.DeleteAsync(ruleId, CancellationToken.None));
 }