diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs new file mode 100644 index 000000000000..345146bea651 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs @@ -0,0 +1,16 @@ +// +// 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.OperationalInsights.Models +{ + public partial class DataExport : Resource + { + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs new file mode 100644 index 000000000000..06b197cc8f87 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs @@ -0,0 +1,282 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// AvailableServiceTiersOperations operations. + /// + internal partial class AvailableServiceTiersOperations : Microsoft.Rest.IServiceOperations, IAvailableServiceTiersOperations + { + /// + /// Initializes a new instance of the AvailableServiceTiersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AvailableServiceTiersOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs new file mode 100644 index 000000000000..0981c6ee2caf --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for AvailableServiceTiersOperations + /// + public static partial class AvailableServiceTiersOperationsExtensions + { + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IList ListByWorkspace(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName) + { + return ((IAvailableServiceTiersOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs new file mode 100644 index 000000000000..c3520b11f61f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs @@ -0,0 +1,1797 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// ClustersOperations operations. + /// + internal partial class ClustersOperations : Microsoft.Rest.IServiceOperations, IClustersOperations + { + /// + /// Initializes a new instance of the ClustersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ClustersOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (clusterName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); + } + + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clusterName", clusterName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (clusterName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); + } + if (clusterName != null) + { + if (clusterName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "clusterName", 63); + } + if (clusterName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "clusterName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clusterName", clusterName); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (clusterName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (clusterName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs new file mode 100644 index 000000000000..8c1ffccdc97d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs @@ -0,0 +1,409 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ClustersOperations + /// + public static partial class ClustersOperationsExtensions + { + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IClustersOperations operations, string resourceGroupName) + { + return ((IClustersOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IClustersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IClustersOperations operations) + { + return ((IClustersOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IClustersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + public static Cluster CreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + { + return ((IClustersOperations)operations).CreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static void Delete(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + ((IClustersOperations)operations).DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster Get(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + return ((IClustersOperations)operations).GetAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return ((IClustersOperations)operations).UpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + { + return ((IClustersOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static void BeginDelete(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + ((IClustersOperations)operations).BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster BeginUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return ((IClustersOperations)operations).BeginUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IClustersOperations operations, string nextPageLink) + { + return ((IClustersOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IClustersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IClustersOperations operations, string nextPageLink) + { + return ((IClustersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IClustersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs new file mode 100644 index 000000000000..372c551b5def --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs @@ -0,0 +1,1038 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// DataExportsOperations operations. + /// + internal partial class DataExportsOperations : Microsoft.Rest.IServiceOperations, IDataExportsOperations + { + /// + /// Initializes a new instance of the DataExportsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataExportsOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Create or update a data export. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The parameters required to create or update a data export. + /// + /// + /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataExportName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataExportName"); + } + if (dataExportName != null) + { + if (dataExportName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dataExportName", 63); + } + if (dataExportName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dataExportName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets a data export instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataExportName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataExportName"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataExportName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataExportName"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs new file mode 100644 index 000000000000..a1a2420ec6f8 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs @@ -0,0 +1,187 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DataExportsOperations + /// + public static partial class DataExportsOperationsExtensions + { + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable ListByWorkspace(this IDataExportsOperations operations, string resourceGroupName, string workspaceName) + { + return ((IDataExportsOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a data export. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static DataExport CreateOrUpdate(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters) + { + return ((IDataExportsOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, dataExportName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a data export. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a data export instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static DataExport Get(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + { + return ((IDataExportsOperations)operations).GetAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + } + + /// + /// Gets a data export instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static void Delete(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + { + ((IDataExportsOperations)operations).DeleteAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs new file mode 100644 index 000000000000..7e0fbdf60290 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs @@ -0,0 +1,1253 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// DataSourcesOperations operations. + /// + internal partial class DataSourcesOperations : Microsoft.Rest.IServiceOperations, IDataSourcesOperations + { + /// + /// Initializes a new instance of the DataSourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataSourcesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or update a data source. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The parameters required to create or update a datasource. + /// + /// + /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataSourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataSourceName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes a data source instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataSourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataSourceName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets a datasource instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataSourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataSourceName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _dataSourceFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_dataSourceFilter)) + { + _queryParameters.Add(_dataSourceFilter); + } + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs new file mode 100644 index 000000000000..368186830a15 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs @@ -0,0 +1,236 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DataSourcesOperations + /// + public static partial class DataSourcesOperationsExtensions + { + /// + /// Create or update a data source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + public static DataSource CreateOrUpdate(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters) + { + return ((IDataSourcesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a data source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a data source instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + public static void Delete(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) + { + ((IDataSourcesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a data source instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a datasource instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + public static DataSource Get(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) + { + return ((IDataSourcesOperations)operations).GetAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a datasource instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspace(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string)) + { + return ((IDataSourcesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName, odataQuery, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, odataQuery, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspaceNext(this IDataSourcesOperations operations, string nextPageLink) + { + return ((IDataSourcesOperations)operations).ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceNextAsync(this IDataSourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs new file mode 100644 index 000000000000..8b664dea86fe --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs @@ -0,0 +1,445 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// DeletedWorkspacesOperations operations. + /// + internal partial class DeletedWorkspacesOperations : Microsoft.Rest.IServiceOperations, IDeletedWorkspacesOperations + { + /// + /// Initializes a new instance of the DeletedWorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DeletedWorkspacesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..fa23cb67d284 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs @@ -0,0 +1,78 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DeletedWorkspacesOperations + /// + public static partial class DeletedWorkspacesOperationsExtensions + { + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IDeletedWorkspacesOperations operations) + { + return ((IDeletedWorkspacesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDeletedWorkspacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IDeletedWorkspacesOperations operations, string resourceGroupName) + { + return ((IDeletedWorkspacesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDeletedWorkspacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs new file mode 100644 index 000000000000..ce595492638e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs @@ -0,0 +1,271 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// GatewaysOperations operations. + /// + internal partial class GatewaysOperations : Microsoft.Rest.IServiceOperations, IGatewaysOperations + { + /// + /// Initializes a new instance of the GatewaysOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GatewaysOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (gatewayId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayId"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("gatewayId", gatewayId); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{gatewayId}", System.Uri.EscapeDataString(gatewayId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs new file mode 100644 index 000000000000..9e2210a53cca --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for GatewaysOperations + /// + public static partial class GatewaysOperationsExtensions + { + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + public static void Delete(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId) + { + ((IGatewaysOperations)operations).DeleteAsync(resourceGroupName, workspaceName, gatewayId).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, gatewayId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs new file mode 100644 index 000000000000..7b402be0a3b2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// AvailableServiceTiersOperations operations. + /// + public partial interface IAvailableServiceTiersOperations + { + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs new file mode 100644 index 000000000000..5768e4342178 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs @@ -0,0 +1,294 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// ClustersOperations operations. + /// + public partial interface IClustersOperations + { + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a cluster instance. + /// + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a cluster instance. + /// + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs new file mode 100644 index 000000000000..4838e28c3c52 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs @@ -0,0 +1,130 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// DataExportsOperations operations. + /// + public partial interface IDataExportsOperations + { + /// + /// Lists the data export instances within a workspace. + /// + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update a data export. + /// + /// + /// Create or update a data export. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The parameters required to create or update a data export. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a data export instance. + /// + /// + /// Gets a data export instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs new file mode 100644 index 000000000000..2abfe5e2ab2a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs @@ -0,0 +1,163 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// DataSourcesOperations operations. + /// + public partial interface IDataSourcesOperations + { + /// + /// Create or update a data source. + /// + /// + /// Create or update a data source. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The parameters required to create or update a datasource. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a data source instance. + /// + /// + /// Deletes a data source instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a datasource instance. + /// + /// + /// Gets a datasource instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs new file mode 100644 index 000000000000..4b753807c94a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs @@ -0,0 +1,62 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// DeletedWorkspacesOperations operations. + /// + public partial interface IDeletedWorkspacesOperations + { + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs new file mode 100644 index 000000000000..864cf8b8a933 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// GatewaysOperations operations. + /// + public partial interface IGatewaysOperations + { + /// + /// Delete a Log Analytics gateway. + /// + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs new file mode 100644 index 000000000000..355ce492af6c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs @@ -0,0 +1,97 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// IntelligencePacksOperations operations. + /// + public partial interface IIntelligencePacksOperations + { + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs new file mode 100644 index 000000000000..94466dcab37f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs @@ -0,0 +1,194 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// LinkedServicesOperations operations. + /// + public partial interface ILinkedServicesOperations + { + /// + /// Create or update a linked service. + /// + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a linked service instance. + /// + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a linked service instance. + /// + /// + /// Gets a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update a linked service. + /// + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a linked service instance. + /// + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs new file mode 100644 index 000000000000..5f06d75b07f7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs @@ -0,0 +1,138 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// LinkedStorageAccountsOperations operations. + /// + public partial interface ILinkedStorageAccountsOperations + { + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// Linked storage accounts resources ids. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs new file mode 100644 index 000000000000..a8d79dec31ad --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// ManagementGroupsOperations operations. + /// + public partial interface IManagementGroupsOperations + { + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs new file mode 100644 index 000000000000..d1d341679ba2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// OperationStatusesOperations operations. + /// + public partial interface IOperationStatusesOperations + { + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs new file mode 100644 index 000000000000..41d734efaa4c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs @@ -0,0 +1,166 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Azure Log Analytics API reference + /// + public partial interface IOperationalInsightsManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + + + /// + /// The ID of the target subscription. + /// + string SubscriptionId { get; set;} + + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set;} + + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set;} + + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set;} + + + /// + /// Gets the IOperations + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Gets the IDeletedWorkspacesOperations + /// + IDeletedWorkspacesOperations DeletedWorkspaces { get; } + + /// + /// Gets the ITablesOperations + /// + ITablesOperations Tables { get; } + + /// + /// Gets the IDataExportsOperations + /// + IDataExportsOperations DataExports { get; } + + /// + /// Gets the IDataSourcesOperations + /// + IDataSourcesOperations DataSources { get; } + + /// + /// Gets the IIntelligencePacksOperations + /// + IIntelligencePacksOperations IntelligencePacks { get; } + + /// + /// Gets the ILinkedServicesOperations + /// + ILinkedServicesOperations LinkedServices { get; } + + /// + /// Gets the ILinkedStorageAccountsOperations + /// + ILinkedStorageAccountsOperations LinkedStorageAccounts { get; } + + /// + /// Gets the IManagementGroupsOperations + /// + IManagementGroupsOperations ManagementGroups { get; } + + /// + /// Gets the IOperationStatusesOperations + /// + IOperationStatusesOperations OperationStatuses { get; } + + /// + /// Gets the ISharedKeysOperations + /// + ISharedKeysOperations SharedKeys { get; } + + /// + /// Gets the IUsagesOperations + /// + IUsagesOperations Usages { get; } + + /// + /// Gets the IStorageInsightConfigsOperations + /// + IStorageInsightConfigsOperations StorageInsightConfigs { get; } + + /// + /// Gets the ISavedSearchesOperations + /// + ISavedSearchesOperations SavedSearches { get; } + + /// + /// Gets the IAvailableServiceTiersOperations + /// + IAvailableServiceTiersOperations AvailableServiceTiers { get; } + + /// + /// Gets the IGatewaysOperations + /// + IGatewaysOperations Gateways { get; } + + /// + /// Gets the ISchemaOperations + /// + ISchemaOperations Schema { get; } + + /// + /// Gets the IWorkspacePurgeOperations + /// + IWorkspacePurgeOperations WorkspacePurge { get; } + + /// + /// Gets the IClustersOperations + /// + IClustersOperations Clusters { get; } + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs new file mode 100644 index 000000000000..7aea452a6aba --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs @@ -0,0 +1,60 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs new file mode 100644 index 000000000000..4a6878a5b8e0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs @@ -0,0 +1,130 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// SavedSearchesOperations operations. + /// + public partial interface ISavedSearchesOperations + { + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The parameters required to save a search. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs new file mode 100644 index 000000000000..44a9023b8977 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// SchemaOperations operations. + /// + public partial interface ISchemaOperations + { + /// + /// Gets the schema for a given workspace. + /// + /// + /// Gets the schema for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs new file mode 100644 index 000000000000..f59c70bbb8d7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// SharedKeysOperations operations. + /// + public partial interface ISharedKeysOperations + { + /// + /// Gets the shared keys for a workspace. + /// + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs new file mode 100644 index 000000000000..90dda555a300 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs @@ -0,0 +1,153 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// StorageInsightConfigsOperations operations. + /// + public partial interface IStorageInsightConfigsOperations + { + /// + /// Create or update a storage insight. + /// + /// + /// Create or update a storage insight. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The parameters required to create or update a storage insight. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a storage insight instance. + /// + /// + /// Gets a storage insight instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs new file mode 100644 index 000000000000..353c2c5940bb --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs @@ -0,0 +1,282 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// TablesOperations operations. + /// + public partial interface ITablesOperations + { + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs new file mode 100644 index 000000000000..035640958713 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs new file mode 100644 index 000000000000..ecb0237ee47c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// WorkspacePurgeOperations operations. + /// + public partial interface IWorkspacePurgeOperations + { + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Describes the body of a request to purge data in a single table of an Log + /// Analytics Workspace + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs new file mode 100644 index 000000000000..235fb73d7e84 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs @@ -0,0 +1,239 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// WorkspacesOperations operations. + /// + public partial interface IWorkspacesOperations + { + /// + /// Gets the workspaces in a subscription. + /// + /// + /// Gets the workspaces in a subscription. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets workspaces in a resource group. + /// + /// + /// Gets workspaces in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update a workspace. + /// + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets a workspace instance. + /// + /// + /// Gets a workspace instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Updates a workspace. + /// + /// + /// Updates a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to patch a workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update a workspace. + /// + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs new file mode 100644 index 000000000000..d7a6e7ac35b0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs @@ -0,0 +1,741 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// IntelligencePacksOperations operations. + /// + internal partial class IntelligencePacksOperations : Microsoft.Rest.IServiceOperations, IIntelligencePacksOperations + { + /// + /// Initializes a new instance of the IntelligencePacksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntelligencePacksOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (intelligencePackName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "intelligencePackName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("intelligencePackName", intelligencePackName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (intelligencePackName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "intelligencePackName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("intelligencePackName", intelligencePackName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs new file mode 100644 index 000000000000..df7281e57685 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for IntelligencePacksOperations + /// + public static partial class IntelligencePacksOperationsExtensions + { + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + public static void Disable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) + { + ((IIntelligencePacksOperations)operations).DisableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); + } + + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DisableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DisableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + public static void Enable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) + { + ((IIntelligencePacksOperations)operations).EnableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); + } + + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task EnableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.EnableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IList List(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName) + { + return ((IIntelligencePacksOperations)operations).ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs new file mode 100644 index 000000000000..80e0be55f255 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs @@ -0,0 +1,1118 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// LinkedServicesOperations operations. + /// + internal partial class LinkedServicesOperations : Microsoft.Rest.IServiceOperations, ILinkedServicesOperations + { + /// + /// Initializes a new instance of the LinkedServicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LinkedServicesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (linkedServiceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkedServiceName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (linkedServiceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkedServiceName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (linkedServiceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkedServiceName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs new file mode 100644 index 000000000000..9a2598920f17 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs @@ -0,0 +1,280 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for LinkedServicesOperations + /// + public static partial class LinkedServicesOperationsExtensions + { + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + public static LinkedService CreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) + { + return ((ILinkedServicesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService Delete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return ((ILinkedServicesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService Get(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return ((ILinkedServicesOperations)operations).GetAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable ListByWorkspace(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName) + { + return ((ILinkedServicesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + public static LinkedService BeginCreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) + { + return ((ILinkedServicesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService BeginDelete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return ((ILinkedServicesOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs new file mode 100644 index 000000000000..f8a200ca786f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs @@ -0,0 +1,1018 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// LinkedStorageAccountsOperations operations. + /// + internal partial class LinkedStorageAccountsOperations : Microsoft.Rest.IServiceOperations, ILinkedStorageAccountsOperations + { + /// + /// Initializes a new instance of the LinkedStorageAccountsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LinkedStorageAccountsOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// Linked storage accounts resources ids. + /// + /// + /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + LinkedStorageAccountsResource parameters = new LinkedStorageAccountsResource(); + if(storageAccountIds != null) + { + parameters.StorageAccountIds = storageAccountIds; + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceName", workspaceName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs new file mode 100644 index 000000000000..799574fe7c81 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs @@ -0,0 +1,195 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for LinkedStorageAccountsOperations + /// + public static partial class LinkedStorageAccountsOperationsExtensions + { + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + public static LinkedStorageAccountsResource CreateOrUpdate(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList)) + { + return ((ILinkedStorageAccountsOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds).GetAwaiter().GetResult(); + } + + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + public static void Delete(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + { + ((ILinkedStorageAccountsOperations)operations).DeleteAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + } + + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + { + return ((ILinkedStorageAccountsOperations)operations).GetAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + } + + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable ListByWorkspace(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName) + { + return ((ILinkedStorageAccountsOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs new file mode 100644 index 000000000000..4db124842ef4 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs @@ -0,0 +1,282 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// ManagementGroupsOperations operations. + /// + internal partial class ManagementGroupsOperations : Microsoft.Rest.IServiceOperations, IManagementGroupsOperations + { + /// + /// Initializes a new instance of the ManagementGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagementGroupsOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..eff893f6c58c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ManagementGroupsOperations + /// + public static partial class ManagementGroupsOperationsExtensions + { + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable List(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName) + { + return ((IManagementGroupsOperations)operations).ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs new file mode 100644 index 000000000000..6378b4b2433e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs @@ -0,0 +1,78 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The list of Log Analytics workspaces associated with the cluster. + /// + public partial class AssociatedWorkspace + { + /// + /// Initializes a new instance of the AssociatedWorkspace class. + /// + public AssociatedWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssociatedWorkspace class. + /// + + /// The id of the assigned workspace. + /// + + /// The name id the assigned workspace. + /// + + /// The ResourceId id the assigned workspace. + /// + + /// The time of workspace association. + /// + public AssociatedWorkspace(string workspaceId = default(string), string workspaceName = default(string), string resourceId = default(string), string associateDate = default(string)) + + { + this.WorkspaceId = workspaceId; + this.WorkspaceName = workspaceName; + this.ResourceId = resourceId; + this.AssociateDate = associateDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the id of the assigned workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId {get; private set; } + + /// + /// Gets the name id the assigned workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceName")] + public string WorkspaceName {get; private set; } + + /// + /// Gets the ResourceId id the assigned workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; private set; } + + /// + /// Gets the time of workspace association. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associateDate")] + public string AssociateDate {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs new file mode 100644 index 000000000000..2f568ff134c2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs @@ -0,0 +1,113 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Service Tier details. + /// + public partial class AvailableServiceTier + { + /// + /// Initializes a new instance of the AvailableServiceTier class. + /// + public AvailableServiceTier() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AvailableServiceTier class. + /// + + /// The name of the Service Tier. + /// Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', + /// 'PerGB2018', 'Standalone', 'CapacityReservation' + + /// True if the Service Tier is enabled for the workspace. + /// + + /// The minimum retention for the Service Tier, in days. + /// + + /// The maximum retention for the Service Tier, in days. + /// + + /// The default retention for the Service Tier, in days. + /// + + /// The capacity reservation level in GB per day. Returned for the Capacity + /// Reservation Service Tier. + /// + + /// Time when the sku was last updated for the workspace. Returned for the + /// Capacity Reservation Service Tier. + /// + public AvailableServiceTier(string serviceTier = default(string), bool? enabled = default(bool?), long? minimumRetention = default(long?), long? maximumRetention = default(long?), long? defaultRetention = default(long?), long? capacityReservationLevel = default(long?), string lastSkuUpdate = default(string)) + + { + this.ServiceTier = serviceTier; + this.Enabled = enabled; + this.MinimumRetention = minimumRetention; + this.MaximumRetention = maximumRetention; + this.DefaultRetention = defaultRetention; + this.CapacityReservationLevel = capacityReservationLevel; + this.LastSkuUpdate = lastSkuUpdate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the Service Tier. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceTier")] + public string ServiceTier {get; private set; } + + /// + /// Gets true if the Service Tier is enabled for the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; private set; } + + /// + /// Gets the minimum retention for the Service Tier, in days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minimumRetention")] + public long? MinimumRetention {get; private set; } + + /// + /// Gets the maximum retention for the Service Tier, in days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maximumRetention")] + public long? MaximumRetention {get; private set; } + + /// + /// Gets the default retention for the Service Tier, in days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultRetention")] + public long? DefaultRetention {get; private set; } + + /// + /// Gets the capacity reservation level in GB per day. Returned for the + /// Capacity Reservation Service Tier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationLevel")] + public long? CapacityReservationLevel {get; private set; } + + /// + /// Gets time when the sku was last updated for the workspace. Returned for the + /// Capacity Reservation Service Tier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs new file mode 100644 index 000000000000..56cdf84d3ec9 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs @@ -0,0 +1,65 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The resource model definition for an Azure Resource Manager resource with + /// an etag. + /// + /// + /// The resource model definition for an Azure Resource Manager resource with + /// an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource Etag. + /// + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + + : base(id, name, type) + { + this.Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets resource Etag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs new file mode 100644 index 000000000000..b464f3459d5b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs @@ -0,0 +1,19 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for BillingType. + /// + + + public static class BillingType + { + public const string Cluster = "Cluster"; + public const string Workspaces = "Workspaces"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.cs new file mode 100644 index 000000000000..9dcaada10106 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.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.OperationalInsights.Models +{ + + /// + /// Defines values for Capacity. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum Capacity + { + [System.Runtime.Serialization.EnumMember(Value = "500")] + FiveHundred, + [System.Runtime.Serialization.EnumMember(Value = "1000")] + TenHundred, + [System.Runtime.Serialization.EnumMember(Value = "2000")] + TwoThousand, + [System.Runtime.Serialization.EnumMember(Value = "5000")] + FiveThousand + } + internal static class CapacityEnumExtension + { + internal static string ToSerializedValue(this Capacity? value) + { + return value == null ? null : ((Capacity)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this Capacity value) + { + switch( value ) + { + case Capacity.FiveHundred: + return "500"; + case Capacity.TenHundred: + return "1000"; + case Capacity.TwoThousand: + return "2000"; + case Capacity.FiveThousand: + return "5000"; + } + return null; + } + internal static Capacity? ParseCapacity(this string value) + { + switch( value ) + { + case "500": + return Capacity.FiveHundred; + case "1000": + return Capacity.TenHundred; + case "2000": + return Capacity.TwoThousand; + case "5000": + return Capacity.FiveThousand; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs new file mode 100644 index 000000000000..a69b71472f27 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs @@ -0,0 +1,87 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for CapacityReservationLevel. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum CapacityReservationLevel + { + [System.Runtime.Serialization.EnumMember(Value = "100")] + OneHundred, + [System.Runtime.Serialization.EnumMember(Value = "200")] + TwoHundred, + [System.Runtime.Serialization.EnumMember(Value = "300")] + ThreeHundred, + [System.Runtime.Serialization.EnumMember(Value = "400")] + FourHundred, + [System.Runtime.Serialization.EnumMember(Value = "500")] + FiveHundred, + [System.Runtime.Serialization.EnumMember(Value = "1000")] + TenHundred, + [System.Runtime.Serialization.EnumMember(Value = "2000")] + TwoThousand, + [System.Runtime.Serialization.EnumMember(Value = "5000")] + FiveThousand + } + internal static class CapacityReservationLevelEnumExtension + { + internal static string ToSerializedValue(this CapacityReservationLevel? value) + { + return value == null ? null : ((CapacityReservationLevel)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this CapacityReservationLevel value) + { + switch( value ) + { + case CapacityReservationLevel.OneHundred: + return "100"; + case CapacityReservationLevel.TwoHundred: + return "200"; + case CapacityReservationLevel.ThreeHundred: + return "300"; + case CapacityReservationLevel.FourHundred: + return "400"; + case CapacityReservationLevel.FiveHundred: + return "500"; + case CapacityReservationLevel.TenHundred: + return "1000"; + case CapacityReservationLevel.TwoThousand: + return "2000"; + case CapacityReservationLevel.FiveThousand: + return "5000"; + } + return null; + } + internal static CapacityReservationLevel? ParseCapacityReservationLevel(this string value) + { + switch( value ) + { + case "100": + return CapacityReservationLevel.OneHundred; + case "200": + return CapacityReservationLevel.TwoHundred; + case "300": + return CapacityReservationLevel.ThreeHundred; + case "400": + return CapacityReservationLevel.FourHundred; + case "500": + return CapacityReservationLevel.FiveHundred; + case "1000": + return CapacityReservationLevel.TenHundred; + case "2000": + return CapacityReservationLevel.TwoThousand; + case "5000": + return CapacityReservationLevel.FiveThousand; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs new file mode 100644 index 000000000000..a2e3dbb4dc3f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The Capacity Reservation properties. + /// + public partial class CapacityReservationProperties + { + /// + /// Initializes a new instance of the CapacityReservationProperties class. + /// + public CapacityReservationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CapacityReservationProperties class. + /// + + /// The last time Sku was updated. + /// + + /// Minimum CapacityReservation value in GB. + /// + public CapacityReservationProperties(string lastSkuUpdate = default(string), long? minCapacity = default(long?)) + + { + this.LastSkuUpdate = lastSkuUpdate; + this.MinCapacity = minCapacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the last time Sku was updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate {get; private set; } + + /// + /// Gets minimum CapacityReservation value in GB. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minCapacity")] + public long? MinCapacity {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs new file mode 100644 index 000000000000..87354a89c386 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs @@ -0,0 +1,211 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level Log Analytics cluster resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Cluster : TrackedResource + { + /// + /// Initializes a new instance of the Cluster class. + /// + public Cluster() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Cluster class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// The identity of the resource. + /// + + /// The sku properties. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + + /// The ID associated with the cluster. + /// + + /// The provisioning state of the cluster. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// Configures whether cluster will use double encryption. This Property can + /// not be modified after cluster creation. Default value is 'true' + /// + + /// Sets whether the cluster will support availability zones. This can be set + /// as true only in regions where Azure Data Explorer support Availability + /// Zones. This Property can not be modified after cluster creation. Default + /// value is 'true' if region supports Availability Zones. + /// + + /// The associated key properties. + /// + + /// The last time the cluster was updated. + /// + + /// The cluster creation time + /// + + /// The list of Log Analytics workspaces associated with the cluster + /// + + /// Additional properties for capacity reservation + /// + public Cluster(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), string billingType = default(string), string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), System.Collections.Generic.IList associatedWorkspaces = default(System.Collections.Generic.IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) + + : base(location, id, name, type, tags) + { + this.Identity = identity; + this.Sku = sku; + this.BillingType = billingType; + this.ClusterId = clusterId; + this.ProvisioningState = provisioningState; + this.IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + this.IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + this.KeyVaultProperties = keyVaultProperties; + this.LastModifiedDate = lastModifiedDate; + this.CreatedDate = createdDate; + this.AssociatedWorkspaces = associatedWorkspaces; + this.CapacityReservationProperties = capacityReservationProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the identity of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public Identity Identity {get; set; } + + /// + /// Gets or sets the sku properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ClusterSku Sku {get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingType")] + public string BillingType {get; set; } + + /// + /// Gets the ID associated with the cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.clusterId")] + public string ClusterId {get; private set; } + + /// + /// Gets the provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets configures whether cluster will use double encryption. This + /// Property can not be modified after cluster creation. Default value is + /// 'true' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDoubleEncryptionEnabled")] + public bool? IsDoubleEncryptionEnabled {get; set; } + + /// + /// Gets or sets sets whether the cluster will support availability zones. This + /// can be set as true only in regions where Azure Data Explorer support + /// Availability Zones. This Property can not be modified after cluster + /// creation. Default value is 'true' if region supports Availability Zones. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isAvailabilityZonesEnabled")] + public bool? IsAvailabilityZonesEnabled {get; set; } + + /// + /// Gets or sets the associated key properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } + + /// + /// Gets the last time the cluster was updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate {get; private set; } + + /// + /// Gets the cluster creation time + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets or sets the list of Log Analytics workspaces associated with the + /// cluster + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.associatedWorkspaces")] + public System.Collections.Generic.IList AssociatedWorkspaces {get; set; } + + /// + /// Gets or sets additional properties for capacity reservation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityReservationProperties")] + public CapacityReservationProperties CapacityReservationProperties {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (this.Identity != null) + { + this.Identity.Validate(); + } + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs new file mode 100644 index 000000000000..e04075993f8e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs @@ -0,0 +1,24 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for ClusterEntityStatus. + /// + + + public static class ClusterEntityStatus + { + public const string Creating = "Creating"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + public const string Deleting = "Deleting"; + public const string ProvisioningAccount = "ProvisioningAccount"; + public const string Updating = "Updating"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs new file mode 100644 index 000000000000..5c42d788817b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs @@ -0,0 +1,106 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level Log Analytics cluster resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ClusterPatch : Microsoft.Rest.Azure.IResource + { + /// + /// Initializes a new instance of the ClusterPatch class. + /// + public ClusterPatch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterPatch class. + /// + + /// The identity of the resource. + /// + + /// The sku properties. + /// + + /// Resource tags. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + + /// The associated key properties. + /// + public ClusterPatch(Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + + { + this.Identity = identity; + this.Sku = sku; + this.Tags = tags; + this.BillingType = billingType; + this.KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the identity of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public Identity Identity {get; set; } + + /// + /// Gets or sets the sku properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ClusterSku Sku {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingType")] + public string BillingType {get; set; } + + /// + /// Gets or sets the associated key properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Identity != null) + { + this.Identity.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs new file mode 100644 index 000000000000..a695bfabfaad --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Log Analytics cluster patch properties. + /// + public partial class ClusterPatchProperties + { + /// + /// Initializes a new instance of the ClusterPatchProperties class. + /// + public ClusterPatchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterPatchProperties class. + /// + + /// The associated key properties. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + public ClusterPatchProperties(KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string billingType = default(string)) + + { + this.KeyVaultProperties = keyVaultProperties; + this.BillingType = billingType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the associated key properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "billingType")] + public string BillingType {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs new file mode 100644 index 000000000000..d499634b2cd7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs @@ -0,0 +1,149 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Cluster properties. + /// + public partial class ClusterProperties + { + /// + /// Initializes a new instance of the ClusterProperties class. + /// + public ClusterProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterProperties class. + /// + + /// The ID associated with the cluster. + /// + + /// The provisioning state of the cluster. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// Configures whether cluster will use double encryption. This Property can + /// not be modified after cluster creation. Default value is 'true' + /// + + /// Sets whether the cluster will support availability zones. This can be set + /// as true only in regions where Azure Data Explorer support Availability + /// Zones. This Property can not be modified after cluster creation. Default + /// value is 'true' if region supports Availability Zones. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + + /// The associated key properties. + /// + + /// The last time the cluster was updated. + /// + + /// The cluster creation time + /// + + /// The list of Log Analytics workspaces associated with the cluster + /// + + /// Additional properties for capacity reservation + /// + public ClusterProperties(string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), System.Collections.Generic.IList associatedWorkspaces = default(System.Collections.Generic.IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) + + { + this.ClusterId = clusterId; + this.ProvisioningState = provisioningState; + this.IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + this.IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + this.BillingType = billingType; + this.KeyVaultProperties = keyVaultProperties; + this.LastModifiedDate = lastModifiedDate; + this.CreatedDate = createdDate; + this.AssociatedWorkspaces = associatedWorkspaces; + this.CapacityReservationProperties = capacityReservationProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the ID associated with the cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clusterId")] + public string ClusterId {get; private set; } + + /// + /// Gets the provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets configures whether cluster will use double encryption. This + /// Property can not be modified after cluster creation. Default value is + /// 'true' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDoubleEncryptionEnabled")] + public bool? IsDoubleEncryptionEnabled {get; set; } + + /// + /// Gets or sets sets whether the cluster will support availability zones. This + /// can be set as true only in regions where Azure Data Explorer support + /// Availability Zones. This Property can not be modified after cluster + /// creation. Default value is 'true' if region supports Availability Zones. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isAvailabilityZonesEnabled")] + public bool? IsAvailabilityZonesEnabled {get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "billingType")] + public string BillingType {get; set; } + + /// + /// Gets or sets the associated key properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } + + /// + /// Gets the last time the cluster was updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDate")] + public string LastModifiedDate {get; private set; } + + /// + /// Gets the cluster creation time + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets or sets the list of Log Analytics workspaces associated with the + /// cluster + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedWorkspaces")] + public System.Collections.Generic.IList AssociatedWorkspaces {get; set; } + + /// + /// Gets or sets additional properties for capacity reservation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationProperties")] + public CapacityReservationProperties CapacityReservationProperties {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs new file mode 100644 index 000000000000..44d2feee6924 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The cluster sku definition. + /// + public partial class ClusterSku + { + /// + /// Initializes a new instance of the ClusterSku class. + /// + public ClusterSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterSku class. + /// + + /// The capacity value + /// Possible values include: '500', '1000', '2000', '5000' + + /// The name of the SKU. + /// Possible values include: 'CapacityReservation' + public ClusterSku(long? capacity = default(long?), string name = default(string)) + + { + this.Capacity = capacity; + this.Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the capacity value Possible values include: '500', '1000', '2000', '5000' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public long? Capacity {get; set; } + + /// + /// Gets or sets the name of the SKU. Possible values include: 'CapacityReservation' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs new file mode 100644 index 000000000000..6d2f709417b0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs @@ -0,0 +1,18 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for ClusterSkuNameEnum. + /// + + + public static class ClusterSkuNameEnum + { + public const string CapacityReservation = "CapacityReservation"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs new file mode 100644 index 000000000000..d0535f1c8a12 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs @@ -0,0 +1,109 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Table column. + /// + public partial class Column + { + /// + /// Initializes a new instance of the Column class. + /// + public Column() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Column class. + /// + + /// Column name. + /// + + /// Column data type. + /// Possible values include: 'string', 'int', 'long', 'real', 'boolean', + /// 'dateTime', 'guid', 'dynamic' + + /// Column data type logical hint. + /// Possible values include: 'uri', 'guid', 'armPath', 'ip' + + /// Column display name. + /// + + /// Column description. + /// + + /// Is displayed by default. + /// + + /// Is column hidden. + /// + public Column(string name = default(string), string type = default(string), string dataTypeHint = default(string), string displayName = default(string), string description = default(string), bool? isDefaultDisplay = default(bool?), bool? isHidden = default(bool?)) + + { + this.Name = name; + this.Type = type; + this.DataTypeHint = dataTypeHint; + this.DisplayName = displayName; + this.Description = description; + this.IsDefaultDisplay = isDefaultDisplay; + this.IsHidden = isHidden; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets column name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets column data type. Possible values include: 'string', 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', 'dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets column data type logical hint. Possible values include: 'uri', 'guid', 'armPath', 'ip' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataTypeHint")] + public string DataTypeHint {get; set; } + + /// + /// Gets or sets column display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets column description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets is displayed by default. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDefaultDisplay")] + public bool? IsDefaultDisplay {get; private set; } + + /// + /// Gets is column hidden. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs new file mode 100644 index 000000000000..ae8f450cf6d3 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs @@ -0,0 +1,37 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for ColumnDataTypeHintEnum. + /// + + + public static class ColumnDataTypeHintEnum + { + /// + /// A string that matches the pattern of a URI, for example, + /// scheme://username:password@host:1234/this/is/a/path?k1=v1&amp;k2=v2#fragment + /// + public const string Uri = "uri"; + /// + /// A standard 128-bit GUID following the standard shape, + /// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// + public const string Guid = "guid"; + /// + /// An Azure Resource Model (ARM) path: + /// /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}... + /// + public const string ArmPath = "armPath"; + /// + /// A standard V4/V6 ip address following the standard shape, + /// x.x.x.x/y:y:y:y:y:y:y:y + /// + public const string Ip = "ip"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs new file mode 100644 index 000000000000..af3e1845f27f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs @@ -0,0 +1,25 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for ColumnTypeEnum. + /// + + + public static class ColumnTypeEnum + { + public const string String = "string"; + public const string Int = "int"; + public const string Long = "long"; + public const string Real = "real"; + public const string Boolean = "boolean"; + public const string DateTime = "dateTime"; + public const string Guid = "guid"; + public const string Dynamic = "dynamic"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs new file mode 100644 index 000000000000..97404a5ecc84 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs @@ -0,0 +1,68 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The core summary of a search. + /// + public partial class CoreSummary + { + /// + /// Initializes a new instance of the CoreSummary class. + /// + public CoreSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CoreSummary class. + /// + + /// The status of a core summary. + /// + + /// The number of documents of a core summary. + /// + public CoreSummary(long numberOfDocuments, string status = default(string)) + + { + this.Status = status; + this.NumberOfDocuments = numberOfDocuments; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the status of a core summary. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the number of documents of a core summary. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "numberOfDocuments")] + public long NumberOfDocuments {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..130114c54ac7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs @@ -0,0 +1,21 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for CreatedByType. + /// + + + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs new file mode 100644 index 000000000000..2a0d32b18295 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs @@ -0,0 +1,124 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level data export resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DataExport : Microsoft.Rest.Azure.IResource + { + /// + /// Initializes a new instance of the DataExport class. + /// + public DataExport() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataExport class. + /// + + /// The data export rule ID. + /// + + /// An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + /// + + /// Active when enabled. + /// + + /// The latest data export rule modification time. + /// + + /// Date and time when the export was last modified. + /// + + /// The destination resource ID. This can be copied from the Properties entry + /// of the destination resource in Azure. + /// + + /// The type of the destination resource + /// Possible values include: 'StorageAccount', 'EventHub' + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public DataExport(string dataExportId = default(string), System.Collections.Generic.IList tableNames = default(System.Collections.Generic.IList), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string), string resourceId = default(string), string dataExportType = default(string), string eventHubName = default(string)) + + { + this.DataExportId = dataExportId; + this.TableNames = tableNames; + this.Enable = enable; + this.CreatedDate = createdDate; + this.LastModifiedDate = lastModifiedDate; + this.ResourceId = resourceId; + this.DataExportType = dataExportType; + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the data export rule ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataExportId")] + public string DataExportId {get; set; } + + /// + /// Gets or sets an array of tables to export, for example: [“Heartbeat, + /// SecurityEvent”]. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tableNames")] + public System.Collections.Generic.IList TableNames {get; set; } + + /// + /// Gets or sets active when enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enable")] + public bool? Enable {get; set; } + + /// + /// Gets or sets the latest data export rule modification time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; set; } + + /// + /// Gets or sets date and time when the export was last modified. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate {get; set; } + + /// + /// Gets or sets the destination resource ID. This can be copied from the + /// Properties entry of the destination resource in Azure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination.resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets the type of the destination resource Possible values include: 'StorageAccount', 'EventHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination.type")] + public string DataExportType {get; private set; } + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination.metaData.eventHubName")] + public string EventHubName {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs new file mode 100644 index 000000000000..2aa32eb0d491 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs @@ -0,0 +1,144 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Data Export properties. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DataExportProperties + { + /// + /// Initializes a new instance of the DataExportProperties class. + /// + public DataExportProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataExportProperties class. + /// + + /// The data export rule ID. + /// + + /// An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + /// + + /// Active when enabled. + /// + + /// The latest data export rule modification time. + /// + + /// Date and time when the export was last modified. + /// + + /// The destination resource ID. This can be copied from the Properties entry + /// of the destination resource in Azure. + /// + + /// The type of the destination resource + /// Possible values include: 'StorageAccount', 'EventHub' + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public DataExportProperties(System.Collections.Generic.IList tableNames, string dataExportId = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string), string resourceId = default(string), string type = default(string), string eventHubName = default(string)) + + { + this.DataExportId = dataExportId; + this.TableNames = tableNames; + this.Enable = enable; + this.CreatedDate = createdDate; + this.LastModifiedDate = lastModifiedDate; + this.ResourceId = resourceId; + this.Type = type; + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the data export rule ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataExportId")] + public string DataExportId {get; set; } + + /// + /// Gets or sets an array of tables to export, for example: [“Heartbeat, + /// SecurityEvent”]. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tableNames")] + public System.Collections.Generic.IList TableNames {get; set; } + + /// + /// Gets or sets active when enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enable")] + public bool? Enable {get; set; } + + /// + /// Gets or sets the latest data export rule modification time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public string CreatedDate {get; set; } + + /// + /// Gets or sets date and time when the export was last modified. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDate")] + public string LastModifiedDate {get; set; } + + /// + /// Gets or sets the destination resource ID. This can be copied from the + /// Properties entry of the destination resource in Azure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destination.resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets the type of the destination resource Possible values include: 'StorageAccount', 'EventHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destination.type")] + public string Type {get; private set; } + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destination.metaData.eventHubName")] + public string EventHubName {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.TableNames == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TableNames"); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs new file mode 100644 index 000000000000..b25a3930aa77 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs @@ -0,0 +1,42 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for DataIngestionStatus. + /// + + + public static class DataIngestionStatus + { + /// + /// Ingestion enabled following daily cap quota reset, or subscription + /// enablement. + /// + public const string RespectQuota = "RespectQuota"; + /// + /// Ingestion started following service setting change. + /// + public const string ForceOn = "ForceOn"; + /// + /// Ingestion stopped following service setting change. + /// + public const string ForceOff = "ForceOff"; + /// + /// Reached daily cap quota, ingestion stopped. + /// + public const string OverQuota = "OverQuota"; + /// + /// Ingestion stopped following suspended subscription. + /// + public const string SubscriptionSuspended = "SubscriptionSuspended"; + /// + /// 80% of daily cap quota reached. + /// + public const string ApproachingQuota = "ApproachingQuota"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs new file mode 100644 index 000000000000..508e0de4ff1d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs @@ -0,0 +1,127 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Datasources under OMS Workspace. + /// + public partial class DataSource : ProxyResource + { + /// + /// Initializes a new instance of the DataSource class. + /// + public DataSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// The data source properties in raw json format, each kind of data source + /// have it's own schema. + /// + + /// The ETag of the data source. + /// + + /// The kind of the DataSource. + /// Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', + /// 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', + /// 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', + /// 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', + /// 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + + /// Resource tags. + /// + public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type) + { + this.Properties = properties; + this.Etag = etag; + this.Kind = kind; + this.Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the data source properties in raw json format, each kind of + /// data source have it's own schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public object Properties {get; set; } + + /// + /// Gets or sets the ETag of the data source. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } + + /// + /// Gets or sets the kind of the DataSource. Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Properties == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); + } + if (this.Kind == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Kind"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs new file mode 100644 index 000000000000..e07eab7bc373 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs @@ -0,0 +1,62 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// DataSource filter. Right now, only filter by kind is supported. + /// + public partial class DataSourceFilter + { + /// + /// Initializes a new instance of the DataSourceFilter class. + /// + public DataSourceFilter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSourceFilter class. + /// + + /// The kind of the DataSource. + /// Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', + /// 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', + /// 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', + /// 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', + /// 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + public DataSourceFilter(string kind = default(string)) + + { + this.Kind = kind; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the kind of the DataSource. Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs new file mode 100644 index 000000000000..35e4a526a5b0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs @@ -0,0 +1,50 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for DataSourceKind. + /// + + + public static class DataSourceKind + { + public const string WindowsEvent = "WindowsEvent"; + public const string WindowsPerformanceCounter = "WindowsPerformanceCounter"; + public const string IISLogs = "IISLogs"; + public const string LinuxSyslog = "LinuxSyslog"; + public const string LinuxSyslogCollection = "LinuxSyslogCollection"; + public const string LinuxPerformanceObject = "LinuxPerformanceObject"; + public const string LinuxPerformanceCollection = "LinuxPerformanceCollection"; + public const string CustomLog = "CustomLog"; + public const string CustomLogCollection = "CustomLogCollection"; + public const string AzureAuditLog = "AzureAuditLog"; + public const string AzureActivityLog = "AzureActivityLog"; + public const string GenericDataSource = "GenericDataSource"; + public const string ChangeTrackingCustomPath = "ChangeTrackingCustomPath"; + public const string ChangeTrackingPath = "ChangeTrackingPath"; + public const string ChangeTrackingServices = "ChangeTrackingServices"; + public const string ChangeTrackingDataTypeConfiguration = "ChangeTrackingDataTypeConfiguration"; + public const string ChangeTrackingDefaultRegistry = "ChangeTrackingDefaultRegistry"; + public const string ChangeTrackingRegistry = "ChangeTrackingRegistry"; + public const string ChangeTrackingLinuxPath = "ChangeTrackingLinuxPath"; + public const string LinuxChangeTrackingPath = "LinuxChangeTrackingPath"; + public const string ChangeTrackingContentLocation = "ChangeTrackingContentLocation"; + public const string WindowsTelemetry = "WindowsTelemetry"; + public const string Office365 = "Office365"; + public const string SecurityWindowsBaselineConfiguration = "SecurityWindowsBaselineConfiguration"; + public const string SecurityCenterSecurityWindowsBaselineConfiguration = "SecurityCenterSecurityWindowsBaselineConfiguration"; + public const string SecurityEventCollectionConfiguration = "SecurityEventCollectionConfiguration"; + public const string SecurityInsightsSecurityEventCollectionConfiguration = "SecurityInsightsSecurityEventCollectionConfiguration"; + public const string ImportComputerGroup = "ImportComputerGroup"; + public const string NetworkMonitoring = "NetworkMonitoring"; + public const string Itsm = "Itsm"; + public const string DnsAnalytics = "DnsAnalytics"; + public const string ApplicationInsights = "ApplicationInsights"; + public const string SqlDataClassification = "SqlDataClassification"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs new file mode 100644 index 000000000000..f8ff89218933 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.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.OperationalInsights.Models +{ + + /// + /// Defines values for DataSourceType. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum DataSourceType + { + [System.Runtime.Serialization.EnumMember(Value = "CustomLogs")] + CustomLogs, + [System.Runtime.Serialization.EnumMember(Value = "AzureWatson")] + AzureWatson, + [System.Runtime.Serialization.EnumMember(Value = "Query")] + Query, + [System.Runtime.Serialization.EnumMember(Value = "Alerts")] + Alerts + } + internal static class DataSourceTypeEnumExtension + { + internal static string ToSerializedValue(this DataSourceType? value) + { + return value == null ? null : ((DataSourceType)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this DataSourceType value) + { + switch( value ) + { + case DataSourceType.CustomLogs: + return "CustomLogs"; + case DataSourceType.AzureWatson: + return "AzureWatson"; + case DataSourceType.Query: + return "Query"; + case DataSourceType.Alerts: + return "Alerts"; + } + return null; + } + internal static DataSourceType? ParseDataSourceType(this string value) + { + switch( value ) + { + case "CustomLogs": + return DataSourceType.CustomLogs; + case "AzureWatson": + return DataSourceType.AzureWatson; + case "Query": + return DataSourceType.Query; + case "Alerts": + return DataSourceType.Alerts; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs new file mode 100644 index 000000000000..0572b1e917ef --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Destination properties. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Destination + { + /// + /// Initializes a new instance of the Destination class. + /// + public Destination() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Destination class. + /// + + /// The destination resource ID. This can be copied from the Properties entry + /// of the destination resource in Azure. + /// + + /// The type of the destination resource + /// Possible values include: 'StorageAccount', 'EventHub' + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public Destination(string resourceId, string type = default(string), string eventHubName = default(string)) + + { + this.ResourceId = resourceId; + this.Type = type; + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the destination resource ID. This can be copied from the + /// Properties entry of the destination resource in Azure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets the type of the destination resource Possible values include: 'StorageAccount', 'EventHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metaData.eventHubName")] + public string EventHubName {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ResourceId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceId"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs new file mode 100644 index 000000000000..c477b6677519 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs @@ -0,0 +1,50 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Destination meta data. + /// + public partial class DestinationMetaData + { + /// + /// Initializes a new instance of the DestinationMetaData class. + /// + public DestinationMetaData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DestinationMetaData class. + /// + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public DestinationMetaData(string eventHubName = default(string)) + + { + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventHubName")] + public string EventHubName {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..509a9bc7ba7e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + + /// The additional info type. + /// + + /// The additional info. + /// + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + + { + this.Type = type; + this.Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the additional info type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + + /// + /// Gets the additional info. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "info")] + public object Info {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..26f9a5a5f0e3 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -0,0 +1,88 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the error code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } + + /// + /// Gets the error message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } + + /// + /// Gets the error target. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } + + /// + /// Gets the error details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } + + /// + /// Gets the error additional info. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..18f4c2ce34f8 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + + /// The error object. + /// + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the error object. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..2c109044fa72 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Exception thrown for an invalid response with ErrorResponse information. + /// + public partial class ErrorResponseException : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs new file mode 100644 index 000000000000..f3cb42a56361 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs @@ -0,0 +1,96 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + + /// The principal ID of resource identity. + /// + + /// The tenant ID of resource. + /// + + /// Type of managed service identity. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'None' + + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public Identity(IdentityType type, string principalId = default(string), string tenantId = default(string), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + + { + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the principal ID of resource identity. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } + + /// + /// Gets or sets type of managed service identity. Possible values include: 'SystemAssigned', 'UserAssigned', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public IdentityType Type {get; set; } + + /// + /// Gets or sets the list of user identities associated with the resource. The + /// user identity dictionary key references will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..9d37cfd7e562 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs @@ -0,0 +1,57 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for IdentityType. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum IdentityType + { + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [System.Runtime.Serialization.EnumMember(Value = "UserAssigned")] + UserAssigned, + [System.Runtime.Serialization.EnumMember(Value = "None")] + None + } + internal static class IdentityTypeEnumExtension + { + internal static string ToSerializedValue(this IdentityType? value) + { + return value == null ? null : ((IdentityType)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this IdentityType value) + { + switch( value ) + { + case IdentityType.SystemAssigned: + return "SystemAssigned"; + case IdentityType.UserAssigned: + return "UserAssigned"; + case IdentityType.None: + return "None"; + } + return null; + } + internal static IdentityType? ParseIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return IdentityType.SystemAssigned; + case "UserAssigned": + return IdentityType.UserAssigned; + case "None": + return IdentityType.None; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs new file mode 100644 index 000000000000..5c1810c91887 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Intelligence Pack containing a string name and boolean indicating if it's + /// enabled. + /// + public partial class IntelligencePack + { + /// + /// Initializes a new instance of the IntelligencePack class. + /// + public IntelligencePack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IntelligencePack class. + /// + + /// The name of the intelligence pack. + /// + + /// The enabled boolean for the intelligence pack. + /// + + /// The display name of the intelligence pack. + /// + public IntelligencePack(string name = default(string), bool? enabled = default(bool?), string displayName = default(string)) + + { + this.Name = name; + this.Enabled = enabled; + this.DisplayName = displayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the intelligence pack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the enabled boolean for the intelligence pack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } + + /// + /// Gets or sets the display name of the intelligence pack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 000000000000..7fb2362cbd1d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,81 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The key vault properties. + /// + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + + /// The Key Vault uri which holds they key associated with the Log Analytics + /// cluster. + /// + + /// The name of the key associated with the Log Analytics cluster. + /// + + /// The version of the key associated with the Log Analytics cluster. + /// + + /// Selected key minimum required size. + /// + public KeyVaultProperties(string keyVaultUri = default(string), string keyName = default(string), string keyVersion = default(string), int? keyRsaSize = default(int?)) + + { + this.KeyVaultUri = keyVaultUri; + this.KeyName = keyName; + this.KeyVersion = keyVersion; + this.KeyRsaSize = keyRsaSize; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the Key Vault uri which holds they key associated with the Log + /// Analytics cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri {get; set; } + + /// + /// Gets or sets the name of the key associated with the Log Analytics cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyName")] + public string KeyName {get; set; } + + /// + /// Gets or sets the version of the key associated with the Log Analytics + /// cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVersion")] + public string KeyVersion {get; set; } + + /// + /// Gets or sets selected key minimum required size. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyRsaSize")] + public int? KeyRsaSize {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs new file mode 100644 index 000000000000..b80b97d08c36 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs @@ -0,0 +1,98 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level Linked service resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class LinkedService : ProxyResource + { + /// + /// Initializes a new instance of the LinkedService class. + /// + public LinkedService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedService class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require read access + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require write access + /// + + /// The provisioning state of the linked service. + /// Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + public LinkedService(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string resourceId = default(string), string writeAccessResourceId = default(string), string provisioningState = default(string)) + + : base(id, name, type) + { + this.Tags = tags; + this.ResourceId = resourceId; + this.WriteAccessResourceId = writeAccessResourceId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require read + /// access + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require write + /// access + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.writeAccessResourceId")] + public string WriteAccessResourceId {get; set; } + + /// + /// Gets or sets the provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs new file mode 100644 index 000000000000..f87f71b162a9 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs @@ -0,0 +1,21 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for LinkedServiceEntityStatus. + /// + + + public static class LinkedServiceEntityStatus + { + public const string Succeeded = "Succeeded"; + public const string Deleting = "Deleting"; + public const string ProvisioningAccount = "ProvisioningAccount"; + public const string Updating = "Updating"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs new file mode 100644 index 000000000000..6a70db7b277b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs @@ -0,0 +1,75 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Linked service properties. + /// + public partial class LinkedServiceProperties + { + /// + /// Initializes a new instance of the LinkedServiceProperties class. + /// + public LinkedServiceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedServiceProperties class. + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require read access + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require write access + /// + + /// The provisioning state of the linked service. + /// Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + public LinkedServiceProperties(string resourceId = default(string), string writeAccessResourceId = default(string), string provisioningState = default(string)) + + { + this.ResourceId = resourceId; + this.WriteAccessResourceId = writeAccessResourceId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require read + /// access + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require write + /// access + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAccessResourceId")] + public string WriteAccessResourceId {get; set; } + + /// + /// Gets or sets the provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs new file mode 100644 index 000000000000..8ae13c59d6af --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Linked storage accounts properties. + /// + public partial class LinkedStorageAccountsProperties + { + /// + /// Initializes a new instance of the LinkedStorageAccountsProperties class. + /// + public LinkedStorageAccountsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedStorageAccountsProperties class. + /// + + /// Linked storage accounts type. + /// Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + + /// Linked storage accounts resources ids. + /// + public LinkedStorageAccountsProperties(DataSourceType? dataSourceType = default(DataSourceType?), System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList)) + + { + this.DataSourceType = dataSourceType; + this.StorageAccountIds = storageAccountIds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataSourceType")] + public DataSourceType? DataSourceType {get; private set; } + + /// + /// Gets or sets linked storage accounts resources ids. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountIds")] + public System.Collections.Generic.IList StorageAccountIds {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs new file mode 100644 index 000000000000..2e0f6536a075 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Linked storage accounts top level resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class LinkedStorageAccountsResource : ProxyResource + { + /// + /// Initializes a new instance of the LinkedStorageAccountsResource class. + /// + public LinkedStorageAccountsResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedStorageAccountsResource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Linked storage accounts type. + /// Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + + /// Linked storage accounts resources ids. + /// + public LinkedStorageAccountsResource(string id = default(string), string name = default(string), string type = default(string), DataSourceType? dataSourceType = default(DataSourceType?), System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList)) + + : base(id, name, type) + { + this.DataSourceType = dataSourceType; + this.StorageAccountIds = storageAccountIds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataSourceType")] + public DataSourceType? DataSourceType {get; private set; } + + /// + /// Gets or sets linked storage accounts resources ids. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountIds")] + public System.Collections.Generic.IList StorageAccountIds {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs new file mode 100644 index 000000000000..2d46399f8d18 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs @@ -0,0 +1,122 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// A management group that is connected to a workspace + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ManagementGroup + { + /// + /// Initializes a new instance of the ManagementGroup class. + /// + public ManagementGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagementGroup class. + /// + + /// The number of servers connected to the management group. + /// + + /// Gets or sets a value indicating whether the management group is a gateway. + /// + + /// The name of the management group. + /// + + /// The unique ID of the management group. + /// + + /// The datetime that the management group was created. + /// + + /// The last datetime that the management group received data. + /// + + /// The version of System Center that is managing the management group. + /// + + /// The SKU of System Center that is managing the management group. + /// + public ManagementGroup(int? serverCount = default(int?), bool? isGateway = default(bool?), string name = default(string), string id = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? dataReceived = default(System.DateTime?), string version = default(string), string sku = default(string)) + + { + this.ServerCount = serverCount; + this.IsGateway = isGateway; + this.Name = name; + this.Id = id; + this.Created = created; + this.DataReceived = dataReceived; + this.Version = version; + this.Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the number of servers connected to the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serverCount")] + public int? ServerCount {get; set; } + + /// + /// Gets or sets gets or sets a value indicating whether the management group + /// is a gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isGateway")] + public bool? IsGateway {get; set; } + + /// + /// Gets or sets the name of the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + public string Name {get; set; } + + /// + /// Gets or sets the unique ID of the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.id")] + public string Id {get; set; } + + /// + /// Gets or sets the datetime that the management group was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.created")] + public System.DateTime? Created {get; set; } + + /// + /// Gets or sets the last datetime that the management group received data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataReceived")] + public System.DateTime? DataReceived {get; set; } + + /// + /// Gets or sets the version of System Center that is managing the management + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.version")] + public string Version {get; set; } + + /// + /// Gets or sets the SKU of System Center that is managing the management + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public string Sku {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs new file mode 100644 index 000000000000..f75a4bdb1102 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs @@ -0,0 +1,121 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Management group properties. + /// + public partial class ManagementGroupProperties + { + /// + /// Initializes a new instance of the ManagementGroupProperties class. + /// + public ManagementGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagementGroupProperties class. + /// + + /// The number of servers connected to the management group. + /// + + /// Gets or sets a value indicating whether the management group is a gateway. + /// + + /// The name of the management group. + /// + + /// The unique ID of the management group. + /// + + /// The datetime that the management group was created. + /// + + /// The last datetime that the management group received data. + /// + + /// The version of System Center that is managing the management group. + /// + + /// The SKU of System Center that is managing the management group. + /// + public ManagementGroupProperties(int? serverCount = default(int?), bool? isGateway = default(bool?), string name = default(string), string id = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? dataReceived = default(System.DateTime?), string version = default(string), string sku = default(string)) + + { + this.ServerCount = serverCount; + this.IsGateway = isGateway; + this.Name = name; + this.Id = id; + this.Created = created; + this.DataReceived = dataReceived; + this.Version = version; + this.Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the number of servers connected to the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serverCount")] + public int? ServerCount {get; set; } + + /// + /// Gets or sets gets or sets a value indicating whether the management group + /// is a gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isGateway")] + public bool? IsGateway {get; set; } + + /// + /// Gets or sets the name of the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the unique ID of the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets the datetime that the management group was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "created")] + public System.DateTime? Created {get; set; } + + /// + /// Gets or sets the last datetime that the management group received data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataReceived")] + public System.DateTime? DataReceived {get; set; } + + /// + /// Gets or sets the version of System Center that is managing the management + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } + + /// + /// Gets or sets the SKU of System Center that is managing the management + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs new file mode 100644 index 000000000000..ce0e0c5d7b3f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The name of a metric. + /// + public partial class MetricName + { + /// + /// Initializes a new instance of the MetricName class. + /// + public MetricName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricName class. + /// + + /// The system name of the metric. + /// + + /// The localized name of the metric. + /// + public MetricName(string value = default(string), string localizedValue = default(string)) + + { + this.Value = value; + this.LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the system name of the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } + + /// + /// Gets or sets the localized name of the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs new file mode 100644 index 000000000000..5b1ed98060ad --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Supported operation of OperationalInsights resource provider. + /// + 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)) + + { + this.Name = name; + this.Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets display metadata associated with the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..613784171c48 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -0,0 +1,78 @@ +// 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.OperationalInsights.Models +{ + 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 OperationsManagement. + /// + + /// Resource on which the operation is performed etc. + /// + + /// Type of operation: get, read, delete, etc. + /// + + /// Description of operation + /// + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + + { + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets service provider: Microsoft OperationsManagement. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } + + /// + /// Gets or sets resource on which the operation is performed etc. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } + + /// + /// Gets or sets type of operation: get, read, delete, etc. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } + + /// + /// Gets or sets description of operation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs new file mode 100644 index 000000000000..7d75829d8f98 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs @@ -0,0 +1,98 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The status of operation. + /// + public partial class OperationStatus + { + /// + /// Initializes a new instance of the OperationStatus class. + /// + public OperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatus class. + /// + + /// The operation Id. + /// + + /// The operation name. + /// + + /// The start time of the operation. + /// + + /// The end time of the operation. + /// + + /// The status of the operation. + /// + + /// The error detail of the operation if any. + /// + public OperationStatus(string id = default(string), string name = default(string), string startTime = default(string), string endTime = default(string), string status = default(string), ErrorResponse error = default(ErrorResponse)) + + { + this.Id = id; + this.Name = name; + this.StartTime = startTime; + this.EndTime = endTime; + this.Status = status; + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the operation Id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets the operation name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the start time of the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public string StartTime {get; set; } + + /// + /// Gets or sets the end time of the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public string EndTime {get; set; } + + /// + /// Gets or sets the status of the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the error detail of the operation if any. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs new file mode 100644 index 000000000000..0f7880aa5b96 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs new file mode 100644 index 000000000000..38bc51e55695 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs new file mode 100644 index 000000000000..9e5cdafb3228 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs @@ -0,0 +1,43 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page2 : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("@odata.nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs new file mode 100644 index 000000000000..cdf1d89246d3 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The private link scope resource reference. + /// + public partial class PrivateLinkScopedResource + { + /// + /// Initializes a new instance of the PrivateLinkScopedResource class. + /// + public PrivateLinkScopedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkScopedResource class. + /// + + /// The full resource Id of the private link scope resource. + /// + + /// The private link scope unique Identifier. + /// + public PrivateLinkScopedResource(string resourceId = default(string), string scopeId = default(string)) + + { + this.ResourceId = resourceId; + this.ScopeId = scopeId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the full resource Id of the private link scope resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets or sets the private link scope unique Identifier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scopeId")] + public string ScopeId {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs new file mode 100644 index 000000000000..dfa5473d9c72 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs @@ -0,0 +1,31 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for ProvisioningStateEnum. + /// + + + public static class ProvisioningStateEnum + { + /// + /// Table schema is still being built and updated, table is currently locked + /// for any changes till the procedure is done. + /// + public const string Updating = "Updating"; + /// + /// Table schema is stable and without changes, table data is being updated. + /// + public const string InProgress = "InProgress"; + /// + /// Table state is stable and without changes, table is unlocked and open for + /// new updates. + /// + public const string Succeeded = "Succeeded"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..c9f805fce090 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs new file mode 100644 index 000000000000..f810253f2ffc --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs @@ -0,0 +1,25 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for PublicNetworkAccessType. + /// + + + public static class PublicNetworkAccessType + { + /// + /// Enables connectivity to Log Analytics through public DNS. + /// + public const string Enabled = "Enabled"; + /// + /// Disables public connectivity to Log Analytics through public DNS. + /// + public const string Disabled = "Disabled"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs new file mode 100644 index 000000000000..e799d4edb6ca --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs @@ -0,0 +1,19 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for PurgeState. + /// + + + public static class PurgeState + { + public const string Pending = "pending"; + public const string Completed = "completed"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs new file mode 100644 index 000000000000..e08a1c9ca372 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + public partial class Resource : Microsoft.Rest.Azure.IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + public Resource(string id = default(string), string name = default(string), string type = default(string)) + + { + this.Id = id; + this.Name = name; + this.Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } + + /// + /// Gets the name of the resource + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } + + /// + /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs new file mode 100644 index 000000000000..1b8c7e33a1a2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs @@ -0,0 +1,68 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Restore parameters. + /// + public partial class RestoredLogs + { + /// + /// Initializes a new instance of the RestoredLogs class. + /// + public RestoredLogs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestoredLogs class. + /// + + /// The timestamp to start the restore from (UTC). + /// + + /// The timestamp to end the restore by (UTC). + /// + + /// The table to restore data from. + /// + public RestoredLogs(System.DateTime? startRestoreTime = default(System.DateTime?), System.DateTime? endRestoreTime = default(System.DateTime?), string sourceTable = default(string)) + + { + this.StartRestoreTime = startRestoreTime; + this.EndRestoreTime = endRestoreTime; + this.SourceTable = sourceTable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the timestamp to start the restore from (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startRestoreTime")] + public System.DateTime? StartRestoreTime {get; set; } + + /// + /// Gets or sets the timestamp to end the restore by (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endRestoreTime")] + public System.DateTime? EndRestoreTime {get; set; } + + /// + /// Gets or sets the table to restore data from. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceTable")] + public string SourceTable {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs new file mode 100644 index 000000000000..c6fc2474b8ad --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs @@ -0,0 +1,74 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Search job execution statistics. + /// + public partial class ResultStatistics + { + /// + /// Initializes a new instance of the ResultStatistics class. + /// + public ResultStatistics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResultStatistics class. + /// + + /// Search job completion percentage. + /// + + /// The number of rows that were returned by the search job. + /// + public ResultStatistics(double? progress = default(double?), int? ingestedRecords = default(int?)) + + { + this.Progress = progress; + this.IngestedRecords = ingestedRecords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets search job completion percentage. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "progress")] + public double? Progress {get; private set; } + + /// + /// Gets the number of rows that were returned by the search job. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingestedRecords")] + public int? IngestedRecords {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Progress != null) + { + if (this.Progress % 0.01 != 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MultipleOf, "Progress", 0.01); + } + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs new file mode 100644 index 000000000000..038aa8370924 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs @@ -0,0 +1,182 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Value object for saved search results. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class SavedSearch : ProxyResource + { + /// + /// Initializes a new instance of the SavedSearch class. + /// + public SavedSearch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SavedSearch class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// The ETag of the saved search. To override an existing saved search, use "*" + /// or specify the current Etag + /// + + /// The category of the saved search. This helps the user to find a saved + /// search faster. + /// + + /// Saved search display name. + /// + + /// The query expression for the saved search. + /// + + /// The function alias if query serves as a function. + /// + + /// The optional function parameters if query serves as a function. Value + /// should be in the following format: 'param-name1:type1 = default_value1, + /// param-name2:type2 = default_value2'. For more examples and proper syntax + /// please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + + /// The version number of the query language. The current version is 2 and is + /// the default. + /// + + /// The tags attached to the saved search. + /// + public SavedSearch(string category, string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), System.Collections.Generic.IList tags = default(System.Collections.Generic.IList)) + + : base(id, name, type) + { + this.Etag = etag; + this.Category = category; + this.DisplayName = displayName; + this.Query = query; + this.FunctionAlias = functionAlias; + this.FunctionParameters = functionParameters; + this.Version = version; + this.Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the ETag of the saved search. To override an existing saved + /// search, use "*" or specify the current Etag + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } + + /// + /// Gets or sets the category of the saved search. This helps the user to find + /// a saved search faster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.category")] + public string Category {get; set; } + + /// + /// Gets or sets saved search display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the query expression for the saved search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.query")] + public string Query {get; set; } + + /// + /// Gets or sets the function alias if query serves as a function. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.functionAlias")] + public string FunctionAlias {get; set; } + + /// + /// Gets or sets the optional function parameters if query serves as a + /// function. Value should be in the following format: 'param-name1:type1 = + /// default_value1, param-name2:type2 = default_value2'. For more examples and + /// proper syntax please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.functionParameters")] + public string FunctionParameters {get; set; } + + /// + /// Gets or sets the version number of the query language. The current version + /// is 2 and is the default. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.version")] + public long? Version {get; set; } + + /// + /// Gets or sets the tags attached to the saved search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tags")] + public System.Collections.Generic.IList Tags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Category == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Category"); + } + if (this.DisplayName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DisplayName"); + } + if (this.Query == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Query"); + } + + + + + + + if (this.Tags != null) + { + foreach (var element in this.Tags) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs new file mode 100644 index 000000000000..18c8eb876ee5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs @@ -0,0 +1,156 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Value object for saved search results. + /// + public partial class SavedSearchProperties + { + /// + /// Initializes a new instance of the SavedSearchProperties class. + /// + public SavedSearchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SavedSearchProperties class. + /// + + /// The category of the saved search. This helps the user to find a saved + /// search faster. + /// + + /// Saved search display name. + /// + + /// The query expression for the saved search. + /// + + /// The function alias if query serves as a function. + /// + + /// The optional function parameters if query serves as a function. Value + /// should be in the following format: 'param-name1:type1 = default_value1, + /// param-name2:type2 = default_value2'. For more examples and proper syntax + /// please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + + /// The version number of the query language. The current version is 2 and is + /// the default. + /// + + /// The tags attached to the saved search. + /// + public SavedSearchProperties(string category, string displayName, string query, string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), System.Collections.Generic.IList tags = default(System.Collections.Generic.IList)) + + { + this.Category = category; + this.DisplayName = displayName; + this.Query = query; + this.FunctionAlias = functionAlias; + this.FunctionParameters = functionParameters; + this.Version = version; + this.Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the category of the saved search. This helps the user to find + /// a saved search faster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + public string Category {get; set; } + + /// + /// Gets or sets saved search display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the query expression for the saved search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "query")] + public string Query {get; set; } + + /// + /// Gets or sets the function alias if query serves as a function. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "functionAlias")] + public string FunctionAlias {get; set; } + + /// + /// Gets or sets the optional function parameters if query serves as a + /// function. Value should be in the following format: 'param-name1:type1 = + /// default_value1, param-name2:type2 = default_value2'. For more examples and + /// proper syntax please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "functionParameters")] + public string FunctionParameters {get; set; } + + /// + /// Gets or sets the version number of the query language. The current version + /// is 2 and is the default. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public long? Version {get; set; } + + /// + /// Gets or sets the tags attached to the saved search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IList Tags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Category == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Category"); + } + if (this.DisplayName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DisplayName"); + } + if (this.Query == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Query"); + } + + + + + + if (this.Tags != null) + { + foreach (var element in this.Tags) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs new file mode 100644 index 000000000000..e3f05076a02c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The saved search list operation response. + /// + public partial class SavedSearchesListResult + { + /// + /// Initializes a new instance of the SavedSearchesListResult class. + /// + public SavedSearchesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SavedSearchesListResult class. + /// + + /// The array of result values. + /// + public SavedSearchesListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + + { + this.Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the array of result values. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs new file mode 100644 index 000000000000..f2a31da9cecc --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs @@ -0,0 +1,171 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Table's schema. + /// + public partial class Schema + { + /// + /// Initializes a new instance of the Schema class. + /// + public Schema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Schema class. + /// + + /// Table name. + /// + + /// Table display name. + /// + + /// Table description. + /// + + /// A list of table custom columns. + /// + + /// A list of table standard columns. + /// + + /// Table category. + /// + + /// Table labels. + /// + + /// Table's creator. + /// Possible values include: 'microsoft', 'customer' + + /// Table's creator. + /// Possible values include: 'Microsoft', 'CustomLog', 'RestoredLogs', + /// 'SearchResults' + + /// The subtype describes what APIs can be used to interact with the table, and + /// what features are available against it. + /// Possible values include: 'Any', 'Classic', 'DataCollectionRuleBased' + + /// List of solutions the table is affiliated with + /// + + /// Parameters of the search job that initiated this table. + /// + + /// Parameters of the restore operation that initiated this table. + /// + public Schema(string name = default(string), string displayName = default(string), string description = default(string), System.Collections.Generic.IList columns = default(System.Collections.Generic.IList), System.Collections.Generic.IList standardColumns = default(System.Collections.Generic.IList), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), System.Collections.Generic.IList labels = default(System.Collections.Generic.IList), string source = default(string), string tableType = default(string), string tableSubType = default(string), System.Collections.Generic.IList solutions = default(System.Collections.Generic.IList), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs)) + + { + this.Name = name; + this.DisplayName = displayName; + this.Description = description; + this.Columns = columns; + this.StandardColumns = standardColumns; + this.Categories = categories; + this.Labels = labels; + this.Source = source; + this.TableType = tableType; + this.TableSubType = tableSubType; + this.Solutions = solutions; + this.SearchResults = searchResults; + this.RestoredLogs = restoredLogs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets table name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets table display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets table description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets a list of table custom columns. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "columns")] + public System.Collections.Generic.IList Columns {get; set; } + + /// + /// Gets a list of table standard columns. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "standardColumns")] + public System.Collections.Generic.IList StandardColumns {get; private set; } + + /// + /// Gets table category. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "categories")] + public System.Collections.Generic.IList Categories {get; private set; } + + /// + /// Gets table labels. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labels")] + public System.Collections.Generic.IList Labels {get; private set; } + + /// + /// Gets table's creator. Possible values include: 'microsoft', 'customer' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public string Source {get; private set; } + + /// + /// Gets table's creator. Possible values include: 'Microsoft', 'CustomLog', 'RestoredLogs', 'SearchResults' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tableType")] + public string TableType {get; private set; } + + /// + /// Gets the subtype describes what APIs can be used to interact with the + /// table, and what features are available against it. Possible values include: 'Any', 'Classic', 'DataCollectionRuleBased' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tableSubType")] + public string TableSubType {get; private set; } + + /// + /// Gets list of solutions the table is affiliated with + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "solutions")] + public System.Collections.Generic.IList Solutions {get; private set; } + + /// + /// Gets parameters of the search job that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "searchResults")] + public SearchResults SearchResults {get; private set; } + + /// + /// Gets parameters of the restore operation that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "restoredLogs")] + public RestoredLogs RestoredLogs {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs new file mode 100644 index 000000000000..480c5fbbd51e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The get schema operation response. + /// + public partial class SearchGetSchemaResponse + { + /// + /// Initializes a new instance of the SearchGetSchemaResponse class. + /// + public SearchGetSchemaResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchGetSchemaResponse class. + /// + + /// The metadata from search results. + /// + + /// The array of result values. + /// + public SearchGetSchemaResponse(SearchMetadata metadata = default(SearchMetadata), System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + + { + this.Metadata = metadata; + this.Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the metadata from search results. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public SearchMetadata Metadata {get; set; } + + /// + /// Gets or sets the array of result values. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs new file mode 100644 index 000000000000..dd09163a70c8 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs @@ -0,0 +1,208 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Metadata for search results. + /// + public partial class SearchMetadata + { + /// + /// Initializes a new instance of the SearchMetadata class. + /// + public SearchMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchMetadata class. + /// + + /// The request id of the search. + /// + + /// The search result type. + /// + + /// The total number of search results. + /// + + /// The number of top search results. + /// + + /// The id of the search results request. + /// + + /// The core summaries. + /// + + /// The status of the search results. + /// + + /// The start time for the search. + /// + + /// The time of last update. + /// + + /// The ETag of the search results. + /// + + /// How the results are sorted. + /// + + /// The request time. + /// + + /// The aggregated value field. + /// + + /// The aggregated grouping fields. + /// + + /// The sum of all aggregates returned in the result set. + /// + + /// The max of all aggregates returned in the result set. + /// + + /// The schema. + /// + public SearchMetadata(string searchId = default(string), string resultType = default(string), long? total = default(long?), long? top = default(long?), string id = default(string), System.Collections.Generic.IList coreSummaries = default(System.Collections.Generic.IList), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastUpdated = default(System.DateTime?), string eTag = default(string), System.Collections.Generic.IList sort = default(System.Collections.Generic.IList), long? requestTime = default(long?), string aggregatedValueField = default(string), string aggregatedGroupingFields = default(string), long? sum = default(long?), long? max = default(long?), SearchMetadataSchema schema = default(SearchMetadataSchema)) + + { + this.SearchId = searchId; + this.ResultType = resultType; + this.Total = total; + this.Top = top; + this.Id = id; + this.CoreSummaries = coreSummaries; + this.Status = status; + this.StartTime = startTime; + this.LastUpdated = lastUpdated; + this.ETag = eTag; + this.Sort = sort; + this.RequestTime = requestTime; + this.AggregatedValueField = aggregatedValueField; + this.AggregatedGroupingFields = aggregatedGroupingFields; + this.Sum = sum; + this.Max = max; + this.Schema = schema; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the request id of the search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestId")] + public string SearchId {get; set; } + + /// + /// Gets or sets the search result type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resultType")] + public string ResultType {get; set; } + + /// + /// Gets or sets the total number of search results. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "total")] + public long? Total {get; set; } + + /// + /// Gets or sets the number of top search results. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "top")] + public long? Top {get; set; } + + /// + /// Gets or sets the id of the search results request. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets the core summaries. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coreSummaries")] + public System.Collections.Generic.IList CoreSummaries {get; set; } + + /// + /// Gets or sets the status of the search results. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the start time for the search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; set; } + + /// + /// Gets or sets the time of last update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdated")] + public System.DateTime? LastUpdated {get; set; } + + /// + /// Gets or sets the ETag of the search results. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + + /// + /// Gets or sets how the results are sorted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sort")] + public System.Collections.Generic.IList Sort {get; set; } + + /// + /// Gets or sets the request time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestTime")] + public long? RequestTime {get; set; } + + /// + /// Gets or sets the aggregated value field. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregatedValueField")] + public string AggregatedValueField {get; set; } + + /// + /// Gets or sets the aggregated grouping fields. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregatedGroupingFields")] + public string AggregatedGroupingFields {get; set; } + + /// + /// Gets or sets the sum of all aggregates returned in the result set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sum")] + public long? Sum {get; set; } + + /// + /// Gets or sets the max of all aggregates returned in the result set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "max")] + public long? Max {get; set; } + + /// + /// Gets or sets the schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "schema")] + public SearchMetadataSchema Schema {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs new file mode 100644 index 000000000000..45f84fb7e088 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Schema metadata for search. + /// + public partial class SearchMetadataSchema + { + /// + /// Initializes a new instance of the SearchMetadataSchema class. + /// + public SearchMetadataSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchMetadataSchema class. + /// + + /// The name of the metadata schema. + /// + + /// The version of the metadata schema. + /// + public SearchMetadataSchema(string name = default(string), int? version = default(int?)) + + { + this.Name = name; + this.Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the metadata schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the version of the metadata schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public int? Version {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs new file mode 100644 index 000000000000..5c8309723271 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs @@ -0,0 +1,98 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Parameters of the search job that initiated this table. + /// + public partial class SearchResults + { + /// + /// Initializes a new instance of the SearchResults class. + /// + public SearchResults() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResults class. + /// + + /// Search job query. + /// + + /// Search job Description. + /// + + /// Limit the search job to return up to specified number of rows. + /// + + /// The timestamp to start the search from (UTC) + /// + + /// The timestamp to end the search by (UTC) + /// + + /// The table used in the search job. + /// + public SearchResults(string query = default(string), string description = default(string), int? limit = default(int?), System.DateTime? startSearchTime = default(System.DateTime?), System.DateTime? endSearchTime = default(System.DateTime?), string sourceTable = default(string)) + + { + this.Query = query; + this.Description = description; + this.Limit = limit; + this.StartSearchTime = startSearchTime; + this.EndSearchTime = endSearchTime; + this.SourceTable = sourceTable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets search job query. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "query")] + public string Query {get; set; } + + /// + /// Gets or sets search job Description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets limit the search job to return up to specified number of rows. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public int? Limit {get; set; } + + /// + /// Gets or sets the timestamp to start the search from (UTC) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startSearchTime")] + public System.DateTime? StartSearchTime {get; set; } + + /// + /// Gets or sets the timestamp to end the search by (UTC) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endSearchTime")] + public System.DateTime? EndSearchTime {get; set; } + + /// + /// Gets the table used in the search job. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceTable")] + public string SourceTable {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs new file mode 100644 index 000000000000..484e343a9b88 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs @@ -0,0 +1,123 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Value object for schema results. + /// + public partial class SearchSchemaValue + { + /// + /// Initializes a new instance of the SearchSchemaValue class. + /// + public SearchSchemaValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchSchemaValue class. + /// + + /// The name of the schema. + /// + + /// The display name of the schema. + /// + + /// The type. + /// + + /// The boolean that indicates the field is searchable as free text. + /// + + /// The boolean that indicates whether or not the field is stored. + /// + + /// The boolean that indicates whether or not the field is a facet. + /// + + /// The array of workflows containing the field. + /// + public SearchSchemaValue(bool indexed, bool stored, bool facet, string name = default(string), string displayName = default(string), string type = default(string), System.Collections.Generic.IList ownerType = default(System.Collections.Generic.IList)) + + { + this.Name = name; + this.DisplayName = displayName; + this.Type = type; + this.Indexed = indexed; + this.Stored = stored; + this.Facet = facet; + this.OwnerType = ownerType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the display name of the schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets the boolean that indicates the field is searchable as free + /// text. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "indexed")] + public bool Indexed {get; set; } + + /// + /// Gets or sets the boolean that indicates whether or not the field is stored. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "stored")] + public bool Stored {get; set; } + + /// + /// Gets or sets the boolean that indicates whether or not the field is a + /// facet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "facet")] + public bool Facet {get; set; } + + /// + /// Gets or sets the array of workflows containing the field. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerType")] + public System.Collections.Generic.IList OwnerType {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs new file mode 100644 index 000000000000..eb189a435d5a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The sort parameters for search. + /// + public partial class SearchSort + { + /// + /// Initializes a new instance of the SearchSort class. + /// + public SearchSort() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchSort class. + /// + + /// The name of the field the search query is sorted on. + /// + + /// The sort order of the search. + /// Possible values include: 'asc', 'desc' + public SearchSort(string name = default(string), string order = default(string)) + + { + this.Name = name; + this.Order = order; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the field the search query is sorted on. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the sort order of the search. Possible values include: 'asc', 'desc' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "order")] + public string Order {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs new file mode 100644 index 000000000000..3392d120be53 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs @@ -0,0 +1,19 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for SearchSortEnum. + /// + + + public static class SearchSortEnum + { + public const string Asc = "asc"; + public const string Desc = "desc"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs new file mode 100644 index 000000000000..7c8da31381ff --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The shared keys for a workspace. + /// + public partial class SharedKeys + { + /// + /// Initializes a new instance of the SharedKeys class. + /// + public SharedKeys() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedKeys class. + /// + + /// The primary shared key of a workspace. + /// + + /// The secondary shared key of a workspace. + /// + public SharedKeys(string primarySharedKey = default(string), string secondarySharedKey = default(string)) + + { + this.PrimarySharedKey = primarySharedKey; + this.SecondarySharedKey = secondarySharedKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the primary shared key of a workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primarySharedKey")] + public string PrimarySharedKey {get; set; } + + /// + /// Gets or sets the secondary shared key of a workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondarySharedKey")] + public string SecondarySharedKey {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs new file mode 100644 index 000000000000..744bc3853b62 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs @@ -0,0 +1,24 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for SkuNameEnum. + /// + + + public static class SkuNameEnum + { + public const string Free = "Free"; + public const string Standard = "Standard"; + public const string Premium = "Premium"; + public const string PerNode = "PerNode"; + public const string PerGB2018 = "PerGB2018"; + public const string Standalone = "Standalone"; + public const string CapacityReservation = "CapacityReservation"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs new file mode 100644 index 000000000000..a66e57fcb18e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs @@ -0,0 +1,27 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for SourceEnum. + /// + + + public static class SourceEnum + { + /// + /// Tables provisioned by the system, as collected via Diagnostic Settings, the + /// Agents, or any other standard data collection means. + /// + public const string Microsoft = "microsoft"; + /// + /// Tables created by the owner of the Workspace, and only found in this + /// Workspace. + /// + public const string Customer = "customer"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs new file mode 100644 index 000000000000..a0202a3de68a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Describes a storage account connection. + /// + public partial class StorageAccount + { + /// + /// Initializes a new instance of the StorageAccount class. + /// + public StorageAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageAccount class. + /// + + /// The Azure Resource Manager ID of the storage account resource. + /// + + /// The storage account key. + /// + public StorageAccount(string id, string key) + + { + this.Id = id; + this.Key = key; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the Azure Resource Manager ID of the storage account resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets the storage account key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "key")] + public string Key {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Id == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + } + if (this.Key == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Key"); + } + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs new file mode 100644 index 000000000000..0674afb927b0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level storage insight resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class StorageInsight : ProxyResource + { + /// + /// Initializes a new instance of the StorageInsight class. + /// + public StorageInsight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageInsight class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// The ETag of the storage insight. + /// + + /// Resource tags. + /// + + /// The storage account connection details + /// + + /// The names of the blob containers that the workspace should read + /// + + /// The names of the Azure tables that the workspace should read + /// + + /// The status of the storage insight + /// + public StorageInsight(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), StorageAccount storageAccount = default(StorageAccount), System.Collections.Generic.IList containers = default(System.Collections.Generic.IList), System.Collections.Generic.IList tables = default(System.Collections.Generic.IList), StorageInsightStatus status = default(StorageInsightStatus)) + + : base(id, name, type) + { + this.ETag = eTag; + this.Tags = tags; + this.StorageAccount = storageAccount; + this.Containers = containers; + this.Tables = tables; + this.Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the ETag of the storage insight. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the storage account connection details + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccount")] + public StorageAccount StorageAccount {get; set; } + + /// + /// Gets or sets the names of the blob containers that the workspace should + /// read + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containers")] + public System.Collections.Generic.IList Containers {get; set; } + + /// + /// Gets or sets the names of the Azure tables that the workspace should read + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tables")] + public System.Collections.Generic.IList Tables {get; set; } + + /// + /// Gets the status of the storage insight + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public StorageInsightStatus Status {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.StorageAccount != null) + { + this.StorageAccount.Validate(); + } + + + if (this.Status != null) + { + this.Status.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs new file mode 100644 index 000000000000..cb4dc136d80e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs @@ -0,0 +1,102 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Storage insight properties. + /// + public partial class StorageInsightProperties + { + /// + /// Initializes a new instance of the StorageInsightProperties class. + /// + public StorageInsightProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageInsightProperties class. + /// + + /// The names of the blob containers that the workspace should read + /// + + /// The names of the Azure tables that the workspace should read + /// + + /// The storage account connection details + /// + + /// The status of the storage insight + /// + public StorageInsightProperties(StorageAccount storageAccount, System.Collections.Generic.IList containers = default(System.Collections.Generic.IList), System.Collections.Generic.IList tables = default(System.Collections.Generic.IList), StorageInsightStatus status = default(StorageInsightStatus)) + + { + this.Containers = containers; + this.Tables = tables; + this.StorageAccount = storageAccount; + this.Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the names of the blob containers that the workspace should + /// read + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containers")] + public System.Collections.Generic.IList Containers {get; set; } + + /// + /// Gets or sets the names of the Azure tables that the workspace should read + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tables")] + public System.Collections.Generic.IList Tables {get; set; } + + /// + /// Gets or sets the storage account connection details + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccount")] + public StorageAccount StorageAccount {get; set; } + + /// + /// Gets the status of the storage insight + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public StorageInsightStatus Status {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.StorageAccount == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccount"); + } + + + if (this.StorageAccount != null) + { + this.StorageAccount.Validate(); + } + if (this.Status != null) + { + this.Status.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs new file mode 100644 index 000000000000..9184271245ed --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs @@ -0,0 +1,19 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for StorageInsightState. + /// + + + public static class StorageInsightState + { + public const string OK = "OK"; + public const string Error = "ERROR"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs new file mode 100644 index 000000000000..99be42a2d4b9 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs @@ -0,0 +1,73 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The status of the storage insight. + /// + public partial class StorageInsightStatus + { + /// + /// Initializes a new instance of the StorageInsightStatus class. + /// + public StorageInsightStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageInsightStatus class. + /// + + /// The state of the storage insight connection to the workspace + /// Possible values include: 'OK', 'ERROR' + + /// Description of the state of the storage insight. + /// + public StorageInsightStatus(string state, string description = default(string)) + + { + this.State = state; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the state of the storage insight connection to the workspace Possible values include: 'OK', 'ERROR' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } + + /// + /// Gets or sets description of the state of the storage insight. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.State == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "State"); + } + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..7734067d84be --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs @@ -0,0 +1,98 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource last modification (UTC) + /// + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + + { + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the identity that created the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } + + /// + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs new file mode 100644 index 000000000000..1e54fa3db869 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs @@ -0,0 +1,215 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Workspace data table definition. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Table : ProxyResource + { + /// + /// Initializes a new instance of the Table class. + /// + public Table() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Table class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Metadata pertaining to creation and last modification of the resource. + /// + + /// Parameters of the search job that initiated this table. + /// + + /// Parameters of the restore operation that initiated this table. + /// + + /// Search job execution statistics. + /// + + /// Table schema. + /// + + /// The table retention in days, between 4 and 730. Setting this property to -1 + /// will default to the workspace retention. + /// + + /// The table total retention in days, between 4 and 2555. Setting this + /// property to -1 will default to table retention. + /// + + /// The table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + + /// Instruct the system how to handle and charge the logs ingested to this + /// table. + /// Possible values include: 'Basic', 'Analytics' + + /// The timestamp that table plan was last modified (UTC). + /// + + /// Table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. + /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + public Table(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), Schema schema = default(Schema), int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), string plan = default(string), string lastPlanModifiedDate = default(string), string provisioningState = default(string)) + + : base(id, name, type) + { + this.SystemData = systemData; + this.SearchResults = searchResults; + this.RestoredLogs = restoredLogs; + this.ResultStatistics = resultStatistics; + this.Schema = schema; + this.RetentionInDays = retentionInDays; + this.TotalRetentionInDays = totalRetentionInDays; + this.ArchiveRetentionInDays = archiveRetentionInDays; + this.Plan = plan; + this.LastPlanModifiedDate = lastPlanModifiedDate; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets metadata pertaining to creation and last modification of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } + + /// + /// Gets or sets parameters of the search job that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.searchResults")] + public SearchResults SearchResults {get; set; } + + /// + /// Gets or sets parameters of the restore operation that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restoredLogs")] + public RestoredLogs RestoredLogs {get; set; } + + /// + /// Gets or sets search job execution statistics. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resultStatistics")] + public ResultStatistics ResultStatistics {get; set; } + + /// + /// Gets or sets table schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.schema")] + public Schema Schema {get; set; } + + /// + /// Gets or sets the table retention in days, between 4 and 730. Setting this + /// property to -1 will default to the workspace retention. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets or sets the table total retention in days, between 4 and 2555. Setting + /// this property to -1 will default to table retention. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.totalRetentionInDays")] + public int? TotalRetentionInDays {get; set; } + + /// + /// Gets the table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.archiveRetentionInDays")] + public int? ArchiveRetentionInDays {get; private set; } + + /// + /// Gets or sets instruct the system how to handle and charge the logs ingested + /// to this table. Possible values include: 'Basic', 'Analytics' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.plan")] + public string Plan {get; set; } + + /// + /// Gets the timestamp that table plan was last modified (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastPlanModifiedDate")] + public string LastPlanModifiedDate {get; private set; } + + /// + /// Gets table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. Possible values include: 'Updating', 'InProgress', 'Succeeded' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.ResultStatistics != null) + { + this.ResultStatistics.Validate(); + } + + if (this.RetentionInDays != null) + { + if (this.RetentionInDays > 730) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + } + if (this.RetentionInDays < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RetentionInDays", 4); + } + } + if (this.TotalRetentionInDays != null) + { + if (this.TotalRetentionInDays > 2555) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); + } + if (this.TotalRetentionInDays < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs new file mode 100644 index 000000000000..c2baef281564 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs @@ -0,0 +1,25 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for TablePlanEnum. + /// + + + public static class TablePlanEnum + { + /// + /// Logs that are adjusted to support high volume low value verbose logs. + /// + public const string Basic = "Basic"; + /// + /// Logs that allow monitoring and analytics. + /// + public const string Analytics = "Analytics"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs new file mode 100644 index 000000000000..3b0374c735b2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs @@ -0,0 +1,191 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Table properties. + /// + public partial class TableProperties + { + /// + /// Initializes a new instance of the TableProperties class. + /// + public TableProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TableProperties class. + /// + + /// The table retention in days, between 4 and 730. Setting this property to -1 + /// will default to the workspace retention. + /// + + /// The table total retention in days, between 4 and 2555. Setting this + /// property to -1 will default to table retention. + /// + + /// The table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + + /// Parameters of the search job that initiated this table. + /// + + /// Parameters of the restore operation that initiated this table. + /// + + /// Search job execution statistics. + /// + + /// Instruct the system how to handle and charge the logs ingested to this + /// table. + /// Possible values include: 'Basic', 'Analytics' + + /// The timestamp that table plan was last modified (UTC). + /// + + /// Table schema. + /// + + /// Table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. + /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + public TableProperties(int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), string plan = default(string), string lastPlanModifiedDate = default(string), Schema schema = default(Schema), string provisioningState = default(string)) + + { + this.RetentionInDays = retentionInDays; + this.TotalRetentionInDays = totalRetentionInDays; + this.ArchiveRetentionInDays = archiveRetentionInDays; + this.SearchResults = searchResults; + this.RestoredLogs = restoredLogs; + this.ResultStatistics = resultStatistics; + this.Plan = plan; + this.LastPlanModifiedDate = lastPlanModifiedDate; + this.Schema = schema; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the table retention in days, between 4 and 730. Setting this + /// property to -1 will default to the workspace retention. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets or sets the table total retention in days, between 4 and 2555. Setting + /// this property to -1 will default to table retention. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "totalRetentionInDays")] + public int? TotalRetentionInDays {get; set; } + + /// + /// Gets the table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "archiveRetentionInDays")] + public int? ArchiveRetentionInDays {get; private set; } + + /// + /// Gets or sets parameters of the search job that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "searchResults")] + public SearchResults SearchResults {get; set; } + + /// + /// Gets or sets parameters of the restore operation that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "restoredLogs")] + public RestoredLogs RestoredLogs {get; set; } + + /// + /// Gets or sets search job execution statistics. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resultStatistics")] + public ResultStatistics ResultStatistics {get; set; } + + /// + /// Gets or sets instruct the system how to handle and charge the logs ingested + /// to this table. Possible values include: 'Basic', 'Analytics' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public string Plan {get; set; } + + /// + /// Gets the timestamp that table plan was last modified (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastPlanModifiedDate")] + public string LastPlanModifiedDate {get; private set; } + + /// + /// Gets or sets table schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "schema")] + public Schema Schema {get; set; } + + /// + /// Gets table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. Possible values include: 'Updating', 'InProgress', 'Succeeded' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RetentionInDays != null) + { + if (this.RetentionInDays > 730) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + } + if (this.RetentionInDays < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RetentionInDays", 4); + } + } + if (this.TotalRetentionInDays != null) + { + if (this.TotalRetentionInDays > 2555) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); + } + if (this.TotalRetentionInDays < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); + } + } + + + if (this.ResultStatistics != null) + { + this.ResultStatistics.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs new file mode 100644 index 000000000000..59978a60714b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs @@ -0,0 +1,33 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for TableSubTypeEnum. + /// + + + public static class TableSubTypeEnum + { + /// + /// The default subtype with which built-in tables are created. + /// + public const string Any = "Any"; + /// + /// Indicates a table created through the Data Collector API or with the custom + /// logs feature of the MMA agent, or any table against which Custom Fields + /// were created. + /// + public const string Classic = "Classic"; + /// + /// A table eligible to have data sent into it via any of the means supported + /// by Data Collection Rules: the Data Collection Endpoint API, ingestion-time + /// transformations, or any other mechanism provided by Data Collection Rules + /// + public const string DataCollectionRuleBased = "DataCollectionRuleBased"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs new file mode 100644 index 000000000000..92978b7b5c7d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs @@ -0,0 +1,33 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for TableTypeEnum. + /// + + + public static class TableTypeEnum + { + /// + /// Standard data collected by Azure Monitor. + /// + public const string Microsoft = "Microsoft"; + /// + /// Custom log table. + /// + public const string CustomLog = "CustomLog"; + /// + /// Restored data. + /// + public const string RestoredLogs = "RestoredLogs"; + /// + /// Data collected by a search job. + /// + public const string SearchResults = "SearchResults"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs new file mode 100644 index 000000000000..382ae7aa8f91 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// A tag of a saved search. + /// + public partial class Tag + { + /// + /// Initializes a new instance of the Tag class. + /// + public Tag() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Tag class. + /// + + /// The tag name. + /// + + /// The tag value. + /// + public Tag(string name, string value) + + { + this.Name = name; + this.Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the tag name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the tag value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + } + if (this.Value == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + } + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..afc5e9addb69 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs @@ -0,0 +1,90 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type) + { + this.Tags = tags; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + } + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs new file mode 100644 index 000000000000..f7f47d277071 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs @@ -0,0 +1,19 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for Type. + /// + + + public static class Type + { + public const string StorageAccount = "StorageAccount"; + public const string EventHub = "EventHub"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs new file mode 100644 index 000000000000..d7aa43a5b50d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs @@ -0,0 +1,99 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// A metric describing the usage of a resource. + /// + public partial class UsageMetric + { + /// + /// Initializes a new instance of the UsageMetric class. + /// + public UsageMetric() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UsageMetric class. + /// + + /// The name of the metric. + /// + + /// The units used for the metric. + /// + + /// The current value of the metric. + /// + + /// The quota limit for the metric. + /// + + /// The time that the metric's value will reset. + /// + + /// The quota period that determines the length of time between value resets. + /// + public UsageMetric(MetricName name = default(MetricName), string unit = default(string), double? currentValue = default(double?), double? limit = default(double?), System.DateTime? nextResetTime = default(System.DateTime?), string quotaPeriod = default(string)) + + { + this.Name = name; + this.Unit = unit; + this.CurrentValue = currentValue; + this.Limit = limit; + this.NextResetTime = nextResetTime; + this.QuotaPeriod = quotaPeriod; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public MetricName Name {get; set; } + + /// + /// Gets or sets the units used for the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public string Unit {get; set; } + + /// + /// Gets or sets the current value of the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + public double? CurrentValue {get; set; } + + /// + /// Gets or sets the quota limit for the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public double? Limit {get; set; } + + /// + /// Gets or sets the time that the metric's value will reset. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime {get; set; } + + /// + /// Gets or sets the quota period that determines the length of time between + /// value resets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaPeriod")] + public string QuotaPeriod {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs new file mode 100644 index 000000000000..79464625463a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs @@ -0,0 +1,58 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// User assigned identity properties. + /// + public partial class UserIdentityProperties + { + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + public UserIdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + + /// The principal id of user assigned identity. + /// + + /// The client id of user assigned identity. + /// + public UserIdentityProperties(string principalId = default(string), string clientId = default(string)) + + { + this.PrincipalId = principalId; + this.ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the principal id of user assigned identity. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } + + /// + /// Gets the client id of user assigned identity. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs new file mode 100644 index 000000000000..ac80fd72714f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs @@ -0,0 +1,244 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level Workspace resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Workspace : TrackedResource + { + /// + /// Initializes a new instance of the Workspace class. + /// + public Workspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workspace class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Metadata pertaining to creation and last modification of the resource. + /// + + /// The ETag of the workspace. + /// + + /// The daily volume cap for ingestion. + /// + + /// The provisioning state of the workspace. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// This is a read-only property. Represents the ID associated with the + /// workspace. + /// + + /// The SKU of the workspace. + /// + + /// The workspace data retention in days. Allowed values are per pricing plan. + /// See pricing tiers documentation for details. + /// + + /// Workspace creation date. + /// + + /// Workspace modification date. + /// + + /// The network access type for accessing Log Analytics ingestion. + /// Possible values include: 'Enabled', 'Disabled' + + /// The network access type for accessing Log Analytics query. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether customer managed storage is mandatory for query + /// management. + /// + + /// List of linked private link scope resources. + /// + + /// Workspace features. + /// + + /// The resource ID of the default Data Collection Rule to use for this + /// workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SystemData systemData = default(SystemData), string eTag = default(string), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), System.Collections.Generic.IList privateLinkScopedResources = default(System.Collections.Generic.IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string)) + + : base(location, id, name, type, tags) + { + this.SystemData = systemData; + this.ETag = eTag; + this.WorkspaceCapping = workspaceCapping; + this.ProvisioningState = provisioningState; + this.CustomerId = customerId; + this.Sku = sku; + this.RetentionInDays = retentionInDays; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + this.PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + this.PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + this.ForceCmkForQuery = forceCmkForQuery; + this.PrivateLinkScopedResources = privateLinkScopedResources; + this.Features = features; + this.DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets metadata pertaining to creation and last modification of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } + + /// + /// Gets or sets the ETag of the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping {get; set; } + + /// + /// Gets the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets this is a read-only property. Represents the ID associated with the + /// workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId {get; private set; } + + /// + /// Gets or sets the SKU of the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public WorkspaceSku Sku {get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values are per + /// pricing plan. See pricing tiers documentation for details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets workspace creation date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets workspace modification date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate {get; private set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion {get; set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery {get; set; } + + /// + /// Gets or sets indicates whether customer managed storage is mandatory for + /// query management. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery {get; set; } + + /// + /// Gets list of linked private link scope resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkScopedResources")] + public System.Collections.Generic.IList PrivateLinkScopedResources {get; private set; } + + /// + /// Gets or sets workspace features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public WorkspaceFeatures Features {get; set; } + + /// + /// Gets or sets the resource ID of the default Data Collection Rule to use for + /// this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + + + + + if (this.Sku != null) + { + this.Sku.Validate(); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs new file mode 100644 index 000000000000..f7c0f2281085 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The daily volume cap for ingestion. + /// + public partial class WorkspaceCapping + { + /// + /// Initializes a new instance of the WorkspaceCapping class. + /// + public WorkspaceCapping() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceCapping class. + /// + + /// The workspace daily quota for ingestion. + /// + + /// The time when the quota will be rest. + /// + + /// The status of data ingestion for this workspace. + /// Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', + /// 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota' + public WorkspaceCapping(double? dailyQuotaGb = default(double?), string quotaNextResetTime = default(string), string dataIngestionStatus = default(string)) + + { + this.DailyQuotaGb = dailyQuotaGb; + this.QuotaNextResetTime = quotaNextResetTime; + this.DataIngestionStatus = dataIngestionStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the workspace daily quota for ingestion. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dailyQuotaGb")] + public double? DailyQuotaGb {get; set; } + + /// + /// Gets the time when the quota will be rest. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaNextResetTime")] + public string QuotaNextResetTime {get; private set; } + + /// + /// Gets the status of data ingestion for this workspace. Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataIngestionStatus")] + public string DataIngestionStatus {get; private set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs new file mode 100644 index 000000000000..ef1e97e6f2e5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs @@ -0,0 +1,24 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for WorkspaceEntityStatus. + /// + + + public static class WorkspaceEntityStatus + { + public const string Creating = "Creating"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + public const string Deleting = "Deleting"; + public const string ProvisioningAccount = "ProvisioningAccount"; + public const string Updating = "Updating"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs new file mode 100644 index 000000000000..0bf406fc9817 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs @@ -0,0 +1,101 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Workspace features. + /// + public partial class WorkspaceFeatures + { + /// + /// Initializes a new instance of the WorkspaceFeatures class. + /// + public WorkspaceFeatures() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceFeatures class. + /// + + /// Workspace features. + /// + + /// Flag that indicate if data should be exported. + /// + + /// Flag that describes if we want to remove the data after 30 days. + /// + + /// Flag that indicate which permission to use - resource or workspace or both. + /// + + /// Dedicated LA cluster resourceId that is linked to the workspaces. + /// + + /// Disable Non-AAD based Auth. + /// + public WorkspaceFeatures(System.Collections.Generic.IDictionary additionalProperties = default(System.Collections.Generic.IDictionary), bool? enableDataExport = default(bool?), bool? immediatePurgeDataOn30Days = default(bool?), bool? enableLogAccessUsingOnlyResourcePermissions = default(bool?), string clusterResourceId = default(string), bool? disableLocalAuth = default(bool?)) + + { + this.AdditionalProperties = additionalProperties; + this.EnableDataExport = enableDataExport; + this.ImmediatePurgeDataOn30Days = immediatePurgeDataOn30Days; + this.EnableLogAccessUsingOnlyResourcePermissions = enableLogAccessUsingOnlyResourcePermissions; + this.ClusterResourceId = clusterResourceId; + this.DisableLocalAuth = disableLocalAuth; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets workspace features. + /// + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties {get; set; } + + /// + /// Gets or sets flag that indicate if data should be exported. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableDataExport")] + public bool? EnableDataExport {get; set; } + + /// + /// Gets or sets flag that describes if we want to remove the data after 30 + /// days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "immediatePurgeDataOn30Days")] + public bool? ImmediatePurgeDataOn30Days {get; set; } + + /// + /// Gets or sets flag that indicate which permission to use - resource or + /// workspace or both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableLogAccessUsingOnlyResourcePermissions")] + public bool? EnableLogAccessUsingOnlyResourcePermissions {get; set; } + + /// + /// Gets or sets dedicated LA cluster resourceId that is linked to the + /// workspaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clusterResourceId")] + public string ClusterResourceId {get; set; } + + /// + /// Gets or sets disable Non-AAD based Auth. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs new file mode 100644 index 000000000000..a5f623fc4322 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs @@ -0,0 +1,229 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The top level Workspace resource container. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class WorkspacePatch : AzureEntityResource + { + /// + /// Initializes a new instance of the WorkspacePatch class. + /// + public WorkspacePatch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePatch class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource Etag. + /// + + /// Resource tags. Optional. + /// + + /// The daily volume cap for ingestion. + /// + + /// The provisioning state of the workspace. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// This is a read-only property. Represents the ID associated with the + /// workspace. + /// + + /// The SKU of the workspace. + /// + + /// The workspace data retention in days. Allowed values are per pricing plan. + /// See pricing tiers documentation for details. + /// + + /// Workspace creation date. + /// + + /// Workspace modification date. + /// + + /// The network access type for accessing Log Analytics ingestion. + /// Possible values include: 'Enabled', 'Disabled' + + /// The network access type for accessing Log Analytics query. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether customer managed storage is mandatory for query + /// management. + /// + + /// List of linked private link scope resources. + /// + + /// Workspace features. + /// + + /// The resource ID of the default Data Collection Rule to use for this + /// workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), System.Collections.Generic.IList privateLinkScopedResources = default(System.Collections.Generic.IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string)) + + : base(id, name, type, etag) + { + this.Tags = tags; + this.WorkspaceCapping = workspaceCapping; + this.ProvisioningState = provisioningState; + this.CustomerId = customerId; + this.Sku = sku; + this.RetentionInDays = retentionInDays; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + this.PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + this.PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + this.ForceCmkForQuery = forceCmkForQuery; + this.PrivateLinkScopedResources = privateLinkScopedResources; + this.Features = features; + this.DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets resource tags. Optional. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping {get; set; } + + /// + /// Gets the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets this is a read-only property. Represents the ID associated with the + /// workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId {get; private set; } + + /// + /// Gets or sets the SKU of the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public WorkspaceSku Sku {get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values are per + /// pricing plan. See pricing tiers documentation for details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets workspace creation date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets workspace modification date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate {get; private set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion {get; set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery {get; set; } + + /// + /// Gets or sets indicates whether customer managed storage is mandatory for + /// query management. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery {get; set; } + + /// + /// Gets list of linked private link scope resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkScopedResources")] + public System.Collections.Generic.IList PrivateLinkScopedResources {get; private set; } + + /// + /// Gets or sets workspace features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public WorkspaceFeatures Features {get; set; } + + /// + /// Gets or sets the resource ID of the default Data Collection Rule to use for + /// this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + if (this.Sku != null) + { + this.Sku.Validate(); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs new file mode 100644 index 000000000000..ed0f8b57951c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs @@ -0,0 +1,202 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Workspace properties. + /// + public partial class WorkspaceProperties + { + /// + /// Initializes a new instance of the WorkspaceProperties class. + /// + public WorkspaceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceProperties class. + /// + + /// The provisioning state of the workspace. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// This is a read-only property. Represents the ID associated with the + /// workspace. + /// + + /// The SKU of the workspace. + /// + + /// The workspace data retention in days. Allowed values are per pricing plan. + /// See pricing tiers documentation for details. + /// + + /// The daily volume cap for ingestion. + /// + + /// Workspace creation date. + /// + + /// Workspace modification date. + /// + + /// The network access type for accessing Log Analytics ingestion. + /// Possible values include: 'Enabled', 'Disabled' + + /// The network access type for accessing Log Analytics query. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether customer managed storage is mandatory for query + /// management. + /// + + /// List of linked private link scope resources. + /// + + /// Workspace features. + /// + + /// The resource ID of the default Data Collection Rule to use for this + /// workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + public WorkspaceProperties(string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), System.Collections.Generic.IList privateLinkScopedResources = default(System.Collections.Generic.IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string)) + + { + this.ProvisioningState = provisioningState; + this.CustomerId = customerId; + this.Sku = sku; + this.RetentionInDays = retentionInDays; + this.WorkspaceCapping = workspaceCapping; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + this.PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + this.PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + this.ForceCmkForQuery = forceCmkForQuery; + this.PrivateLinkScopedResources = privateLinkScopedResources; + this.Features = features; + this.DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets this is a read-only property. Represents the ID associated with the + /// workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customerId")] + public string CustomerId {get; private set; } + + /// + /// Gets or sets the SKU of the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public WorkspaceSku Sku {get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values are per + /// pricing plan. See pricing tiers documentation for details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceCapping")] + public WorkspaceCapping WorkspaceCapping {get; set; } + + /// + /// Gets workspace creation date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets workspace modification date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedDate")] + public string ModifiedDate {get; private set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion {get; set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery {get; set; } + + /// + /// Gets or sets indicates whether customer managed storage is mandatory for + /// query management. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceCmkForQuery")] + public bool? ForceCmkForQuery {get; set; } + + /// + /// Gets list of linked private link scope resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkScopedResources")] + public System.Collections.Generic.IList PrivateLinkScopedResources {get; private set; } + + /// + /// Gets or sets workspace features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "features")] + public WorkspaceFeatures Features {get; set; } + + /// + /// Gets or sets the resource ID of the default Data Collection Rule to use for + /// this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.Sku != null) + { + this.Sku.Validate(); + } + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs new file mode 100644 index 000000000000..f3afc01b45e8 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs @@ -0,0 +1,79 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Describes the body of a purge request for an App Insights Workspace + /// + public partial class WorkspacePurgeBody + { + /// + /// Initializes a new instance of the WorkspacePurgeBody class. + /// + public WorkspacePurgeBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeBody class. + /// + + /// Table from which to purge data. + /// + + /// The set of columns and filters (queries) to run over them to purge the + /// resulting data. + /// + public WorkspacePurgeBody(string table, System.Collections.Generic.IList filters) + + { + this.Table = table; + this.Filters = filters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets table from which to purge data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "table")] + public string Table {get; set; } + + /// + /// Gets or sets the set of columns and filters (queries) to run over them to + /// purge the resulting data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "filters")] + public System.Collections.Generic.IList Filters {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Table == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Table"); + } + if (this.Filters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Filters"); + } + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs new file mode 100644 index 000000000000..eb0711e82e91 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs @@ -0,0 +1,87 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// User-defined filters to return data which will be purged from the table. + /// + public partial class WorkspacePurgeBodyFilters + { + /// + /// Initializes a new instance of the WorkspacePurgeBodyFilters class. + /// + public WorkspacePurgeBodyFilters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeBodyFilters class. + /// + + /// The column of the table over which the given query should run + /// + + /// A query operator to evaluate over the provided column and value(s). + /// Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have + /// the same behavior as they would in a KQL query. + /// + + /// the value for the operator to function over. This can be a number (e.g., > + /// 100), a string (timestamp >= '2017-09-01') or array of values. + /// + + /// When filtering over custom dimensions, this key will be used as the name of + /// the custom dimension. + /// + public WorkspacePurgeBodyFilters(string column = default(string), string operatorProperty = default(string), object value = default(object), string key = default(string)) + + { + this.Column = column; + this.OperatorProperty = operatorProperty; + this.Value = value; + this.Key = key; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the column of the table over which the given query should run + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "column")] + public string Column {get; set; } + + /// + /// Gets or sets a query operator to evaluate over the provided column and + /// value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + /// and have the same behavior as they would in a KQL query. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public string OperatorProperty {get; set; } + + /// + /// Gets or sets the value for the operator to function over. This can be a + /// number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + /// values. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public object Value {get; set; } + + /// + /// Gets or sets when filtering over custom dimensions, this key will be used + /// as the name of the custom dimension. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "key")] + public string Key {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs new file mode 100644 index 000000000000..6b87cab63929 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs @@ -0,0 +1,45 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + public partial class WorkspacePurgeHeaders + { + /// + /// Initializes a new instance of the WorkspacePurgeHeaders class. + /// + public WorkspacePurgeHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeHeaders class. + /// + + /// + /// + public WorkspacePurgeHeaders(string xmsStatusLocation = default(string)) + + { + this.XMSStatusLocation = xmsStatusLocation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-status-location")] + public string XMSStatusLocation {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs new file mode 100644 index 000000000000..f98a47b3b92e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Response containing operationId for a specific purge action. + /// + public partial class WorkspacePurgeResponse + { + /// + /// Initializes a new instance of the WorkspacePurgeResponse class. + /// + public WorkspacePurgeResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeResponse class. + /// + + /// Id to use when querying for status for a particular purge operation. + /// + public WorkspacePurgeResponse(string operationId) + + { + this.OperationId = operationId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets id to use when querying for status for a particular purge + /// operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operationId")] + public string OperationId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.OperationId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OperationId"); + } + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs new file mode 100644 index 000000000000..723ec07033be --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs @@ -0,0 +1,62 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Response containing status for a specific purge operation. + /// + public partial class WorkspacePurgeStatusResponse + { + /// + /// Initializes a new instance of the WorkspacePurgeStatusResponse class. + /// + public WorkspacePurgeStatusResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeStatusResponse class. + /// + + /// Status of the operation represented by the requested Id. + /// Possible values include: 'pending', 'completed' + public WorkspacePurgeStatusResponse(string status) + + { + this.Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets status of the operation represented by the requested Id. Possible values include: 'pending', 'completed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Status == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Status"); + } + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs new file mode 100644 index 000000000000..d7c70db6bc65 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs @@ -0,0 +1,88 @@ +// 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.OperationalInsights.Models +{ + using System.Linq; + + /// + /// The SKU (tier) of a workspace. + /// + public partial class WorkspaceSku + { + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + public WorkspaceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + + /// The name of the SKU. + /// Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', + /// 'PerGB2018', 'Standalone', 'CapacityReservation', 'LACluster' + + /// The capacity reservation level in GB for this workspace, when + /// CapacityReservation sku is selected. + /// Possible values include: '100', '200', '300', '400', '500', '1000', '2000', + /// '5000' + + /// The last time when the sku was updated. + /// + public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) + + { + this.Name = name; + this.CapacityReservationLevel = capacityReservationLevel; + this.LastSkuUpdate = lastSkuUpdate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the SKU. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation', 'LACluster' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the capacity reservation level in GB for this workspace, when + /// CapacityReservation sku is selected. Possible values include: '100', '200', '300', '400', '500', '1000', '2000', '5000' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationLevel")] + public int? CapacityReservationLevel {get; set; } + + /// + /// Gets the last time when the sku was updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs new file mode 100644 index 000000000000..613ab63b2568 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs @@ -0,0 +1,25 @@ +// 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.OperationalInsights.Models +{ + + /// + /// Defines values for WorkspaceSkuNameEnum. + /// + + + public static class WorkspaceSkuNameEnum + { + public const string Free = "Free"; + public const string Standard = "Standard"; + public const string Premium = "Premium"; + public const string PerNode = "PerNode"; + public const string PerGB2018 = "PerGB2018"; + public const string Standalone = "Standalone"; + public const string CapacityReservation = "CapacityReservation"; + public const string LACluster = "LACluster"; + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs new file mode 100644 index 000000000000..07b352e550f1 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs @@ -0,0 +1,258 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// OperationStatusesOperations operations. + /// + internal partial class OperationStatusesOperations : Microsoft.Rest.IServiceOperations, IOperationStatusesOperations + { + /// + /// Initializes a new instance of the OperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationStatusesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + + if (asyncOperationId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "asyncOperationId"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("asyncOperationId", asyncOperationId); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{asyncOperationId}", System.Uri.EscapeDataString(asyncOperationId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..6a9b8282f142 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for OperationStatusesOperations + /// + public static partial class OperationStatusesOperationsExtensions + { + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + public static OperationStatus Get(this IOperationStatusesOperations operations, string location, string asyncOperationId) + { + return ((IOperationStatusesOperations)operations).GetAsync(location, asyncOperationId).GetAwaiter().GetResult(); + } + + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IOperationStatusesOperations operations, string location, string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, asyncOperationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs new file mode 100644 index 000000000000..8e1d907c1932 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs @@ -0,0 +1,428 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Azure Log Analytics API reference + /// + public partial class OperationalInsightsManagementClient : Microsoft.Rest.ServiceClient, IOperationalInsightsManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + /// + /// Gets or sets json serialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + /// + /// Gets or sets json deserialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + /// + /// Credentials needed for the client to connect to Azure. + /// + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + + /// + /// The ID of the target subscription. + /// + public string SubscriptionId { get; set;} + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set;} + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. + /// + public int? LongRunningOperationRetryTimeout { get; set;} + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set;} + + /// + /// Gets the IOperations + /// + public virtual IOperations Operations { get; private set; } + /// + /// Gets the IWorkspacesOperations + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + /// + /// Gets the IDeletedWorkspacesOperations + /// + public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } + /// + /// Gets the ITablesOperations + /// + public virtual ITablesOperations Tables { get; private set; } + /// + /// Gets the IDataExportsOperations + /// + public virtual IDataExportsOperations DataExports { get; private set; } + /// + /// Gets the IDataSourcesOperations + /// + public virtual IDataSourcesOperations DataSources { get; private set; } + /// + /// Gets the IIntelligencePacksOperations + /// + public virtual IIntelligencePacksOperations IntelligencePacks { get; private set; } + /// + /// Gets the ILinkedServicesOperations + /// + public virtual ILinkedServicesOperations LinkedServices { get; private set; } + /// + /// Gets the ILinkedStorageAccountsOperations + /// + public virtual ILinkedStorageAccountsOperations LinkedStorageAccounts { get; private set; } + /// + /// Gets the IManagementGroupsOperations + /// + public virtual IManagementGroupsOperations ManagementGroups { get; private set; } + /// + /// Gets the IOperationStatusesOperations + /// + public virtual IOperationStatusesOperations OperationStatuses { get; private set; } + /// + /// Gets the ISharedKeysOperations + /// + public virtual ISharedKeysOperations SharedKeys { get; private set; } + /// + /// Gets the IUsagesOperations + /// + public virtual IUsagesOperations Usages { get; private set; } + /// + /// Gets the IStorageInsightConfigsOperations + /// + public virtual IStorageInsightConfigsOperations StorageInsightConfigs { get; private set; } + /// + /// Gets the ISavedSearchesOperations + /// + public virtual ISavedSearchesOperations SavedSearches { get; private set; } + /// + /// Gets the IAvailableServiceTiersOperations + /// + public virtual IAvailableServiceTiersOperations AvailableServiceTiers { get; private set; } + /// + /// Gets the IGatewaysOperations + /// + public virtual IGatewaysOperations Gateways { get; private set; } + /// + /// Gets the ISchemaOperations + /// + public virtual ISchemaOperations Schema { get; private set; } + /// + /// Gets the IWorkspacePurgeOperations + /// + public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } + /// + /// Gets the IClustersOperations + /// + public virtual IClustersOperations Clusters { get; private set; } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling OperationalInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + protected OperationalInsightsManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + this.Initialize(); + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected OperationalInsightsManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + { + this.Initialize(); + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected OperationalInsightsManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + this.Initialize(); + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected OperationalInsightsManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected OperationalInsightsManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + + this.BaseUri = baseUri; + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling OperationalInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + + /// + /// Initializes client properties. + /// + private void Initialize() + { + this.Operations = new Operations(this); + this.Workspaces = new WorkspacesOperations(this); + this.DeletedWorkspaces = new DeletedWorkspacesOperations(this); + this.Tables = new TablesOperations(this); + this.DataExports = new DataExportsOperations(this); + this.DataSources = new DataSourcesOperations(this); + this.IntelligencePacks = new IntelligencePacksOperations(this); + this.LinkedServices = new LinkedServicesOperations(this); + this.LinkedStorageAccounts = new LinkedStorageAccountsOperations(this); + this.ManagementGroups = new ManagementGroupsOperations(this); + this.OperationStatuses = new OperationStatusesOperations(this); + this.SharedKeys = new SharedKeysOperations(this); + this.Usages = new UsagesOperations(this); + this.StorageInsightConfigs = new StorageInsightConfigsOperations(this); + this.SavedSearches = new SavedSearchesOperations(this); + this.AvailableServiceTiers = new AvailableServiceTiersOperations(this); + this.Gateways = new GatewaysOperations(this); + this.Schema = new SchemaOperations(this); + this.WorkspacePurge = new WorkspacePurgeOperations(this); + this.Clusters = new ClustersOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs new file mode 100644 index 000000000000..0fc6d6f2007c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs @@ -0,0 +1,398 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Operations operations. + /// + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.OperationalInsights/operations").ToString(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..3b0a4657215b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs @@ -0,0 +1,76 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for Operations + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs new file mode 100644 index 000000000000..d9acacf34111 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs @@ -0,0 +1,1029 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// SavedSearchesOperations operations. + /// + internal partial class SavedSearchesOperations : Microsoft.Rest.IServiceOperations, ISavedSearchesOperations + { + /// + /// Initializes a new instance of the SavedSearchesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SavedSearchesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (savedSearchId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "savedSearchId"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The parameters required to save a search. + /// + /// + /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (savedSearchId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "savedSearchId"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (savedSearchId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "savedSearchId"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs new file mode 100644 index 000000000000..659376f14822 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs @@ -0,0 +1,187 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for SavedSearchesOperations + /// + public static partial class SavedSearchesOperationsExtensions + { + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static void Delete(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + { + ((ISavedSearchesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static SavedSearch CreateOrUpdate(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters) + { + return ((ISavedSearchesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, savedSearchId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static SavedSearch Get(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + { + return ((ISavedSearchesOperations)operations).GetAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SavedSearchesListResult ListByWorkspace(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISavedSearchesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListByWorkspaceAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs new file mode 100644 index 000000000000..934332e07d19 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs @@ -0,0 +1,282 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// SchemaOperations operations. + /// + internal partial class SchemaOperations : Microsoft.Rest.IServiceOperations, ISchemaOperations + { + /// + /// Initializes a new instance of the SchemaOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SchemaOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the schema for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs new file mode 100644 index 000000000000..c4777bf098c5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for SchemaOperations + /// + public static partial class SchemaOperationsExtensions + { + /// + /// Gets the schema for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SearchGetSchemaResponse Get(this ISchemaOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISchemaOperations)operations).GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the schema for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISchemaOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs new file mode 100644 index 000000000000..8dd1e24f0c63 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs @@ -0,0 +1,523 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// SharedKeysOperations operations. + /// + internal partial class SharedKeysOperations : Microsoft.Rest.IServiceOperations, ISharedKeysOperations + { + /// + /// Initializes a new instance of the SharedKeysOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SharedKeysOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSharedKeys", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Regenerate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs new file mode 100644 index 000000000000..ae0e1f401eff --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs @@ -0,0 +1,96 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for SharedKeysOperations + /// + public static partial class SharedKeysOperationsExtensions + { + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SharedKeys GetSharedKeys(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISharedKeysOperations)operations).GetSharedKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetSharedKeysAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetSharedKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SharedKeys Regenerate(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISharedKeysOperations)operations).RegenerateAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RegenerateAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RegenerateWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs new file mode 100644 index 000000000000..c2a47e947bb9 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs @@ -0,0 +1,1229 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// StorageInsightConfigsOperations operations. + /// + internal partial class StorageInsightConfigsOperations : Microsoft.Rest.IServiceOperations, IStorageInsightConfigsOperations + { + /// + /// Initializes a new instance of the StorageInsightConfigsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal StorageInsightConfigsOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or update a storage insight. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The parameters required to create or update a storage insight. + /// + /// + /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (storageInsightName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storageInsightName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets a storage insight instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (storageInsightName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storageInsightName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (storageInsightName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storageInsightName"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs new file mode 100644 index 000000000000..3b27ad81ad8c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for StorageInsightConfigsOperations + /// + public static partial class StorageInsightConfigsOperationsExtensions + { + /// + /// Create or update a storage insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static StorageInsight CreateOrUpdate(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters) + { + return ((IStorageInsightConfigsOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, storageInsightName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a storage insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a storage insight instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static StorageInsight Get(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + { + return ((IStorageInsightConfigsOperations)operations).GetAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + } + + /// + /// Gets a storage insight instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static void Delete(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + { + ((IStorageInsightConfigsOperations)operations).DeleteAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspace(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName) + { + return ((IStorageInsightConfigsOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspaceNext(this IStorageInsightConfigsOperations operations, string nextPageLink) + { + return ((IStorageInsightConfigsOperations)operations).ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceNextAsync(this IStorageInsightConfigsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs new file mode 100644 index 000000000000..0270705b85a9 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs @@ -0,0 +1,1575 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// TablesOperations operations. + /// + internal partial class TablesOperations : Microsoft.Rest.IServiceOperations, ITablesOperations + { + /// + /// Initializes a new instance of the TablesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TablesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse
_response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs new file mode 100644 index 000000000000..2abec86ab36e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs @@ -0,0 +1,410 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for TablesOperations + /// + public static partial class TablesOperationsExtensions + { + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable
ListByWorkspace(this ITablesOperations operations, string resourceGroupName, string workspaceName) + { + return ((ITablesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table CreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
CreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table Get(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + return ((ITablesOperations)operations).GetAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
GetAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Delete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + ((ITablesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Migrate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + ((ITablesOperations)operations).MigrateAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MigrateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table BeginCreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
BeginCreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table BeginUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).BeginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
BeginUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void BeginDelete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + ((ITablesOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs new file mode 100644 index 000000000000..0b422e927f81 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs @@ -0,0 +1,282 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// UsagesOperations operations. + /// + internal partial class UsagesOperations : Microsoft.Rest.IServiceOperations, IUsagesOperations + { + /// + /// Initializes a new instance of the UsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsagesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs new file mode 100644 index 000000000000..c4da1f915b7b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs @@ -0,0 +1,55 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for UsagesOperations + /// + public static partial class UsagesOperationsExtensions + { + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable List(this IUsagesOperations operations, string resourceGroupName, string workspaceName) + { + return ((IUsagesOperations)operations).ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IUsagesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs new file mode 100644 index 000000000000..903371711e95 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs @@ -0,0 +1,571 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// WorkspacePurgeOperations operations. + /// + internal partial class WorkspacePurgeOperations : Microsoft.Rest.IServiceOperations, IWorkspacePurgeOperations + { + /// + /// Initializes a new instance of the WorkspacePurgeOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacePurgeOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Describes the body of a request to purge data in a single table of an Log + /// Analytics Workspace + /// + /// + /// 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 System.Threading.Tasks.Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceName", workspaceName); + + tracingParameters.Add("body", body); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Purge", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(body != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// 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 System.Threading.Tasks.Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (purgeId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "purgeId"); + } + + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("purgeId", purgeId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPurgeStatus", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{purgeId}", System.Uri.EscapeDataString(purgeId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs new file mode 100644 index 000000000000..f61934c4be32 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs @@ -0,0 +1,114 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for WorkspacePurgeOperations + /// + public static partial class WorkspacePurgeOperationsExtensions + { + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static WorkspacePurgeResponse Purge(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body) + { + return ((IWorkspacePurgeOperations)operations).PurgeAsync(resourceGroupName, workspaceName, body).GetAwaiter().GetResult(); + } + + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PurgeAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PurgeWithHttpMessagesAsync(resourceGroupName, workspaceName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + public static WorkspacePurgeStatusResponse GetPurgeStatus(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId) + { + return ((IWorkspacePurgeOperations)operations).GetPurgeStatusAsync(resourceGroupName, workspaceName, purgeId).GetAwaiter().GetResult(); + } + + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetPurgeStatusAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetPurgeStatusWithHttpMessagesAsync(resourceGroupName, workspaceName, purgeId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs new file mode 100644 index 000000000000..c38dcfcc8f1f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs @@ -0,0 +1,1480 @@ +// 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.OperationalInsights +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// WorkspacesOperations operations. + /// + internal partial class WorkspacesOperations : Microsoft.Rest.IServiceOperations, IWorkspacesOperations + { + /// + /// Initializes a new instance of the WorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacesOperations (OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the workspaces in a subscription. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets workspaces in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a workspace instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Updates a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to patch a workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("force", force); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..7681d1a435ab --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs @@ -0,0 +1,332 @@ +// 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.OperationalInsights +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for WorkspacesOperations + /// + public static partial class WorkspacesOperationsExtensions + { + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IWorkspacesOperations operations) + { + return ((IWorkspacesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IWorkspacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets workspaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName) + { + return ((IWorkspacesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets workspaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return ((IWorkspacesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + { + ((IWorkspacesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a workspace instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return ((IWorkspacesOperations)operations).GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a workspace instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters) + { + return ((IWorkspacesOperations)operations).UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace BeginCreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return ((IWorkspacesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + public static void BeginDelete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + { + ((IWorkspacesOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj b/src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj new file mode 100644 index 000000000000..6957308c8e65 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj @@ -0,0 +1,13 @@ + + + OperationalInsights + + + + netstandard2.0 + Microsoft.Azure.PowerShell.OperationalInsights.Management.Sdk + Microsoft.Azure.Management.OperationalInsights + $(NoWarn);CS0108;CS1573 + + + \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..313990cacdbb --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Powershell - OperationalInsights Management SDK")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] +[assembly: AssemblyVersion("0.25.0.0")] +[assembly: AssemblyFileVersion("0.25.0.0")] \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md b/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md new file mode 100644 index 000000000000..c618d28ff3fc --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md @@ -0,0 +1,103 @@ +# Overall +This directory contains management plane service clients of Az.OperationalInsights module. + +## Run Generation +In this directory, run AutoRest: +``` +autorest --reset +autorest --use:@autorest/powershell@4.x +``` + +### AutoRest Configuration +> see https://aka.ms/autorest +``` yaml +isSdkGenerator: true +powershell: true +clear-output-folder: true +reflect-api-versions: true +openapi-type: arm +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +payload-flattening-threshold: 1 +title: OperationalInsightsManagementClient +``` + + + +### +``` yaml +commit: 9673e2239f4f8257b2e916df2d15e1ef41c5bfd1 +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Operations.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Workspaces.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Tables.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/DataExports.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/DataSources.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/IntelligencePacks.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/LinkedServices.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/LinkedStorageAccounts.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/ManagementGroups.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/OperationStatuses.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SharedKeys.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/Usages.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SavedSearches.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/AvailableServiceTiers.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/Gateways.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/Schema.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SharedKeys.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/WorkspacePurge.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/Clusters.json + +output-folder: Generated + +namespace: Microsoft.Azure.Management.OperationalInsights + +directive: + # README suppress + - from: OperationalInsights.json + suppress: R3006 # BodyTopLevelProperties/R3006/RPCViolation + reason: properties etag defined as eTag in model + # Model property rename + - where: + model-name: DataExport + property-name: PropertiesDestinationType + set: + property-name: DataExportType + # XML format error fix + - from: Tables.json + where: $.definitions.Column.properties.dataTypeHint + transform: >- + return { + "type": "string", + "description": "Column data type logical hint.", + "enum": [ + "uri", + "guid", + "armPath", + "ip" + ], + "x-ms-enum": { + "name": "ColumnDataTypeHintEnum", + "modelAsString": true, + "values": [ + { + "value": "uri", + "description": "A string that matches the pattern of a URI, for example, scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment" + }, + { + "value": "guid", + "description": "A standard 128-bit GUID following the standard shape, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + }, + { + "value": "armPath", + "description": "An Azure Resource Model (ARM) path: /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}..." + }, + { + "value": "ip", + "description": "A standard V4/V6 ip address following the standard shape, x.x.x.x/y:y:y:y:y:y:y:y" + } + ] + } + } +``` \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj b/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj index c54bc5269125..12e08a0ca7c5 100644 --- a/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj +++ b/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj @@ -11,9 +11,12 @@ - + + + + \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json b/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json index 05af1bf54d0e..9279a137a0ca 100644 --- a/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json +++ b/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/providers/Microsoft.OperationalInsights?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuT3BlcmF0aW9uYWxJbnNpZ2h0cz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/providers/Microsoft.OperationalInsights?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Byb3ZpZGVycy9NaWNyb3NvZnQuT3BlcmF0aW9uYWxJbnNpZ2h0cz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "ad939642-9528-4b95-81e8-e9c708b17f2d" + "ee61c05a-6d36-4f86-924e-eccc42b9551f" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.58" + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.102" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -27,16 +27,19 @@ "no-cache" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "249" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "973bcc0f-2a05-4096-a989-48ef5ac9560b" + "d971555d-3b92-43d2-b7a1-5dd65167122b" ], "x-ms-correlation-request-id": [ - "973bcc0f-2a05-4096-a989-48ef5ac9560b" + "d971555d-3b92-43d2-b7a1-5dd65167122b" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125130Z:973bcc0f-2a05-4096-a989-48ef5ac9560b" + "SOUTHEASTASIA:20241128T091711Z:d971555d-3b92-43d2-b7a1-5dd65167122b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -44,39 +47,44 @@ "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 45C7E82822404E96B6F519EBF9B7B82E Ref B: MAA201060513019 Ref C: 2024-11-28T09:17:11Z" + ], "Date": [ - "Thu, 07 Jul 2022 12:51:30 GMT" + "Thu, 28 Nov 2024 09:17:11 GMT" + ], + "Content-Length": [ + "16240" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" - ], - "Content-Length": [ - "11823" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/providers/Microsoft.OperationalInsights\",\r\n \"namespace\": \"Microsoft.OperationalInsights\",\r\n \"authorizations\": [\r\n {\r\n \"applicationId\": \"d2a0a418-0aac-4541-82b2-b3142c89da77\",\r\n \"roleDefinitionId\": \"86695298-2eb9-48a7-9ec3-2fdb38b6878b\"\r\n },\r\n {\r\n \"applicationId\": \"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5\",\r\n \"roleDefinitionId\": \"5d5a2e56-9835-44aa-93db-d2f19e155438\"\r\n }\r\n ],\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"workspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2021-06-01\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"querypacks\",\r\n \"locations\": [\r\n \"West Central US\",\r\n \"East US\",\r\n \"South Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"West US 2\",\r\n \"UK South\",\r\n \"Canada Central\",\r\n \"Central India\",\r\n \"Japan East\",\r\n \"Australia East\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"East Asia\",\r\n \"West US\",\r\n \"South Africa North\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Norway East\",\r\n \"Australia Southeast\",\r\n \"Australia Central 2\",\r\n \"Germany West Central\",\r\n \"Switzerland West\",\r\n \"UAE Central\",\r\n \"UK West\",\r\n \"Brazil Southeast\",\r\n \"Japan West\",\r\n \"UAE North\",\r\n \"Australia Central\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2019-09-01-preview\",\r\n \"2019-09-01\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationStatuses\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/scopedPrivateLinkProxies\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/query\",\r\n \"locations\": [\r\n \"East US 2 EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/metadata\",\r\n \"locations\": [\r\n \"East US 2 EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataSources\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedStorageAccounts\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/tables\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\",\r\n \"Sweden South\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-07-01-privatepreview\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/storageInsightConfigs\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"storageInsightConfigs\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2014-10-10\"\r\n ],\r\n \"capabilities\": \"SupportsExtension\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedServices\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"linkTargets\",\r\n \"locations\": [\r\n \"East US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"deletedWorkspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2014-11-10\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"clusters\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"Brazil South\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-06-01\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataExports\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/providers/Microsoft.OperationalInsights\",\r\n \"namespace\": \"Microsoft.OperationalInsights\",\r\n \"authorizations\": [\r\n {\r\n \"applicationId\": \"d2a0a418-0aac-4541-82b2-b3142c89da77\",\r\n \"roleDefinitionId\": \"86695298-2eb9-48a7-9ec3-2fdb38b6878b\"\r\n },\r\n {\r\n \"applicationId\": \"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5\",\r\n \"roleDefinitionId\": \"5d5a2e56-9835-44aa-93db-d2f19e155438\"\r\n }\r\n ],\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"workspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-12-01-preview\",\r\n \"2021-06-01\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"querypacks\",\r\n \"locations\": [\r\n \"West Central US\",\r\n \"East US\",\r\n \"South Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"West US 2\",\r\n \"UK South\",\r\n \"Canada Central\",\r\n \"Central India\",\r\n \"Japan East\",\r\n \"Australia East\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"East Asia\",\r\n \"West US\",\r\n \"South Africa North\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Norway East\",\r\n \"Australia Southeast\",\r\n \"Australia Central 2\",\r\n \"Germany West Central\",\r\n \"Switzerland West\",\r\n \"UAE Central\",\r\n \"UK West\",\r\n \"Brazil Southeast\",\r\n \"Japan West\",\r\n \"UAE North\",\r\n \"Australia Central\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2019-09-01-preview\",\r\n \"2019-09-01\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationStatuses\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2023-01-01-preview\",\r\n \"2022-10-01\",\r\n \"2022-09-01-privatepreview\",\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/workspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Australia Southeast\",\r\n \"UK South\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"Germany West Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/scopedPrivateLinkProxies\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/api\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/query\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/metadata\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/purge\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2017-04-26-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2020-08-01\",\r\n \"2017-04-26-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataSources\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedStorageAccounts\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/tables\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-07-01-privatepreview\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/summaryLogs\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/storageInsightConfigs\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"storageInsightConfigs\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2014-10-10\"\r\n ],\r\n \"capabilities\": \"SupportsExtension\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedServices\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"linkTargets\",\r\n \"locations\": [\r\n \"East US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"deletedWorkspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2014-11-10\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"clusters\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"Brazil South\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-06-01\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataExports\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/networkSecurityPerimeterAssociationProxies\",\r\n \"locations\": [\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/networkSecurityPerimeterConfigurations\",\r\n \"locations\": [\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/notifyNetworkSecurityPerimeterUpdatesAvailable\",\r\n \"locations\": [\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\",\r\n \"Australia Central\",\r\n \"Australia Central 2\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Brazil Southeast\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Central India\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"France Central\",\r\n \"France South\",\r\n \"Germany North\",\r\n \"Germany West Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"Mexico Central\",\r\n \"North Central US\",\r\n \"North Europe\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"Poland Central\",\r\n \"Qatar Central\",\r\n \"South Africa North\",\r\n \"South Africa West\",\r\n \"South Central US\",\r\n \"South India\",\r\n \"Southeast Asia\",\r\n \"Spain Central\",\r\n \"Sweden Central\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West Central US\",\r\n \"West Europe\",\r\n \"West India\",\r\n \"West US\",\r\n \"West US 2\",\r\n \"West US 3\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-10-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"East US\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "41e6478d-cebd-45af-84d3-04ee1b1ad674" + "771f1d02-00c8-4510-9348-a1b4798e6a73" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.58" + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.102" ], "Content-Type": [ "application/json; charset=utf-8" @@ -85,6 +93,7 @@ "29" ] }, + "RequestBody": "{\r\n \"location\": \"East US\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -93,16 +102,19 @@ "no-cache" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "199" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "46f3fb26-cc11-4211-bd68-88a2c971fdbe" + "b9aecc08-1814-4d4c-856c-fe8af22046c1" ], "x-ms-correlation-request-id": [ - "46f3fb26-cc11-4211-bd68-88a2c971fdbe" + "b9aecc08-1814-4d4c-856c-fe8af22046c1" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125133Z:46f3fb26-cc11-4211-bd68-88a2c971fdbe" + "SOUTHEASTASIA:20241128T091715Z:b9aecc08-1814-4d4c-856c-fe8af22046c1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -110,8 +122,14 @@ "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F84EFBFF1964411ABEE964B8B105FC9D Ref B: MAA201060516035 Ref C: 2024-11-28T09:17:11Z" + ], "Date": [ - "Thu, 07 Jul 2022 12:51:32 GMT" + "Thu, 28 Nov 2024 09:17:15 GMT" ], "Content-Length": [ "165" @@ -123,25 +141,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388\",\r\n \"name\": \"ps3388\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050\",\r\n \"name\": \"ps2050\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063?api-version=2021-12-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783?api-version=2021-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"pergb2018\"\r\n },\r\n \"features\": {}\r\n },\r\n \"tags\": {},\r\n \"location\": \"East US\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "623a1a4d-82c6-4092-8440-cc374e8ed2f0" + "14e5e7c6-ee59-4440-b3db-9f62d0f4a15a" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -151,6 +168,7 @@ "138" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"pergb2018\"\r\n },\r\n \"features\": {}\r\n },\r\n \"tags\": {},\r\n \"location\": \"East US\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -158,8 +176,11 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "Location": [ + "https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783?api-version=2021-12-01-preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" ], "Request-Context": [ "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" @@ -167,57 +188,65 @@ "X-Content-Type-Options": [ "nosniff" ], - "x-ms-request-id": [ - "2bdb20a8-a2d9-4df3-9583-f2b1613fcf4a" + "api-supported-versions": [ + "2021-12-01-preview" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], "Access-Control-Allow-Origin": [ "*" ], - "Server": [ - "Microsoft-IIS/10.0" + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "x-ms-request-id": [ + "eeae3768-0cda-4260-97a5-07484f76ab5b" ], "x-ms-correlation-request-id": [ - "be68ef59-8516-4a46-975f-d09116d22f46" + "eeae3768-0cda-4260-97a5-07484f76ab5b" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125140Z:be68ef59-8516-4a46-975f-d09116d22f46" + "SOUTHEASTASIA:20241128T091720Z:eeae3768-0cda-4260-97a5-07484f76ab5b" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 429C39869692463CADA1EE0E67AEA12F Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:16Z" ], "Date": [ - "Thu, 07 Jul 2022 12:51:40 GMT" + "Thu, 28 Nov 2024 09:17:20 GMT" ], "Content-Length": [ - "1064" + "882" ], "Content-Type": [ - "application/json" + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": \"d4ba7b9b-b2b2-4782-84b8-cc164cd15a05\",\r\n \"provisioningState\": \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"Thu, 07 Jul 2022 12:51:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"Fri, 08 Jul 2022 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"Thu, 07 Jul 2022 12:51:39 GMT\",\r\n \"modifiedDate\": \"Thu, 07 Jul 2022 12:51:39 GMT\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/microsoft.operationalinsights/workspaces/aztestps8063\",\r\n \"name\": \"AzTestps8063\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"location\": \"East US\",\r\n \"tags\": {}\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"customerId\": \"77403bf2-429b-4499-9107-94d05e38e491\",\r\n \"provisioningState\": \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"2024-11-28T09:17:20.0083434Z\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"2024-11-29T00:00:00Z\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"2024-11-28T09:17:20.0083434Z\",\r\n \"modifiedDate\": \"2024-11-28T09:17:20.0083434Z\"\r\n },\r\n \"location\": \"East US\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783\",\r\n \"name\": \"AzTestps6783\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"etag\": \"\\\"8e0963d8-0000-0100-0000-674835200000\\\"\"\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063?api-version=2021-12-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783?api-version=2021-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "623a1a4d-82c6-4092-8440-cc374e8ed2f0" + "14e5e7c6-ee59-4440-b3db-9f62d0f4a15a" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -225,11 +254,8 @@ "Pragma": [ "no-cache" ], - "Vary": [ - "Accept-Encoding" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" ], "Request-Context": [ "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" @@ -237,60 +263,68 @@ "X-Content-Type-Options": [ "nosniff" ], - "x-ms-request-id": [ - "29b45b44-2f24-4950-acfa-0ce3ccaf10af" + "api-supported-versions": [ + "2021-12-01-preview" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], "Access-Control-Allow-Origin": [ "*" ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-request-id": [ + "b2606503-1cb1-4525-8d18-ce98a712d601" ], "x-ms-correlation-request-id": [ - "11542dd5-c810-4f98-9614-0d7f91b566a5" + "b2606503-1cb1-4525-8d18-ce98a712d601" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125210Z:11542dd5-c810-4f98-9614-0d7f91b566a5" + "SOUTHEASTASIA:20241128T091751Z:b2606503-1cb1-4525-8d18-ce98a712d601" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 8D2A7D1C0B3A4658BA48FA9903000D1C Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:50Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:10 GMT" + "Thu, 28 Nov 2024 09:17:50 GMT" ], "Content-Length": [ - "1065" + "882" ], "Content-Type": [ - "application/json" + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": \"d4ba7b9b-b2b2-4782-84b8-cc164cd15a05\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"Thu, 07 Jul 2022 12:51:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"Fri, 08 Jul 2022 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"Thu, 07 Jul 2022 12:51:39 GMT\",\r\n \"modifiedDate\": \"Thu, 07 Jul 2022 12:51:40 GMT\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/microsoft.operationalinsights/workspaces/aztestps8063\",\r\n \"name\": \"AzTestps8063\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"location\": \"East US\",\r\n \"tags\": {}\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"customerId\": \"77403bf2-429b-4499-9107-94d05e38e491\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"2024-11-28T09:17:20.0083434Z\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"2024-11-29T00:00:00Z\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"2024-11-28T09:17:20.0083434Z\",\r\n \"modifiedDate\": \"2024-11-28T09:17:21.415792Z\"\r\n },\r\n \"location\": \"East US\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783\",\r\n \"name\": \"AzTestps6783\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"etag\": \"\\\"8e09b1d8-0000-0100-0000-674835210000\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "4eb49314-cbd8-4334-9495-f1ec9980d176" + "47632c69-6ab2-47d9-8f82-6baf8d04d045" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -298,35 +332,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "8642741e-d4bb-4d7c-a6b7-ee4e0c430daa" + "69eb1109-5a3f-44ea-b845-066622a41cc9" ], "x-ms-correlation-request-id": [ - "8642741e-d4bb-4d7c-a6b7-ee4e0c430daa" + "69eb1109-5a3f-44ea-b845-066622a41cc9" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125213Z:8642741e-d4bb-4d7c-a6b7-ee4e0c430daa" + "SOUTHEASTASIA:20241128T091752Z:69eb1109-5a3f-44ea-b845-066622a41cc9" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: E36C8260D3DB4A4C9046B28F3D2AEC2C Ref B: MAA201060515051 Ref C: 2024-11-28T09:17:51Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:12 GMT" + "Thu, 28 Nov 2024 09:17:51 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -335,28 +381,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "028a52d3-c19e-4f27-9fd7-1b0b1b0567a0" + "ae02cc85-8f11-4ede-a3b4-067c151609c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -364,35 +410,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "4aeed2f2-f33c-4c17-9ef8-1406975f076f" + "fb4f3ef0-fda7-4254-816c-4e37f568e24f" ], "x-ms-correlation-request-id": [ - "4aeed2f2-f33c-4c17-9ef8-1406975f076f" + "fb4f3ef0-fda7-4254-816c-4e37f568e24f" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125217Z:4aeed2f2-f33c-4c17-9ef8-1406975f076f" + "SOUTHEASTASIA:20241128T091757Z:fb4f3ef0-fda7-4254-816c-4e37f568e24f" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 754D8A6A818C452CB5B3772ADC22C892 Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:56Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:17 GMT" + "Thu, 28 Nov 2024 09:17:56 GMT" ], "Content-Length": [ - "396" + "414" ], "Content-Type": [ "application/json; charset=utf-8" @@ -401,28 +459,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A15.5492550Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A55.3116659Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "4eb49314-cbd8-4334-9495-f1ec9980d176" + "47632c69-6ab2-47d9-8f82-6baf8d04d045" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -430,65 +488,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "f73ac3ee-4a6d-4a90-aa3f-f8dcab5b0b0b" + "b9b1b6b8-5554-4ca4-9bfd-22c2b8e9a91a" ], "x-ms-correlation-request-id": [ - "f73ac3ee-4a6d-4a90-aa3f-f8dcab5b0b0b" + "b9b1b6b8-5554-4ca4-9bfd-22c2b8e9a91a" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125213Z:f73ac3ee-4a6d-4a90-aa3f-f8dcab5b0b0b" + "SOUTHEASTASIA:20241128T091753Z:b9b1b6b8-5554-4ca4-9bfd-22c2b8e9a91a" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:13 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "103" + "X-MSEdge-Ref": [ + "Ref A: E340ADCB43E8433BA5EB9AF3EA17CC25 Ref B: MAA201060515051 Ref C: 2024-11-28T09:17:52Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:17:53 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_IISLogs' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "028a52d3-c19e-4f27-9fd7-1b0b1b0567a0" + "ae02cc85-8f11-4ede-a3b4-067c151609c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -496,32 +563,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "d5407aa7-2412-4d0a-a3d3-dc01ad818dfb" + "f27bc585-20f8-4f9c-8920-8c0ea52355b4" ], "x-ms-correlation-request-id": [ - "d5407aa7-2412-4d0a-a3d3-dc01ad818dfb" + "f27bc585-20f8-4f9c-8920-8c0ea52355b4" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125218Z:d5407aa7-2412-4d0a-a3d3-dc01ad818dfb" + "SOUTHEASTASIA:20241128T091758Z:f27bc585-20f8-4f9c-8920-8c0ea52355b4" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 9A473DE0CB28402D867BBE345A89DA40 Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:57Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:17 GMT" + "Thu, 28 Nov 2024 09:17:57 GMT" ], "Content-Length": [ "384" @@ -533,25 +612,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A15.5492550Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A55.3116659Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "4eb49314-cbd8-4334-9495-f1ec9980d176" + "47632c69-6ab2-47d9-8f82-6baf8d04d045" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -561,6 +639,7 @@ "83" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -568,32 +647,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "11ca8645-9521-4c89-9fc6-8788ec9d9807" + "f8c6b3a2-9f84-470b-8265-f1ae4d4dee72" ], "x-ms-correlation-request-id": [ - "11ca8645-9521-4c89-9fc6-8788ec9d9807" + "f8c6b3a2-9f84-470b-8265-f1ae4d4dee72" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125216Z:11ca8645-9521-4c89-9fc6-8788ec9d9807" + "SOUTHEASTASIA:20241128T091756Z:f8c6b3a2-9f84-470b-8265-f1ae4d4dee72" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 072CEF6A5BBC467C8DC1B092ECE56976 Ref B: MAA201060515051 Ref C: 2024-11-28T09:17:54Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:15 GMT" + "Thu, 28 Nov 2024 09:17:55 GMT" ], "Content-Length": [ "384" @@ -605,25 +696,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A15.5492550Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A55.3116659Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "028a52d3-c19e-4f27-9fd7-1b0b1b0567a0" + "ae02cc85-8f11-4ede-a3b4-067c151609c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -633,6 +723,7 @@ "84" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -640,32 +731,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "603b5649-95be-4c1b-8978-9eaa9d6eb38c" + "bcea2be9-bf5d-4b78-8d3f-047a73dc4f35" ], "x-ms-correlation-request-id": [ - "603b5649-95be-4c1b-8978-9eaa9d6eb38c" + "bcea2be9-bf5d-4b78-8d3f-047a73dc4f35" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125219Z:603b5649-95be-4c1b-8978-9eaa9d6eb38c" + "SOUTHEASTASIA:20241128T091800Z:bcea2be9-bf5d-4b78-8d3f-047a73dc4f35" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 98E2865AD75640B2A2F7DBF6DA6D95F2 Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:58Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:19 GMT" + "Thu, 28 Nov 2024 09:18:00 GMT" ], "Content-Length": [ "385" @@ -677,28 +780,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A19.1346169Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A59.9862421Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "7bdf109d-4a8c-4a3d-bf43-6d1444dc401e" + "a1802172-8efc-4c78-9279-b6cef77450bf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -706,35 +809,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "f841c730-d98f-460c-a795-a94d91fc7d00" + "8869f7a9-5cfb-4c6d-898b-82b476e86a67" ], "x-ms-correlation-request-id": [ - "f841c730-d98f-460c-a795-a94d91fc7d00" + "8869f7a9-5cfb-4c6d-898b-82b476e86a67" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125222Z:f841c730-d98f-460c-a795-a94d91fc7d00" + "SOUTHEASTASIA:20241128T091801Z:8869f7a9-5cfb-4c6d-898b-82b476e86a67" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 31FF638480FD4BB4B0847571303ECB4E Ref B: MAA201060515051 Ref C: 2024-11-28T09:18:01Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:22 GMT" + "Thu, 28 Nov 2024 09:18:00 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -743,28 +858,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b5bf6ae8-c3c7-4a8f-b4ee-6b4a255c8a5d" + "64077949-fc9a-4d6a-82a7-c9cc15ef1979" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -772,35 +887,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "a8f6415b-88a9-4aa8-9b98-428121cf7a5b" + "02a8a307-5c4a-4b7b-a140-53f2aa5d327a" ], "x-ms-correlation-request-id": [ - "a8f6415b-88a9-4aa8-9b98-428121cf7a5b" + "02a8a307-5c4a-4b7b-a140-53f2aa5d327a" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125226Z:a8f6415b-88a9-4aa8-9b98-428121cf7a5b" + "SOUTHEASTASIA:20241128T091807Z:02a8a307-5c4a-4b7b-a140-53f2aa5d327a" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7833A6C0EBD74C6C88A416B7520B931F Ref B: MAA201060514009 Ref C: 2024-11-28T09:18:06Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:26 GMT" + "Thu, 28 Nov 2024 09:18:06 GMT" ], "Content-Length": [ - "432" + "450" ], "Content-Type": [ "application/json; charset=utf-8" @@ -809,28 +936,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A24.5105456Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A05.4274006Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "7bdf109d-4a8c-4a3d-bf43-6d1444dc401e" + "a1802172-8efc-4c78-9279-b6cef77450bf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -838,65 +965,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "da77a132-3464-4143-b7e4-2e9d156c3daa" + "b0c616f6-2cc0-4668-af59-6b82f19fae71" ], "x-ms-correlation-request-id": [ - "da77a132-3464-4143-b7e4-2e9d156c3daa" + "b0c616f6-2cc0-4668-af59-6b82f19fae71" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125223Z:da77a132-3464-4143-b7e4-2e9d156c3daa" + "SOUTHEASTASIA:20241128T091803Z:b0c616f6-2cc0-4668-af59-6b82f19fae71" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:22 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "115" + "X-MSEdge-Ref": [ + "Ref A: 2BDB880EA9C5443CABA46E255E15F54E Ref B: MAA201060515051 Ref C: 2024-11-28T09:18:01Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:18:03 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_CustomLogCollection' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b5bf6ae8-c3c7-4a8f-b4ee-6b4a255c8a5d" + "64077949-fc9a-4d6a-82a7-c9cc15ef1979" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -904,32 +1040,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "d6de031f-0517-4c0a-9f3d-62dc6e09d322" + "d2006125-8004-4664-a8ae-dadbb5df2425" ], "x-ms-correlation-request-id": [ - "d6de031f-0517-4c0a-9f3d-62dc6e09d322" + "d2006125-8004-4664-a8ae-dadbb5df2425" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125227Z:d6de031f-0517-4c0a-9f3d-62dc6e09d322" + "SOUTHEASTASIA:20241128T091808Z:d2006125-8004-4664-a8ae-dadbb5df2425" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: DCE7C80124D44ED8943ADDBD854CED32 Ref B: MAA201060514009 Ref C: 2024-11-28T09:18:07Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:27 GMT" + "Thu, 28 Nov 2024 09:18:07 GMT" ], "Content-Length": [ "420" @@ -941,25 +1089,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A24.5105456Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A05.4274006Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "7bdf109d-4a8c-4a3d-bf43-6d1444dc401e" + "a1802172-8efc-4c78-9279-b6cef77450bf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -969,6 +1116,7 @@ "95" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -976,32 +1124,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "7e7f3218-1798-4805-b85b-f1e9cd948f56" + "01398287-5234-4757-9b3b-d44dc64ec30f" ], "x-ms-correlation-request-id": [ - "7e7f3218-1798-4805-b85b-f1e9cd948f56" + "01398287-5234-4757-9b3b-d44dc64ec30f" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125225Z:7e7f3218-1798-4805-b85b-f1e9cd948f56" + "SOUTHEASTASIA:20241128T091805Z:01398287-5234-4757-9b3b-d44dc64ec30f" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: CF7AA07329F844A397329D274728631F Ref B: MAA201060515051 Ref C: 2024-11-28T09:18:03Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:24 GMT" + "Thu, 28 Nov 2024 09:18:05 GMT" ], "Content-Length": [ "420" @@ -1013,25 +1173,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A24.5105456Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A05.4274006Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "b5bf6ae8-c3c7-4a8f-b4ee-6b4a255c8a5d" + "64077949-fc9a-4d6a-82a7-c9cc15ef1979" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1041,6 +1200,7 @@ "96" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1048,32 +1208,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "5583fc78-2a5d-480b-adab-5ad284bec5ac" + "24785759-c369-4d79-9486-22ba6f451023" ], "x-ms-correlation-request-id": [ - "5583fc78-2a5d-480b-adab-5ad284bec5ac" + "24785759-c369-4d79-9486-22ba6f451023" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125228Z:5583fc78-2a5d-480b-adab-5ad284bec5ac" + "SOUTHEASTASIA:20241128T091812Z:24785759-c369-4d79-9486-22ba6f451023" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F1787745AFF441B4AA2B9141C5A114BC Ref B: MAA201060514009 Ref C: 2024-11-28T09:18:08Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:28 GMT" + "Thu, 28 Nov 2024 09:18:11 GMT" ], "Content-Length": [ "421" @@ -1085,28 +1257,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A28.3386924Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A10.2990252Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "80856c20-966d-4877-a98a-9d867560851b" + "01bfa5c0-d159-4f6f-a300-32e501977aaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1114,35 +1286,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "22f0dd8b-0c3d-443b-8788-6ba057b5639c" + "61544b67-c2cd-46a6-8ba7-7789b97eccf0" ], "x-ms-correlation-request-id": [ - "22f0dd8b-0c3d-443b-8788-6ba057b5639c" + "61544b67-c2cd-46a6-8ba7-7789b97eccf0" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125231Z:22f0dd8b-0c3d-443b-8788-6ba057b5639c" + "SOUTHEASTASIA:20241128T091813Z:61544b67-c2cd-46a6-8ba7-7789b97eccf0" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 217CF92727E243478EF328A546BE097F Ref B: MAA201060514021 Ref C: 2024-11-28T09:18:12Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:31 GMT" + "Thu, 28 Nov 2024 09:18:13 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1151,28 +1335,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "aedc24ef-52d0-4039-94b1-9068e00e4127" + "ca41a0db-68b2-46ec-94ea-6aec8f392a13" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1180,35 +1364,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "a039e583-3963-427a-ad83-db471e78e4e1" + "5892b3e6-f91b-4c08-875b-24b3142bd1ea" ], "x-ms-correlation-request-id": [ - "a039e583-3963-427a-ad83-db471e78e4e1" + "5892b3e6-f91b-4c08-875b-24b3142bd1ea" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125236Z:a039e583-3963-427a-ad83-db471e78e4e1" + "SOUTHEASTASIA:20241128T091818Z:5892b3e6-f91b-4c08-875b-24b3142bd1ea" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: E3A190277B404668A989D7F012B1B300 Ref B: MAA201060516037 Ref C: 2024-11-28T09:18:17Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:36 GMT" + "Thu, 28 Nov 2024 09:18:17 GMT" ], "Content-Length": [ - "444" + "462" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1217,28 +1413,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A32.8158624Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A15.8233546Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "80856c20-966d-4877-a98a-9d867560851b" + "01bfa5c0-d159-4f6f-a300-32e501977aaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1246,65 +1442,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "060a44b2-fec0-4572-8f83-1011558f51a0" + "5584c2c5-582f-4834-90e3-c69ec927196e" ], "x-ms-correlation-request-id": [ - "060a44b2-fec0-4572-8f83-1011558f51a0" + "5584c2c5-582f-4834-90e3-c69ec927196e" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125231Z:060a44b2-fec0-4572-8f83-1011558f51a0" + "SOUTHEASTASIA:20241128T091814Z:5584c2c5-582f-4834-90e3-c69ec927196e" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:31 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "122" + "X-MSEdge-Ref": [ + "Ref A: 613FA7D638AA4C3EB8C1FFB8BBD47A95 Ref B: MAA201060514021 Ref C: 2024-11-28T09:18:14Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:18:14 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_LinuxPerformanceCollection' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "aedc24ef-52d0-4039-94b1-9068e00e4127" + "ca41a0db-68b2-46ec-94ea-6aec8f392a13" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1312,32 +1517,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "a32958b9-e5b1-4dde-bafa-76ed7ef9afa9" + "9e5ba200-bb80-4873-b356-ad71d68d79f0" ], "x-ms-correlation-request-id": [ - "a32958b9-e5b1-4dde-bafa-76ed7ef9afa9" + "9e5ba200-bb80-4873-b356-ad71d68d79f0" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125237Z:a32958b9-e5b1-4dde-bafa-76ed7ef9afa9" + "SOUTHEASTASIA:20241128T091819Z:9e5ba200-bb80-4873-b356-ad71d68d79f0" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 10EC7F0B26A241D9993DB132F69530D4 Ref B: MAA201060516037 Ref C: 2024-11-28T09:18:18Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:37 GMT" + "Thu, 28 Nov 2024 09:18:19 GMT" ], "Content-Length": [ "432" @@ -1349,25 +1566,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A32.8158624Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A15.8233546Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "80856c20-966d-4877-a98a-9d867560851b" + "01bfa5c0-d159-4f6f-a300-32e501977aaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1377,6 +1593,7 @@ "93" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1384,32 +1601,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "d0d84df8-4bbf-4b09-8f12-9479a4321140" + "426a0712-fdd7-409e-9a55-b7dcbef29336" ], "x-ms-correlation-request-id": [ - "d0d84df8-4bbf-4b09-8f12-9479a4321140" + "426a0712-fdd7-409e-9a55-b7dcbef29336" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125233Z:d0d84df8-4bbf-4b09-8f12-9479a4321140" + "SOUTHEASTASIA:20241128T091816Z:426a0712-fdd7-409e-9a55-b7dcbef29336" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: B899225916B147E5999B96D4754387AF Ref B: MAA201060514021 Ref C: 2024-11-28T09:18:14Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:33 GMT" + "Thu, 28 Nov 2024 09:18:16 GMT" ], "Content-Length": [ "432" @@ -1421,25 +1650,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A32.8158624Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A15.8233546Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "aedc24ef-52d0-4039-94b1-9068e00e4127" + "ca41a0db-68b2-46ec-94ea-6aec8f392a13" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1449,6 +1677,7 @@ "94" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1456,32 +1685,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "9689ea36-3cb1-4d21-9032-4b4b867f6b1e" + "67dc232b-3909-4619-9c60-68ebdde4b5ac" ], "x-ms-correlation-request-id": [ - "9689ea36-3cb1-4d21-9032-4b4b867f6b1e" + "67dc232b-3909-4619-9c60-68ebdde4b5ac" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125239Z:9689ea36-3cb1-4d21-9032-4b4b867f6b1e" + "SOUTHEASTASIA:20241128T091821Z:67dc232b-3909-4619-9c60-68ebdde4b5ac" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7B8C2D497DA14A669EE107FDD3F21619 Ref B: MAA201060516037 Ref C: 2024-11-28T09:18:19Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:39 GMT" + "Thu, 28 Nov 2024 09:18:20 GMT" ], "Content-Length": [ "433" @@ -1493,28 +1734,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A38.9698940Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A20.7606956Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "8f676f4f-3d1b-4044-93e6-887108dfab22" + "0163b032-b35b-4311-aa0f-fd93ee0328f6" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1522,35 +1763,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "ced69d59-6945-487b-8c4a-7789af0f44fd" + "690e549c-76e7-4ae2-bb97-07067fea6e74" ], "x-ms-correlation-request-id": [ - "ced69d59-6945-487b-8c4a-7789af0f44fd" + "690e549c-76e7-4ae2-bb97-07067fea6e74" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125241Z:ced69d59-6945-487b-8c4a-7789af0f44fd" + "SOUTHEASTASIA:20241128T091822Z:690e549c-76e7-4ae2-bb97-07067fea6e74" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F32094D14124476582688724F820017B Ref B: MAA201060514045 Ref C: 2024-11-28T09:18:21Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:41 GMT" + "Thu, 28 Nov 2024 09:18:22 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1559,28 +1812,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "6ca9d95a-2c55-4a37-ac68-c4c5e6a05f09" + "7e2a6662-06e2-44e1-aaf7-212adacb9fef" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1588,35 +1841,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "2622a637-b13c-45ce-bd30-8a8021c48601" + "eb35477d-75a6-445a-8f9d-9949ed2bd687" ], "x-ms-correlation-request-id": [ - "2622a637-b13c-45ce-bd30-8a8021c48601" + "eb35477d-75a6-445a-8f9d-9949ed2bd687" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125245Z:2622a637-b13c-45ce-bd30-8a8021c48601" + "SOUTHEASTASIA:20241128T091829Z:eb35477d-75a6-445a-8f9d-9949ed2bd687" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 96DFE2179BAB4153A0FCEBF5C6343002 Ref B: MAA201060516017 Ref C: 2024-11-28T09:18:27Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:45 GMT" + "Thu, 28 Nov 2024 09:18:28 GMT" ], "Content-Length": [ - "429" + "447" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1625,28 +1890,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A43.8046904Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A26.9582875Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "8f676f4f-3d1b-4044-93e6-887108dfab22" + "0163b032-b35b-4311-aa0f-fd93ee0328f6" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1654,65 +1919,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "c88414d3-267e-42ca-aece-808b5853bd03" + "4e881b8f-4e2b-4628-92fd-1c1faf3eab7c" ], "x-ms-correlation-request-id": [ - "c88414d3-267e-42ca-aece-808b5853bd03" + "4e881b8f-4e2b-4628-92fd-1c1faf3eab7c" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125242Z:c88414d3-267e-42ca-aece-808b5853bd03" + "SOUTHEASTASIA:20241128T091825Z:4e881b8f-4e2b-4628-92fd-1c1faf3eab7c" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:42 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "117" + "X-MSEdge-Ref": [ + "Ref A: E71080E2E4FA411499EC0B9E68363FB9 Ref B: MAA201060514045 Ref C: 2024-11-28T09:18:24Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:18:25 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_LinuxSyslogCollection' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "6ca9d95a-2c55-4a37-ac68-c4c5e6a05f09" + "7e2a6662-06e2-44e1-aaf7-212adacb9fef" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1720,32 +1994,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "5871d22f-ccfb-4334-9f1b-3684434b7a75" + "e34d2454-408e-4764-b453-961b71ef2973" ], "x-ms-correlation-request-id": [ - "5871d22f-ccfb-4334-9f1b-3684434b7a75" + "e34d2454-408e-4764-b453-961b71ef2973" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125246Z:5871d22f-ccfb-4334-9f1b-3684434b7a75" + "SOUTHEASTASIA:20241128T091830Z:e34d2454-408e-4764-b453-961b71ef2973" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 75984E64236D4BD5BA32858FDACED874 Ref B: MAA201060516017 Ref C: 2024-11-28T09:18:29Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:45 GMT" + "Thu, 28 Nov 2024 09:18:29 GMT" ], "Content-Length": [ "417" @@ -1757,25 +2043,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A43.8046904Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A26.9582875Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "8f676f4f-3d1b-4044-93e6-887108dfab22" + "0163b032-b35b-4311-aa0f-fd93ee0328f6" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1785,6 +2070,7 @@ "88" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1792,32 +2078,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "a900f068-c6af-4016-8440-f9f3ac2484f9" + "419c6e8e-d780-4a07-998e-b764e6ce0471" ], "x-ms-correlation-request-id": [ - "a900f068-c6af-4016-8440-f9f3ac2484f9" + "419c6e8e-d780-4a07-998e-b764e6ce0471" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125244Z:a900f068-c6af-4016-8440-f9f3ac2484f9" + "SOUTHEASTASIA:20241128T091827Z:419c6e8e-d780-4a07-998e-b764e6ce0471" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 613CDAD0F03043D8A0A3944C4B4C0612 Ref B: MAA201060514045 Ref C: 2024-11-28T09:18:25Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:44 GMT" + "Thu, 28 Nov 2024 09:18:27 GMT" ], "Content-Length": [ "417" @@ -1829,25 +2127,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A43.8046904Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A26.9582875Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "6ca9d95a-2c55-4a37-ac68-c4c5e6a05f09" + "7e2a6662-06e2-44e1-aaf7-212adacb9fef" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1857,6 +2154,7 @@ "89" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1864,32 +2162,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "9fdf1c4e-f4a5-47f8-8b04-a382a747bccb" + "6a353ebe-6ea0-41be-a31f-29e6e3c9c722" ], "x-ms-correlation-request-id": [ - "9fdf1c4e-f4a5-47f8-8b04-a382a747bccb" + "6a353ebe-6ea0-41be-a31f-29e6e3c9c722" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125248Z:9fdf1c4e-f4a5-47f8-8b04-a382a747bccb" + "SOUTHEASTASIA:20241128T091832Z:6a353ebe-6ea0-41be-a31f-29e6e3c9c722" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 5FC78B69491C4AF0AC9C86396450D682 Ref B: MAA201060516017 Ref C: 2024-11-28T09:18:30Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:47 GMT" + "Thu, 28 Nov 2024 09:18:31 GMT" ], "Content-Length": [ "418" @@ -1901,17 +2211,17 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A47.4284730Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A31.6797759Z'\\\"\"\r\n}", "StatusCode": 200 } ], "Names": { "Test-ToggleSingletonDataSourceState": [ - "ps8063", - "ps3388" + "ps6783", + "ps2050" ] }, "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" + "SubscriptionId": "0b1f6471-1bf0-4dda-aec3-cb9272f09590" } } \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.sln b/src/OperationalInsights/OperationalInsights.sln index 043698e4cafc..8052861ea419 100644 --- a/src/OperationalInsights/OperationalInsights.sln +++ b/src/OperationalInsights/OperationalInsights.sln @@ -5,46 +5,45 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Accounts", "Accounts", "{AD3998BD-3E51-44D1-A055-D7A9033ADB5D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{C893888E-9690-4DE5-9158-164C21009FB8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{C893888E-9690-4DE5-9158-164C21009FB8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{F63559FE-5FCD-440A-A685-A99438C4C31B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{F63559FE-5FCD-440A-A685-A99438C4C31B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{F3C54E60-D53B-478C-8173-BA9101AB3D58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{F3C54E60-D53B-478C-8173-BA9101AB3D58}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{ED803440-AD43-4EDC-9709-CF9C467543BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{ED803440-AD43-4EDC-9709-CF9C467543BD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{8BEB7055-A642-4387-8DF2-9ED7B43FEE4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{8BEB7055-A642-4387-8DF2-9ED7B43FEE4E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{E18F35D9-2F59-4668-9F74-F8A9BC1B3AEE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{E18F35D9-2F59-4668-9F74-F8A9BC1B3AEE}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{F1010D34-3CBD-4B21-96CB-6153B422A0EE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationalInsights.Test", "OperationalInsights.Test\OperationalInsights.Test.csproj", "{09EAF805-4AE7-4EC1-B76C-DD2808738AC9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationalInsights.Test", "OperationalInsights.Test\OperationalInsights.Test.csproj", "{09EAF805-4AE7-4EC1-B76C-DD2808738AC9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationalInsights", "OperationalInsights\OperationalInsights.csproj", "{42DF21A7-1002-488D-AE91-973EE23F3112}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationalInsights", "OperationalInsights\OperationalInsights.csproj", "{42DF21A7-1002-488D-AE91-973EE23F3112}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependentModules", "DependentModules", "{77B64301-6B96-4D75-B914-B4F3751E0F44}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Storage", "..\Storage\Storage.Autorest\Az.Storage.csproj", "{185FA7C2-EDC3-458D-8C3D-DB42DBE99EBE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Az.Storage", "..\Storage\Storage.Autorest\Az.Storage.csproj", "{185FA7C2-EDC3-458D-8C3D-DB42DBE99EBE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Management.Sdk", "..\Storage\Storage.Management.Sdk\Storage.Management.Sdk.csproj", "{3FDF69B9-5F16-4921-AACF-ABB660040E95}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.Management.Sdk", "..\Storage\Storage.Management.Sdk\Storage.Management.Sdk.csproj", "{3FDF69B9-5F16-4921-AACF-ABB660040E95}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Management", "..\Storage\Storage.Management\Storage.Management.csproj", "{B6467B71-8B8E-4A29-8159-EC8DBACF4691}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.Management", "..\Storage\Storage.Management\Storage.Management.csproj", "{B6467B71-8B8E-4A29-8159-EC8DBACF4691}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage", "..\Storage\Storage\Storage.csproj", "{9938F31A-07ED-4820-9CC2-4E7CB72D306B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage", "..\Storage\Storage\Storage.csproj", "{9938F31A-07ED-4820-9CC2-4E7CB72D306B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{A3828DB6-6110-4291-A0B2-C49D379B0032}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{A3828DB6-6110-4291-A0B2-C49D379B0032}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.common", "..\Storage\Storage.common\Storage.common.csproj", "{7A67C3ED-5F2E-4B1A-A96A-2A0757041078}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.common", "..\Storage\Storage.common\Storage.common.csproj", "{7A67C3ED-5F2E-4B1A-A96A-2A0757041078}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationalInsights.Management.Sdk", "OperationalInsights.Management.Sdk\OperationalInsights.Management.Sdk.csproj", "{131963B1-37FC-439C-A29A-9CC1BF264771}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C893888E-9690-4DE5-9158-164C21009FB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C893888E-9690-4DE5-9158-164C21009FB8}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -102,6 +101,13 @@ Global {7A67C3ED-5F2E-4B1A-A96A-2A0757041078}.Debug|Any CPU.Build.0 = Debug|Any CPU {7A67C3ED-5F2E-4B1A-A96A-2A0757041078}.Release|Any CPU.ActiveCfg = Release|Any CPU {7A67C3ED-5F2E-4B1A-A96A-2A0757041078}.Release|Any CPU.Build.0 = Release|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Debug|Any CPU.Build.0 = Debug|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Release|Any CPU.ActiveCfg = Release|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {C893888E-9690-4DE5-9158-164C21009FB8} = {AD3998BD-3E51-44D1-A055-D7A9033ADB5D} diff --git a/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 b/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 index 4f41d5f956f8..69d5396ce1dd 100644 --- a/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 +++ b/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 @@ -54,7 +54,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.0'; }) # Assemblies that must be loaded prior to importing this module -RequiredAssemblies = 'Microsoft.Azure.Management.OperationalInsights.dll', +RequiredAssemblies = 'Microsoft.Azure.PowerShell.OperationalInsights.Management.Sdk.dll', 'Microsoft.Azure.OperationalInsights.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. diff --git a/src/OperationalInsights/OperationalInsights/ChangeLog.md b/src/OperationalInsights/OperationalInsights/ChangeLog.md index d6b6c2a29037..62bebfa51d2b 100644 --- a/src/OperationalInsights/OperationalInsights/ChangeLog.md +++ b/src/OperationalInsights/OperationalInsights/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Removed "Microsoft.Azure.Management.OperationalInsights" Version "0.25.0-preview" PackageReference. ## Version 3.2.1 * Fixed an issue that `Invoke-AzOperationalInsightsQuery` timed out after 100 seconds. The timeout is now bound to the `-Wait` parameter. (#16553) diff --git a/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs b/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs index 1afa6f80268b..579e88a4f869 100644 --- a/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs +++ b/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs @@ -41,7 +41,7 @@ public virtual List ListDataSources(string resourceGroupName, stri // List data sources by kind var response = OperationalInsightsManagementClient.DataSources.ListByWorkspace( - new ODataQuery(ds => ds.Kind == kind), resourceGroupName, workspaceName); + resourceGroupName, workspaceName, new ODataQuery(ds => ds.Kind == kind)); while (null != response) { diff --git a/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs b/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs index cc9d56f67bcb..91987a96d6ff 100644 --- a/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs +++ b/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs @@ -62,7 +62,7 @@ public PSLinkedService(LinkedService service) public LinkedService getLinkedService() { - return new LinkedService(this.Id, this.Name, this.Type, this.ResourceId, this.WriteAccessResourceId, this.ProvisioningState, this.Tags); + return new LinkedService(this.Id, this.Name, this.Type, this.Tags, this.ResourceId, this.WriteAccessResourceId, this.ProvisioningState); } } } diff --git a/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj b/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj index 0a395d405caf..e95b419fccb5 100644 --- a/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj +++ b/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj @@ -11,10 +11,13 @@ - + + + + True