Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monitor] SDK version 0.19.0-preview #4108

Merged
merged 8 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public partial interface IMetricDefinitionsOperations
/// <param name='resourceUri'>
/// The identifier of the resource.
/// </param>
/// <param name='metricnamespace'>
/// Metric namespace to query metric definitions for.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -44,6 +47,6 @@ public partial interface IMetricDefinitionsOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IEnumerable<MetricDefinition>>> ListWithHttpMessagesAsync(string resourceUri, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<IEnumerable<MetricDefinition>>> ListWithHttpMessagesAsync(string resourceUri, string metricnamespace = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,31 @@ public partial interface IMetricsOperations
/// <param name='interval'>
/// The interval (i.e. timegrain) of the query.
/// </param>
/// <param name='metric'>
/// The name of the metric to retrieve.
/// <param name='metricnames'>
/// The names of the metrics (comma separated) to retrieve.
/// </param>
/// <param name='aggregation'>
/// The list of aggregation types (comma separated) to retrieve.
/// </param>
/// <param name='top'>
/// The maximum number of records to retrieve.
/// Valid only if $filter is specified.
/// Defaults to 10.
/// </param>
/// <param name='orderby'>
/// The aggregation to use for sorting results and the direction of the
/// sort.
/// Only one order can be specified.
/// Examples: sum asc.
/// </param>
/// <param name='resultType'>
/// Reduces the set of data collected. The syntax allowed depends on
/// the operation. See the operation's description for details.
/// Possible values include: 'Data', 'Metadata'
/// </param>
/// <param name='metricnamespace'>
/// Metric namespace to query metric definitions for.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -66,6 +80,6 @@ public partial interface IMetricsOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<Response>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery<MetadataValue> odataQuery = default(ODataQuery<MetadataValue>), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string metric = default(string), string aggregation = default(string), ResultType? resultType = default(ResultType?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<Response>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery<MetadataValue> odataQuery = default(ODataQuery<MetadataValue>), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string metricnames = default(string), string aggregation = default(string), double? top = default(double?), string orderby = default(string), ResultType? resultType = default(ResultType?), string metricnamespace = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ internal MetricDefinitionsOperations(MonitorManagementClient client)
/// <param name='resourceUri'>
/// The identifier of the resource.
/// </param>
/// <param name='metricnamespace'>
/// Metric namespace to query metric definitions for.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -77,13 +80,13 @@ internal MetricDefinitionsOperations(MonitorManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<IEnumerable<MetricDefinition>>> ListWithHttpMessagesAsync(string resourceUri, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<IEnumerable<MetricDefinition>>> ListWithHttpMessagesAsync(string resourceUri, string metricnamespace = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceUri == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri");
}
string apiVersion = "2017-05-01-preview";
string apiVersion = "2018-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -93,6 +96,7 @@ internal MetricDefinitionsOperations(MonitorManagementClient client)
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceUri", resourceUri);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("metricnamespace", metricnamespace);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
Expand All @@ -105,6 +109,10 @@ internal MetricDefinitionsOperations(MonitorManagementClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (metricnamespace != null)
{
_queryParameters.Add(string.Format("metricnamespace={0}", System.Uri.EscapeDataString(metricnamespace)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public static partial class MetricDefinitionsOperationsExtensions
/// <param name='resourceUri'>
/// The identifier of the resource.
/// </param>
public static IEnumerable<MetricDefinition> List(this IMetricDefinitionsOperations operations, string resourceUri)
/// <param name='metricnamespace'>
/// Metric namespace to query metric definitions for.
/// </param>
public static IEnumerable<MetricDefinition> List(this IMetricDefinitionsOperations operations, string resourceUri, string metricnamespace = default(string))
{
return operations.ListAsync(resourceUri).GetAwaiter().GetResult();
return operations.ListAsync(resourceUri, metricnamespace).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -46,12 +49,15 @@ public static IEnumerable<MetricDefinition> List(this IMetricDefinitionsOperatio
/// <param name='resourceUri'>
/// The identifier of the resource.
/// </param>
/// <param name='metricnamespace'>
/// Metric namespace to query metric definitions for.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IEnumerable<MetricDefinition>> ListAsync(this IMetricDefinitionsOperations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<IEnumerable<MetricDefinition>> ListAsync(this IMetricDefinitionsOperations operations, string resourceUri, string metricnamespace = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, metricnamespace, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
42 changes: 35 additions & 7 deletions src/SDKs/Monitor/Management.Monitor/Generated/MetricsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,30 @@ internal MetricsOperations(MonitorManagementClient client)
/// <param name='interval'>
/// The interval (i.e. timegrain) of the query.
/// </param>
/// <param name='metric'>
/// The name of the metric to retrieve.
/// <param name='metricnames'>
/// The names of the metrics (comma separated) to retrieve.
/// </param>
/// <param name='aggregation'>
/// The list of aggregation types (comma separated) to retrieve.
/// </param>
/// <param name='top'>
/// The maximum number of records to retrieve.
/// Valid only if $filter is specified.
/// Defaults to 10.
/// </param>
/// <param name='orderby'>
/// The aggregation to use for sorting results and the direction of the sort.
/// Only one order can be specified.
/// Examples: sum asc.
/// </param>
/// <param name='resultType'>
/// Reduces the set of data collected. The syntax allowed depends on the
/// operation. See the operation's description for details. Possible values
/// include: 'Data', 'Metadata'
/// </param>
/// <param name='metricnamespace'>
/// Metric namespace to query metric definitions for.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -99,13 +112,13 @@ internal MetricsOperations(MonitorManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<Response>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery<MetadataValue> odataQuery = default(ODataQuery<MetadataValue>), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string metric = default(string), string aggregation = default(string), ResultType? resultType = default(ResultType?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<Response>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery<MetadataValue> odataQuery = default(ODataQuery<MetadataValue>), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string metricnames = default(string), string aggregation = default(string), double? top = default(double?), string orderby = default(string), ResultType? resultType = default(ResultType?), string metricnamespace = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceUri == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri");
}
string apiVersion = "2017-05-01-preview";
string apiVersion = "2018-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -117,10 +130,13 @@ internal MetricsOperations(MonitorManagementClient client)
tracingParameters.Add("resourceUri", resourceUri);
tracingParameters.Add("timespan", timespan);
tracingParameters.Add("interval", interval);
tracingParameters.Add("metric", metric);
tracingParameters.Add("metricnames", metricnames);
tracingParameters.Add("aggregation", aggregation);
tracingParameters.Add("top", top);
tracingParameters.Add("orderby", orderby);
tracingParameters.Add("resultType", resultType);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("metricnamespace", metricnamespace);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
Expand All @@ -145,14 +161,22 @@ internal MetricsOperations(MonitorManagementClient client)
{
_queryParameters.Add(string.Format("interval={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(interval, Client.SerializationSettings).Trim('"'))));
}
if (metric != null)
if (metricnames != null)
{
_queryParameters.Add(string.Format("metric={0}", System.Uri.EscapeDataString(metric)));
_queryParameters.Add(string.Format("metricnames={0}", System.Uri.EscapeDataString(metricnames)));
}
if (aggregation != null)
{
_queryParameters.Add(string.Format("aggregation={0}", System.Uri.EscapeDataString(aggregation)));
}
if (top != null)
{
_queryParameters.Add(string.Format("top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
}
if (orderby != null)
{
_queryParameters.Add(string.Format("orderby={0}", System.Uri.EscapeDataString(orderby)));
}
if (resultType != null)
{
_queryParameters.Add(string.Format("resultType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(resultType, Client.SerializationSettings).Trim('"'))));
Expand All @@ -161,6 +185,10 @@ internal MetricsOperations(MonitorManagementClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (metricnamespace != null)
{
_queryParameters.Add(string.Format("metricnamespace={0}", System.Uri.EscapeDataString(metricnamespace)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
Expand Down
Loading