/// <summary> /// The List operation lists the usage metrics for the /// resource.<br>**WARNING**: This operation will be *deprecated* in the /// next release. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceUri'> /// The identifier of the resource. /// </param> /// <param name='apiVersion'> /// Client Api Version. NOTE: This is not a client property, it must be /// explicit in the call and there is no default value. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <UsageMetricInner> > ListAsync(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, ODataQuery <UsageMetricInner> odataQuery = default(ODataQuery <UsageMetricInner>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, apiVersion, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// The List operation lists the usage metrics for the resource. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Monitoring.Usages.IUsageMetricsOperations. /// </param> /// <param name='resourceUri'> /// Required. /// </param> /// <param name='metricNames'> /// Required. /// </param> /// <returns> /// The List Usage Metric operation response. /// </returns> public static UsageMetricListResponse List(this IUsageMetricsOperations operations, string resourceUri, IList <string> metricNames) { return(Task.Factory.StartNew((object s) => { return ((IUsageMetricsOperations)s).ListAsync(resourceUri, metricNames); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the UsagesClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> private UsagesClient(HttpClient httpClient) : base(httpClient) { this._usageMetrics = new UsageMetricsOperations(this); this._apiVersion = "2014-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; 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._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); }
/// <summary> /// The List operation lists the usage metrics for the resource. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Monitoring.Usages.IUsageMetricsOperations. /// </param> /// <param name='resourceUri'> /// Required. /// </param> /// <param name='metricNames'> /// Required. /// </param> /// <returns> /// The List Usage Metric operation response. /// </returns> public static Task <UsageMetricListResponse> ListAsync(this IUsageMetricsOperations operations, string resourceUri, IList <string> metricNames) { return(operations.ListAsync(resourceUri, metricNames, CancellationToken.None)); }
/// <summary> /// Initializes a new instance of the UsagesClient class. /// </summary> private UsagesClient() : base() { this._usageMetrics = new UsageMetricsOperations(this); this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// The List operation lists the usage metrics for the resource. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Insights.IUsageMetricsOperations. /// </param> /// <param name='resourceUri'> /// Required. The resource identifier of the target resource to get /// usages for. /// </param> /// <param name='filterString'> /// Optional. An OData $filter expression that supports querying by the /// name of the usage. For example, "name.value eq 'Percentage CPU'". /// Name is optional, meaning the expression may be "". /// </param> /// <returns> /// The List Usage Metric operation response. /// </returns> public static Task <UsageMetricListResponse> ListAsync(this IUsageMetricsOperations operations, string resourceUri, string filterString) { return(operations.ListAsync(resourceUri, filterString, CancellationToken.None)); }
/// <summary> /// The List operation lists the usage metrics for the resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceUri'> /// The identifier of the resource. /// </param> /// <param name='apiVersion'> /// The client Api Version. /// </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 <UsageMetric> > ListAsync(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery <UsageMetric> odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery <UsageMetric>), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, apiVersion, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// The List operation lists the usage metrics for the resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceUri'> /// The identifier of the resource. /// </param> /// <param name='apiVersion'> /// The client Api Version. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static System.Collections.Generic.IEnumerable <UsageMetric> List(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery <UsageMetric> odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery <UsageMetric>)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageMetricsOperations)s).ListAsync(resourceUri, apiVersion, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The List operation lists the usage metrics for the resource. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Insights.IUsageMetricsOperations. /// </param> /// <param name='resourceUri'> /// Required. The resource identifier of the target resource to get /// usages for. /// </param> /// <param name='metricNames'> /// Required. metric names to return. /// </param> /// <param name='apiVersion'> /// Required. The resource provider api version. /// </param> /// <returns> /// Deprecated. The List Usage Metric operation response. /// </returns> public static Task <UsageMetricListResponseDeprecated> ListDeprecatedAsync(this IUsageMetricsOperations operations, string resourceUri, IList <string> metricNames, string apiVersion) { return(operations.ListDeprecatedAsync(resourceUri, metricNames, apiVersion, CancellationToken.None)); }