Exemple #1
0
 /// <summary>
 /// The List Metric Definitions operation lists the metric definitions
 /// for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Insights.Legacy.IMetricDefinitionOperations.
 /// </param>
 /// <param name='resourceUri'>
 /// Required. The resource identifier of the target resource to get
 /// metrics for.
 /// </param>
 /// <param name='filterString'>
 /// Optional. An OData $filter expression that supports querying by the
 /// name of the metric definition. For example, "name.value eq
 /// 'Percentage CPU'". Name is optional, meaning the expression may be
 /// "".
 /// </param>
 /// <returns>
 /// The List Metric Definitions operation response.
 /// </returns>
 public static MetricDefinitionListResponse GetMetricDefinitions(this IMetricDefinitionOperations operations, string resourceUri, string filterString)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IMetricDefinitionOperations)s).GetMetricDefinitionsAsync(resourceUri, filterString);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <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 MetricDefinitionListResponse List(this IMetricDefinitionOperations operations, string resourceId, IList <string> metricNames, string metricNamespace)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IMetricDefinitionOperations)s).ListAsync(resourceId, metricNames, metricNamespace);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the MetricsClient class.
 /// </summary>
 private MetricsClient()
     : base()
 {
     this._metricDefinitions = new MetricDefinitionOperations(this);
     this._metricSettings    = new MetricSettingOperations(this);
     this._metricValues      = new MetricValueOperations(this);
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Initializes a new instance of the InsightsClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public InsightsClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._metricDefinitionOperations = new MetricDefinitionOperations(this);
     this._metricOperations           = new MetricOperations(this);
     this._apiVersion = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the MetricsClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private MetricsClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._metricDefinitions = new MetricDefinitionOperations(this);
     this._metricSettings    = new MetricSettingOperations(this);
     this._metricValues      = new MetricValueOperations(this);
     this._apiVersion        = "2013-10-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Initializes a new instance of the InsightsClient class.
 /// </summary>
 private InsightsClient()
     : base()
 {
     this._eventOperations            = new EventOperations(this);
     this._metricDefinitionOperations = new MetricDefinitionOperations(this);
     this._metricOperations           = new MetricOperations(this);
     this._usageMetricOperations      = new UsageMetricsOperations(this);
     this._apiVersion = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Exemple #7
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;
         }
     }
 }
Exemple #8
0
 /// <summary>
 /// The List Metric Definitions operation lists the metric definitions
 /// for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Insights.Legacy.IMetricDefinitionOperations.
 /// </param>
 /// <param name='resourceUri'>
 /// Required. The resource identifier of the target resource to get
 /// metrics for.
 /// </param>
 /// <param name='filterString'>
 /// Optional. An OData $filter expression that supports querying by the
 /// name of the metric definition. For example, "name.value eq
 /// 'Percentage CPU'". Name is optional, meaning the expression may be
 /// "".
 /// </param>
 /// <returns>
 /// The List Metric Definitions operation response.
 /// </returns>
 public static Task <MetricDefinitionListResponse> GetMetricDefinitionsAsync(this IMetricDefinitionOperations operations, string resourceUri, string filterString)
 {
     return(operations.GetMetricDefinitionsAsync(resourceUri, filterString, CancellationToken.None));
 }
 /// <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));
 }