From c9d76e2e8e9fdb523b17f69d422b3ede2947019a Mon Sep 17 00:00:00 2001 From: daniel ben-hamoo Date: Thu, 6 May 2021 17:30:24 +0300 Subject: [PATCH] changed back Tables api version from 2020-10 to 2020-08 --- .../operationalinsights_resource-manager.txt | 4 +- .../IOperationalInsightsManagementClient.cs | 10 ++--- .../src/Generated/ITablesOperations.cs | 7 ++-- .../src/Generated/Models/Table.cs | 41 +++---------------- .../src/Generated/Models/WorkspaceSku.cs | 13 +----- .../OperationalInsightsManagementClient.cs | 12 +++--- ...nfo_OperationalInsightsManagementClient.cs | 4 +- .../src/Generated/TablesOperations.cs | 26 ++++++++---- .../Generated/TablesOperationsExtensions.cs | 18 ++++---- ...zure.Management.OperationalInsights.csproj | 4 +- .../src/Properties/AssemblyInfo.cs | 4 +- 11 files changed, 58 insertions(+), 85 deletions(-) diff --git a/eng/mgmt/mgmtmetadata/operationalinsights_resource-manager.txt b/eng/mgmt/mgmtmetadata/operationalinsights_resource-manager.txt index e586f276731c..5d002c6b36aa 100644 --- a/eng/mgmt/mgmtmetadata/operationalinsights_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/operationalinsights_resource-manager.txt @@ -4,11 +4,11 @@ Commencing code generation Generating CSharp code Executing AutoRest command 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_repos\azure-sdk-for-net\sdk -2021-04-22 06:48:20 UTC +2021-05-06 14:00:15 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: e5839301dfd424559851119c99ef0a2699fbd228 +Commit: e401e457b5e95941f241f5c71bc56d42d431a4e0 AutoRest information Requested version: v2 Bootstrapper version: autorest@2.0.4413 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 86c103586017..cb2480311f55 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs @@ -139,6 +139,11 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IWorkspacePurgeOperations WorkspacePurge { get; } + /// + /// Gets the ITablesOperations. + /// + ITablesOperations Tables { get; } + /// /// Gets the IClustersOperations. /// @@ -149,11 +154,6 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IOperations Operations { get; } - /// - /// Gets the ITablesOperations. - /// - ITablesOperations Tables { get; } - /// /// Gets the IWorkspacesOperations. /// 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 c8f8aa790a4e..025b88ee9237 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs @@ -60,8 +60,9 @@ public partial interface ITablesOperations /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting + /// this property to null will default to the workspace retention. /// /// /// The headers that will be added to request. @@ -78,7 +79,7 @@ public partial interface ITablesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a Log Analytics workspace table. /// 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 afd2355aae7d..cb912d5f41a5 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 @@ -39,22 +39,12 @@ public Table() /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" /// The data table data retention in - /// days, between 7 and 730. Setting this property to null will default - /// to the workspace retention. - /// Specifies if - /// IsTroubleshootingEnabled property can be set for this - /// table. - /// Enable or disable troubleshoot - /// for this table. - /// Last time when troubleshooting - /// was set for this table. - public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?), bool? isTroubleshootingAllowed = default(bool?), bool? isTroubleshootEnabled = default(bool?), string lastTroubleshootDate = default(string)) + /// days, between 30 and 730. Setting this property to null will + /// default to the workspace retention. + public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?)) : base(id, name, type) { RetentionInDays = retentionInDays; - IsTroubleshootingAllowed = isTroubleshootingAllowed; - IsTroubleshootEnabled = isTroubleshootEnabled; - LastTroubleshootDate = lastTroubleshootDate; CustomInit(); } @@ -64,32 +54,13 @@ public Table() partial void CustomInit(); /// - /// Gets or sets the data table data retention in days, between 7 and + /// Gets or sets the data table data retention in days, between 30 and /// 730. Setting this property to null will default to the workspace /// retention. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } - /// - /// Gets specifies if IsTroubleshootingEnabled property can be set for - /// this table. - /// - [JsonProperty(PropertyName = "properties.isTroubleshootingAllowed")] - public bool? IsTroubleshootingAllowed { get; private set; } - - /// - /// Gets or sets enable or disable troubleshoot for this table. - /// - [JsonProperty(PropertyName = "properties.isTroubleshootEnabled")] - public bool? IsTroubleshootEnabled { get; set; } - - /// - /// Gets last time when troubleshooting was set for this table. - /// - [JsonProperty(PropertyName = "properties.lastTroubleshootDate")] - public string LastTroubleshootDate { get; private set; } - /// /// Validate the object. /// @@ -102,9 +73,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); } - if (RetentionInDays < 7) + if (RetentionInDays < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 7); + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 30); } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs index 4544409f382e..9870c99eb53d 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 @@ -36,16 +36,12 @@ public WorkspaceSku() /// The capacity reservation /// level for this workspace, when CapacityReservation sku is /// selected. - /// The maximum capacity - /// reservation level available for this workspace, when - /// CapacityReservation sku is selected. /// The last time when the sku was /// updated. - public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), int? maxCapacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) + public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) { Name = name; CapacityReservationLevel = capacityReservationLevel; - MaxCapacityReservationLevel = maxCapacityReservationLevel; LastSkuUpdate = lastSkuUpdate; CustomInit(); } @@ -70,13 +66,6 @@ public WorkspaceSku() [JsonProperty(PropertyName = "capacityReservationLevel")] public int? CapacityReservationLevel { get; set; } - /// - /// Gets the maximum capacity reservation level available for this - /// workspace, when CapacityReservation sku is selected. - /// - [JsonProperty(PropertyName = "maxCapacityReservationLevel")] - public int? MaxCapacityReservationLevel { get; private set; } - /// /// Gets the last time when the sku was updated. /// 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 96bbd379fa5d..be3cc94869c9 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs @@ -144,6 +144,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. /// @@ -154,11 +159,6 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IOperations Operations { get; private set; } - /// - /// Gets the ITablesOperations. - /// - public virtual ITablesOperations Tables { get; private set; } - /// /// Gets the IWorkspacesOperations. /// @@ -425,9 +425,9 @@ 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); - Tables = new TablesOperations(this); Workspaces = new WorkspacesOperations(this); DeletedWorkspaces = new DeletedWorkspacesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); 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 4ef8c223541c..a877b3e64272 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 @@ -35,7 +35,7 @@ public static IEnumerable> ApiInfo_OperationalInsi 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-10-01"), + new Tuple("OperationalInsights", "Tables", "2020-08-01"), new Tuple("OperationalInsights", "Usages", "2020-08-01"), new Tuple("OperationalInsights", "WorkspacePurge", "2020-08-01"), new Tuple("OperationalInsights", "Workspaces", "2020-10-01"), @@ -48,7 +48,7 @@ public static IEnumerable> ApiInfo_OperationalInsi 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_repos\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e5839301dfd424559851119c99ef0a2699fbd228"; + public static readonly String GithubCommidId = "e401e457b5e95941f241f5c71bc56d42d431a4e0"; 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 194ae186e9cc..df656c603066 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs @@ -131,7 +131,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-10-01"; + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -288,8 +288,9 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. /// /// /// Headers that will be added to request. @@ -312,7 +313,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, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -367,11 +368,20 @@ internal TablesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - if (parameters == null) + if (retentionInDays > 730) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "retentionInDays", 730); + } + if (retentionInDays < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "retentionInDays", 30); + } + string apiVersion = "2020-08-01"; + Table parameters = new Table(); + if (retentionInDays != null) + { + parameters.RetentionInDays = retentionInDays; } - string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -613,7 +623,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-10-01"; + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 9578086d4a28..f73975ec44bf 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs @@ -78,12 +78,13 @@ public static IEnumerable ListByWorkspace(this ITablesOperations operatio /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. /// - public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?)) { - return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, retentionInDays).GetAwaiter().GetResult(); } /// @@ -101,15 +102,16 @@ public static Table Update(this ITablesOperations operations, string resourceGro /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. /// /// /// The cancellation token. /// - public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, retentionInDays, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Microsoft.Azure.Management.OperationalInsights.csproj b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Microsoft.Azure.Management.OperationalInsights.csproj index bf4ba51ad782..f22b31306c62 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Microsoft.Azure.Management.OperationalInsights.csproj +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Microsoft.Azure.Management.OperationalInsights.csproj @@ -7,9 +7,9 @@ Microsoft.Azure.Management.OperationalInsightsProvides Microsoft Azure Operational Insights management operationsMicrosoft.Azure.Management.OperationalInsights - 0.22.0-preview + 0.23.0-previewMicrosoft Azure OperationalInsights;OperationalInsights; - updated all OperationalInsights APIs to version 2020-10 + rolled back tables api to API version 2020-08 $(SdkTargetFx) diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Properties/AssemblyInfo.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Properties/AssemblyInfo.cs index 99c4283a5623..f752ade31b31 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Properties/AssemblyInfo.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Properties/AssemblyInfo.cs @@ -11,8 +11,8 @@ [assembly: AssemblyProduct("Azure .NET SDK")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] -[assembly: AssemblyVersion("0.22.0.0")] -[assembly: AssemblyFileVersion("0.22.0.0")] +[assembly: AssemblyVersion("0.23.0.0")] +[assembly: AssemblyFileVersion("0.23.0.0")] [assembly: AssemblyTitle("Microsoft Azure OperationalInsights Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure OperationalInsights management operations.")] [assembly: AssemblyCulture("")]