Esempio n. 1
0
 /// <summary>
 /// The List Metric Definitions operation lists the metric definitions
 /// for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Metrics.IMetricDefinitionOperations.
 /// </param>
 /// <param name='resourceId'>
 /// The id of the resource.The resource id can be built using the
 /// resource id builder class under utilities
 /// </param>
 /// <param name='metricNames'>
 /// The names of the metrics.
 /// </param>
 /// <param name='metricNamespace'>
 /// The namespace of the metrics.The value is either null or
 /// WindowsAzure.Availability.WindowsAzure.Availability returns the
 /// metric definitions for endpoint monitoring metrics
 /// </param>
 /// <returns>
 /// The List Metric Definitions operation response.
 /// </returns>
 public static MetricDefinitionListResponse List(this IMetricDefinitionOperations operations, string resourceId, IList <string> metricNames, string metricNamespace)
 {
     try
     {
         return(operations.ListAsync(resourceId, metricNames, metricNamespace).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The List Metric Definitions operation lists the metric definitions
 /// for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Metrics.IMetricDefinitionOperations.
 /// </param>
 /// <param name='resourceId'>
 /// Required. The id of the resource.The resource id can be built using
 /// the resource id builder class under utilities
 /// </param>
 /// <param name='metricNames'>
 /// Optional. The names of the metrics.
 /// </param>
 /// <param name='metricNamespace'>
 /// Optional. The namespace of the metrics.The value is either null or
 /// WindowsAzure.Availability.WindowsAzure.Availability returns the
 /// metric definitions for endpoint monitoring metrics
 /// </param>
 /// <returns>
 /// The List Metric Definitions operation response.
 /// </returns>
 public static Task <MetricDefinitionListResponse> ListAsync(this IMetricDefinitionOperations operations, string resourceId, IList <string> metricNames, string metricNamespace)
 {
     return(operations.ListAsync(resourceId, metricNames, metricNamespace, CancellationToken.None));
 }