From 4d57d1aea906aa706fe10de5bd1416c9b766aa9f Mon Sep 17 00:00:00 2001 From: adxsdknet <39844661+adxsdknet@users.noreply.github.com> Date: Fri, 12 Apr 2019 14:47:32 -0700 Subject: [PATCH] AutoPr-Monitor-asafst-REST Spec PrNumber 5500 (#5623) * .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 * .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 * .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 * .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 * .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/BaselinesOperations.cs | 305 ++++++++++++++++++ .../BaselinesOperationsExtensions.cs | 133 ++++++++ .../Generated/IBaselinesOperations.cs | 86 +++++ .../Generated/IMonitorManagementClient.cs | 5 + .../Generated/Models/ArmRoleReceiver.cs | 11 +- .../Models/AutomationRunbookReceiver.cs | 11 +- .../Generated/Models/AzureFunctionReceiver.cs | 11 +- .../Generated/Models/BaselineMetadata.cs | 77 +++++ .../Generated/Models/BaselineSensitivity.cs | 23 ++ .../Generated/Models/EmailReceiver.cs | 11 +- .../Generated/Models/LogicAppReceiver.cs | 11 +- .../Generated/Models/MetricSingleDimension.cs | 77 +++++ .../Generated/Models/SingleBaseline.cs | 95 ++++++ .../Generated/Models/SingleMetricBaseline.cs | 160 +++++++++ .../Generated/Models/TimeSeriesBaseline.cs | 141 ++++++++ .../Generated/Models/WebhookReceiver.cs | 11 +- .../Generated/MonitorManagementClient.cs | 6 + .../Generated/SdkInfo_MonitorClient.cs | 3 +- 20 files changed, 1178 insertions(+), 15 deletions(-) create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineMetadata.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/BaselineSensitivity.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/MetricSingleDimension.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleBaseline.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.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/BaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs new file mode 100644 index 000000000000..49715e977715 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperations.cs @@ -0,0 +1,305 @@ +// +// 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; + + /// + /// BaselinesOperations operations. + /// + internal partial class BaselinesOperations : IServiceOperations, IBaselinesOperations + { + /// + /// Initializes a new instance of the BaselinesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BaselinesOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// **Lists the metric baseline values for a resource**. + /// + /// + /// The identifier of the resource. + /// + /// + /// 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>> 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) + { + 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, "List", 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/BaselinesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs new file mode 100644 index 000000000000..dadeb2276784 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/BaselinesOperationsExtensions.cs @@ -0,0 +1,133 @@ +// +// 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; + + /// + /// Extension methods for BaselinesOperations. + /// + public static partial class BaselinesOperationsExtensions + { + /// + /// **Lists the metric baseline values for a resource**. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// 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 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(); + } + + /// + /// **Lists the metric baseline values for a resource**. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// 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> 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)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs new file mode 100644 index 000000000000..065deca8f8ee --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/IBaselinesOperations.cs @@ -0,0 +1,86 @@ +// +// 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; + + /// + /// BaselinesOperations operations. + /// + public partial interface IBaselinesOperations + { + /// + /// **Lists the metric baseline values for a resource**. + /// + /// + /// The identifier of the resource. + /// + /// + /// 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>> 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 34dcec6b1430..9fc3a9677dc6 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 IBaselinesOperations. + /// + IBaselinesOperations Baselines { get; } + /// /// Gets the IMetricAlertsOperations. /// 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/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/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/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/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 new file mode 100644 index 000000000000..d7d36f282e52 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Models/SingleMetricBaseline.cs @@ -0,0 +1,160 @@ +// +// 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 Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The baseline results of a single metric. + /// + [Rest.Serialization.JsonTransformation] + public partial class SingleMetricBaseline + { + /// + /// Initializes a new instance of the SingleMetricBaseline class. + /// + public SingleMetricBaseline() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SingleMetricBaseline class. + /// + /// The metric baseline Id. + /// The resource type of the metric baseline + /// resource. + /// 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. + /// 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; + Name = name; + Timespan = timespan; + Interval = interval; + NamespaceProperty = namespaceProperty; + 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 or sets the resource type of the metric baseline resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// 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 = "properties.namespace")] + public string NamespaceProperty { get; set; } + + /// + /// Gets or sets the baseline for each time series that was queried. + /// + [JsonProperty(PropertyName = "properties.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 (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Timespan == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Timespan"); + } + 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/TimeSeriesBaseline.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Models/TimeSeriesBaseline.cs new file mode 100644 index 000000000000..24a82423f312 --- /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 baseline values for a single time series. + /// + 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 list 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 list 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..d4fc9d0c255e 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 IBaselinesOperations. + /// + public virtual IBaselinesOperations Baselines { 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); + 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 9520a3961e12..9b3c60cafecc 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/SdkInfo_MonitorClient.cs @@ -22,12 +22,13 @@ 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"), 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"),