From e0e69551770bcf5700dbff0f04b312598f06b5b1 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Thu, 14 Sep 2017 18:20:30 -0700 Subject: [PATCH 1/2] [Monitor] Sync with latest spec --- .../Monitor/DiagnosticSettingsOperations.cs | 4 - .../Monitor/IMonitorManagementClient.cs | 5 + .../Management/Monitor/IOperations.cs | 48 ++++ .../DiagnosticSettingsCategoryResource.cs | 22 +- .../Models/DiagnosticSettingsResource.cs | 40 +--- .../Management/Monitor/Models/Operation.cs | 63 +++++ .../Monitor/Models/OperationDisplay.cs | 72 ++++++ .../Monitor/Models/OperationListResult.cs | 69 ++++++ .../Monitor/Models/ProxyOnlyResource.cs | 71 ++++++ .../Monitor/MonitorManagementClient.cs | 6 + .../Management/Monitor/Operations.cs | 220 ++++++++++++++++++ .../Monitor/OperationsExtensions.cs | 54 +++++ .../BasicTests/DiagnosticSettingsTests.cs | 7 +- .../Scenarios/DiagnosticSettingsTests.cs | 3 +- 14 files changed, 619 insertions(+), 65 deletions(-) create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IOperations.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/Operation.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationDisplay.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationListResult.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ProxyOnlyResource.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Operations.cs create mode 100644 src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/OperationsExtensions.cs diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/DiagnosticSettingsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/DiagnosticSettingsOperations.cs index 6e9b17de26d07..4dbb1ed1f51c0 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/DiagnosticSettingsOperations.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/DiagnosticSettingsOperations.cs @@ -278,10 +278,6 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs index 4dd3e96888787..6658eb5c91aa0 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs @@ -69,6 +69,11 @@ public partial interface IMonitorManagementClient : System.IDisposable /// IAutoscaleSettingsOperations AutoscaleSettings { get; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + /// /// Gets the IAlertRuleIncidentsOperations. /// diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IOperations.cs new file mode 100644 index 0000000000000..8580d77a3451a --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IOperations.cs @@ -0,0 +1,48 @@ +// 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.Management +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using 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; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available operations from Microsoft.Insights + /// provider. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsCategoryResource.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsCategoryResource.cs index 90a70d5e43770..3d4792c8d80d1 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsCategoryResource.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsCategoryResource.cs @@ -15,15 +15,13 @@ namespace Microsoft.Azure.Management.Monitor.Management.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Description of diagnostic setting category. + /// The diagnostic settings category resource. /// [Rest.Serialization.JsonTransformation] - public partial class DiagnosticSettingsCategoryResource : Resource + public partial class DiagnosticSettingsCategoryResource : ProxyOnlyResource { /// /// Initializes a new instance of the @@ -38,15 +36,13 @@ public DiagnosticSettingsCategoryResource() /// Initializes a new instance of the /// DiagnosticSettingsCategoryResource class. /// - /// Resource location /// Azure resource Id /// Azure resource name /// Azure resource type - /// Resource tags /// The type of the diagnostic settings /// category. Possible values include: 'Metrics', 'Logs' - public DiagnosticSettingsCategoryResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), CategoryType categoryType = default(CategoryType)) - : base(location, id, name, type, tags) + public DiagnosticSettingsCategoryResource(string id = default(string), string name = default(string), string type = default(string), CategoryType categoryType = default(CategoryType)) + : base(id, name, type) { CategoryType = categoryType; CustomInit(); @@ -64,15 +60,5 @@ public DiagnosticSettingsCategoryResource() [JsonProperty(PropertyName = "properties.categoryType")] public CategoryType CategoryType { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsResource.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsResource.cs index 4c7befb9dcb4e..bcf769de09831 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsResource.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/DiagnosticSettingsResource.cs @@ -20,10 +20,10 @@ namespace Microsoft.Azure.Management.Monitor.Management.Models using System.Linq; /// - /// Description of diagnostic setting resource. + /// The diagnostic setting resource. /// [Rest.Serialization.JsonTransformation] - public partial class DiagnosticSettingsResource : Resource + public partial class DiagnosticSettingsResource : ProxyOnlyResource { /// /// Initializes a new instance of the DiagnosticSettingsResource class. @@ -36,11 +36,9 @@ public DiagnosticSettingsResource() /// /// Initializes a new instance of the DiagnosticSettingsResource class. /// - /// Resource location /// Azure resource Id /// Azure resource name /// Azure resource type - /// Resource tags /// The resource ID of the storage /// account to which you would like to send Diagnostic Logs. /// The resource Id for the @@ -53,8 +51,8 @@ public DiagnosticSettingsResource() /// Analytics workspace) for a Log Analytics workspace to which you /// would like to send Diagnostic Logs. Example: /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 - public DiagnosticSettingsResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string storageAccountId = default(string), string eventHubAuthorizationRuleId = default(string), string eventHubName = default(string), IList metrics = default(IList), IList logs = default(IList), string workspaceId = default(string)) - : base(location, id, name, type, tags) + public DiagnosticSettingsResource(string id = default(string), string name = default(string), string type = default(string), string storageAccountId = default(string), string eventHubAuthorizationRuleId = default(string), string eventHubName = default(string), IList metrics = default(IList), IList logs = default(IList), string workspaceId = default(string)) + : base(id, name, type) { StorageAccountId = storageAccountId; EventHubAuthorizationRuleId = eventHubAuthorizationRuleId; @@ -111,35 +109,5 @@ public DiagnosticSettingsResource() [JsonProperty(PropertyName = "properties.workspaceId")] public string WorkspaceId { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (Metrics != null) - { - foreach (var element in Metrics) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Logs != null) - { - foreach (var element1 in Logs) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - } } } diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/Operation.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/Operation.cs new file mode 100644 index 0000000000000..574043b0f37c0 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/Operation.cs @@ -0,0 +1,63 @@ +// 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.Management.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Monitor; + using Microsoft.Azure.Management.Monitor.Management; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Microsoft Insights API operation definition. + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// Display metadata associated with the + /// operation. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display metadata associated with the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationDisplay.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..ed5b74f66f660 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationDisplay.cs @@ -0,0 +1,72 @@ +// 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.Management.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Monitor; + using Microsoft.Azure.Management.Monitor.Management; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Display metadata associated with the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: Microsoft.Insights + /// Resource on which the operation is + /// performed: AlertRules, Autoscale, etc. + /// Operation type: Read, write, delete, + /// etc. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets service provider: Microsoft.Insights + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets resource on which the operation is performed: + /// AlertRules, Autoscale, etc. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets operation type: Read, write, delete, etc. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationListResult.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationListResult.cs new file mode 100644 index 0000000000000..4c0f59c40a195 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/OperationListResult.cs @@ -0,0 +1,69 @@ +// 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.Management.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Monitor; + using Microsoft.Azure.Management.Monitor.Management; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list Microsoft.Insights operations. It + /// contains a list of operations and a URL link to get the next set of + /// results. + /// + public partial class OperationListResult + { + /// + /// Initializes a new instance of the OperationListResult class. + /// + public OperationListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationListResult class. + /// + /// List of operations supported by the + /// Microsoft.Insights provider. + /// URL to get the next set of operation list + /// results if there are any. + public OperationListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of operations supported by the Microsoft.Insights + /// provider. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets URL to get the next set of operation list results if + /// there are any. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ProxyOnlyResource.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ProxyOnlyResource.cs new file mode 100644 index 0000000000000..4da39c6f04671 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ProxyOnlyResource.cs @@ -0,0 +1,71 @@ +// 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.Management.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Monitor; + using Microsoft.Azure.Management.Monitor.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A proxy only azure resource object + /// + public partial class ProxyOnlyResource : IResource + { + /// + /// Initializes a new instance of the ProxyOnlyResource class. + /// + public ProxyOnlyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyOnlyResource class. + /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + public ProxyOnlyResource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs index 5c95542dbcb48..0334f4661c01c 100644 --- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs @@ -74,6 +74,11 @@ public partial class MonitorManagementClient : ServiceClient public virtual IAutoscaleSettingsOperations AutoscaleSettings { get; private set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + /// /// Gets the IAlertRuleIncidentsOperations. /// @@ -311,6 +316,7 @@ public MonitorManagementClient(System.Uri baseUri, ServiceClientCredentials cred private void Initialize() { AutoscaleSettings = new AutoscaleSettingsOperations(this); + Operations = new Operations(this); AlertRuleIncidents = new AlertRuleIncidentsOperations(this); AlertRules = new AlertRulesOperations(this); LogProfiles = new LogProfilesOperations(this); diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Operations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Operations.cs new file mode 100644 index 0000000000000..4fdf8930a105f --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Operations.cs @@ -0,0 +1,220 @@ +// 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.Management +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(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 all of the available operations from Microsoft.Insights provider. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + 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("/") ? "" : "/")), "providers/microsoft.insights/operations").ToString(); + List _queryParameters = new List(); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/Management/Monitor/OperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/OperationsExtensions.cs new file mode 100644 index 0000000000000..ba66b52e08ce7 --- /dev/null +++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/OperationsExtensions.cs @@ -0,0 +1,54 @@ +// 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.Management +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Monitor; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available operations from Microsoft.Insights provider. + /// + /// + /// The operations group for this extension method. + /// + public static OperationListResult List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available operations from Microsoft.Insights provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Monitor/Monitor.Tests/BasicTests/DiagnosticSettingsTests.cs b/src/SDKs/Monitor/Monitor.Tests/BasicTests/DiagnosticSettingsTests.cs index 834cea08d1c66..830b872b86ee5 100644 --- a/src/SDKs/Monitor/Monitor.Tests/BasicTests/DiagnosticSettingsTests.cs +++ b/src/SDKs/Monitor/Monitor.Tests/BasicTests/DiagnosticSettingsTests.cs @@ -58,13 +58,11 @@ public void DiagnosticSettings_UpdateTest() monitorManagementClient = GetMonitorManagementClient(handler); DiagnosticSettingsResource patchResource = new DiagnosticSettingsResource( - tags: resource.Tags, storageAccountId: resource.StorageAccountId, eventHubAuthorizationRuleId: resource.EventHubAuthorizationRuleId, metrics: resource.Metrics, logs: resource.Logs, - workspaceId: resource.WorkspaceId, - location: "eastus" + workspaceId: resource.WorkspaceId ); DiagnosticSettingsResource response = monitorManagementClient.DiagnosticSettings.CreateOrUpdate( @@ -124,8 +122,7 @@ private static DiagnosticSettingsResource CreateDiagnosticSettingsParams() }, TimeGrain = TimeSpan.FromMinutes(1) } - }, - Location = "" + } }; } diff --git a/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs b/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs index 53f22adb96cf4..92cd4166ef2d4 100644 --- a/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs +++ b/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs @@ -90,8 +90,7 @@ private static DiagnosticSettingsResource CreateDiagnosticSettings() }, TimeGrain = TimeSpan.FromMinutes(1) } - }, - Location = string.Empty + } }; } From 6db6e3afbd1136ad314ebb7ad11469a8bcabfd2c Mon Sep 17 00:00:00 2001 From: Vinicius Date: Fri, 15 Sep 2017 11:32:34 -0700 Subject: [PATCH 2/2] [Monitor] Add tests for operations api --- .../BasicTests/OperationsTests.cs | 71 +++++++++++++++++++ .../Monitor.Tests/Monitor.Tests.csproj | 1 + .../Scenarios/DiagnosticSettingsTests.cs | 1 - .../Scenarios/OperationsTests.cs | 59 +++++++++++++++ .../ListOperationsTest.json | 69 ++++++++++++++++++ 5 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 src/SDKs/Monitor/Monitor.Tests/BasicTests/OperationsTests.cs create mode 100644 src/SDKs/Monitor/Monitor.Tests/Scenarios/OperationsTests.cs create mode 100644 src/SDKs/Monitor/Monitor.Tests/SessionRecords/Monitor.Tests.Scenarios.OperationsTests/ListOperationsTest.json diff --git a/src/SDKs/Monitor/Monitor.Tests/BasicTests/OperationsTests.cs b/src/SDKs/Monitor/Monitor.Tests/BasicTests/OperationsTests.cs new file mode 100644 index 0000000000000..1a553c46ec837 --- /dev/null +++ b/src/SDKs/Monitor/Monitor.Tests/BasicTests/OperationsTests.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Management.Monitor.Management; +using Microsoft.Azure.Management.Monitor.Management.Models; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class OperationsTests : TestBase + { + [Fact] + [Trait("Category", "Mock")] + public void OperationsTests_ListOperationsTest() + { + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + + var expResponse = new OperationListResult + { + Value = new List + { + new Operation + { + Name = "Operation1", + Display = new OperationDisplay { + Operation = "Operation1", + Provider = "microsoft.insights", + Resource = "resource1" + } + }, + new Operation + { + Name = "Operation2", + Display = new OperationDisplay { + Operation = "Operation2", + Provider = "microsoft.insights", + Resource = "resource2" + } + }, + } + }; + + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + OperationListResult operations = insightsClient.Operations.List(); + Assert.Equal(2, operations.Value.Count); + Assert.Equal("Operation1", operations.Value[0].Name); + Assert.Equal("Operation1", operations.Value[0].Display.Operation); + Assert.Equal("microsoft.insights", operations.Value[0].Display.Provider); + Assert.Equal("resource1", operations.Value[0].Display.Resource); + + Assert.Equal("Operation2", operations.Value[1].Name); + Assert.Equal("Operation2", operations.Value[1].Display.Operation); + Assert.Equal("microsoft.insights", operations.Value[1].Display.Provider); + Assert.Equal("resource2", operations.Value[1].Display.Resource); + } + } +} diff --git a/src/SDKs/Monitor/Monitor.Tests/Monitor.Tests.csproj b/src/SDKs/Monitor/Monitor.Tests/Monitor.Tests.csproj index 795e8219f4a1a..b83570e3dc519 100644 --- a/src/SDKs/Monitor/Monitor.Tests/Monitor.Tests.csproj +++ b/src/SDKs/Monitor/Monitor.Tests/Monitor.Tests.csproj @@ -13,6 +13,7 @@ + PreserveNewest diff --git a/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs b/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs index 92cd4166ef2d4..aaba655d0e2b6 100644 --- a/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs +++ b/src/SDKs/Monitor/Monitor.Tests/Scenarios/DiagnosticSettingsTests.cs @@ -24,7 +24,6 @@ public DiagnosticSettingsTests() handler = new RecordedDelegatingHandler { SubsequentStatusCodeToReturn = HttpStatusCode.OK }; } - /// /// User needs several permissions before executing these commands. Otherwise it fails for some authorization issue. /// diff --git a/src/SDKs/Monitor/Monitor.Tests/Scenarios/OperationsTests.cs b/src/SDKs/Monitor/Monitor.Tests/Scenarios/OperationsTests.cs new file mode 100644 index 0000000000000..eb2254578b5b0 --- /dev/null +++ b/src/SDKs/Monitor/Monitor.Tests/Scenarios/OperationsTests.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Management.Monitor.Management; +using Microsoft.Azure.Management.Monitor.Management.Models; +using Xunit; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; + +namespace Monitor.Tests.Scenarios +{ + public class OperationsTests : TestBase + { + private RecordedDelegatingHandler handler; + + public OperationsTests() + : base() + { + handler = new RecordedDelegatingHandler { SubsequentStatusCodeToReturn = HttpStatusCode.OK }; + } + + [Fact] + [Trait("Category", "Mock")] + public void ListOperationsTest() + { + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + var insightsClient = GetMonitorManagementClient(context, handler); + + OperationListResult actual = insightsClient.Operations.List(); + + if (!this.IsRecording) + { + Check(insightsClient, actual); + } + } + } + + private static void Check( + MonitorManagementClient insightsClient, + OperationListResult operationListResult) + { + Assert.Equal(46, operationListResult.Value.Count); + Assert.Equal("Microsoft.Insights/Operations/Read", operationListResult.Value[0].Name); + Assert.Equal("Operations read", operationListResult.Value[0].Display.Operation); + Assert.Equal("Microsoft Monitoring Insights", operationListResult.Value[0].Display.Provider); + Assert.Equal("Operations", operationListResult.Value[0].Display.Resource); + + Assert.Equal("Microsoft.Insights/Webtests/Read", operationListResult.Value[45].Name); + Assert.Equal("Webtest read", operationListResult.Value[45].Display.Operation); + Assert.Equal("Microsoft Monitoring Insights", operationListResult.Value[45].Display.Provider); + Assert.Equal("Web tests", operationListResult.Value[45].Display.Resource); + } + } +} diff --git a/src/SDKs/Monitor/Monitor.Tests/SessionRecords/Monitor.Tests.Scenarios.OperationsTests/ListOperationsTest.json b/src/SDKs/Monitor/Monitor.Tests/SessionRecords/Monitor.Tests.Scenarios.OperationsTests/ListOperationsTest.json new file mode 100644 index 0000000000000..8fc00a76076c8 --- /dev/null +++ b/src/SDKs/Monitor/Monitor.Tests/SessionRecords/Monitor.Tests.Scenarios.OperationsTests/ListOperationsTest.json @@ -0,0 +1,69 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/microsoft.insights/operations?api-version=2015-04-01", + "EncodedRequestUri": "L3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvb3BlcmF0aW9ucz9hcGktdmVyc2lvbj0yMDE1LTA0LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ccd56dcc-f808-4397-a53e-15a62e68fd67" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Monitor.Management.MonitorManagementClient/0.17.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"Microsoft.Insights/Operations/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Operations\",\r\n \"operation\": \"Operations read\",\r\n \"description\": \"Reading operations\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/MetricDefinitions/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Metric Definitions\",\r\n \"operation\": \"Metric definitions read\",\r\n \"description\": \"Read metric definitions\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Metrics/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Metrics\",\r\n \"operation\": \"Metrics read\",\r\n \"description\": \"Read metrics\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rules\",\r\n \"operation\": \"Alert Rule write\",\r\n \"description\": \"Writing to an alert rule configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rules\",\r\n \"operation\": \"Alert Rule delete\",\r\n \"description\": \"Deleting an alert rule configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rules\",\r\n \"operation\": \"Alert Rule read\",\r\n \"description\": \"Reading an alert rule configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/MetricAlerts/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Metric alerts\",\r\n \"operation\": \"Metric alert write\",\r\n \"description\": \"Writing a metric alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/MetricAlerts/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Metric alerts\",\r\n \"operation\": \"Metric alert delete\",\r\n \"description\": \"Deleting a metric alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/MetricAlerts/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Metric alerts\",\r\n \"operation\": \"Metric alert read\",\r\n \"description\": \"Reading a metric alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AutoscaleSettings/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Autoscale\",\r\n \"operation\": \"Autoscale Setting write\",\r\n \"description\": \"Writing to an autoscale setting configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AutoscaleSettings/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Autoscale\",\r\n \"operation\": \"Autoscale Setting delete\",\r\n \"description\": \"Deleting an autoscale setting configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AutoscaleSettings/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Autoscale\",\r\n \"operation\": \"Autoscale Setting read\",\r\n \"description\": \"Reading an autoscale setting configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Incidents/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rule Incident resource\",\r\n \"operation\": \"Alert Rule Incidents read\",\r\n \"description\": \"Reading an alert rule incident configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AutoscaleSettings/providers/Microsoft.Insights/MetricDefinitions/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Metric Definitions\",\r\n \"operation\": \"Metric definitions read\",\r\n \"description\": \"Read metric definitions\"\r\n },\r\n \"properties\": {\r\n \"serviceSpecification\": {\r\n \"metricSpecifications\": [\r\n {\r\n \"name\": \"ObservedMetricValue\",\r\n \"displayName\": \"Observed Metric Value\",\r\n \"displayDescription\": \"The value computed by autoscale when executed\",\r\n \"unit\": \"Count\",\r\n \"aggregationType\": \"Average\",\r\n \"availabilities\": null,\r\n \"fillGapWithZero\": false,\r\n \"category\": \"Metric\",\r\n \"dimensions\": [\r\n {\r\n \"name\": \"MetricTriggerSource\",\r\n \"displayName\": \"Metric Trigger Source\",\r\n \"toBeExportedForShoebox\": true\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"MetricThreshold\",\r\n \"displayName\": \"Metric Threshold\",\r\n \"displayDescription\": \"The configured autoscale threshold when autoscale ran.\",\r\n \"unit\": \"Count\",\r\n \"aggregationType\": \"Average\",\r\n \"availabilities\": null,\r\n \"fillGapWithZero\": false,\r\n \"category\": \"Metric\",\r\n \"dimensions\": [\r\n {\r\n \"name\": \"MetricTriggerRule\",\r\n \"displayName\": \"Metric Trigger Rule\",\r\n \"toBeExportedForShoebox\": true\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"ObservedCapacity\",\r\n \"displayName\": \"Observed Capacity\",\r\n \"displayDescription\": \"The capacity reported to autoscale when it executed.\",\r\n \"unit\": \"Count\",\r\n \"aggregationType\": \"Average\",\r\n \"availabilities\": null,\r\n \"fillGapWithZero\": false,\r\n \"category\": \"ScaleAction\",\r\n \"dimensions\": null\r\n },\r\n {\r\n \"name\": \"ScaleActionsInitiated\",\r\n \"displayName\": \"Scale Actions Initiated\",\r\n \"displayDescription\": \"The direction of the scale operation.\",\r\n \"unit\": \"Count\",\r\n \"aggregationType\": \"Total\",\r\n \"availabilities\": null,\r\n \"fillGapWithZero\": true,\r\n \"category\": \"ScaleAction\",\r\n \"dimensions\": [\r\n {\r\n \"name\": \"ScaleDirection\",\r\n \"displayName\": \"Scale Direction\",\r\n \"toBeExportedForShoebox\": true\r\n }\r\n ]\r\n }\r\n ],\r\n \"logSpecifications\": null,\r\n \"legacyMetricSpecifications\": null\r\n }\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActionGroups/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Action groups\",\r\n \"operation\": \"Action group write\",\r\n \"description\": \"Writing an action group\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActionGroups/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Action groups\",\r\n \"operation\": \"Action group delete\",\r\n \"description\": \"Deleting an action group\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActionGroups/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Action groups\",\r\n \"operation\": \"Action group read\",\r\n \"description\": \"Reading an action group\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActivityLogAlerts/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Activity log alert\",\r\n \"operation\": \"Activity log alert read\",\r\n \"description\": \"Reading an activity log alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActivityLogAlerts/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Activity log alert\",\r\n \"operation\": \"Activity log alert delete\",\r\n \"description\": \"Deleting an activity log alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActivityLogAlerts/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Activity log alert\",\r\n \"operation\": \"Activity log alert read\",\r\n \"description\": \"Reading an activity log alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ActivityLogAlerts/Activated/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Activity Log Alert\",\r\n \"operation\": \"Activity Log Alert Activated\",\r\n \"description\": \"Triggered the Activity Log Alert\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/EventCategories/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Event category\",\r\n \"operation\": \"Event category read\",\r\n \"description\": \"Reading an event category\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/eventtypes/values/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Events\",\r\n \"operation\": \"Event types management values read\",\r\n \"description\": \"Read management event type values\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/eventtypes/digestevents/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Digest events\",\r\n \"operation\": \"Event types management digest read\",\r\n \"description\": \"Read management event type digest\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/DiagnosticSettings/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Diagnostic settings\",\r\n \"operation\": \"Diagnostic settings write\",\r\n \"description\": \"Writing to diagnostic settings configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/DiagnosticSettings/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Diagnostic settings\",\r\n \"operation\": \"Diagnostic settings delete\",\r\n \"description\": \"Deleting diagnostic settings configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/DiagnosticSettings/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Diagnostic settings\",\r\n \"operation\": \"Diagnostic settings read\",\r\n \"description\": \"Reading a diagnostic settings configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ExtendedDiagnosticSettings/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Extended Diagnostic settings\",\r\n \"operation\": \"Extended Diagnostic settings write\",\r\n \"description\": \"Writing to extended diagnostic settings configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ExtendedDiagnosticSettings/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Extended Diagnostic settings\",\r\n \"operation\": \"Extended Diagnostic settings delete\",\r\n \"description\": \"Deleting extended diagnostic settings configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/ExtendedDiagnosticSettings/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Extended Diagnostic settings\",\r\n \"operation\": \"Extended Diagnostic settings read\",\r\n \"description\": \"Reading a extended diagnostic settings configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/LogProfiles/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Log Profiles\",\r\n \"operation\": \"Log profile write\",\r\n \"description\": \"Writing to a log profile configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/LogProfiles/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Log Profiles\",\r\n \"operation\": \"Log profile delete\",\r\n \"description\": \"Delete log profiles configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/LogProfiles/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Log Profiles\",\r\n \"operation\": \"Log profile read\",\r\n \"description\": \"Read log profiles\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/LogDefinitions/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Log Definitions\",\r\n \"operation\": \"Log Definitions read\",\r\n \"description\": \"Read log definitions\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AutoscaleSettings/Scaleup/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Autoscale\",\r\n \"operation\": \"Autoscale scale up operation\",\r\n \"description\": \"Autoscale scale up operation\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AutoscaleSettings/Scaledown/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Autoscale\",\r\n \"operation\": \"Autoscale scale down operation\",\r\n \"description\": \"Autoscale scale down operation\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Activated/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rules\",\r\n \"operation\": \"Alert Rule activated\",\r\n \"description\": \"Alert Rule activated\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Resolved/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rules\",\r\n \"operation\": \"Alert Rule resolved\",\r\n \"description\": \"Alert Rule resolved\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/AlertRules/Throttled/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Alert Rules\",\r\n \"operation\": \"Alert Rule throttled\",\r\n \"description\": \"Alert rule is throttled\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Register/Action\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Microsoft.Insights\",\r\n \"operation\": \"Register Microsoft.Insights\",\r\n \"description\": \"Register the microsoft insights provider\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Components/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Application insights components\",\r\n \"operation\": \"Application insights component write\",\r\n \"description\": \"Writing to an application insights component configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Components/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Application insights components\",\r\n \"operation\": \"Application insights component delete\",\r\n \"description\": \"Deleting an application insights component configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Components/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Application insights components\",\r\n \"operation\": \"Application insights component read\",\r\n \"description\": \"Reading an application insights component configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Webtests/Write\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Web tests\",\r\n \"operation\": \"Webtest write\",\r\n \"description\": \"Writing to a webtest configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Webtests/Delete\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Web tests\",\r\n \"operation\": \"Webtest delete\",\r\n \"description\": \"Deleting a webtest configuration\"\r\n },\r\n \"properties\": {}\r\n },\r\n {\r\n \"name\": \"Microsoft.Insights/Webtests/Read\",\r\n \"display\": {\r\n \"publisher\": \"Microsoft\",\r\n \"provider\": \"Microsoft Monitoring Insights\",\r\n \"resource\": \"Web tests\",\r\n \"operation\": \"Webtest read\",\r\n \"description\": \"Reading a webtest configuration\"\r\n },\r\n \"properties\": {}\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Sep 2017 18:21:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "8a9078f8-dfaf-4ea3-9ae5-d39b5332f698" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "6380bf4b-126e-4d5a-8d8a-75a2444019e2" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20170915T182115Z:6380bf4b-126e-4d5a-8d8a-75a2444019e2" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "1a66ce04-b633-4a0b-b2bc-a912ec8986a6" + } +} \ No newline at end of file