From 8b3f26fe2450bd6e7952f08138c817091fb9c46f Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Thu, 28 Mar 2019 22:26:28 +0000 Subject: [PATCH 1/5] .NET SDK Resource Provider:'Monitor' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5500' REST Spec PR Author 'asafst' REST Spec PR Last commit --- src/SDKs/Monitor/AzSdk.RP.props | 2 +- .../Generated/ActionGroupsOperations.cs | 14 +- .../Generated/IMetricBaselinesOperations.cs | 89 +++++ .../Generated/IMonitorManagementClient.cs | 5 + .../Generated/MetricBaselinesOperations.cs | 308 ++++++++++++++++++ .../MetricBaselinesOperationsExtensions.cs | 137 ++++++++ .../Generated/Models/ArmRoleReceiver.cs | 11 +- .../Models/AutomationRunbookReceiver.cs | 11 +- .../Generated/Models/AzureFunctionReceiver.cs | 11 +- .../Generated/Models/BaselineMetadata.cs | 77 +++++ .../Generated/Models/EmailReceiver.cs | 11 +- .../Generated/Models/LogicAppReceiver.cs | 11 +- .../Generated/Models/MetricBaseline.cs | 107 ++++++ .../Models/MetricBaselinesResponse.cs | 110 +++++++ .../Generated/Models/MetricSingleDimension.cs | 77 +++++ .../Generated/Models/TimeSeriesBaseline.cs | 141 ++++++++ .../Generated/Models/WebhookReceiver.cs | 11 +- .../Generated/MonitorManagementClient.cs | 6 + .../Generated/SdkInfo_MonitorClient.cs | 3 +- 19 files changed, 1127 insertions(+), 15 deletions(-) create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineMetadata.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricSingleDimension.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs diff --git a/src/SDKs/Monitor/AzSdk.RP.props b/src/SDKs/Monitor/AzSdk.RP.props index 4d636c6a8b56..075c7cfa0808 100644 --- a/src/SDKs/Monitor/AzSdk.RP.props +++ b/src/SDKs/Monitor/AzSdk.RP.props @@ -1,7 +1,7 @@ - Insights_2018-03-01;Insights_2018-11-27-preview;insights_2018-09-01;insights_2017-04-01;insights_2015-04-01;insights_2016-03-01;insights_2017-05-01-preview;insights_2017-11-01-preview;insights_2018-01-01;insights_2017-12-01-preview;insights_2018-04-16; + Insights_2018-03-01;Insights_2018-11-27-preview;insights_2019-03-01;insights_2017-04-01;insights_2015-04-01;insights_2016-03-01;insights_2017-05-01-preview;insights_2017-11-01-preview;insights_2018-01-01;insights_2017-12-01-preview;insights_2018-04-16; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/ActionGroupsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/ActionGroupsOperations.cs index 0851f41ee670..254d58bcc04e 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/ActionGroupsOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/ActionGroupsOperations.cs @@ -105,7 +105,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -319,7 +319,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -684,7 +684,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupPatch"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -866,7 +866,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1044,7 +1044,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1237,7 +1237,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "receiverName"); } - string apiVersion = "2018-09-01"; + string apiVersion = "2019-03-01"; EnableRequest enableRequest = new EnableRequest(); if (receiverName != null) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs new file mode 100644 index 000000000000..f6d710b890fa --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MetricBaselinesOperations operations. + /// + public partial interface IMetricBaselinesOperations + { + /// + /// **Gets the metric baseline values**. + /// + /// + /// The identifier of the resource. It has the following structure: + /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. + /// For example: + /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// + /// + /// The names of the metrics (comma separated) to retrieve. + /// + /// + /// Metric namespace to query metric definitions for. + /// + /// + /// The timespan of the query. It is a string with the following format + /// 'startDateTime_ISO/endDateTime_ISO'. + /// + /// + /// The interval (i.e. timegrain) of the query. + /// + /// + /// The list of aggregation types (comma separated) to retrieve. + /// + /// + /// The list of sensitivities (comma separated) to retrieve. + /// + /// + /// The **$filter** is used to reduce the set of metric data + /// returned.<br>Example:<br>Metric contains metadata A, B + /// and C.<br>- Return all time series of C where A = a1 and B = + /// b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ + /// and C eq ‘*’**<br>- Invalid variant:<br>**$filter=A eq + /// ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is + /// invalid because the logical or operator cannot separate two + /// different metadata names.<br>- Return all time series where A + /// = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ + /// and C eq ‘c1’**<br>- Return all time series where A = + /// a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + /// + /// + /// Allows retrieving only metadata of the baseline. On data request + /// all information is retrieved. Possible values include: 'Data', + /// 'Metadata' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs index 34dcec6b1430..86a4999e0ef9 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs @@ -139,6 +139,11 @@ public partial interface IMonitorManagementClient : System.IDisposable /// IMetricBaselineOperations MetricBaseline { get; } + /// + /// Gets the IMetricBaselinesOperations. + /// + IMetricBaselinesOperations MetricBaselines { get; } + /// /// Gets the IMetricAlertsOperations. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs new file mode 100644 index 000000000000..9e02480a32f6 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs @@ -0,0 +1,308 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MetricBaselinesOperations operations. + /// + internal partial class MetricBaselinesOperations : IServiceOperations, IMetricBaselinesOperations + { + /// + /// Initializes a new instance of the MetricBaselinesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MetricBaselinesOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// **Gets the metric baseline values**. + /// + /// + /// The identifier of the resource. It has the following structure: + /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. + /// For example: + /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// + /// + /// The names of the metrics (comma separated) to retrieve. + /// + /// + /// Metric namespace to query metric definitions for. + /// + /// + /// The timespan of the query. It is a string with the following format + /// 'startDateTime_ISO/endDateTime_ISO'. + /// + /// + /// The interval (i.e. timegrain) of the query. + /// + /// + /// The list of aggregation types (comma separated) to retrieve. + /// + /// + /// The list of sensitivities (comma separated) to retrieve. + /// + /// + /// The **$filter** is used to reduce the set of metric data + /// returned.<br>Example:<br>Metric contains metadata A, B and + /// C.<br>- Return all time series of C where A = a1 and B = b1 or + /// b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq + /// ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq + /// ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the + /// logical or operator cannot separate two different metadata + /// names.<br>- Return all time series where A = a1, B = b1 and C = + /// c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- + /// Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq + /// ‘*’ and C eq ‘*’**. + /// + /// + /// Allows retrieving only metadata of the baseline. On data request all + /// information is retrieved. Possible values include: 'Data', 'Metadata' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceUri == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); + } + string apiVersion = "2019-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceUri", resourceUri); + tracingParameters.Add("metricnames", metricnames); + tracingParameters.Add("metricnamespace", metricnamespace); + tracingParameters.Add("timespan", timespan); + tracingParameters.Add("interval", interval); + tracingParameters.Add("aggregation", aggregation); + tracingParameters.Add("sensitivities", sensitivities); + tracingParameters.Add("filter", filter); + tracingParameters.Add("resultType", resultType); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricBaselines").ToString(); + _url = _url.Replace("{resourceUri}", resourceUri); + List _queryParameters = new List(); + if (metricnames != null) + { + _queryParameters.Add(string.Format("metricnames={0}", System.Uri.EscapeDataString(metricnames))); + } + if (metricnamespace != null) + { + _queryParameters.Add(string.Format("metricnamespace={0}", System.Uri.EscapeDataString(metricnamespace))); + } + if (timespan != null) + { + _queryParameters.Add(string.Format("timespan={0}", System.Uri.EscapeDataString(timespan))); + } + if (interval != null) + { + _queryParameters.Add(string.Format("interval={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(interval, Client.SerializationSettings).Trim('"')))); + } + if (aggregation != null) + { + _queryParameters.Add(string.Format("aggregation={0}", System.Uri.EscapeDataString(aggregation))); + } + if (sensitivities != null) + { + _queryParameters.Add(string.Format("sensitivities={0}", System.Uri.EscapeDataString(sensitivities))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (resultType != null) + { + _queryParameters.Add(string.Format("resultType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(resultType, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs new file mode 100644 index 000000000000..013993d2988c --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs @@ -0,0 +1,137 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MetricBaselinesOperations. + /// + public static partial class MetricBaselinesOperationsExtensions + { + /// + /// **Gets the metric baseline values**. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. It has the following structure: + /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. + /// For example: + /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// + /// + /// The names of the metrics (comma separated) to retrieve. + /// + /// + /// Metric namespace to query metric definitions for. + /// + /// + /// The timespan of the query. It is a string with the following format + /// 'startDateTime_ISO/endDateTime_ISO'. + /// + /// + /// The interval (i.e. timegrain) of the query. + /// + /// + /// The list of aggregation types (comma separated) to retrieve. + /// + /// + /// The list of sensitivities (comma separated) to retrieve. + /// + /// + /// The **$filter** is used to reduce the set of metric data + /// returned.<br>Example:<br>Metric contains metadata A, B and + /// C.<br>- Return all time series of C where A = a1 and B = b1 or + /// b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq + /// ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq + /// ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the + /// logical or operator cannot separate two different metadata + /// names.<br>- Return all time series where A = a1, B = b1 and C = + /// c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- + /// Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq + /// ‘*’ and C eq ‘*’**. + /// + /// + /// Allows retrieving only metadata of the baseline. On data request all + /// information is retrieved. Possible values include: 'Data', 'Metadata' + /// + public static MetricBaselinesResponse Get(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) + { + return operations.GetAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType).GetAwaiter().GetResult(); + } + + /// + /// **Gets the metric baseline values**. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. It has the following structure: + /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. + /// For example: + /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// + /// + /// The names of the metrics (comma separated) to retrieve. + /// + /// + /// Metric namespace to query metric definitions for. + /// + /// + /// The timespan of the query. It is a string with the following format + /// 'startDateTime_ISO/endDateTime_ISO'. + /// + /// + /// The interval (i.e. timegrain) of the query. + /// + /// + /// The list of aggregation types (comma separated) to retrieve. + /// + /// + /// The list of sensitivities (comma separated) to retrieve. + /// + /// + /// The **$filter** is used to reduce the set of metric data + /// returned.<br>Example:<br>Metric contains metadata A, B and + /// C.<br>- Return all time series of C where A = a1 and B = b1 or + /// b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq + /// ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq + /// ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the + /// logical or operator cannot separate two different metadata + /// names.<br>- Return all time series where A = a1, B = b1 and C = + /// c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- + /// Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq + /// ‘*’ and C eq ‘*’**. + /// + /// + /// Allows retrieving only metadata of the baseline. On data request all + /// information is retrieved. Possible values include: 'Data', 'Metadata' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/ArmRoleReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/ArmRoleReceiver.cs index d9c0d05b5105..b6868eab8890 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/ArmRoleReceiver.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/ArmRoleReceiver.cs @@ -33,10 +33,13 @@ public ArmRoleReceiver() /// The name of the arm role receiver. Names must be /// unique across all receivers within an action group. /// The arm role id. - public ArmRoleReceiver(string name, string roleId) + /// Indicates whether to use common + /// alert schema. + public ArmRoleReceiver(string name, string roleId, bool useCommonAlertSchema) { Name = name; RoleId = roleId; + UseCommonAlertSchema = useCommonAlertSchema; CustomInit(); } @@ -58,6 +61,12 @@ public ArmRoleReceiver(string name, string roleId) [JsonProperty(PropertyName = "roleId")] public string RoleId { get; set; } + /// + /// Gets or sets indicates whether to use common alert schema. + /// + [JsonProperty(PropertyName = "useCommonAlertSchema")] + public bool UseCommonAlertSchema { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/AutomationRunbookReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/AutomationRunbookReceiver.cs index cfedf1c65816..3acb0207fb46 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/AutomationRunbookReceiver.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/AutomationRunbookReceiver.cs @@ -38,10 +38,12 @@ public AutomationRunbookReceiver() /// to this runbook. /// Indicates whether this instance is /// global runbook. + /// Indicates whether to use common + /// alert schema. /// Indicates name of the webhook. /// The URI where webhooks should be /// sent. - public AutomationRunbookReceiver(string automationAccountId, string runbookName, string webhookResourceId, bool isGlobalRunbook, string name = default(string), string serviceUri = default(string)) + public AutomationRunbookReceiver(string automationAccountId, string runbookName, string webhookResourceId, bool isGlobalRunbook, bool useCommonAlertSchema, string name = default(string), string serviceUri = default(string)) { AutomationAccountId = automationAccountId; RunbookName = runbookName; @@ -49,6 +51,7 @@ public AutomationRunbookReceiver() IsGlobalRunbook = isGlobalRunbook; Name = name; ServiceUri = serviceUri; + UseCommonAlertSchema = useCommonAlertSchema; CustomInit(); } @@ -94,6 +97,12 @@ public AutomationRunbookReceiver() [JsonProperty(PropertyName = "serviceUri")] public string ServiceUri { get; set; } + /// + /// Gets or sets indicates whether to use common alert schema. + /// + [JsonProperty(PropertyName = "useCommonAlertSchema")] + public bool UseCommonAlertSchema { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/AzureFunctionReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/AzureFunctionReceiver.cs index e1f6536f30d1..9a0157305b0b 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/AzureFunctionReceiver.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/AzureFunctionReceiver.cs @@ -38,12 +38,15 @@ public AzureFunctionReceiver() /// app. /// The http trigger url where http /// request sent to. - public AzureFunctionReceiver(string name, string functionAppResourceId, string functionName, string httpTriggerUrl) + /// Indicates whether to use common + /// alert schema. + public AzureFunctionReceiver(string name, string functionAppResourceId, string functionName, string httpTriggerUrl, bool useCommonAlertSchema) { Name = name; FunctionAppResourceId = functionAppResourceId; FunctionName = functionName; HttpTriggerUrl = httpTriggerUrl; + UseCommonAlertSchema = useCommonAlertSchema; CustomInit(); } @@ -77,6 +80,12 @@ public AzureFunctionReceiver(string name, string functionAppResourceId, string f [JsonProperty(PropertyName = "httpTriggerUrl")] public string HttpTriggerUrl { get; set; } + /// + /// Gets or sets indicates whether to use common alert schema. + /// + [JsonProperty(PropertyName = "useCommonAlertSchema")] + public bool UseCommonAlertSchema { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineMetadata.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineMetadata.cs new file mode 100644 index 000000000000..fa234fe8bac1 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineMetadata.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a baseline metadata value. + /// + public partial class BaselineMetadata + { + /// + /// Initializes a new instance of the BaselineMetadata class. + /// + public BaselineMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BaselineMetadata class. + /// + /// Name of the baseline metadata. + /// Value of the baseline metadata. + public BaselineMetadata(string name, string value) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the baseline metadata. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets value of the baseline metadata. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/EmailReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/EmailReceiver.cs index e918d145deea..edd022c9f92f 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/EmailReceiver.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/EmailReceiver.cs @@ -34,12 +34,15 @@ public EmailReceiver() /// unique across all receivers within an action group. /// The email address of this /// receiver. + /// Indicates whether to use common + /// alert schema. /// The receiver status of the e-mail. Possible /// values include: 'NotSpecified', 'Enabled', 'Disabled' - public EmailReceiver(string name, string emailAddress, ReceiverStatus? status = default(ReceiverStatus?)) + public EmailReceiver(string name, string emailAddress, bool useCommonAlertSchema, ReceiverStatus? status = default(ReceiverStatus?)) { Name = name; EmailAddress = emailAddress; + UseCommonAlertSchema = useCommonAlertSchema; Status = status; CustomInit(); } @@ -62,6 +65,12 @@ public EmailReceiver() [JsonProperty(PropertyName = "emailAddress")] public string EmailAddress { get; set; } + /// + /// Gets or sets indicates whether to use common alert schema. + /// + [JsonProperty(PropertyName = "useCommonAlertSchema")] + public bool UseCommonAlertSchema { get; set; } + /// /// Gets the receiver status of the e-mail. Possible values include: /// 'NotSpecified', 'Enabled', 'Disabled' diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/LogicAppReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/LogicAppReceiver.cs index 0ee911383ac4..862a2a8dd73f 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/LogicAppReceiver.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/LogicAppReceiver.cs @@ -36,11 +36,14 @@ public LogicAppReceiver() /// receiver. /// The callback url where http request sent /// to. - public LogicAppReceiver(string name, string resourceId, string callbackUrl) + /// Indicates whether to use common + /// alert schema. + public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool useCommonAlertSchema) { Name = name; ResourceId = resourceId; CallbackUrl = callbackUrl; + UseCommonAlertSchema = useCommonAlertSchema; CustomInit(); } @@ -68,6 +71,12 @@ public LogicAppReceiver(string name, string resourceId, string callbackUrl) [JsonProperty(PropertyName = "callbackUrl")] public string CallbackUrl { get; set; } + /// + /// Gets or sets indicates whether to use common alert schema. + /// + [JsonProperty(PropertyName = "useCommonAlertSchema")] + public bool UseCommonAlertSchema { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs new file mode 100644 index 000000000000..7392c39b0845 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The baseline results of a specific metric. + /// + public partial class MetricBaseline + { + /// + /// Initializes a new instance of the MetricBaseline class. + /// + public MetricBaseline() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricBaseline class. + /// + /// the metric baseline Id. + /// the resource type of the metric baseline + /// resource. + /// the name of the metric. + /// the baseline for each time series that was + /// queried. + public MetricBaseline(string id, string type, string metricName, IList baselines) + { + Id = id; + Type = type; + MetricName = metricName; + Baselines = baselines; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the metric baseline Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets the resource type of the metric baseline resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the name of the metric. + /// + [JsonProperty(PropertyName = "metricName")] + public string MetricName { get; private set; } + + /// + /// Gets or sets the baseline for each time series that was queried. + /// + [JsonProperty(PropertyName = "baselines")] + public IList Baselines { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (Baselines == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Baselines"); + } + if (Baselines != null) + { + foreach (var element in Baselines) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs new file mode 100644 index 000000000000..4039d8cd2cb3 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The response to a metric baselines query. + /// + public partial class MetricBaselinesResponse + { + /// + /// Initializes a new instance of the MetricBaselinesResponse class. + /// + public MetricBaselinesResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricBaselinesResponse class. + /// + /// The timespan for which the data was + /// retrieved. Its value consists of two datetimes concatenated, + /// separated by '/'. This may be adjusted in the future and returned + /// back from what was originally requested. + /// The interval (window size) for which the + /// metric data was returned in. This may be adjusted in the future + /// and returned back from what was originally requested. This is not + /// present if a metadata request was made. + /// the properties of the baseline. + /// The namespace of the metrics been + /// queried. + public MetricBaselinesResponse(string timespan, System.TimeSpan interval, MetricBaseline value, string namespaceProperty = default(string)) + { + Timespan = timespan; + Interval = interval; + NamespaceProperty = namespaceProperty; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the timespan for which the data was retrieved. Its + /// value consists of two datetimes concatenated, separated by '/'. + /// This may be adjusted in the future and returned back from what was + /// originally requested. + /// + [JsonProperty(PropertyName = "timespan")] + public string Timespan { get; set; } + + /// + /// Gets or sets the interval (window size) for which the metric data + /// was returned in. This may be adjusted in the future and returned + /// back from what was originally requested. This is not present if a + /// metadata request was made. + /// + [JsonProperty(PropertyName = "interval")] + public System.TimeSpan Interval { get; set; } + + /// + /// Gets or sets the namespace of the metrics been queried. + /// + [JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty { get; set; } + + /// + /// Gets or sets the properties of the baseline. + /// + [JsonProperty(PropertyName = "value")] + public MetricBaseline Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Timespan == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Timespan"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (Value != null) + { + Value.Validate(); + } + } + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricSingleDimension.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricSingleDimension.cs new file mode 100644 index 000000000000..b80789586206 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricSingleDimension.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The metric dimension name and value. + /// + public partial class MetricSingleDimension + { + /// + /// Initializes a new instance of the MetricSingleDimension class. + /// + public MetricSingleDimension() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricSingleDimension class. + /// + /// Name of the dimension. + /// Value of the dimension. + public MetricSingleDimension(string name, string value) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the dimension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets value of the dimension. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs new file mode 100644 index 000000000000..52e3df40e060 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs @@ -0,0 +1,141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The time series baseline class. + /// + public partial class TimeSeriesBaseline + { + /// + /// Initializes a new instance of the TimeSeriesBaseline class. + /// + public TimeSeriesBaseline() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TimeSeriesBaseline class. + /// + /// The aggregation type of the + /// metric. + /// the array of timestamps of the + /// baselines. + /// the baseline values for each + /// sensitivity. + /// the dimensions of this time + /// series. + /// the baseline metadata values. + public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadata = default(IList)) + { + Aggregation = aggregation; + Dimensions = dimensions; + Timestamps = timestamps; + Data = data; + Metadata = metadata; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the aggregation type of the metric. + /// + [JsonProperty(PropertyName = "aggregation")] + public string Aggregation { get; set; } + + /// + /// Gets or sets the dimensions of this time series. + /// + [JsonProperty(PropertyName = "dimensions")] + public IList Dimensions { get; set; } + + /// + /// Gets or sets the array of timestamps of the baselines. + /// + [JsonProperty(PropertyName = "timestamps")] + public IList Timestamps { get; set; } + + /// + /// Gets or sets the baseline values for each sensitivity. + /// + [JsonProperty(PropertyName = "data")] + public IList Data { get; set; } + + /// + /// Gets or sets the baseline metadata values. + /// + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Aggregation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Aggregation"); + } + if (Timestamps == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Timestamps"); + } + if (Data == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Data"); + } + if (Dimensions != null) + { + foreach (var element in Dimensions) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Data != null) + { + foreach (var element1 in Data) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (Metadata != null) + { + foreach (var element2 in Metadata) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/WebhookReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/WebhookReceiver.cs index 407fc4c66554..2f026b0e4399 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/WebhookReceiver.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/WebhookReceiver.cs @@ -34,10 +34,13 @@ public WebhookReceiver() /// unique across all receivers within an action group. /// The URI where webhooks should be /// sent. - public WebhookReceiver(string name, string serviceUri) + /// Indicates whether to use common + /// alert schema. + public WebhookReceiver(string name, string serviceUri, bool useCommonAlertSchema) { Name = name; ServiceUri = serviceUri; + UseCommonAlertSchema = useCommonAlertSchema; CustomInit(); } @@ -59,6 +62,12 @@ public WebhookReceiver(string name, string serviceUri) [JsonProperty(PropertyName = "serviceUri")] public string ServiceUri { get; set; } + /// + /// Gets or sets indicates whether to use common alert schema. + /// + [JsonProperty(PropertyName = "useCommonAlertSchema")] + public bool UseCommonAlertSchema { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs index b4b3b30f8bbd..fc758332600c 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs @@ -144,6 +144,11 @@ public partial class MonitorManagementClient : ServiceClient public virtual IMetricBaselineOperations MetricBaseline { get; private set; } + /// + /// Gets the IMetricBaselinesOperations. + /// + public virtual IMetricBaselinesOperations MetricBaselines { get; private set; } + /// /// Gets the IMetricAlertsOperations. /// @@ -425,6 +430,7 @@ private void Initialize() MetricDefinitions = new MetricDefinitionsOperations(this); Metrics = new MetricsOperations(this); MetricBaseline = new MetricBaselineOperations(this); + MetricBaselines = new MetricBaselinesOperations(this); MetricAlerts = new MetricAlertsOperations(this); MetricAlertsStatus = new MetricAlertsStatusOperations(this); ScheduledQueryRules = new ScheduledQueryRulesOperations(this); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs index 9520a3961e12..a397aeff522a 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs @@ -22,7 +22,7 @@ public static IEnumerable> ApiInfo_MonitorClient new Tuple("Insights", "MetricAlerts", "2018-03-01"), new Tuple("Insights", "MetricAlertsStatus", "2018-03-01"), new Tuple("Insights", "VMInsights", "2018-11-27-preview"), - new Tuple("insights", "ActionGroups", "2018-09-01"), + new Tuple("insights", "ActionGroups", "2019-03-01"), new Tuple("insights", "ActivityLogAlerts", "2017-04-01"), new Tuple("insights", "ActivityLogs", "2015-04-01"), new Tuple("insights", "AlertRuleIncidents", "2016-03-01"), @@ -33,6 +33,7 @@ public static IEnumerable> ApiInfo_MonitorClient new Tuple("insights", "EventCategories", "2015-04-01"), new Tuple("insights", "LogProfiles", "2016-03-01"), new Tuple("insights", "MetricBaseline", "2017-11-01-preview"), + new Tuple("insights", "MetricBaselines", "2019-03-01"), new Tuple("insights", "MetricDefinitions", "2018-01-01"), new Tuple("insights", "MetricNamespaces", "2017-12-01-preview"), new Tuple("insights", "Metrics", "2018-01-01"), From e6ce1aeaa73eb9c2ae9c9a4faa266640906665e3 Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Fri, 29 Mar 2019 08:30:19 +0000 Subject: [PATCH 2/5] .NET SDK Resource Provider:'Monitor' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5500' REST Spec PR Author 'asafst' REST Spec PR Last commit --- src/SDKs/Monitor/AzSdk.RP.props | 2 +- ...ineOperations.cs => BaselineOperations.cs} | 8 +++--- ...ons.cs => BaselineOperationsExtensions.cs} | 12 ++++---- ...neOperations.cs => IBaselineOperations.cs} | 4 +-- .../Generated/IMonitorManagementClient.cs | 4 +-- .../Models/MetricBaselinesResponse.cs | 9 +++--- ...ricBaseline.cs => SingleMetricBaseline.cs} | 28 ++++++++++++------- .../Generated/MonitorManagementClient.cs | 6 ++-- .../Generated/SdkInfo_MonitorClient.cs | 2 +- 9 files changed, 42 insertions(+), 33 deletions(-) rename src/SDKs/Monitor/Management.Monitor/Generated/{MetricBaselineOperations.cs => BaselineOperations.cs} (98%) rename src/SDKs/Monitor/Management.Monitor/Generated/{MetricBaselineOperationsExtensions.cs => BaselineOperationsExtensions.cs} (86%) rename src/SDKs/Monitor/Management.Monitor/Generated/{IMetricBaselineOperations.cs => IBaselineOperations.cs} (97%) rename src/SDKs/Monitor/Management.Monitor/Generated/Models/{MetricBaseline.cs => SingleMetricBaseline.cs} (75%) diff --git a/src/SDKs/Monitor/AzSdk.RP.props b/src/SDKs/Monitor/AzSdk.RP.props index 075c7cfa0808..c554c7105270 100644 --- a/src/SDKs/Monitor/AzSdk.RP.props +++ b/src/SDKs/Monitor/AzSdk.RP.props @@ -1,7 +1,7 @@ - Insights_2018-03-01;Insights_2018-11-27-preview;insights_2019-03-01;insights_2017-04-01;insights_2015-04-01;insights_2016-03-01;insights_2017-05-01-preview;insights_2017-11-01-preview;insights_2018-01-01;insights_2017-12-01-preview;insights_2018-04-16; + Insights_2018-03-01;Insights_2018-11-27-preview;insights_2019-03-01;insights_2017-04-01;insights_2015-04-01;insights_2016-03-01;insights_2017-11-01-preview;insights_2017-05-01-preview;insights_2018-01-01;insights_2017-12-01-preview;insights_2018-04-16; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperations.cs similarity index 98% rename from src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperations.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperations.cs index 048ca649aaf3..8b610a601627 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// MetricBaselineOperations operations. + /// BaselineOperations operations. /// - internal partial class MetricBaselineOperations : IServiceOperations, IMetricBaselineOperations + internal partial class BaselineOperations : IServiceOperations, IBaselineOperations { /// - /// Initializes a new instance of the MetricBaselineOperations class. + /// Initializes a new instance of the BaselineOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class MetricBaselineOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal MetricBaselineOperations(MonitorManagementClient client) + internal BaselineOperations(MonitorManagementClient client) { if (client == null) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperationsExtensions.cs similarity index 86% rename from src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperationsExtensions.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperationsExtensions.cs index 8cb8be9f8969..ea6e89e2e18d 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperationsExtensions.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// Extension methods for MetricBaselineOperations. + /// Extension methods for BaselineOperations. /// - public static partial class MetricBaselineOperationsExtensions + public static partial class BaselineOperationsExtensions { /// /// **Gets the baseline values for a specific metric**. @@ -53,7 +53,7 @@ public static partial class MetricBaselineOperationsExtensions /// Allows retrieving only metadata of the baseline. On data request all /// information is retrieved. Possible values include: 'Data', 'Metadata' /// - public static BaselineResponse Get(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?)) + public static BaselineResponse Get(this IBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?)) { return operations.GetAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType).GetAwaiter().GetResult(); } @@ -93,7 +93,7 @@ public static partial class MetricBaselineOperationsExtensions /// /// The cancellation token. /// - public static async Task GetAsync(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType, null, cancellationToken).ConfigureAwait(false)) { @@ -117,7 +117,7 @@ public static partial class MetricBaselineOperationsExtensions /// Information that need to be specified to calculate a baseline on a time /// series. /// - public static CalculateBaselineResponse CalculateBaseline(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation) + public static CalculateBaselineResponse CalculateBaseline(this IBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation) { return operations.CalculateBaselineAsync(resourceUri, timeSeriesInformation).GetAwaiter().GetResult(); } @@ -141,7 +141,7 @@ public static CalculateBaselineResponse CalculateBaseline(this IMetricBaselineOp /// /// The cancellation token. /// - public static async Task CalculateBaselineAsync(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CalculateBaselineAsync(this IBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CalculateBaselineWithHttpMessagesAsync(resourceUri, timeSeriesInformation, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselineOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselineOperations.cs similarity index 97% rename from src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselineOperations.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/IBaselineOperations.cs index fa417ecdba12..8da238e8ff10 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselineOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselineOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// MetricBaselineOperations operations. + /// BaselineOperations operations. /// - public partial interface IMetricBaselineOperations + public partial interface IBaselineOperations { /// /// **Gets the baseline values for a specific metric**. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs index 86a4999e0ef9..0331d56bb430 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs @@ -135,9 +135,9 @@ public partial interface IMonitorManagementClient : System.IDisposable IMetricsOperations Metrics { get; } /// - /// Gets the IMetricBaselineOperations. + /// Gets the IBaselineOperations. /// - IMetricBaselineOperations MetricBaseline { get; } + IBaselineOperations Baseline { get; } /// /// Gets the IMetricBaselinesOperations. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs index 4039d8cd2cb3..b8e13ee11367 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs @@ -38,10 +38,11 @@ public MetricBaselinesResponse() /// metric data was returned in. This may be adjusted in the future /// and returned back from what was originally requested. This is not /// present if a metadata request was made. - /// the properties of the baseline. + /// The baseline results of a single + /// metric. /// The namespace of the metrics been /// queried. - public MetricBaselinesResponse(string timespan, System.TimeSpan interval, MetricBaseline value, string namespaceProperty = default(string)) + public MetricBaselinesResponse(string timespan, System.TimeSpan interval, SingleMetricBaseline value, string namespaceProperty = default(string)) { Timespan = timespan; Interval = interval; @@ -80,10 +81,10 @@ public MetricBaselinesResponse() public string NamespaceProperty { get; set; } /// - /// Gets or sets the properties of the baseline. + /// Gets or sets the baseline results of a single metric. /// [JsonProperty(PropertyName = "value")] - public MetricBaseline Value { get; set; } + public SingleMetricBaseline Value { get; set; } /// /// Validate the object. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs similarity index 75% rename from src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs index 7392c39b0845..27d84b22b8b4 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaseline.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs @@ -17,20 +17,20 @@ namespace Microsoft.Azure.Management.Monitor.Models using System.Linq; /// - /// The baseline results of a specific metric. + /// The baseline results of a single metric. /// - public partial class MetricBaseline + public partial class SingleMetricBaseline { /// - /// Initializes a new instance of the MetricBaseline class. + /// Initializes a new instance of the SingleMetricBaseline class. /// - public MetricBaseline() + public SingleMetricBaseline() { CustomInit(); } /// - /// Initializes a new instance of the MetricBaseline class. + /// Initializes a new instance of the SingleMetricBaseline class. /// /// the metric baseline Id. /// the resource type of the metric baseline @@ -38,7 +38,7 @@ public MetricBaseline() /// the name of the metric. /// the baseline for each time series that was /// queried. - public MetricBaseline(string id, string type, string metricName, IList baselines) + public SingleMetricBaseline(string id, string type, string metricName, IList baselines) { Id = id; Type = type; @@ -59,16 +59,16 @@ public MetricBaseline(string id, string type, string metricName, IList - /// Gets the resource type of the metric baseline resource. + /// Gets or sets the resource type of the metric baseline resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + public string Type { get; set; } /// - /// Gets the name of the metric. + /// Gets or sets the name of the metric. /// [JsonProperty(PropertyName = "metricName")] - public string MetricName { get; private set; } + public string MetricName { get; set; } /// /// Gets or sets the baseline for each time series that was queried. @@ -88,6 +88,14 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (MetricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MetricName"); + } if (Baselines == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Baselines"); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs index fc758332600c..acacbd93f09b 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs @@ -140,9 +140,9 @@ public partial class MonitorManagementClient : ServiceClient - /// Gets the IMetricBaselineOperations. + /// Gets the IBaselineOperations. /// - public virtual IMetricBaselineOperations MetricBaseline { get; private set; } + public virtual IBaselineOperations Baseline { get; private set; } /// /// Gets the IMetricBaselinesOperations. @@ -429,7 +429,7 @@ private void Initialize() TenantActivityLogs = new TenantActivityLogsOperations(this); MetricDefinitions = new MetricDefinitionsOperations(this); Metrics = new MetricsOperations(this); - MetricBaseline = new MetricBaselineOperations(this); + Baseline = new BaselineOperations(this); MetricBaselines = new MetricBaselinesOperations(this); MetricAlerts = new MetricAlertsOperations(this); MetricAlertsStatus = new MetricAlertsStatusOperations(this); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs index a397aeff522a..0590c1915537 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs @@ -28,11 +28,11 @@ public static IEnumerable> ApiInfo_MonitorClient new Tuple("insights", "AlertRuleIncidents", "2016-03-01"), new Tuple("insights", "AlertRules", "2016-03-01"), new Tuple("insights", "AutoscaleSettings", "2015-04-01"), + new Tuple("insights", "Baseline", "2017-11-01-preview"), new Tuple("insights", "DiagnosticSettings", "2017-05-01-preview"), new Tuple("insights", "DiagnosticSettingsCategory", "2017-05-01-preview"), new Tuple("insights", "EventCategories", "2015-04-01"), new Tuple("insights", "LogProfiles", "2016-03-01"), - new Tuple("insights", "MetricBaseline", "2017-11-01-preview"), new Tuple("insights", "MetricBaselines", "2019-03-01"), new Tuple("insights", "MetricDefinitions", "2018-01-01"), new Tuple("insights", "MetricNamespaces", "2017-12-01-preview"), From d85addac7c0b377385d1be4332bd6e0ad1d6de0e Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Sat, 30 Mar 2019 06:21:26 +0000 Subject: [PATCH 3/5] .NET SDK Resource Provider:'Monitor' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5500' REST Spec PR Author 'asafst' REST Spec PR Last commit --- src/SDKs/Monitor/AzSdk.RP.props | 2 +- ...ations.cs => IMetricBaselineOperations.cs} | 4 ++-- .../Generated/IMetricBaselinesOperations.cs | 9 +++----- .../Generated/IMonitorManagementClient.cs | 4 ++-- ...rations.cs => MetricBaselineOperations.cs} | 8 +++---- ... => MetricBaselineOperationsExtensions.cs} | 12 +++++----- .../Generated/MetricBaselinesOperations.cs | 11 ++++------ .../MetricBaselinesOperationsExtensions.cs | 22 +++++++------------ .../Models/MetricBaselinesResponse.cs | 18 ++++++++++----- .../Generated/Models/SingleMetricBaseline.cs | 8 +++---- .../Generated/Models/TimeSeriesBaseline.cs | 12 +++++----- .../Generated/MonitorManagementClient.cs | 6 ++--- .../Generated/SdkInfo_MonitorClient.cs | 2 +- 13 files changed, 57 insertions(+), 61 deletions(-) rename src/SDKs/Monitor/Management.Monitor/Generated/{IBaselineOperations.cs => IMetricBaselineOperations.cs} (97%) rename src/SDKs/Monitor/Management.Monitor/Generated/{BaselineOperations.cs => MetricBaselineOperations.cs} (98%) rename src/SDKs/Monitor/Management.Monitor/Generated/{BaselineOperationsExtensions.cs => MetricBaselineOperationsExtensions.cs} (86%) diff --git a/src/SDKs/Monitor/AzSdk.RP.props b/src/SDKs/Monitor/AzSdk.RP.props index c554c7105270..075c7cfa0808 100644 --- a/src/SDKs/Monitor/AzSdk.RP.props +++ b/src/SDKs/Monitor/AzSdk.RP.props @@ -1,7 +1,7 @@ - Insights_2018-03-01;Insights_2018-11-27-preview;insights_2019-03-01;insights_2017-04-01;insights_2015-04-01;insights_2016-03-01;insights_2017-11-01-preview;insights_2017-05-01-preview;insights_2018-01-01;insights_2017-12-01-preview;insights_2018-04-16; + Insights_2018-03-01;Insights_2018-11-27-preview;insights_2019-03-01;insights_2017-04-01;insights_2015-04-01;insights_2016-03-01;insights_2017-05-01-preview;insights_2017-11-01-preview;insights_2018-01-01;insights_2017-12-01-preview;insights_2018-04-16; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IBaselineOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselineOperations.cs similarity index 97% rename from src/SDKs/Monitor/Management.Monitor/Generated/IBaselineOperations.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselineOperations.cs index 8da238e8ff10..fa417ecdba12 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IBaselineOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselineOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// BaselineOperations operations. + /// MetricBaselineOperations operations. /// - public partial interface IBaselineOperations + public partial interface IMetricBaselineOperations { /// /// **Gets the baseline values for a specific metric**. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs index f6d710b890fa..2a5da1d73810 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs @@ -24,13 +24,10 @@ namespace Microsoft.Azure.Management.Monitor public partial interface IMetricBaselinesOperations { /// - /// **Gets the metric baseline values**. + /// **Lists the metric baseline values for a resource**. /// /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// The identifier of the resource. /// /// /// The names of the metrics (comma separated) to retrieve. @@ -84,6 +81,6 @@ public partial interface IMetricBaselinesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs index 0331d56bb430..86a4999e0ef9 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs @@ -135,9 +135,9 @@ public partial interface IMonitorManagementClient : System.IDisposable IMetricsOperations Metrics { get; } /// - /// Gets the IBaselineOperations. + /// Gets the IMetricBaselineOperations. /// - IBaselineOperations Baseline { get; } + IMetricBaselineOperations MetricBaseline { get; } /// /// Gets the IMetricBaselinesOperations. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperations.cs similarity index 98% rename from src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperations.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperations.cs index 8b610a601627..048ca649aaf3 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// BaselineOperations operations. + /// MetricBaselineOperations operations. /// - internal partial class BaselineOperations : IServiceOperations, IBaselineOperations + internal partial class MetricBaselineOperations : IServiceOperations, IMetricBaselineOperations { /// - /// Initializes a new instance of the BaselineOperations class. + /// Initializes a new instance of the MetricBaselineOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class BaselineOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BaselineOperations(MonitorManagementClient client) + internal MetricBaselineOperations(MonitorManagementClient client) { if (client == null) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperationsExtensions.cs similarity index 86% rename from src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperationsExtensions.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperationsExtensions.cs index ea6e89e2e18d..8cb8be9f8969 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/BaselineOperationsExtensions.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselineOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// Extension methods for BaselineOperations. + /// Extension methods for MetricBaselineOperations. /// - public static partial class BaselineOperationsExtensions + public static partial class MetricBaselineOperationsExtensions { /// /// **Gets the baseline values for a specific metric**. @@ -53,7 +53,7 @@ public static partial class BaselineOperationsExtensions /// Allows retrieving only metadata of the baseline. On data request all /// information is retrieved. Possible values include: 'Data', 'Metadata' /// - public static BaselineResponse Get(this IBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?)) + public static BaselineResponse Get(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?)) { return operations.GetAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType).GetAwaiter().GetResult(); } @@ -93,7 +93,7 @@ public static partial class BaselineOperationsExtensions /// /// The cancellation token. /// - public static async Task GetAsync(this IBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType, null, cancellationToken).ConfigureAwait(false)) { @@ -117,7 +117,7 @@ public static partial class BaselineOperationsExtensions /// Information that need to be specified to calculate a baseline on a time /// series. /// - public static CalculateBaselineResponse CalculateBaseline(this IBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation) + public static CalculateBaselineResponse CalculateBaseline(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation) { return operations.CalculateBaselineAsync(resourceUri, timeSeriesInformation).GetAwaiter().GetResult(); } @@ -141,7 +141,7 @@ public static CalculateBaselineResponse CalculateBaseline(this IBaselineOperatio /// /// The cancellation token. /// - public static async Task CalculateBaselineAsync(this IBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CalculateBaselineAsync(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CalculateBaselineWithHttpMessagesAsync(resourceUri, timeSeriesInformation, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs index 9e02480a32f6..df9a5fe4fff2 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs @@ -51,13 +51,10 @@ internal MetricBaselinesOperations(MonitorManagementClient client) public MonitorManagementClient Client { get; private set; } /// - /// **Gets the metric baseline values**. + /// **Lists the metric baseline values for a resource**. /// /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// The identifier of the resource. /// /// /// The names of the metrics (comma separated) to retrieve. @@ -116,7 +113,7 @@ internal MetricBaselinesOperations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { @@ -141,7 +138,7 @@ internal MetricBaselinesOperations(MonitorManagementClient client) tracingParameters.Add("resultType", resultType); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs index 013993d2988c..fb1d5926eb28 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs @@ -22,16 +22,13 @@ namespace Microsoft.Azure.Management.Monitor public static partial class MetricBaselinesOperationsExtensions { /// - /// **Gets the metric baseline values**. + /// **Lists the metric baseline values for a resource**. /// /// /// The operations group for this extension method. /// /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// The identifier of the resource. /// /// /// The names of the metrics (comma separated) to retrieve. @@ -69,22 +66,19 @@ public static partial class MetricBaselinesOperationsExtensions /// Allows retrieving only metadata of the baseline. On data request all /// information is retrieved. Possible values include: 'Data', 'Metadata' /// - public static MetricBaselinesResponse Get(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) + public static MetricBaselinesResponse List(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) { - return operations.GetAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType).GetAwaiter().GetResult(); + return operations.ListAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType).GetAwaiter().GetResult(); } /// - /// **Gets the metric baseline values**. + /// **Lists the metric baseline values for a resource**. /// /// /// The operations group for this extension method. /// /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + /// The identifier of the resource. /// /// /// The names of the metrics (comma separated) to retrieve. @@ -125,9 +119,9 @@ public static partial class MetricBaselinesOperationsExtensions /// /// The cancellation token. /// - public static async Task GetAsync(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs index b8e13ee11367..290deba679c3 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Management.Monitor.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -38,11 +40,11 @@ public MetricBaselinesResponse() /// metric data was returned in. This may be adjusted in the future /// and returned back from what was originally requested. This is not /// present if a metadata request was made. - /// The baseline results of a single + /// The list of baseline results for each /// metric. /// The namespace of the metrics been /// queried. - public MetricBaselinesResponse(string timespan, System.TimeSpan interval, SingleMetricBaseline value, string namespaceProperty = default(string)) + public MetricBaselinesResponse(string timespan, System.TimeSpan interval, IList value, string namespaceProperty = default(string)) { Timespan = timespan; Interval = interval; @@ -81,10 +83,10 @@ public MetricBaselinesResponse() public string NamespaceProperty { get; set; } /// - /// Gets or sets the baseline results of a single metric. + /// Gets or sets the list of baseline results for each metric. /// [JsonProperty(PropertyName = "value")] - public SingleMetricBaseline Value { get; set; } + public IList Value { get; set; } /// /// Validate the object. @@ -104,7 +106,13 @@ public virtual void Validate() } if (Value != null) { - Value.Validate(); + foreach (var element in Value) + { + if (element != null) + { + element.Validate(); + } + } } } } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs index 27d84b22b8b4..c0aaddf31474 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs @@ -32,11 +32,11 @@ public SingleMetricBaseline() /// /// Initializes a new instance of the SingleMetricBaseline class. /// - /// the metric baseline Id. - /// the resource type of the metric baseline + /// The metric baseline Id. + /// The resource type of the metric baseline /// resource. - /// the name of the metric. - /// the baseline for each time series that was + /// The name of the metric. + /// The baseline for each time series that was /// queried. public SingleMetricBaseline(string id, string type, string metricName, IList baselines) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs index 52e3df40e060..cde974326421 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Management.Monitor.Models using System.Linq; /// - /// The time series baseline class. + /// The baseline values for a single time series. /// public partial class TimeSeriesBaseline { @@ -34,13 +34,13 @@ public TimeSeriesBaseline() /// /// The aggregation type of the /// metric. - /// the array of timestamps of the + /// The list of timestamps of the /// baselines. - /// the baseline values for each + /// The baseline values for each /// sensitivity. - /// the dimensions of this time + /// The dimensions of this time /// series. - /// the baseline metadata values. + /// The baseline metadata values. public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadata = default(IList)) { Aggregation = aggregation; @@ -69,7 +69,7 @@ public TimeSeriesBaseline() public IList Dimensions { get; set; } /// - /// Gets or sets the array of timestamps of the baselines. + /// Gets or sets the list of timestamps of the baselines. /// [JsonProperty(PropertyName = "timestamps")] public IList Timestamps { get; set; } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs index acacbd93f09b..fc758332600c 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs @@ -140,9 +140,9 @@ public partial class MonitorManagementClient : ServiceClient - /// Gets the IBaselineOperations. + /// Gets the IMetricBaselineOperations. /// - public virtual IBaselineOperations Baseline { get; private set; } + public virtual IMetricBaselineOperations MetricBaseline { get; private set; } /// /// Gets the IMetricBaselinesOperations. @@ -429,7 +429,7 @@ private void Initialize() TenantActivityLogs = new TenantActivityLogsOperations(this); MetricDefinitions = new MetricDefinitionsOperations(this); Metrics = new MetricsOperations(this); - Baseline = new BaselineOperations(this); + MetricBaseline = new MetricBaselineOperations(this); MetricBaselines = new MetricBaselinesOperations(this); MetricAlerts = new MetricAlertsOperations(this); MetricAlertsStatus = new MetricAlertsStatusOperations(this); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs index 0590c1915537..a397aeff522a 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs @@ -28,11 +28,11 @@ public static IEnumerable> ApiInfo_MonitorClient new Tuple("insights", "AlertRuleIncidents", "2016-03-01"), new Tuple("insights", "AlertRules", "2016-03-01"), new Tuple("insights", "AutoscaleSettings", "2015-04-01"), - new Tuple("insights", "Baseline", "2017-11-01-preview"), new Tuple("insights", "DiagnosticSettings", "2017-05-01-preview"), new Tuple("insights", "DiagnosticSettingsCategory", "2017-05-01-preview"), new Tuple("insights", "EventCategories", "2015-04-01"), new Tuple("insights", "LogProfiles", "2016-03-01"), + new Tuple("insights", "MetricBaseline", "2017-11-01-preview"), new Tuple("insights", "MetricBaselines", "2019-03-01"), new Tuple("insights", "MetricDefinitions", "2018-01-01"), new Tuple("insights", "MetricNamespaces", "2017-12-01-preview"), From faff4bda709bc841273a5fbc321ae645e163695a Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Sat, 30 Mar 2019 07:09:17 +0000 Subject: [PATCH 4/5] .NET SDK Resource Provider:'Monitor' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5500' REST Spec PR Author 'asafst' REST Spec PR Last commit --- ...etricBaselinesOperations.cs => BaselinesOperations.cs} | 8 ++++---- ...ionsExtensions.cs => BaselinesOperationsExtensions.cs} | 8 ++++---- ...tricBaselinesOperations.cs => IBaselinesOperations.cs} | 4 ++-- .../Generated/IMonitorManagementClient.cs | 4 ++-- .../Generated/MonitorManagementClient.cs | 6 +++--- .../Management.Monitor/Generated/SdkInfo_MonitorClient.cs | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) rename src/SDKs/Monitor/Management.Monitor/Generated/{MetricBaselinesOperations.cs => BaselinesOperations.cs} (97%) rename src/SDKs/Monitor/Management.Monitor/Generated/{MetricBaselinesOperationsExtensions.cs => BaselinesOperationsExtensions.cs} (85%) rename src/SDKs/Monitor/Management.Monitor/Generated/{IMetricBaselinesOperations.cs => IBaselinesOperations.cs} (97%) diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs similarity index 97% rename from src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs index df9a5fe4fff2..3fb28b83eab4 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// MetricBaselinesOperations operations. + /// BaselinesOperations operations. /// - internal partial class MetricBaselinesOperations : IServiceOperations, IMetricBaselinesOperations + internal partial class BaselinesOperations : IServiceOperations, IBaselinesOperations { /// - /// Initializes a new instance of the MetricBaselinesOperations class. + /// Initializes a new instance of the BaselinesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class MetricBaselinesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal MetricBaselinesOperations(MonitorManagementClient client) + internal BaselinesOperations(MonitorManagementClient client) { if (client == null) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs similarity index 85% rename from src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs index fb1d5926eb28..d89c7ae62db8 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MetricBaselinesOperationsExtensions.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// Extension methods for MetricBaselinesOperations. + /// Extension methods for BaselinesOperations. /// - public static partial class MetricBaselinesOperationsExtensions + public static partial class BaselinesOperationsExtensions { /// /// **Lists the metric baseline values for a resource**. @@ -66,7 +66,7 @@ public static partial class MetricBaselinesOperationsExtensions /// Allows retrieving only metadata of the baseline. On data request all /// information is retrieved. Possible values include: 'Data', 'Metadata' /// - public static MetricBaselinesResponse List(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) + public static MetricBaselinesResponse List(this IBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) { return operations.ListAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType).GetAwaiter().GetResult(); } @@ -119,7 +119,7 @@ public static partial class MetricBaselinesOperationsExtensions /// /// The cancellation token. /// - public static async Task ListAsync(this IMetricBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this IBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs similarity index 97% rename from src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs rename to src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs index 2a5da1d73810..8ef77b67f8c7 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMetricBaselinesOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// MetricBaselinesOperations operations. + /// BaselinesOperations operations. /// - public partial interface IMetricBaselinesOperations + public partial interface IBaselinesOperations { /// /// **Lists the metric baseline values for a resource**. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs index 86a4999e0ef9..9fc3a9677dc6 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IMonitorManagementClient.cs @@ -140,9 +140,9 @@ public partial interface IMonitorManagementClient : System.IDisposable IMetricBaselineOperations MetricBaseline { get; } /// - /// Gets the IMetricBaselinesOperations. + /// Gets the IBaselinesOperations. /// - IMetricBaselinesOperations MetricBaselines { get; } + IBaselinesOperations Baselines { get; } /// /// Gets the IMetricAlertsOperations. diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs index fc758332600c..d4fc9d0c255e 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/MonitorManagementClient.cs @@ -145,9 +145,9 @@ public partial class MonitorManagementClient : ServiceClient - /// Gets the IMetricBaselinesOperations. + /// Gets the IBaselinesOperations. /// - public virtual IMetricBaselinesOperations MetricBaselines { get; private set; } + public virtual IBaselinesOperations Baselines { get; private set; } /// /// Gets the IMetricAlertsOperations. @@ -430,7 +430,7 @@ private void Initialize() MetricDefinitions = new MetricDefinitionsOperations(this); Metrics = new MetricsOperations(this); MetricBaseline = new MetricBaselineOperations(this); - MetricBaselines = new MetricBaselinesOperations(this); + Baselines = new BaselinesOperations(this); MetricAlerts = new MetricAlertsOperations(this); MetricAlertsStatus = new MetricAlertsStatusOperations(this); ScheduledQueryRules = new ScheduledQueryRulesOperations(this); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs index a397aeff522a..9b3c60cafecc 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs @@ -28,12 +28,12 @@ public static IEnumerable> ApiInfo_MonitorClient new Tuple("insights", "AlertRuleIncidents", "2016-03-01"), new Tuple("insights", "AlertRules", "2016-03-01"), new Tuple("insights", "AutoscaleSettings", "2015-04-01"), + new Tuple("insights", "Baselines", "2019-03-01"), new Tuple("insights", "DiagnosticSettings", "2017-05-01-preview"), new Tuple("insights", "DiagnosticSettingsCategory", "2017-05-01-preview"), new Tuple("insights", "EventCategories", "2015-04-01"), new Tuple("insights", "LogProfiles", "2016-03-01"), new Tuple("insights", "MetricBaseline", "2017-11-01-preview"), - new Tuple("insights", "MetricBaselines", "2019-03-01"), new Tuple("insights", "MetricDefinitions", "2018-01-01"), new Tuple("insights", "MetricNamespaces", "2017-12-01-preview"), new Tuple("insights", "Metrics", "2018-01-01"), From 29edc652a3a1b2d405eb1b79a03642882a851695 Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Fri, 5 Apr 2019 13:00:20 +0000 Subject: [PATCH 5/5] .NET SDK Resource Provider:'Monitor' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5500' REST Spec PR Author 'asafst' REST Spec PR Last commit --- .../Generated/BaselinesOperations.cs | 6 +- .../BaselinesOperationsExtensions.cs | 6 +- .../Generated/IBaselinesOperations.cs | 2 +- .../Generated/Models/BaselineSensitivity.cs | 23 ++++ .../Models/MetricBaselinesResponse.cs | 119 ------------------ .../Generated/Models/SingleBaseline.cs | 95 ++++++++++++++ .../Generated/Models/SingleMetricBaseline.cs | 63 ++++++++-- .../Generated/Models/TimeSeriesBaseline.cs | 4 +- 8 files changed, 182 insertions(+), 136 deletions(-) create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineSensitivity.cs delete mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleBaseline.cs diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs index 3fb28b83eab4..49715e977715 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs @@ -113,7 +113,7 @@ internal BaselinesOperations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { @@ -269,7 +269,7 @@ internal BaselinesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -282,7 +282,7 @@ internal BaselinesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs index d89c7ae62db8..dadeb2276784 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Monitor using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -66,7 +68,7 @@ public static partial class BaselinesOperationsExtensions /// Allows retrieving only metadata of the baseline. On data request all /// information is retrieved. Possible values include: 'Data', 'Metadata' /// - public static MetricBaselinesResponse List(this IBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) + public static IEnumerable List(this IBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?)) { return operations.ListAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType).GetAwaiter().GetResult(); } @@ -119,7 +121,7 @@ public static partial class BaselinesOperationsExtensions /// /// The cancellation token. /// - public static async Task ListAsync(this IBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IBaselinesOperations operations, string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, metricnames, metricnamespace, timespan, interval, aggregation, sensitivities, filter, resultType, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs index 8ef77b67f8c7..065deca8f8ee 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs @@ -81,6 +81,6 @@ public partial interface IBaselinesOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceUri, string metricnames = default(string), string metricnamespace = default(string), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), string filter = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineSensitivity.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineSensitivity.cs new file mode 100644 index 000000000000..4170b0895b20 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineSensitivity.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for BaselineSensitivity. + /// + public static class BaselineSensitivity + { + public const string Low = "Low"; + public const string Medium = "Medium"; + public const string High = "High"; + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs deleted file mode 100644 index 290deba679c3..000000000000 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricBaselinesResponse.cs +++ /dev/null @@ -1,119 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response to a metric baselines query. - /// - public partial class MetricBaselinesResponse - { - /// - /// Initializes a new instance of the MetricBaselinesResponse class. - /// - public MetricBaselinesResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricBaselinesResponse class. - /// - /// The timespan for which the data was - /// retrieved. Its value consists of two datetimes concatenated, - /// separated by '/'. This may be adjusted in the future and returned - /// back from what was originally requested. - /// The interval (window size) for which the - /// metric data was returned in. This may be adjusted in the future - /// and returned back from what was originally requested. This is not - /// present if a metadata request was made. - /// The list of baseline results for each - /// metric. - /// The namespace of the metrics been - /// queried. - public MetricBaselinesResponse(string timespan, System.TimeSpan interval, IList value, string namespaceProperty = default(string)) - { - Timespan = timespan; - Interval = interval; - NamespaceProperty = namespaceProperty; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the timespan for which the data was retrieved. Its - /// value consists of two datetimes concatenated, separated by '/'. - /// This may be adjusted in the future and returned back from what was - /// originally requested. - /// - [JsonProperty(PropertyName = "timespan")] - public string Timespan { get; set; } - - /// - /// Gets or sets the interval (window size) for which the metric data - /// was returned in. This may be adjusted in the future and returned - /// back from what was originally requested. This is not present if a - /// metadata request was made. - /// - [JsonProperty(PropertyName = "interval")] - public System.TimeSpan Interval { get; set; } - - /// - /// Gets or sets the namespace of the metrics been queried. - /// - [JsonProperty(PropertyName = "namespace")] - public string NamespaceProperty { get; set; } - - /// - /// Gets or sets the list of baseline results for each metric. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Timespan == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Timespan"); - } - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - if (Value != null) - { - foreach (var element in Value) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleBaseline.cs new file mode 100644 index 000000000000..8959f4d061eb --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleBaseline.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The baseline values for a single sensitivity value. + /// + public partial class SingleBaseline + { + /// + /// Initializes a new instance of the SingleBaseline class. + /// + public SingleBaseline() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SingleBaseline class. + /// + /// the sensitivity of the baseline. Possible + /// values include: 'Low', 'Medium', 'High' + /// The low thresholds of the + /// baseline. + /// The high thresholds of the + /// baseline. + public SingleBaseline(string sensitivity, IList lowThresholds, IList highThresholds) + { + Sensitivity = sensitivity; + LowThresholds = lowThresholds; + HighThresholds = highThresholds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sensitivity of the baseline. Possible values + /// include: 'Low', 'Medium', 'High' + /// + [JsonProperty(PropertyName = "sensitivity")] + public string Sensitivity { get; set; } + + /// + /// Gets or sets the low thresholds of the baseline. + /// + [JsonProperty(PropertyName = "lowThresholds")] + public IList LowThresholds { get; set; } + + /// + /// Gets or sets the high thresholds of the baseline. + /// + [JsonProperty(PropertyName = "highThresholds")] + public IList HighThresholds { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sensitivity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sensitivity"); + } + if (LowThresholds == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "LowThresholds"); + } + if (HighThresholds == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "HighThresholds"); + } + } + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs index c0aaddf31474..d7d36f282e52 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Management.Monitor.Models { using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,6 +20,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// /// The baseline results of a single metric. /// + [Rest.Serialization.JsonTransformation] public partial class SingleMetricBaseline { /// @@ -35,14 +37,28 @@ public SingleMetricBaseline() /// The metric baseline Id. /// The resource type of the metric baseline /// resource. - /// The name of the metric. + /// The name of the metric for which the baselines + /// were retrieved. + /// The timespan for which the data was + /// retrieved. Its value consists of two datetimes concatenated, + /// separated by '/'. This may be adjusted in the future and returned + /// back from what was originally requested. + /// The interval (window size) for which the + /// metric data was returned in. This may be adjusted in the future + /// and returned back from what was originally requested. This is not + /// present if a metadata request was made. /// The baseline for each time series that was /// queried. - public SingleMetricBaseline(string id, string type, string metricName, IList baselines) + /// The namespace of the metrics been + /// queried. + public SingleMetricBaseline(string id, string type, string name, string timespan, System.TimeSpan interval, IList baselines, string namespaceProperty = default(string)) { Id = id; Type = type; - MetricName = metricName; + Name = name; + Timespan = timespan; + Interval = interval; + NamespaceProperty = namespaceProperty; Baselines = baselines; CustomInit(); } @@ -65,15 +81,40 @@ public SingleMetricBaseline(string id, string type, string metricName, IList - /// Gets or sets the name of the metric. + /// Gets or sets the name of the metric for which the baselines were + /// retrieved. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the timespan for which the data was retrieved. Its + /// value consists of two datetimes concatenated, separated by '/'. + /// This may be adjusted in the future and returned back from what was + /// originally requested. + /// + [JsonProperty(PropertyName = "properties.timespan")] + public string Timespan { get; set; } + + /// + /// Gets or sets the interval (window size) for which the metric data + /// was returned in. This may be adjusted in the future and returned + /// back from what was originally requested. This is not present if a + /// metadata request was made. + /// + [JsonProperty(PropertyName = "properties.interval")] + public System.TimeSpan Interval { get; set; } + + /// + /// Gets or sets the namespace of the metrics been queried. /// - [JsonProperty(PropertyName = "metricName")] - public string MetricName { get; set; } + [JsonProperty(PropertyName = "properties.namespace")] + public string NamespaceProperty { get; set; } /// /// Gets or sets the baseline for each time series that was queried. /// - [JsonProperty(PropertyName = "baselines")] + [JsonProperty(PropertyName = "properties.baselines")] public IList Baselines { get; set; } /// @@ -92,9 +133,13 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Type"); } - if (MetricName == null) + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Timespan == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MetricName"); + throw new ValidationException(ValidationRules.CannotBeNull, "Timespan"); } if (Baselines == null) { diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs index cde974326421..24a82423f312 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs @@ -41,7 +41,7 @@ public TimeSeriesBaseline() /// The dimensions of this time /// series. /// The baseline metadata values. - public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadata = default(IList)) + public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadata = default(IList)) { Aggregation = aggregation; Dimensions = dimensions; @@ -78,7 +78,7 @@ public TimeSeriesBaseline() /// Gets or sets the baseline values for each sensitivity. /// [JsonProperty(PropertyName = "data")] - public IList Data { get; set; } + public IList Data { get; set; } /// /// Gets or sets the baseline metadata values.