diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs index ad9af4775f53..87d703abf18f 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs @@ -105,7 +105,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -229,7 +229,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -285,7 +285,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -407,7 +407,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -535,7 +535,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,6 +693,31 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// The parameters required to patch a Log Analytics cluster. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// /// Headers that will be added to request. /// /// @@ -713,7 +738,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -730,14 +755,6 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -749,7 +766,34 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (clusterName != null) + { + if (clusterName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "clusterName", 63); + } + if (clusterName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "clusterName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -758,18 +802,18 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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/clusters/{clusterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -782,7 +826,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -839,7 +883,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -894,6 +938,24 @@ internal ClustersOperations(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); @@ -902,16 +964,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) } /// - /// Create or update a Log Analytics cluster. + /// Deletes a cluster instance. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the Log Analytics cluster. - /// - /// - /// The parameters required to create or update a Log Analytics cluster. + /// Name of the Log Analytics Cluster. /// /// /// Headers that will be added to request. @@ -922,9 +981,6 @@ internal ClustersOperations(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 /// @@ -934,7 +990,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -951,6 +1007,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -962,34 +1022,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (clusterName != null) - { - if (clusterName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "clusterName", 63); - } - if (clusterName.Length < 4) - { - throw new ValidationException(ValidationRules.MinLength, "clusterName", 4); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) - { - throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); - } - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -998,18 +1031,17 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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/clusters/{clusterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1022,7 +1054,7 @@ internal ClustersOperations(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) @@ -1053,12 +1085,6 @@ internal ClustersOperations(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) { @@ -1079,7 +1105,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1109,49 +1135,13 @@ internal ClustersOperations(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); @@ -1160,7 +1150,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) } /// - /// Deletes a cluster instance. + /// Updates a Log Analytics cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -1168,6 +1158,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// Name of the Log Analytics Cluster. /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// /// /// Headers that will be added to request. /// @@ -1177,6 +1170,9 @@ internal ClustersOperations(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 /// @@ -1186,7 +1182,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1207,6 +1203,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1218,7 +1218,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1228,9 +1228,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1250,7 +1251,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1281,6 +1282,12 @@ internal ClustersOperations(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) { @@ -1301,7 +1308,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1331,13 +1338,31 @@ internal ClustersOperations(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); @@ -1494,7 +1519,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1662,7 +1687,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperationsExtensions.cs index ffb1e05060c4..d999fd7ef830 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperationsExtensions.cs @@ -335,6 +335,52 @@ public static void BeginDelete(this IClustersOperations operations, string resou (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + public static Cluster BeginUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets Log Analytics clusters in a resource group. /// 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 27af932a800e..9171c0ad1109 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs @@ -253,7 +253,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs index 97787bc75aee..c5e7fea9eff7 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs @@ -1007,7 +1007,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1181,7 +1181,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs index a14d340b0e56..b042bc8bf45e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs @@ -87,7 +87,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -209,7 +209,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -284,7 +284,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -408,7 +408,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs index 21b4ab592431..595be09e83b2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs @@ -220,6 +220,34 @@ public partial interface IClustersOperations /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets Log Analytics clusters in a resource group. /// /// 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 cb2480311f55..02cd9ac12edf 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs @@ -64,6 +64,26 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Gets the IDeletedWorkspacesOperations. + /// + IDeletedWorkspacesOperations DeletedWorkspaces { get; } + + /// + /// Gets the ITablesOperations. + /// + ITablesOperations Tables { get; } + /// /// Gets the IDataExportsOperations. /// @@ -139,30 +159,10 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IWorkspacePurgeOperations WorkspacePurge { get; } - /// - /// Gets the ITablesOperations. - /// - ITablesOperations Tables { get; } - /// /// Gets the IClustersOperations. /// IClustersOperations Clusters { get; } - /// - /// Gets the IOperations. - /// - IOperations Operations { get; } - - /// - /// Gets the IWorkspacesOperations. - /// - IWorkspacesOperations Workspaces { get; } - - /// - /// Gets the IDeletedWorkspacesOperations. - /// - IDeletedWorkspacesOperations DeletedWorkspaces { 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 index 025b88ee9237..4b2e43bd9240 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs @@ -49,7 +49,7 @@ public partial interface ITablesOperations /// Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a Log Analytics workspace table properties. + /// Update or Create a Log Analytics workspace table. /// /// /// The name of the resource group. The name is case insensitive. @@ -60,9 +60,8 @@ public partial interface ITablesOperations /// /// 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 parameters required to update table properties. /// /// /// The headers that will be added to request. @@ -79,7 +78,38 @@ public partial interface ITablesOperations /// /// 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)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a Log Analytics workspace table. /// @@ -108,5 +138,144 @@ public partial interface ITablesOperations /// Thrown when a required parameter is null /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Migrate a Log Analytics table from support of the Data Collector + /// API and Custom Fields features to support of Data Collection + /// Rule-based Custom Logs. + /// + /// + /// 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 a required parameter is null + /// + Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs index ddd74e1d7517..45807f9649f1 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs @@ -547,7 +547,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs index f7fc3caf4da3..c90001a1a49f 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs @@ -955,7 +955,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs index acb18638c085..2f2228980c0e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs @@ -258,7 +258,7 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs index e893322523f2..18d66429ce55 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs @@ -34,13 +34,10 @@ public CapacityReservationProperties() /// The last time Sku was updated. /// Minimum CapacityReservation value in /// GB. - /// Maximum CapacityReservation value in - /// GB. - public CapacityReservationProperties(string lastSkuUpdate = default(string), long? minCapacity = default(long?), long? maxCapacity = default(long?)) + public CapacityReservationProperties(string lastSkuUpdate = default(string), long? minCapacity = default(long?)) { LastSkuUpdate = lastSkuUpdate; MinCapacity = minCapacity; - MaxCapacity = maxCapacity; CustomInit(); } @@ -61,11 +58,5 @@ public CapacityReservationProperties() [JsonProperty(PropertyName = "minCapacity")] public long? MinCapacity { get; private set; } - /// - /// Gets maximum CapacityReservation value in GB. - /// - [JsonProperty(PropertyName = "maxCapacity")] - public long? MaxCapacity { get; private set; } - } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Column.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Column.cs new file mode 100644 index 000000000000..93c8f432af90 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Column.cs @@ -0,0 +1,104 @@ +// +// 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; + + /// + /// Table column. + /// + public partial class Column + { + /// + /// Initializes a new instance of the Column class. + /// + public Column() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Column class. + /// + /// Column name. + /// Column data type. Possible values include: + /// 'string', 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', + /// 'dynamic' + /// Column data type logical hint. Possible + /// values include: 'uri', 'guid', 'armPath', 'ip' + /// Column display name. + /// Column description. + /// Is displayed by default. + /// Is column hidden. + public Column(string name = default(string), string type = default(string), string dataTypeHint = default(string), string displayName = default(string), string description = default(string), bool? isDefaultDisplay = default(bool?), bool? isHidden = default(bool?)) + { + Name = name; + Type = type; + DataTypeHint = dataTypeHint; + DisplayName = displayName; + Description = description; + IsDefaultDisplay = isDefaultDisplay; + IsHidden = isHidden; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets column name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets column data type. Possible values include: 'string', + /// 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', 'dynamic' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets column data type logical hint. Possible values + /// include: 'uri', 'guid', 'armPath', 'ip' + /// + [JsonProperty(PropertyName = "dataTypeHint")] + public string DataTypeHint { get; set; } + + /// + /// Gets or sets column display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets column description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets is displayed by default. + /// + [JsonProperty(PropertyName = "isDefaultDisplay")] + public bool? IsDefaultDisplay { get; private set; } + + /// + /// Gets is column hidden. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ColumnDataTypeHintEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ColumnDataTypeHintEnum.cs new file mode 100644 index 000000000000..5bcd8dfc9b2d --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ColumnDataTypeHintEnum.cs @@ -0,0 +1,40 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ColumnDataTypeHintEnum. + /// + public static class ColumnDataTypeHintEnum + { + /// + /// A string that matches the pattern of a URI, for example, + /// scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment + /// + public const string Uri = "uri"; + /// + /// A standard 128-bit GUID following the standard shape, + /// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// + public const string Guid = "guid"; + /// + /// An Azure Resource Model (ARM) path: + /// /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}... + /// + public const string ArmPath = "armPath"; + /// + /// A standard V4/V6 ip address following the standard shape, + /// x.x.x.x/y:y:y:y:y:y:y:y + /// + public const string Ip = "ip"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ColumnTypeEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ColumnTypeEnum.cs new file mode 100644 index 000000000000..dec674236591 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ColumnTypeEnum.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ColumnTypeEnum. + /// + public static class ColumnTypeEnum + { + public const string String = "string"; + public const string Int = "int"; + public const string Long = "long"; + public const string Real = "real"; + public const string Boolean = "boolean"; + public const string DateTime = "dateTime"; + public const string Guid = "guid"; + public const string Dynamic = "dynamic"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CreatedByType.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..c2d6149cd9ce --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page.cs index 35074c8d3dca..aaf4ca1c0238 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page.cs @@ -26,7 +26,7 @@ public class Page : IPage /// /// Gets the link to the next page. /// - [JsonProperty("")] + [JsonProperty("nextLink")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page1.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page1.cs index fa22cb49d324..4950adfade26 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page1.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Page1.cs @@ -26,7 +26,7 @@ public class Page1 : IPage /// /// Gets the link to the next page. /// - [JsonProperty("nextLink")] + [JsonProperty("")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProvisioningStateEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProvisioningStateEnum.cs new file mode 100644 index 000000000000..fee961764b03 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProvisioningStateEnum.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ProvisioningStateEnum. + /// + public static class ProvisioningStateEnum + { + /// + /// Table schema is still being built and updated, table is currently + /// locked for any changes till the procedure is done. + /// + public const string Updating = "Updating"; + /// + /// Table schema is stable and without changes, table data is being + /// updated. + /// + public const string InProgress = "InProgress"; + /// + /// Table state is stable and without changes, table is unlocked and + /// open for new updates. + /// + public const string Succeeded = "Succeeded"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/RestoredLogs.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/RestoredLogs.cs new file mode 100644 index 000000000000..99ccb6c4208c --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/RestoredLogs.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Restore parameters. + /// + public partial class RestoredLogs + { + /// + /// Initializes a new instance of the RestoredLogs class. + /// + public RestoredLogs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestoredLogs class. + /// + /// The timestamp to start the restore + /// from (UTC). + /// The timestamp to end the restore by + /// (UTC). + /// The table to restore data from. + public RestoredLogs(System.DateTime? startRestoreTime = default(System.DateTime?), System.DateTime? endRestoreTime = default(System.DateTime?), string sourceTable = default(string)) + { + StartRestoreTime = startRestoreTime; + EndRestoreTime = endRestoreTime; + SourceTable = sourceTable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the timestamp to start the restore from (UTC). + /// + [JsonProperty(PropertyName = "startRestoreTime")] + public System.DateTime? StartRestoreTime { get; set; } + + /// + /// Gets or sets the timestamp to end the restore by (UTC). + /// + [JsonProperty(PropertyName = "endRestoreTime")] + public System.DateTime? EndRestoreTime { get; set; } + + /// + /// Gets or sets the table to restore data from. + /// + [JsonProperty(PropertyName = "sourceTable")] + public string SourceTable { get; set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ResultStatistics.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ResultStatistics.cs new file mode 100644 index 000000000000..3a23a9ae4e74 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ResultStatistics.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Search job execution statistics. + /// + public partial class ResultStatistics + { + /// + /// Initializes a new instance of the ResultStatistics class. + /// + public ResultStatistics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResultStatistics class. + /// + /// Search job completion percentage. + /// The number of rows that were returned + /// by the search job. + public ResultStatistics(double? progress = default(double?), int? ingestedRecords = default(int?)) + { + Progress = progress; + IngestedRecords = ingestedRecords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets search job completion percentage. + /// + [JsonProperty(PropertyName = "progress")] + public double? Progress { get; private set; } + + /// + /// Gets the number of rows that were returned by the search job. + /// + [JsonProperty(PropertyName = "ingestedRecords")] + public int? IngestedRecords { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Progress % 0.01 != 0) + { + throw new ValidationException(ValidationRules.MultipleOf, "Progress", 0.01); + } + } + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Schema.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Schema.cs new file mode 100644 index 000000000000..b5e09561fbbb --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Schema.cs @@ -0,0 +1,162 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Table's schema. + /// + public partial class Schema + { + /// + /// Initializes a new instance of the Schema class. + /// + public Schema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Schema class. + /// + /// Table name. + /// Table display name. + /// Table description. + /// A list of table custom columns. + /// A list of table standard + /// columns. + /// Table category. + /// Table labels. + /// Table's creator. Possible values include: + /// 'microsoft', 'customer' + /// Table's creator. Possible values include: + /// 'Microsoft', 'CustomLog', 'RestoredLogs', 'SearchResults' + /// The subtype describes what APIs can be + /// used to interact with the table, and what features are available + /// against it. Possible values include: 'Any', 'Classic', + /// 'DataCollectionRuleBased' + /// List of solutions the table is affiliated + /// with + /// Parameters of the search job that + /// initiated this table. + /// Parameters of the restore operation that + /// initiated this table. + public Schema(string name = default(string), string displayName = default(string), string description = default(string), IList columns = default(IList), IList standardColumns = default(IList), IList categories = default(IList), IList labels = default(IList), string source = default(string), string tableType = default(string), string tableSubType = default(string), IList solutions = default(IList), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs)) + { + Name = name; + DisplayName = displayName; + Description = description; + Columns = columns; + StandardColumns = standardColumns; + Categories = categories; + Labels = labels; + Source = source; + TableType = tableType; + TableSubType = tableSubType; + Solutions = solutions; + SearchResults = searchResults; + RestoredLogs = restoredLogs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets table name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets table display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets table description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a list of table custom columns. + /// + [JsonProperty(PropertyName = "columns")] + public IList Columns { get; set; } + + /// + /// Gets a list of table standard columns. + /// + [JsonProperty(PropertyName = "standardColumns")] + public IList StandardColumns { get; private set; } + + /// + /// Gets table category. + /// + [JsonProperty(PropertyName = "categories")] + public IList Categories { get; private set; } + + /// + /// Gets table labels. + /// + [JsonProperty(PropertyName = "labels")] + public IList Labels { get; private set; } + + /// + /// Gets table's creator. Possible values include: 'microsoft', + /// 'customer' + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; private set; } + + /// + /// Gets table's creator. Possible values include: 'Microsoft', + /// 'CustomLog', 'RestoredLogs', 'SearchResults' + /// + [JsonProperty(PropertyName = "tableType")] + public string TableType { get; private set; } + + /// + /// Gets the subtype describes what APIs can be used to interact with + /// the table, and what features are available against it. Possible + /// values include: 'Any', 'Classic', 'DataCollectionRuleBased' + /// + [JsonProperty(PropertyName = "tableSubType")] + public string TableSubType { get; private set; } + + /// + /// Gets list of solutions the table is affiliated with + /// + [JsonProperty(PropertyName = "solutions")] + public IList Solutions { get; private set; } + + /// + /// Gets parameters of the search job that initiated this table. + /// + [JsonProperty(PropertyName = "searchResults")] + public SearchResults SearchResults { get; private set; } + + /// + /// Gets parameters of the restore operation that initiated this table. + /// + [JsonProperty(PropertyName = "restoredLogs")] + public RestoredLogs RestoredLogs { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SearchResults.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SearchResults.cs new file mode 100644 index 000000000000..8675e189c120 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SearchResults.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Parameters of the search job that initiated this table. + /// + public partial class SearchResults + { + /// + /// Initializes a new instance of the SearchResults class. + /// + public SearchResults() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResults class. + /// + /// Search job query. + /// Search job Description. + /// Limit the search job to return up to specified + /// number of rows. + /// The timestamp to start the search + /// from (UTC) + /// The timestamp to end the search by + /// (UTC) + /// The table used in the search job. + public SearchResults(string query = default(string), string description = default(string), int? limit = default(int?), System.DateTime? startSearchTime = default(System.DateTime?), System.DateTime? endSearchTime = default(System.DateTime?), string sourceTable = default(string)) + { + Query = query; + Description = description; + Limit = limit; + StartSearchTime = startSearchTime; + EndSearchTime = endSearchTime; + SourceTable = sourceTable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets search job query. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// Gets or sets search job Description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets limit the search job to return up to specified number + /// of rows. + /// + [JsonProperty(PropertyName = "limit")] + public int? Limit { get; set; } + + /// + /// Gets or sets the timestamp to start the search from (UTC) + /// + [JsonProperty(PropertyName = "startSearchTime")] + public System.DateTime? StartSearchTime { get; set; } + + /// + /// Gets or sets the timestamp to end the search by (UTC) + /// + [JsonProperty(PropertyName = "endSearchTime")] + public System.DateTime? EndSearchTime { get; set; } + + /// + /// Gets the table used in the search job. + /// + [JsonProperty(PropertyName = "sourceTable")] + public string SourceTable { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SourceEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SourceEnum.cs new file mode 100644 index 000000000000..1174fdc4c720 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SourceEnum.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for SourceEnum. + /// + public static class SourceEnum + { + /// + /// Tables provisioned by the system, as collected via Diagnostic + /// Settings, the Agents, or any other standard data collection means. + /// + public const string Microsoft = "microsoft"; + /// + /// Tables created by the owner of the Workspace, and only found in + /// this Workspace. + /// + public const string Customer = "customer"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SystemData.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..964c4aa5e6b6 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} 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 index cb912d5f41a5..e770071c0dc8 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs @@ -38,13 +38,46 @@ public Table() /// 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?)) + /// The table retention in days, between + /// 4 and 730. Setting this property to -1 will default to the + /// workspace retention. + /// The table total retention in + /// days, between 4 and 2555. Setting this property to -1 will default + /// to table retention. + /// The table data archive + /// retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// Parameters of the search job that + /// initiated this table. + /// Parameters of the restore operation that + /// initiated this table. + /// Search job execution + /// statistics. + /// Instruct the system how to handle and charge the + /// logs ingested to this table. Possible values include: 'Basic', + /// 'Analytics' + /// The timestamp that table plan + /// was last modified (UTC). + /// Table schema. + /// Table's current provisioning state. + /// If set to 'updating', indicates a resource lock due to ongoing + /// operation, forbidding any update to the table until the ongoing + /// operation is concluded. Possible values include: 'Updating', + /// 'InProgress', 'Succeeded' + public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), string plan = default(string), string lastPlanModifiedDate = default(string), Schema schema = default(Schema), string provisioningState = default(string), SystemData systemData = default(SystemData)) : base(id, name, type) { RetentionInDays = retentionInDays; + TotalRetentionInDays = totalRetentionInDays; + ArchiveRetentionInDays = archiveRetentionInDays; + SearchResults = searchResults; + RestoredLogs = restoredLogs; + ResultStatistics = resultStatistics; + Plan = plan; + LastPlanModifiedDate = lastPlanModifiedDate; + Schema = schema; + ProvisioningState = provisioningState; + SystemData = systemData; CustomInit(); } @@ -54,13 +87,81 @@ public Table() 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 + /// Gets or sets the table retention in days, between 4 and 730. + /// Setting this property to -1 will default to the workspace /// retention. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } + /// + /// Gets or sets the table total retention in days, between 4 and 2555. + /// Setting this property to -1 will default to table retention. + /// + [JsonProperty(PropertyName = "properties.totalRetentionInDays")] + public int? TotalRetentionInDays { get; set; } + + /// + /// Gets the table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + [JsonProperty(PropertyName = "properties.archiveRetentionInDays")] + public int? ArchiveRetentionInDays { get; private set; } + + /// + /// Gets or sets parameters of the search job that initiated this + /// table. + /// + [JsonProperty(PropertyName = "properties.searchResults")] + public SearchResults SearchResults { get; set; } + + /// + /// Gets or sets parameters of the restore operation that initiated + /// this table. + /// + [JsonProperty(PropertyName = "properties.restoredLogs")] + public RestoredLogs RestoredLogs { get; set; } + + /// + /// Gets or sets search job execution statistics. + /// + [JsonProperty(PropertyName = "properties.resultStatistics")] + public ResultStatistics ResultStatistics { get; set; } + + /// + /// Gets or sets instruct the system how to handle and charge the logs + /// ingested to this table. Possible values include: 'Basic', + /// 'Analytics' + /// + [JsonProperty(PropertyName = "properties.plan")] + public string Plan { get; set; } + + /// + /// Gets the timestamp that table plan was last modified (UTC). + /// + [JsonProperty(PropertyName = "properties.lastPlanModifiedDate")] + public string LastPlanModifiedDate { get; private set; } + + /// + /// Gets or sets table schema. + /// + [JsonProperty(PropertyName = "properties.schema")] + public Schema Schema { get; set; } + + /// + /// Gets table's current provisioning state. If set to 'updating', + /// indicates a resource lock due to ongoing operation, forbidding any + /// update to the table until the ongoing operation is concluded. + /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// @@ -73,9 +174,21 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); } - if (RetentionInDays < 30) + if (RetentionInDays < 4) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 4); + } + if (TotalRetentionInDays > 2555) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); + } + if (TotalRetentionInDays < 4) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); + } + if (ResultStatistics != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 30); + ResultStatistics.Validate(); } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TablePlanEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TablePlanEnum.cs new file mode 100644 index 000000000000..7a408029858f --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TablePlanEnum.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for TablePlanEnum. + /// + public static class TablePlanEnum + { + /// + /// Logs that are adjusted to support high volume low value verbose + /// logs. + /// + public const string Basic = "Basic"; + /// + /// Logs that allow monitoring and analytics. + /// + public const string Analytics = "Analytics"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TableSubTypeEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TableSubTypeEnum.cs new file mode 100644 index 000000000000..66290ed88e5e --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TableSubTypeEnum.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for TableSubTypeEnum. + /// + public static class TableSubTypeEnum + { + /// + /// The default subtype with which built-in tables are created. + /// + public const string Any = "Any"; + /// + /// Indicates a table created through the Data Collector API or with + /// the custom logs feature of the MMA agent, or any table against + /// which Custom Fields were created. + /// + public const string Classic = "Classic"; + /// + /// A table eligible to have data sent into it via any of the means + /// supported by Data Collection Rules: the Data Collection Endpoint + /// API, ingestion-time transformations, or any other mechanism + /// provided by Data Collection Rules + /// + public const string DataCollectionRuleBased = "DataCollectionRuleBased"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TableTypeEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TableTypeEnum.cs new file mode 100644 index 000000000000..c0a47dc4ff49 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TableTypeEnum.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for TableTypeEnum. + /// + public static class TableTypeEnum + { + /// + /// Standard data collected by Azure Monitor. + /// + public const string Microsoft = "Microsoft"; + /// + /// Custom log table. + /// + public const string CustomLog = "CustomLog"; + /// + /// Restored data. + /// + public const string RestoredLogs = "RestoredLogs"; + /// + /// Data collected by a search job. + /// + public const string SearchResults = "SearchResults"; + } +} 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 7352bd87ead9..30cfa30eaef6 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 @@ -68,8 +68,12 @@ public Workspace() /// List of linked private /// link scope resources. /// Workspace features. + /// The resource ID + /// of the default Data Collection Rule to use for this workspace. + /// Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. /// 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?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), 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 createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string), SystemData systemData = default(SystemData), string eTag = default(string)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; @@ -84,6 +88,8 @@ public Workspace() ForceCmkForQuery = forceCmkForQuery; PrivateLinkScopedResources = privateLinkScopedResources; Features = features; + DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + SystemData = systemData; ETag = eTag; CustomInit(); } @@ -94,12 +100,12 @@ public Workspace() partial void CustomInit(); /// - /// Gets or sets the provisioning state of the workspace. Possible - /// values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', - /// 'Deleting', 'ProvisioningAccount', 'Updating' + /// Gets the provisioning state of the workspace. Possible values + /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + /// 'ProvisioningAccount', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets this is a read-only property. Represents the ID associated @@ -172,6 +178,19 @@ public Workspace() [JsonProperty(PropertyName = "properties.features")] public WorkspaceFeatures Features { get; set; } + /// + /// Gets or sets the resource ID of the default Data Collection Rule to + /// use for this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Gets or sets the ETag of the workspace. /// 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 c3480de74f13..308ed59db14d 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 @@ -66,8 +66,12 @@ public WorkspacePatch() /// List of linked private /// link scope resources. /// Workspace features. + /// The resource ID + /// of the default Data Collection Rule to use for this workspace. + /// Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. /// 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?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), 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 createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type, etag) { ProvisioningState = provisioningState; @@ -82,6 +86,7 @@ public WorkspacePatch() ForceCmkForQuery = forceCmkForQuery; PrivateLinkScopedResources = privateLinkScopedResources; Features = features; + DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; Tags = tags; CustomInit(); } @@ -92,12 +97,12 @@ public WorkspacePatch() partial void CustomInit(); /// - /// Gets or sets the provisioning state of the workspace. Possible - /// values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', - /// 'Deleting', 'ProvisioningAccount', 'Updating' + /// Gets the provisioning state of the workspace. Possible values + /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + /// 'ProvisioningAccount', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets this is a read-only property. Represents the ID associated @@ -170,6 +175,14 @@ public WorkspacePatch() [JsonProperty(PropertyName = "properties.features")] public WorkspaceFeatures Features { get; set; } + /// + /// Gets or sets the resource ID of the default Data Collection Rule to + /// use for this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId { get; set; } + /// /// Gets or sets resource tags. Optional. /// 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 9870c99eb53d..7a9c6153a300 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 @@ -34,7 +34,7 @@ public WorkspaceSku() /// 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', /// 'Standalone', 'CapacityReservation', 'LACluster' /// The capacity reservation - /// level for this workspace, when CapacityReservation sku is + /// level in GB for this workspace, when CapacityReservation sku is /// selected. /// The last time when the sku was /// updated. @@ -60,8 +60,8 @@ public WorkspaceSku() public string Name { get; set; } /// - /// Gets or sets the capacity reservation level for this workspace, - /// when CapacityReservation sku is selected. + /// Gets or sets the capacity reservation level in GB for this + /// workspace, when CapacityReservation sku is selected. /// [JsonProperty(PropertyName = "capacityReservationLevel")] public int? CapacityReservationLevel { get; set; } 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 be3cc94869c9..e01f0a23d6f5 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs @@ -69,6 +69,26 @@ public partial class OperationalInsightsManagementClient : ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Gets the IDeletedWorkspacesOperations. + /// + public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } + + /// + /// Gets the ITablesOperations. + /// + public virtual ITablesOperations Tables { get; private set; } + /// /// Gets the IDataExportsOperations. /// @@ -144,31 +164,11 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } - /// - /// Gets the ITablesOperations. - /// - public virtual ITablesOperations Tables { get; private set; } - /// /// Gets the IClustersOperations. /// public virtual IClustersOperations Clusters { get; private set; } - /// - /// Gets the IOperations. - /// - public virtual IOperations Operations { get; private set; } - - /// - /// Gets the IWorkspacesOperations. - /// - public virtual IWorkspacesOperations Workspaces { get; private set; } - - /// - /// Gets the IDeletedWorkspacesOperations. - /// - public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -410,6 +410,10 @@ public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCred /// private void Initialize() { + Operations = new Operations(this); + Workspaces = new WorkspacesOperations(this); + DeletedWorkspaces = new DeletedWorkspacesOperations(this); + Tables = new TablesOperations(this); DataExports = new DataExportsOperations(this); DataSources = new DataSourcesOperations(this); IntelligencePacks = new IntelligencePacksOperations(this); @@ -425,11 +429,7 @@ private void Initialize() Gateways = new GatewaysOperations(this); Schema = new SchemaOperations(this); WorkspacePurge = new WorkspacePurgeOperations(this); - Tables = new TablesOperations(this); Clusters = new ClustersOperations(this); - Operations = new Operations(this); - Workspaces = new WorkspacesOperations(this); - DeletedWorkspaces = new DeletedWorkspacesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs index 9a6f47727500..8780c7fb6d41 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(OperationalInsightsManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -191,7 +191,7 @@ internal Operations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -359,7 +359,7 @@ internal Operations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs index 5fa7f8f684fd..0d1aeeb16983 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 @@ -20,38 +20,27 @@ public static IEnumerable> ApiInfo_OperationalInsi return new Tuple[] { new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-08-01"), - new Tuple("OperationalInsights", "Clusters", "2020-10-01"), + new Tuple("OperationalInsights", "Clusters", "2021-06-01"), new Tuple("OperationalInsights", "DataExports", "2020-08-01"), new Tuple("OperationalInsights", "DataSources", "2020-08-01"), - new Tuple("OperationalInsights", "DeletedWorkspaces", "2020-10-01"), + new Tuple("OperationalInsights", "DeletedWorkspaces", "2021-12-01-preview"), 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-10-01"), + new Tuple("OperationalInsights", "Operations", "2021-12-01-preview"), 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", "Tables", "2021-12-01-preview"), new Tuple("OperationalInsights", "Usages", "2020-08-01"), new Tuple("OperationalInsights", "WorkspacePurge", "2020-08-01"), - new Tuple("OperationalInsights", "Workspaces", "2020-10-01"), + new Tuple("OperationalInsights", "Workspaces", "2021-12-01-preview"), }.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=C:\\One\\SDK\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "036c2de2b40ad05a1542b665a9e8bda18c813194"; - 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 index 485f0c2c11fd..68ab5674a04a 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs @@ -127,7 +127,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - string apiVersion = "2020-08-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -253,7 +253,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -273,7 +273,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) } /// - /// Updates a Log Analytics workspace table properties. + /// Update or Create a Log Analytics workspace table. /// /// /// The name of the resource group. The name is case insensitive. @@ -284,9 +284,532 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// 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 parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse
_response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async 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 (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 (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2021-12-01-preview"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse
(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task MigrateWithHttpMessagesAsync(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 (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 (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2021-12-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Migrate", 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}/migrate").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. /// /// /// Headers that will be added to request. @@ -309,7 +832,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// 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)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -360,20 +883,15 @@ internal TablesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - if (retentionInDays > 730) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "retentionInDays", 730); - } - if (retentionInDays < 30) + if (parameters == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "retentionInDays", 30); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-08-01"; - Table parameters = new Table(); - if (retentionInDays != null) + if (parameters != null) { - parameters.RetentionInDays = retentionInDays; + parameters.Validate(); } + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -387,7 +905,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("tableName", tableName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -408,7 +926,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -465,7 +983,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -528,7 +1046,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) } /// - /// Gets a Log Analytics workspace table. + /// Update a Log Analytics workspace table. /// /// /// The name of the resource group. The name is case insensitive. @@ -539,6 +1057,9 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The name of the table. /// + /// + /// The parameters required to update table properties. + /// /// /// Headers that will be added to request. /// @@ -560,7 +1081,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// 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)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -611,7 +1132,11 @@ internal TablesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-08-01"; + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -623,8 +1148,9 @@ internal TablesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -645,7 +1171,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -676,6 +1202,12 @@ internal TablesOperations(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) { @@ -696,7 +1228,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -758,5 +1290,215 @@ internal TablesOperations(OperationalInsightsManagementClient client) return _result; } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(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 (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 (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2021-12-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = 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(); + } + 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 index f73975ec44bf..cecdd43a657e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs @@ -64,7 +64,7 @@ public static IEnumerable
ListByWorkspace(this ITablesOperations operatio } /// - /// Updates a Log Analytics workspace table properties. + /// Update or Create a Log Analytics workspace table. /// /// /// The operations group for this extension method. @@ -78,17 +78,16 @@ public static IEnumerable
ListByWorkspace(this ITablesOperations operatio /// /// 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 parameters required to update table properties. /// - public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?)) + public static Table CreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) { - return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, retentionInDays).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); } /// - /// Updates a Log Analytics workspace table properties. + /// Update or Create a Log Analytics workspace table. /// /// /// The operations group for this extension method. @@ -102,16 +101,67 @@ public static IEnumerable
ListByWorkspace(this ITablesOperations operatio /// /// 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 parameters required to update table properties. /// /// /// 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)) + public static async Task
CreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, retentionInDays, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -163,5 +213,242 @@ public static Table Get(this ITablesOperations operations, string resourceGroupN } } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Delete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Migrate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + operations.MigrateAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task MigrateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table BeginCreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
BeginCreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table BeginUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
BeginUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void BeginDelete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs index e63973ff6ca1..9dc81912a309 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs @@ -258,7 +258,7 @@ internal UsagesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs index 37411b702c16..37ea4a2bed6a 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs @@ -87,7 +87,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -209,7 +209,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -283,7 +283,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -407,7 +407,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -557,7 +557,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -786,7 +786,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1026,7 +1026,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1277,7 +1277,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2021-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null;