diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs index eaea993e4501a..376c4e0c76b87 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs @@ -301,31 +301,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// The parameters required to create or update a data export. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// 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. /// /// @@ -346,7 +321,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -401,6 +376,21 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); } + if (dataExportName != null) + { + if (dataExportName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dataExportName", 63); + } + if (dataExportName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "dataExportName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -412,6 +402,14 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -422,8 +420,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -444,7 +443,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -475,6 +474,12 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -495,7 +500,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -550,6 +555,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -558,7 +581,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) } /// - /// Deletes the specified data export in a given workspace.. + /// Gets a data export instance. /// /// /// The name of the resource group. The name is case insensitive. @@ -578,6 +601,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -587,7 +613,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -664,7 +690,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -685,7 +711,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -736,7 +762,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -766,13 +792,31 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -781,7 +825,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) } /// - /// Create or update a data export. + /// Deletes the specified data export in a given workspace.. /// /// /// The name of the resource group. The name is case insensitive. @@ -792,9 +836,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The data export rule name. /// - /// - /// The parameters required to create or update a data export. - /// /// /// Headers that will be added to request. /// @@ -804,9 +845,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -816,7 +854,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -871,21 +909,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); } - if (dataExportName != null) - { - if (dataExportName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "dataExportName", 63); - } - if (dataExportName.Length < 4) - { - throw new ValidationException(ValidationRules.MinLength, "dataExportName", 4); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); - } - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -897,14 +920,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -915,9 +930,8 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -938,7 +952,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -969,12 +983,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -995,7 +1003,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1025,49 +1033,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs index 1c66796d291b0..579f127cfcb6b 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs @@ -204,57 +204,5 @@ public static void Delete(this IDataExportsOperations operations, string resourc (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// 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 parameters required to create or update a data export. - /// - public static DataExport BeginCreateOrUpdate(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters) - { - return operations.BeginCreateOrUpdateAsync(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 parameters required to create or update a data export. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs index d639cc5d97eed..99bd7ae113124 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs @@ -132,36 +132,5 @@ public partial interface IDataExportsOperations /// Thrown when a required parameter is null /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs index e4797a04c8909..d87630e84e72a 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs @@ -35,7 +35,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -68,7 +68,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// /// /// The headers that will be added to request. @@ -95,7 +95,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// /// /// The headers that will be added to request. diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs index fdd744e341c93..683662c620eef 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs @@ -164,5 +164,10 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IWorkspacePurgeOperations WorkspacePurge { get; } + /// + /// Gets the ITablesOperations. + /// + ITablesOperations Tables { get; } + } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs new file mode 100644 index 0000000000000..ca6f5c42b6fb5 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs @@ -0,0 +1,112 @@ +// +// 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; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TablesOperations operations. + /// + public partial interface ITablesOperations + { + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The data table data retention in days, between 30 and 730. Setting + /// this property to null will default to the workspace retention. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs index 2a235255d6a94..b29569397b4ef 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs @@ -62,7 +62,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -324,7 +324,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Headers that will be added to request. @@ -550,7 +550,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Headers that will be added to request. diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs index 4f52d4a3056f5..327017b8e9b28 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs @@ -38,7 +38,7 @@ public static partial class LinkedStorageAccountsOperationsExtensions /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -63,7 +63,7 @@ public static partial class LinkedStorageAccountsOperationsExtensions /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -94,7 +94,7 @@ public static partial class LinkedStorageAccountsOperationsExtensions /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// public static void Delete(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) { @@ -116,7 +116,7 @@ public static void Delete(this ILinkedStorageAccountsOperations operations, stri /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// The cancellation token. @@ -141,7 +141,7 @@ public static void Delete(this ILinkedStorageAccountsOperations operations, stri /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) { @@ -163,7 +163,7 @@ public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOpera /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// The cancellation token. diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs index 462039c50dc8e..1c2618c5baeb5 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs @@ -46,7 +46,7 @@ public AvailableServiceTier() /// 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?), System.DateTime? lastSkuUpdate = default(System.DateTime?)) + 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)) { ServiceTier = serviceTier; Enabled = enabled; @@ -107,7 +107,7 @@ public AvailableServiceTier() /// for the Capacity Reservation Service Tier. /// [JsonProperty(PropertyName = "lastSkuUpdate")] - public System.DateTime? LastSkuUpdate { get; private set; } + public string LastSkuUpdate { get; private set; } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs index 2dd6da4550e91..4923d59a4ac3d 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs @@ -14,9 +14,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource model definition for a Azure Resource Manager resource - /// with an etag. + /// Entity Resource /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// public partial class AzureEntityResource : Resource { /// @@ -30,12 +33,12 @@ public AzureEntityResource() /// /// Initializes a new instance of the AzureEntityResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// 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) diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs index 060c0f46674c7..cbd7d9d50e0b7 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs @@ -36,12 +36,12 @@ public Cluster() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. /// The identity of the resource. /// The sku properties. diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs index 878942a6cd8d1..22c7831f8f9e0 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs @@ -35,14 +35,12 @@ public DataExport() /// /// Initializes a new instance of the DataExport class. /// + /// An array of tables to export, for example: + /// [“Heartbeat, SecurityEvent”]. /// The destination resource ID. This can be /// copied from the Properties entry of the destination resource in /// Azure. /// The data export rule ID. - /// When ‘true’, all workspace's tables are - /// exported. - /// An array of tables to export, for example: - /// [“Heartbeat, SecurityEvent”]. /// The type of the destination resource. /// Possible values include: 'StorageAccount', 'EventHub' /// Optional. Allows to define an Event Hub @@ -52,10 +50,9 @@ public DataExport() /// time. /// Date and time when the export was /// last modified. - public DataExport(string resourceId, string dataExportId = default(string), bool? allTables = default(bool?), IList tableNames = default(IList), string dataExportType = default(string), string eventHubName = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string)) + public DataExport(IList tableNames, string resourceId, string dataExportId = default(string), string dataExportType = default(string), string eventHubName = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string)) { DataExportId = dataExportId; - AllTables = allTables; TableNames = tableNames; ResourceId = resourceId; DataExportType = dataExportType; @@ -77,12 +74,6 @@ public DataExport() [JsonProperty(PropertyName = "properties.dataExportId")] public string DataExportId { get; set; } - /// - /// Gets or sets when ‘true’, all workspace's tables are exported. - /// - [JsonProperty(PropertyName = "properties.allTables")] - public bool? AllTables { get; set; } - /// /// Gets or sets an array of tables to export, for example: /// [“Heartbeat, SecurityEvent”]. @@ -137,6 +128,10 @@ public DataExport() /// public virtual void Validate() { + if (TableNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TableNames"); + } if (ResourceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.cs new file mode 100644 index 0000000000000..78ed4da9ec3c0 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.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 +{ + + /// + /// 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"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs index cc95f10c6a6e1..62ec50342b71d 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs @@ -50,19 +50,19 @@ public DataSource() /// 'SecurityInsightsSecurityEventCollectionConfiguration', /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', /// 'ApplicationInsights', 'SqlDataClassification' - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. - /// The ETag of the data source. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The ETag of the data source. /// Resource tags. - public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), IDictionary tags = default(IDictionary)) + public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) { Properties = properties; - ETag = eTag; + Etag = etag; Kind = kind; Tags = tags; CustomInit(); @@ -83,8 +83,8 @@ public DataSource() /// /// Gets or sets the ETag of the data source. /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } /// /// Gets or sets possible values include: 'WindowsEvent', diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs index 1a23f4bf9d0a0..9a20d7347e55c 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs @@ -24,7 +24,11 @@ public enum DataSourceType [EnumMember(Value = "CustomLogs")] CustomLogs, [EnumMember(Value = "AzureWatson")] - AzureWatson + AzureWatson, + [EnumMember(Value = "Query")] + Query, + [EnumMember(Value = "Alerts")] + Alerts } internal static class DataSourceTypeEnumExtension { @@ -41,6 +45,10 @@ internal static string ToSerializedValue(this DataSourceType value) return "CustomLogs"; case DataSourceType.AzureWatson: return "AzureWatson"; + case DataSourceType.Query: + return "Query"; + case DataSourceType.Alerts: + return "Alerts"; } return null; } @@ -53,6 +61,10 @@ internal static string ToSerializedValue(this DataSourceType value) return DataSourceType.CustomLogs; case "AzureWatson": return DataSourceType.AzureWatson; + case "Query": + return DataSourceType.Query; + case "Alerts": + return DataSourceType.Alerts; } return null; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorContract.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorContract.cs new file mode 100644 index 0000000000000..a5ed5c3bb6b1a --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorContract.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details. + /// + /// + /// Contains details when the response code indicates an error. + /// + public partial class ErrorContract + { + /// + /// Initializes a new instance of the ErrorContract class. + /// + public ErrorContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorContract class. + /// + /// The details of the error. + public ErrorContract(ErrorResponse error = default(ErrorResponse)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the details of the error. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorContractException.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorContractException.cs new file mode 100644 index 0000000000000..4e8de9c3b5c9a --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorContractException.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 Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorContract + /// information. + /// + public partial class ErrorContractException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorContract Body { get; set; } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + public ErrorContractException() + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + public ErrorContractException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + /// Inner exception. + public ErrorContractException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs index 00b0ece7d8dd6..295a3591e492c 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs @@ -16,8 +16,13 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource management error response. + /// Error Response /// + /// + /// 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 { /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs index 2676c7fdf67d8..56b3f4f15a128 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs @@ -34,12 +34,12 @@ public LinkedService() /// /// Initializes a new instance of the LinkedService class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The resource id of the resource that will /// be linked to the workspace. This should be used for linking /// resources which require read access diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs index 262005085c3b5..9ea1f0c6c7317 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs @@ -36,14 +36,15 @@ public LinkedStorageAccountsResource() /// Initializes a new instance of the LinkedStorageAccountsResource /// class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Linked storage accounts type. Possible - /// values include: 'CustomLogs', 'AzureWatson' + /// 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?), IList storageAccountIds = default(IList)) @@ -61,7 +62,7 @@ public LinkedStorageAccountsResource() /// /// Gets linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// [JsonProperty(PropertyName = "properties.dataSourceType")] public DataSourceType? DataSourceType { get; private set; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs index 56d9b449ab599..431122ae6974e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs @@ -13,9 +13,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource model definition for a ARM proxy resource. It will have - /// everything other than required location and tags + /// Proxy Resource /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// public partial class ProxyResource : Resource { /// @@ -29,12 +32,12 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// 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) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs index 5a7efcc5738c3..da86706ff9566 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs @@ -15,6 +15,13 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using Newtonsoft.Json; using System.Linq; + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -28,12 +35,12 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// 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)) { Id = id; @@ -48,7 +55,7 @@ public Resource() partial void CustomInit(); /// - /// Gets fully qualified resource Id for the resource. Ex - + /// Gets fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] @@ -61,9 +68,9 @@ public Resource() public string Name { get; private set; } /// - /// Gets the type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs index 18fae783328c7..1a3466d18f798 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs @@ -37,17 +37,15 @@ public SavedSearch() /// 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. - /// Please see - /// https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference - /// for reference. - /// Fully qualified resource Id for the resource. Ex - + /// The query expression for the saved + /// search. + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. - /// The ETag of the saved search. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The ETag of the saved search. /// The function alias if query serves as a /// function. /// The optional function parameters @@ -59,10 +57,10 @@ public SavedSearch() /// 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?), IList tags = default(IList)) + 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?), IList tags = default(IList)) : base(id, name, type) { - ETag = eTag; + Etag = etag; Category = category; DisplayName = displayName; Query = query; @@ -81,8 +79,8 @@ public SavedSearch() /// /// Gets or sets the ETag of the saved search. /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } /// /// Gets or sets the category of the saved search. This helps the user @@ -98,9 +96,7 @@ public SavedSearch() public string DisplayName { get; set; } /// - /// Gets or sets the query expression for the saved search. Please see - /// https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference - /// for reference. + /// Gets or sets the query expression for the saved search. /// [JsonProperty(PropertyName = "properties.query")] public string Query { get; set; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs index 2e9977c5a013f..0e95b99f9a8fa 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs @@ -36,12 +36,12 @@ public StorageInsight() /// /// The storage account connection /// details - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The names of the blob containers that the /// workspace should read /// The names of the Azure tables that the diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs new file mode 100644 index 0000000000000..cb912d5f41a53 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs @@ -0,0 +1,82 @@ +// +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace data table definition. + /// + [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" + /// The data table data retention in + /// days, between 30 and 730. Setting this property to null will + /// default to the workspace retention. + public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?)) + : base(id, name, type) + { + RetentionInDays = retentionInDays; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the data table data retention in days, between 30 and + /// 730. Setting this property to null will default to the workspace + /// retention. + /// + [JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RetentionInDays > 730) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + } + if (RetentionInDays < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 30); + } + } + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs index 532847382815d..3bf49fa1ae27f 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs @@ -17,8 +17,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource model definition for a ARM tracked top level resource + /// Tracked Resource /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// public partial class TrackedResource : Resource { /// @@ -34,12 +38,12 @@ public TrackedResource() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs index 6a80c04c246db..79f5dd92ac361 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs @@ -36,12 +36,12 @@ public Workspace() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. /// The provisioning state of the /// workspace. Possible values include: 'Creating', 'Succeeded', @@ -50,9 +50,10 @@ public Workspace() /// This is a read-only property. Represents /// the ID associated with the workspace. /// The SKU of the workspace. - /// The workspace data retention in days. - /// -1 means Unlimited retention for the Unlimited Sku. 730 days is the - /// maximum allowed for all other Skus. + /// The workspace data retention in days, + /// between 30 and 730. + /// The daily volume cap for + /// ingestion. /// The network access /// type for accessing Log Analytics ingestion. Possible values /// include: 'Enabled', 'Disabled' @@ -62,13 +63,14 @@ public Workspace() /// List of linked private /// link scope resources. /// The ETag of the workspace. - public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), IList privateLinkScopedResources = default(IList), string eTag = default(string)) + public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), IList privateLinkScopedResources = default(IList), string eTag = default(string)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; CustomerId = customerId; Sku = sku; RetentionInDays = retentionInDays; + WorkspaceCapping = workspaceCapping; PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; PublicNetworkAccessForQuery = publicNetworkAccessForQuery; PrivateLinkScopedResources = privateLinkScopedResources; @@ -103,13 +105,18 @@ public Workspace() public WorkspaceSku Sku { get; set; } /// - /// Gets or sets the workspace data retention in days. -1 means - /// Unlimited retention for the Unlimited Sku. 730 days is the maximum - /// allowed for all other Skus. + /// Gets or sets the workspace data retention in days, between 30 and + /// 730. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping { get; set; } + /// /// Gets or sets the network access type for accessing Log Analytics /// ingestion. Possible values include: 'Enabled', 'Disabled' @@ -153,9 +160,9 @@ public override void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); } - if (RetentionInDays < -1) + if (RetentionInDays < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", -1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 30); } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.cs new file mode 100644 index 0000000000000..21334397f8a0e --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.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 Newtonsoft.Json; + 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)) + { + DailyQuotaGb = dailyQuotaGb; + QuotaNextResetTime = quotaNextResetTime; + 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. + /// + [JsonProperty(PropertyName = "dailyQuotaGb")] + public double? DailyQuotaGb { get; set; } + + /// + /// Gets the time when the quota will be rest. + /// + [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' + /// + [JsonProperty(PropertyName = "dataIngestionStatus")] + public string DataIngestionStatus { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs index c70424073d7fe..077609259e38b 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs @@ -34,12 +34,12 @@ public WorkspacePatch() /// /// Initializes a new instance of the WorkspacePatch class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource Etag. /// The provisioning state of the /// workspace. Possible values include: 'Creating', 'Succeeded', @@ -48,9 +48,10 @@ public WorkspacePatch() /// This is a read-only property. Represents /// the ID associated with the workspace. /// The SKU of the workspace. - /// The workspace data retention in days. - /// -1 means Unlimited retention for the Unlimited Sku. 730 days is the - /// maximum allowed for all other Skus. + /// The workspace data retention in days, + /// between 30 and 730. + /// The daily volume cap for + /// ingestion. /// The network access /// type for accessing Log Analytics ingestion. Possible values /// include: 'Enabled', 'Disabled' @@ -60,13 +61,14 @@ public WorkspacePatch() /// List of linked private /// link scope resources. /// Resource tags. Optional. - public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), IList privateLinkScopedResources = default(IList), IDictionary tags = default(IDictionary)) + public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), IList privateLinkScopedResources = default(IList), IDictionary tags = default(IDictionary)) : base(id, name, type, etag) { ProvisioningState = provisioningState; CustomerId = customerId; Sku = sku; RetentionInDays = retentionInDays; + WorkspaceCapping = workspaceCapping; PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; PublicNetworkAccessForQuery = publicNetworkAccessForQuery; PrivateLinkScopedResources = privateLinkScopedResources; @@ -101,13 +103,18 @@ public WorkspacePatch() public WorkspaceSku Sku { get; set; } /// - /// Gets or sets the workspace data retention in days. -1 means - /// Unlimited retention for the Unlimited Sku. 730 days is the maximum - /// allowed for all other Skus. + /// Gets or sets the workspace data retention in days, between 30 and + /// 730. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping { get; set; } + /// /// Gets or sets the network access type for accessing Log Analytics /// ingestion. Possible values include: 'Enabled', 'Disabled' @@ -150,9 +157,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); } - if (RetentionInDays < -1) + if (RetentionInDays < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", -1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 30); } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs index 089b4582fe4b6..d980186dc9272 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs @@ -33,9 +33,20 @@ public WorkspaceSku() /// The name of the SKU. Possible values include: /// 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', /// 'Standalone', 'CapacityReservation' - public WorkspaceSku(string name) + /// The capacity reservation + /// level for this workspace, when CapacityReservation sku is + /// selected. + /// The maximum capacity + /// reservation level available for this workspace, when + /// CapacityReservation sku is selected. + /// The last time when the sku was + /// updated. + public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), int? maxCapacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) { Name = name; + CapacityReservationLevel = capacityReservationLevel; + MaxCapacityReservationLevel = maxCapacityReservationLevel; + LastSkuUpdate = lastSkuUpdate; CustomInit(); } @@ -52,6 +63,26 @@ public WorkspaceSku(string name) [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets the capacity reservation level for this workspace, + /// when CapacityReservation sku is selected. + /// + [JsonProperty(PropertyName = "capacityReservationLevel")] + public int? CapacityReservationLevel { get; set; } + + /// + /// Gets the maximum capacity reservation level available for this + /// workspace, when CapacityReservation sku is selected. + /// + [JsonProperty(PropertyName = "maxCapacityReservationLevel")] + public int? MaxCapacityReservationLevel { get; private set; } + + /// + /// Gets the last time when the sku was updated. + /// + [JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs index 5847d07adee8a..a1d66e3ac663f 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs @@ -169,6 +169,11 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } + /// + /// Gets the ITablesOperations. + /// + public virtual ITablesOperations Tables { get; private set; } + /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -429,8 +434,9 @@ private void Initialize() Gateways = new GatewaysOperations(this); Schema = new SchemaOperations(this); WorkspacePurge = new WorkspacePurgeOperations(this); + Tables = new TablesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-03-01-preview"; + ApiVersion = "2020-08-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs index b3ea3aa28bba0..6b0be0fda13ff 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs @@ -19,38 +19,28 @@ public static IEnumerable> ApiInfo_OperationalInsi { return new Tuple[] { - new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Clusters", "2020-03-01-preview"), - new Tuple("OperationalInsights", "DataExports", "2020-03-01-preview"), - new Tuple("OperationalInsights", "DataSources", "2020-03-01-preview"), - new Tuple("OperationalInsights", "DeletedWorkspaces", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Gateways", "2020-03-01-preview"), - new Tuple("OperationalInsights", "IntelligencePacks", "2020-03-01-preview"), - new Tuple("OperationalInsights", "LinkedServices", "2020-03-01-preview"), - new Tuple("OperationalInsights", "LinkedStorageAccounts", "2020-03-01-preview"), - new Tuple("OperationalInsights", "ManagementGroups", "2020-03-01-preview"), - new Tuple("OperationalInsights", "OperationStatuses", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Operations", "2020-03-01-preview"), - new Tuple("OperationalInsights", "SavedSearches", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Schema", "2020-03-01-preview"), - new Tuple("OperationalInsights", "SharedKeys", "2020-03-01-preview"), - new Tuple("OperationalInsights", "StorageInsightConfigs", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Usages", "2020-03-01-preview"), - new Tuple("OperationalInsights", "WorkspacePurge", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Workspaces", "2020-03-01-preview"), + new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-08-01"), + new Tuple("OperationalInsights", "Clusters", "2020-08-01"), + new Tuple("OperationalInsights", "DataExports", "2020-08-01"), + new Tuple("OperationalInsights", "DataSources", "2020-08-01"), + new Tuple("OperationalInsights", "DeletedWorkspaces", "2020-08-01"), + new Tuple("OperationalInsights", "Gateways", "2020-08-01"), + new Tuple("OperationalInsights", "IntelligencePacks", "2020-08-01"), + new Tuple("OperationalInsights", "LinkedServices", "2020-08-01"), + new Tuple("OperationalInsights", "LinkedStorageAccounts", "2020-08-01"), + new Tuple("OperationalInsights", "ManagementGroups", "2020-08-01"), + new Tuple("OperationalInsights", "OperationStatuses", "2020-08-01"), + new Tuple("OperationalInsights", "Operations", "2020-08-01"), + new Tuple("OperationalInsights", "SavedSearches", "2020-08-01"), + new Tuple("OperationalInsights", "Schema", "2020-08-01"), + new Tuple("OperationalInsights", "SharedKeys", "2020-08-01"), + new Tuple("OperationalInsights", "StorageInsightConfigs", "2020-08-01"), + new Tuple("OperationalInsights", "Tables", "2020-08-01"), + new Tuple("OperationalInsights", "Usages", "2020-08-01"), + new Tuple("OperationalInsights", "WorkspacePurge", "2020-08-01"), + new Tuple("OperationalInsights", "Workspaces", "2020-08-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/operationalinsights/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\workspace\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "b069b0fa4817788d6363007645cae04317864f09"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs new file mode 100644 index 0000000000000..f1aa95a965d15 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs @@ -0,0 +1,801 @@ +// +// 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; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TablesOperations operations. + /// + internal partial class TablesOperations : 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"); + } + 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 Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(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 ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = 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(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(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 ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (retentionInDays > 730) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "retentionInDays", 730); + } + if (retentionInDays < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "retentionInDays", 30); + } + Table parameters = new Table(); + if (retentionInDays != null) + { + parameters.RetentionInDays = retentionInDays; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = 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(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)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// 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 Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(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 ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse
(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs new file mode 100644 index 0000000000000..f73975ec44bff --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs @@ -0,0 +1,167 @@ +// +// 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; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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 IEnumerable
ListByWorkspace(this ITablesOperations operations, string resourceGroupName, string workspaceName) + { + return 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 Task> ListByWorkspaceAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// 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 data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. + /// + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?)) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, retentionInDays).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// 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 data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. + /// + /// + /// The cancellation token. + /// + public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, retentionInDays, 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 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 Task
GetAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}