diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/BackupShortTermRetentionPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/BackupShortTermRetentionPoliciesOperations.cs index dc43a012367e..3d801978da1b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/BackupShortTermRetentionPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/BackupShortTermRetentionPoliciesOperations.cs @@ -103,7 +103,7 @@ internal BackupShortTermRetentionPoliciesOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string policyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -367,7 +367,7 @@ internal BackupShortTermRetentionPoliciesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -579,7 +579,7 @@ internal BackupShortTermRetentionPoliciesOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string policyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -800,7 +800,7 @@ internal BackupShortTermRetentionPoliciesOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string policyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs index 0982e58f6068..8e46eb06c69a 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs @@ -56,8 +56,7 @@ public partial interface IReplicationLinksOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. + /// Gets a replication link. /// /// /// The name of the resource group that contains the resource. You can @@ -68,11 +67,10 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed - /// over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// The headers that will be added to request. @@ -83,14 +81,16 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Sets which replica database is primary by failing over from the - /// current primary replica database. This operation might result in - /// data loss. + /// current primary replica database. /// /// /// The name of the resource group that contains the resource. You can @@ -119,9 +119,11 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a database replication link in forced or friendly way. + /// Sets which replica database is primary by failing over from the + /// current primary replica database. This operation might result in + /// data loss. /// /// /// The name of the resource group that contains the resource. You can @@ -138,9 +140,6 @@ public partial interface IReplicationLinksOperations /// /// The ID of the replication link to be failed over. /// - /// - /// The required parameters for unlinking replication link. - /// /// /// The headers that will be added to request. /// @@ -153,9 +152,9 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of replication links on database. + /// Deletes a database replication link in forced or friendly way. /// /// /// The name of the resource group that contains the resource. You can @@ -163,10 +162,17 @@ public partial interface IReplicationLinksOperations /// portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// - /// The name of the database containing the replication link. + /// The name of the database that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. /// /// /// The headers that will be added to request. @@ -177,15 +183,12 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a replication link. + /// Gets a list of replication links on database. /// /// /// The name of the resource group that contains the resource. You can @@ -193,13 +196,10 @@ public partial interface IReplicationLinksOperations /// portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// - /// The name of the database containing the replication link. - /// - /// - /// The name of the replication link. + /// The name of the database. /// /// /// The headers that will be added to request. @@ -216,7 +216,7 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicationLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of replication links. /// @@ -226,7 +226,7 @@ public partial interface IReplicationLinksOperations /// portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// /// The headers that will be added to request. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs index bc688ed524ab..b21c6d120aaa 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs @@ -142,11 +142,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IServerUsagesOperations ServerUsages { get; } - /// - /// Gets the IBackupShortTermRetentionPoliciesOperations. - /// - IBackupShortTermRetentionPoliciesOperations BackupShortTermRetentionPolicies { get; } - /// /// Gets the IExtendedDatabaseBlobAuditingPoliciesOperations. /// @@ -622,6 +617,11 @@ public partial interface ISqlManagementClient : System.IDisposable /// IWorkloadGroupsOperations WorkloadGroups { get; } + /// + /// Gets the IBackupShortTermRetentionPoliciesOperations. + /// + IBackupShortTermRetentionPoliciesOperations BackupShortTermRetentionPolicies { get; } + /// /// Gets the IDatabaseExtensionsOperations. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/BackupShortTermRetentionPolicy.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/BackupShortTermRetentionPolicy.cs index a3666f867d33..c1f8aa1f2397 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/BackupShortTermRetentionPolicy.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/BackupShortTermRetentionPolicy.cs @@ -40,10 +40,15 @@ public BackupShortTermRetentionPolicy() /// The backup retention period in days. /// This is how many days Point-in-Time Restore will be /// supported. - public BackupShortTermRetentionPolicy(string id = default(string), string name = default(string), string type = default(string), int? retentionDays = default(int?)) + /// The differential backup + /// interval in hours. This is how many interval hours between each + /// differential backup will be supported. This is only applicable to + /// live databases but not dropped databases. + public BackupShortTermRetentionPolicy(string id = default(string), string name = default(string), string type = default(string), int? retentionDays = default(int?), int? diffBackupIntervalInHours = default(int?)) : base(id, name, type) { RetentionDays = retentionDays; + DiffBackupIntervalInHours = diffBackupIntervalInHours; CustomInit(); } @@ -59,5 +64,14 @@ public BackupShortTermRetentionPolicy() [JsonProperty(PropertyName = "properties.retentionDays")] public int? RetentionDays { get; set; } + /// + /// Gets or sets the differential backup interval in hours. This is how + /// many interval hours between each differential backup will be + /// supported. This is only applicable to live databases but not + /// dropped databases. + /// + [JsonProperty(PropertyName = "properties.diffBackupIntervalInHours")] + public int? DiffBackupIntervalInHours { get; set; } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLink.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLink.cs index 915f12daee23..bfea713f5fb5 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLink.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLink.cs @@ -38,18 +38,24 @@ public ReplicationLink() /// Resource partner server. /// Resource partner database. /// Resource partner location. - /// Local replication role. - /// Partner replication role. + /// Local replication role. Possible values include: + /// 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', + /// 'Copy' + /// Partner replication role. Possible values + /// include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', + /// 'Copy' /// Replication mode. /// Time at which the link was created. /// Seeding completion percentage for the /// link. /// Replication state (PENDING, SEEDING, - /// CATCHUP, SUSPENDED). + /// CATCHUP, SUSPENDED). Possible values include: 'PENDING', 'SEEDING', + /// 'CATCH_UP', 'SUSPENDED' /// Whether the user is currently /// allowed to terminate the link. - /// Link type (GEO, NAMED). - public ReplicationLink(string id = default(string), string name = default(string), string type = default(string), string partnerServer = default(string), string partnerDatabase = default(string), string partnerLocation = default(string), string role = default(string), string partnerRole = default(string), string replicationMode = default(string), System.DateTime? startTime = default(System.DateTime?), int? percentComplete = default(int?), string replicationState = default(string), bool? isTerminationAllowed = default(bool?), string linkType = default(string)) + /// Link type (GEO, NAMED). Possible values + /// include: 'GEO', 'NAMED' + public ReplicationLink(string id = default(string), string name = default(string), string type = default(string), string partnerServer = default(string), string partnerDatabase = default(string), string partnerLocation = default(string), ReplicationRole? role = default(ReplicationRole?), ReplicationRole? partnerRole = default(ReplicationRole?), string replicationMode = default(string), System.DateTime? startTime = default(System.DateTime?), int? percentComplete = default(int?), string replicationState = default(string), bool? isTerminationAllowed = default(bool?), string linkType = default(string)) : base(id, name, type) { PartnerServer = partnerServer; @@ -90,16 +96,18 @@ public ReplicationLink() public string PartnerLocation { get; private set; } /// - /// Gets local replication role. + /// Gets local replication role. Possible values include: 'Primary', + /// 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' /// [JsonProperty(PropertyName = "properties.role")] - public string Role { get; private set; } + public ReplicationRole? Role { get; private set; } /// - /// Gets partner replication role. + /// Gets partner replication role. Possible values include: 'Primary', + /// 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' /// [JsonProperty(PropertyName = "properties.partnerRole")] - public string PartnerRole { get; private set; } + public ReplicationRole? PartnerRole { get; private set; } /// /// Gets replication mode. @@ -121,6 +129,8 @@ public ReplicationLink() /// /// Gets replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). + /// Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', + /// 'SUSPENDED' /// [JsonProperty(PropertyName = "properties.replicationState")] public string ReplicationState { get; private set; } @@ -132,7 +142,8 @@ public ReplicationLink() public bool? IsTerminationAllowed { get; private set; } /// - /// Gets link type (GEO, NAMED). + /// Gets link type (GEO, NAMED). Possible values include: 'GEO', + /// 'NAMED' /// [JsonProperty(PropertyName = "properties.linkType")] public string LinkType { get; private set; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLinkType.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLinkType.cs new file mode 100644 index 000000000000..15781387e6dc --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationLinkType.cs @@ -0,0 +1,22 @@ +// +// 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.Sql.Models +{ + + /// + /// Defines values for ReplicationLinkType. + /// + public static class ReplicationLinkType + { + public const string GEO = "GEO"; + public const string NAMED = "NAMED"; + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationRole.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationRole.cs new file mode 100644 index 000000000000..f0d74d3f85fb --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationRole.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ReplicationRole. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ReplicationRole + { + [EnumMember(Value = "Primary")] + Primary, + [EnumMember(Value = "Secondary")] + Secondary, + [EnumMember(Value = "NonReadableSecondary")] + NonReadableSecondary, + [EnumMember(Value = "Source")] + Source, + [EnumMember(Value = "Copy")] + Copy + } + internal static class ReplicationRoleEnumExtension + { + internal static string ToSerializedValue(this ReplicationRole? value) + { + return value == null ? null : ((ReplicationRole)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ReplicationRole value) + { + switch( value ) + { + case ReplicationRole.Primary: + return "Primary"; + case ReplicationRole.Secondary: + return "Secondary"; + case ReplicationRole.NonReadableSecondary: + return "NonReadableSecondary"; + case ReplicationRole.Source: + return "Source"; + case ReplicationRole.Copy: + return "Copy"; + } + return null; + } + + internal static ReplicationRole? ParseReplicationRole(this string value) + { + switch( value ) + { + case "Primary": + return ReplicationRole.Primary; + case "Secondary": + return ReplicationRole.Secondary; + case "NonReadableSecondary": + return ReplicationRole.NonReadableSecondary; + case "Source": + return ReplicationRole.Source; + case "Copy": + return ReplicationRole.Copy; + } + return null; + } + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationState.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationState.cs new file mode 100644 index 000000000000..067c14bdb345 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ReplicationState.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.Sql.Models +{ + + /// + /// Defines values for ReplicationState. + /// + public static class ReplicationState + { + public const string PENDING = "PENDING"; + public const string SEEDING = "SEEDING"; + public const string CATCHUP = "CATCH_UP"; + public const string SUSPENDED = "SUSPENDED"; + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs index 5b6868bfcf25..64ddd37e63c9 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs @@ -243,67 +243,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the server. - /// - /// - /// The name of the database that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the server. - /// - /// - /// The name of the database that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a database replication link in forced or friendly way. + /// Gets a replication link. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -313,39 +253,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of replication links on database. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the server containing the replication link. - /// - /// - /// The name of the database containing the replication link. + /// The name of the replication link. /// /// /// Headers that will be added to request. @@ -368,7 +279,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -382,11 +293,15 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (linkId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -397,16 +312,18 @@ internal ReplicationLinksOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("linkId", linkId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + 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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{linkId}", System.Uri.EscapeDataString(linkId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -506,7 +423,7 @@ internal ReplicationLinksOperations(SqlManagementClient 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")) @@ -519,7 +436,7 @@ internal ReplicationLinksOperations(SqlManagementClient 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) { @@ -539,20 +456,109 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Gets a replication link. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// - /// The name of the database containing the replication link. + /// The name of the database that has the replication link to be failed over. /// - /// - /// The name of the replication link. + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of replication links on database. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. /// /// /// Headers that will be added to request. @@ -575,7 +581,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicationLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -589,15 +595,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (replicationLinkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "replicationLinkName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -608,18 +610,16 @@ internal ReplicationLinksOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("replicationLinkName", replicationLinkName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{replicationLinkName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{replicationLinkName}", System.Uri.EscapeDataString(replicationLinkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -719,7 +719,7 @@ internal ReplicationLinksOperations(SqlManagementClient 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")) @@ -732,7 +732,7 @@ internal ReplicationLinksOperations(SqlManagementClient 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) { @@ -759,7 +759,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// this value from the Azure Resource Manager API or the portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// /// Headers that will be added to request. @@ -796,7 +796,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs index 7b89dd57fb38..5cfcc8702823 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs @@ -72,6 +72,60 @@ public static void Delete(this IReplicationLinksOperations operations, string re (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets a replication link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the replication link. + /// + public static ReplicationLink Get(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + { + return operations.GetAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + } + + /// + /// Gets a replication link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the replication link. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Sets which replica database is primary by failing over from the current /// primary replica database. @@ -246,10 +300,10 @@ public static void Unlink(this IReplicationLinksOperations operations, string re /// this value from the Azure Resource Manager API or the portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// - /// The name of the database containing the replication link. + /// The name of the database. /// public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) { @@ -267,10 +321,10 @@ public static IPage ListByDatabase(this IReplicationLinksOperat /// this value from the Azure Resource Manager API or the portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// - /// The name of the database containing the replication link. + /// The name of the database. /// /// /// The cancellation token. @@ -283,60 +337,6 @@ public static IPage ListByDatabase(this IReplicationLinksOperat } } - /// - /// Gets a replication link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the server containing the replication link. - /// - /// - /// The name of the database containing the replication link. - /// - /// - /// The name of the replication link. - /// - public static ReplicationLink Get(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string replicationLinkName) - { - return operations.GetAsync(resourceGroupName, serverName, databaseName, replicationLinkName).GetAwaiter().GetResult(); - } - - /// - /// Gets a replication link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the server containing the replication link. - /// - /// - /// The name of the database containing the replication link. - /// - /// - /// The name of the replication link. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string replicationLinkName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, replicationLinkName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets a list of replication links. /// @@ -348,7 +348,7 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s /// this value from the Azure Resource Manager API or the portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// public static IPage ListByServer(this IReplicationLinksOperations operations, string resourceGroupName, string serverName) { @@ -366,7 +366,7 @@ public static IPage ListByServer(this IReplicationLinksOperatio /// this value from the Azure Resource Manager API or the portal. /// /// - /// The name of the server containing the replication link. + /// The name of the server. /// /// /// The cancellation token. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index 8bf600e1506a..aff31577b3cd 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -19,7 +19,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl { return new Tuple[] { - new Tuple("Sql", "BackupShortTermRetentionPolicies", "2020-11-01-preview"), + new Tuple("Sql", "BackupShortTermRetentionPolicies", "2021-02-01-preview"), new Tuple("Sql", "Capabilities", "2020-11-01-preview"), new Tuple("Sql", "DataMaskingPolicies", "2014-04-01"), new Tuple("Sql", "DataMaskingRules", "2014-04-01"), @@ -106,7 +106,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "RecoverableDatabases", "2014-04-01"), new Tuple("Sql", "RecoverableManagedDatabases", "2020-11-01-preview"), new Tuple("Sql", "ReplicationLinks", "2014-04-01"), - new Tuple("Sql", "ReplicationLinks", "2020-11-01-preview"), + new Tuple("Sql", "ReplicationLinks", "2021-02-01-preview"), new Tuple("Sql", "RestorableDroppedDatabases", "2021-02-01-preview"), new Tuple("Sql", "RestorableDroppedManagedDatabases", "2021-02-01-preview"), new Tuple("Sql", "RestorePoints", "2020-11-01-preview"), @@ -145,16 +145,5 @@ public static IEnumerable> ApiInfo_SqlManagementCl }.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/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "10c93ad91d3f44f62f2568a5b480c538a7c15daf"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs index c4bd489f9788..acf04682292d 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs @@ -147,11 +147,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IServerUsagesOperations ServerUsages { get; private set; } - /// - /// Gets the IBackupShortTermRetentionPoliciesOperations. - /// - public virtual IBackupShortTermRetentionPoliciesOperations BackupShortTermRetentionPolicies { get; private set; } - /// /// Gets the IExtendedDatabaseBlobAuditingPoliciesOperations. /// @@ -627,6 +622,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IWorkloadGroupsOperations WorkloadGroups { get; private set; } + /// + /// Gets the IBackupShortTermRetentionPoliciesOperations. + /// + public virtual IBackupShortTermRetentionPoliciesOperations BackupShortTermRetentionPolicies { get; private set; } + /// /// Gets the IDatabaseExtensionsOperations. /// @@ -928,7 +928,6 @@ private void Initialize() TransparentDataEncryptions = new TransparentDataEncryptionsOperations(this); TransparentDataEncryptionActivities = new TransparentDataEncryptionActivitiesOperations(this); ServerUsages = new ServerUsagesOperations(this); - BackupShortTermRetentionPolicies = new BackupShortTermRetentionPoliciesOperations(this); ExtendedDatabaseBlobAuditingPolicies = new ExtendedDatabaseBlobAuditingPoliciesOperations(this); ExtendedServerBlobAuditingPolicies = new ExtendedServerBlobAuditingPoliciesOperations(this); ServerBlobAuditingPolicies = new ServerBlobAuditingPoliciesOperations(this); @@ -1024,6 +1023,7 @@ private void Initialize() VirtualNetworkRules = new VirtualNetworkRulesOperations(this); WorkloadClassifiers = new WorkloadClassifiersOperations(this); WorkloadGroups = new WorkloadGroupsOperations(this); + BackupShortTermRetentionPolicies = new BackupShortTermRetentionPoliciesOperations(this); DatabaseExtensions = new DatabaseExtensionsOperations(this); DatabaseOperations = new DatabaseOperations(this); DatabaseUsages = new DatabaseUsagesOperations(this);