diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentity.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentity.cs new file mode 100644 index 000000000000..8f3890254580 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentity.cs @@ -0,0 +1,84 @@ +// 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 System.Linq; + + /// + /// Azure Active Directory identity configuration for a resource. + /// + public partial class DataSyncParticipantIdentity + { + /// + /// Initializes a new instance of the DataSyncParticipantIdentity class. + /// + public DataSyncParticipantIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSyncParticipantIdentity class. + /// + + /// The Datasync identity type + /// Possible values include: 'None', 'SystemAssigned', 'UserAssigned', + /// 'SystemAssignedUserAssigned' + + /// The DataSync participant identity tenant id + /// + + /// The resource ids of the user assigned identities to use + /// + public DataSyncParticipantIdentity(string type, System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + + { + this.Type = type; + this.TenantId = tenantId; + this.UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the Datasync identity type Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets the DataSync participant identity tenant id + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public System.Guid? TenantId {get; set; } + + /// + /// Gets or sets the resource ids of the user assigned identities to use + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Type == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); + } + + + } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentityType.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentityType.cs new file mode 100644 index 000000000000..9ef22aa9fa23 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentityType.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + + /// + /// Defines values for DataSyncParticipantIdentityType. + /// + + + public static class DataSyncParticipantIdentityType + { + public const string None = "None"; + public const string SystemAssigned = "SystemAssigned"; + public const string UserAssigned = "UserAssigned"; + public const string SystemAssignedUserAssigned = "SystemAssignedUserAssigned"; + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantUserAssignedIdentity.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantUserAssignedIdentity.cs new file mode 100644 index 000000000000..e9979f66290e --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantUserAssignedIdentity.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + /// + /// Azure Active Directory identity configuration for a resource. + /// + public partial class DataSyncParticipantUserAssignedIdentity + { + /// + /// Initializes a new instance of the DataSyncParticipantUserAssignedIdentity class. + /// + public DataSyncParticipantUserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSyncParticipantUserAssignedIdentity class. + /// + + /// The Azure Active Directory principal id. + /// + + /// The Azure Active Directory client id. + /// + public DataSyncParticipantUserAssignedIdentity(System.Guid? principalId = default(System.Guid?), System.Guid? clientId = default(System.Guid?)) + + { + this.PrincipalId = principalId; + this.ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the Azure Active Directory principal id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public System.Guid? PrincipalId {get; private set; } + + /// + /// Gets the Azure Active Directory client id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public System.Guid? ClientId {get; private set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs new file mode 100644 index 000000000000..dd870f01cc83 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetailAutoGenerated + { + /// + /// Initializes a new instance of the ErrorDetailAutoGenerated class. + /// + public ErrorDetailAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetailAutoGenerated class. + /// + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetailAutoGenerated(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the error code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } + + /// + /// Gets the error message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } + + /// + /// Gets the error target. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } + + /// + /// Gets the error details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } + + /// + /// Gets the error additional info. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs new file mode 100644 index 000000000000..4fcce750e0e2 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + public partial class ErrorResponseAutoGenerated + { + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + public ErrorResponseAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + + /// The error object. + /// + public ErrorResponseAutoGenerated(ErrorDetailAutoGenerated error = default(ErrorDetailAutoGenerated)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the error object. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetailAutoGenerated Error {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs new file mode 100644 index 000000000000..937bfe76dad3 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + + /// + /// Exception thrown for an invalid response with ErrorResponseAutoGenerated information. + /// + public partial class ErrorResponseAutoGeneratedException : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponseAutoGenerated Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseAutoGeneratedException class. + /// + public ErrorResponseAutoGeneratedException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + /// The exception message. + public ErrorResponseAutoGeneratedException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseAutoGeneratedException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroup.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroup.cs index 2db11dc14ecb..a000a9afe4a5 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroup.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroup.cs @@ -37,6 +37,9 @@ public SyncGroup() /// The name and capacity of the SKU. /// + /// Sync group authentication information. + /// + /// Sync interval of the sync group. /// @@ -74,11 +77,12 @@ public SyncGroup() /// Private endpoint name of the sync group if use private link connection is /// enabled. /// - public SyncGroup(string id = default(string), string name = default(string), string type = default(string), Sku sku = default(Sku), int? interval = default(int?), System.DateTime? lastSyncTime = default(System.DateTime?), string conflictResolutionPolicy = default(string), string syncDatabaseId = default(string), string hubDatabaseUserName = default(string), string hubDatabasePassword = default(string), string syncState = default(string), SyncGroupSchema schema = default(SyncGroupSchema), bool? enableConflictLogging = default(bool?), int? conflictLoggingRetentionInDays = default(int?), bool? usePrivateLinkConnection = default(bool?), string privateEndpointName = default(string)) + public SyncGroup(DataSyncParticipantIdentity identity, string id = default(string), string name = default(string), string type = default(string), Sku sku = default(Sku), int? interval = default(int?), System.DateTime? lastSyncTime = default(System.DateTime?), string conflictResolutionPolicy = default(string), string syncDatabaseId = default(string), string hubDatabaseUserName = default(string), string hubDatabasePassword = default(string), string syncState = default(string), SyncGroupSchema schema = default(SyncGroupSchema), bool? enableConflictLogging = default(bool?), int? conflictLoggingRetentionInDays = default(int?), bool? usePrivateLinkConnection = default(bool?), string privateEndpointName = default(string)) : base(id, name, type) { this.Sku = sku; + this.Identity = identity; this.Interval = interval; this.LastSyncTime = lastSyncTime; this.ConflictResolutionPolicy = conflictResolutionPolicy; @@ -106,6 +110,12 @@ public SyncGroup() [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] public Sku Sku {get; set; } + /// + /// Gets or sets sync group authentication information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public DataSyncParticipantIdentity Identity {get; set; } + /// /// Gets or sets sync interval of the sync group. /// @@ -186,10 +196,18 @@ public SyncGroup() /// public virtual void Validate() { + if (this.Identity == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Identity"); + } if (this.Sku != null) { this.Sku.Validate(); } + if (this.Identity != null) + { + this.Identity.Validate(); + } diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupProperties.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupProperties.cs index 0b737805efc7..fb30ec66ef60 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupProperties.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupProperties.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Management.Sql.Models using System.Linq; /// - /// Properties of a sync group. + /// Properties of a sync group with support to MI. /// public partial class SyncGroupProperties { diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsCreateOrUpdateHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..58fb77f33625 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsCreateOrUpdateHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncGroupsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the SyncGroupsCreateOrUpdateHeaders class. + /// + public SyncGroupsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupsCreateOrUpdateHeaders class. + /// + + /// + /// + public SyncGroupsCreateOrUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsDeleteHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsDeleteHeaders.cs new file mode 100644 index 000000000000..fbf965966015 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsDeleteHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncGroupsDeleteHeaders + { + /// + /// Initializes a new instance of the SyncGroupsDeleteHeaders class. + /// + public SyncGroupsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupsDeleteHeaders class. + /// + + /// + /// + public SyncGroupsDeleteHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsRefreshHubSchemaHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsRefreshHubSchemaHeaders.cs new file mode 100644 index 000000000000..fa353dcaeddb --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsRefreshHubSchemaHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncGroupsRefreshHubSchemaHeaders + { + /// + /// Initializes a new instance of the SyncGroupsRefreshHubSchemaHeaders class. + /// + public SyncGroupsRefreshHubSchemaHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupsRefreshHubSchemaHeaders class. + /// + + /// + /// + public SyncGroupsRefreshHubSchemaHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsUpdateHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsUpdateHeaders.cs new file mode 100644 index 000000000000..c52018994bb0 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsUpdateHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncGroupsUpdateHeaders + { + /// + /// Initializes a new instance of the SyncGroupsUpdateHeaders class. + /// + public SyncGroupsUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupsUpdateHeaders class. + /// + + /// + /// + public SyncGroupsUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMember.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMember.cs index 88effdb1d310..63a5dee274b3 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMember.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMember.cs @@ -34,6 +34,9 @@ public SyncMember() /// Resource type. /// + /// Sync member authentication information. + /// + /// Sync direction of the sync member. /// Possible values include: 'Bidirectional', 'OneWayMemberToHub', /// 'OneWayHubToMember' @@ -77,10 +80,11 @@ public SyncMember() /// 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', /// 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', /// 'ReprovisionFailed', 'UnReprovisioned' - public SyncMember(string id = default(string), string name = default(string), string type = default(string), string syncDirection = default(string), string databaseType = default(string), string syncAgentId = default(string), System.Guid? sqlServerDatabaseId = default(System.Guid?), string syncMemberAzureDatabaseResourceId = default(string), bool? usePrivateLinkConnection = default(bool?), string privateEndpointName = default(string), string serverName = default(string), string databaseName = default(string), string userName = default(string), string password = default(string), string syncState = default(string)) + public SyncMember(DataSyncParticipantIdentity identity, string id = default(string), string name = default(string), string type = default(string), string syncDirection = default(string), string databaseType = default(string), string syncAgentId = default(string), System.Guid? sqlServerDatabaseId = default(System.Guid?), string syncMemberAzureDatabaseResourceId = default(string), bool? usePrivateLinkConnection = default(bool?), string privateEndpointName = default(string), string serverName = default(string), string databaseName = default(string), string userName = default(string), string password = default(string), string syncState = default(string)) : base(id, name, type) { + this.Identity = identity; this.SyncDirection = syncDirection; this.DatabaseType = databaseType; this.SyncAgentId = syncAgentId; @@ -102,6 +106,12 @@ public SyncMember() partial void CustomInit(); + /// + /// Gets or sets sync member authentication information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public DataSyncParticipantIdentity Identity {get; set; } + /// /// Gets or sets sync direction of the sync member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' /// @@ -175,5 +185,32 @@ public SyncMember() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.syncState")] public string SyncState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Identity == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Identity"); + } + if (this.Identity != null) + { + this.Identity.Validate(); + } + + + + + + + + + + + } } } \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersCreateOrUpdateHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..4310344b1f36 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersCreateOrUpdateHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncMembersCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the SyncMembersCreateOrUpdateHeaders class. + /// + public SyncMembersCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncMembersCreateOrUpdateHeaders class. + /// + + /// + /// + public SyncMembersCreateOrUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersDeleteHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersDeleteHeaders.cs new file mode 100644 index 000000000000..255a1bcf9ff1 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersDeleteHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncMembersDeleteHeaders + { + /// + /// Initializes a new instance of the SyncMembersDeleteHeaders class. + /// + public SyncMembersDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncMembersDeleteHeaders class. + /// + + /// + /// + public SyncMembersDeleteHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersRefreshMemberSchemaHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersRefreshMemberSchemaHeaders.cs new file mode 100644 index 000000000000..6399a2635396 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersRefreshMemberSchemaHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncMembersRefreshMemberSchemaHeaders + { + /// + /// Initializes a new instance of the SyncMembersRefreshMemberSchemaHeaders class. + /// + public SyncMembersRefreshMemberSchemaHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncMembersRefreshMemberSchemaHeaders class. + /// + + /// + /// + public SyncMembersRefreshMemberSchemaHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersUpdateHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersUpdateHeaders.cs new file mode 100644 index 000000000000..a3733e8a81e1 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersUpdateHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class SyncMembersUpdateHeaders + { + /// + /// Initializes a new instance of the SyncMembersUpdateHeaders class. + /// + public SyncMembersUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncMembersUpdateHeaders class. + /// + + /// + /// + public SyncMembersUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperations.cs index 5ab2e8aba833..e56c49191c6c 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperations.cs @@ -81,7 +81,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -168,14 +168,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -185,10 +184,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -239,36 +234,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Refreshes a hub database schema. - /// - /// - /// 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 on which the sync group is hosted. - /// - /// - /// The name of the sync group. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task RefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a collection of hub database schemas. + /// Lists sync groups under a hub database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -280,9 +246,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the database on which the sync group is hosted. /// - /// - /// The name of the sync group. - /// /// /// Headers that will be added to request. /// @@ -304,7 +267,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListHubSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -325,17 +288,12 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (syncGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncGroupName"); - } - if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,21 +304,19 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("syncGroupName", syncGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListHubSchemas", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups").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("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -428,14 +384,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -445,10 +400,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -461,7 +412,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -475,7 +426,7 @@ internal SyncGroupsOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -499,7 +450,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Gets a collection of sync group logs. + /// Gets a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -514,18 +465,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// - /// - /// Get logs generated after this time. - /// - /// - /// Get logs generated before this time. - /// - /// - /// The types of logs to retrieve. - /// - /// - /// The continuation token for this operation. - /// /// /// Headers that will be added to request. /// @@ -547,7 +486,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListLogsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -573,28 +512,12 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncGroupName"); } - if (startTime == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "startTime"); - } - - if (endTime == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "endTime"); - } - - if (type == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "type"); - } - - if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -606,20 +529,16 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("syncGroupName", syncGroupName); - tracingParameters.Add("startTime", startTime); - tracingParameters.Add("endTime", endTime); - tracingParameters.Add("type", type); - tracingParameters.Add("continuationToken", continuationToken); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListLogs", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").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)); @@ -627,22 +546,6 @@ internal SyncGroupsOperations (SqlManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (startTime != null) - { - _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(startTime))); - } - if (endTime != null) - { - _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(endTime))); - } - if (type != null) - { - _queryParameters.Add(string.Format("type={0}", System.Uri.EscapeDataString(type))); - } - if (continuationToken != null) - { - _queryParameters.Add(string.Format("continuationToken={0}", System.Uri.EscapeDataString(continuationToken))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -707,14 +610,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -724,10 +626,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -740,7 +638,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -754,7 +652,7 @@ internal SyncGroupsOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -777,6 +675,99 @@ internal SyncGroupsOperations (SqlManagementClient client) } + /// + /// Creates or updates a sync group. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a sync group. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a sync group. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Cancels a sync group synchronization. /// @@ -842,7 +833,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -935,14 +926,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -952,10 +942,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -988,7 +974,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Triggers a sync group synchronization. + /// Gets a collection of hub database schemas. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1012,6 +998,9 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1021,7 +1010,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task TriggerSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListHubSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1052,7 +1041,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1068,12 +1057,12 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "TriggerSync", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListHubSchemas", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas").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)); @@ -1092,7 +1081,7 @@ internal SyncGroupsOperations (SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1145,14 +1134,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1162,10 +1150,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1178,7 +1162,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1186,6 +1170,24 @@ internal SyncGroupsOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1198,7 +1200,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Gets a sync group. + /// Gets a collection of sync group logs. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1213,6 +1215,18 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. + /// + /// + /// The continuation token for this operation. + /// /// /// Headers that will be added to request. /// @@ -1234,7 +1248,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListLogsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1260,12 +1274,28 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncGroupName"); } + if (startTime == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "startTime"); + } + + if (endTime == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "endTime"); + } + + if (type == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "type"); + } + + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1277,16 +1307,20 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("startTime", startTime); + tracingParameters.Add("endTime", endTime); + tracingParameters.Add("type", type); + tracingParameters.Add("continuationToken", continuationToken); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListLogs", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs").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)); @@ -1294,6 +1328,22 @@ internal SyncGroupsOperations (SqlManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (startTime != null) + { + _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(startTime))); + } + if (endTime != null) + { + _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(endTime))); + } + if (type != null) + { + _queryParameters.Add(string.Format("type={0}", System.Uri.EscapeDataString(type))); + } + if (continuationToken != null) + { + _queryParameters.Add(string.Format("continuationToken={0}", System.Uri.EscapeDataString(continuationToken))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1358,14 +1408,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1375,10 +1424,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1391,7 +1436,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1405,7 +1450,7 @@ internal SyncGroupsOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1429,39 +1474,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Creates or updates a sync group. - /// - /// - /// 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 on which the sync group is hosted. - /// - /// - /// The name of the sync group. - /// - /// - /// The requested sync group resource state. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a sync group. + /// Refreshes a hub database schema. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1482,15 +1495,15 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> RefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Updates a sync group. + /// Triggers a sync group synchronization. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1505,35 +1518,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists sync groups under a hub 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 on which the sync group is hosted. - /// /// /// Headers that will be added to request. /// @@ -1543,9 +1527,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1555,7 +1536,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TriggerSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1576,12 +1557,17 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } + if (syncGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncGroupName"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1592,19 +1578,21 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "TriggerSync", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync").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("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -1619,7 +1607,7 @@ internal SyncGroupsOperations (SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1672,14 +1660,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1689,10 +1676,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1705,7 +1688,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1713,24 +1696,6 @@ internal SyncGroupsOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1743,7 +1708,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Refreshes a hub database schema. + /// Creates or updates a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1758,6 +1723,9 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// + /// + /// The requested sync group resource state. + /// /// /// Headers that will be added to request. /// @@ -1767,6 +1735,9 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1776,12 +1747,20 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginRefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1807,7 +1786,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1821,14 +1800,15 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("syncGroupName", syncGroupName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRefreshHubSchema", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").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)); @@ -1847,7 +1827,7 @@ internal SyncGroupsOperations (SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1876,6 +1856,12 @@ internal SyncGroupsOperations (SqlManagementClient client) } // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -1898,16 +1884,15 @@ internal SyncGroupsOperations (SqlManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1917,10 +1902,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1933,7 +1914,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1941,6 +1922,55 @@ internal SyncGroupsOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1953,7 +1983,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Creates or updates a sync group. + /// Deletes a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1968,9 +1998,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// /// /// Headers that will be added to request. /// @@ -1980,9 +2007,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1992,20 +2016,12 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2031,7 +2047,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2045,10 +2061,9 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("syncGroupName", syncGroupName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL @@ -2072,7 +2087,7 @@ internal SyncGroupsOperations (SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2101,12 +2116,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2129,16 +2138,15 @@ internal SyncGroupsOperations (SqlManagementClient client) 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 Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2148,10 +2156,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2164,7 +2168,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2172,41 +2176,18 @@ internal SyncGroupsOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - // Deserialize Response - if ((int)_statusCode == 201) + catch (Newtonsoft.Json.JsonException ex) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -2220,7 +2201,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Deletes a sync group. + /// Updates a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -2235,6 +2216,9 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// + /// + /// The requested sync group resource state. + /// /// /// Headers that will be added to request. /// @@ -2244,6 +2228,9 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2253,12 +2240,16 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2284,7 +2275,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2298,9 +2289,10 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("syncGroupName", syncGroupName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL @@ -2324,7 +2316,7 @@ internal SyncGroupsOperations (SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2353,6 +2345,12 @@ internal SyncGroupsOperations (SqlManagementClient client) } // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -2375,16 +2373,15 @@ internal SyncGroupsOperations (SqlManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2394,10 +2391,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2410,7 +2403,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2418,6 +2411,37 @@ internal SyncGroupsOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2430,7 +2454,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -2445,9 +2469,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// /// /// Headers that will be added to request. /// @@ -2457,9 +2478,6 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -2469,16 +2487,12 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2504,7 +2518,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2518,15 +2532,14 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("syncGroupName", syncGroupName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRefreshHubSchema", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema").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)); @@ -2545,7 +2558,7 @@ internal SyncGroupsOperations (SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2574,12 +2587,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2604,14 +2611,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2621,10 +2627,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2637,7 +2639,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2645,23 +2647,18 @@ internal SyncGroupsOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -2786,14 +2783,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2803,10 +2799,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2857,7 +2849,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Gets a collection of hub database schemas. + /// Lists sync groups under a hub database. /// /// /// The NextLink from the previous successful call to List operation. @@ -2883,7 +2875,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListHubSchemasNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) @@ -2901,7 +2893,7 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListHubSchemasNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2968,14 +2960,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2985,10 +2976,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3001,7 +2988,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3015,7 +3002,7 @@ internal SyncGroupsOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3039,7 +3026,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Gets a collection of sync group logs. + /// Gets a collection of hub database schemas. /// /// /// The NextLink from the previous successful call to List operation. @@ -3065,7 +3052,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListLogsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListHubSchemasNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) @@ -3083,7 +3070,7 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListLogsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListHubSchemasNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -3150,14 +3137,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3167,10 +3153,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3183,7 +3165,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3197,7 +3179,7 @@ internal SyncGroupsOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3221,7 +3203,7 @@ internal SyncGroupsOperations (SqlManagementClient client) } /// - /// Lists sync groups under a hub database. + /// Gets a collection of sync group logs. /// /// /// The NextLink from the previous successful call to List operation. @@ -3247,7 +3229,7 @@ internal SyncGroupsOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListLogsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) @@ -3265,7 +3247,7 @@ internal SyncGroupsOperations (SqlManagementClient client) tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListLogsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -3332,14 +3314,13 @@ internal SyncGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3349,10 +3330,6 @@ internal SyncGroupsOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3365,7 +3342,7 @@ internal SyncGroupsOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3379,7 +3356,7 @@ internal SyncGroupsOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperationsExtensions.cs b/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperationsExtensions.cs index 214faa925ef0..7ba7e3dd41a4 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperationsExtensions.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperationsExtensions.cs @@ -46,7 +46,7 @@ public static Microsoft.Rest.Azure.IPage ListSyncDatab } } /// - /// Refreshes a hub database schema. + /// Lists sync groups under a hub database. /// /// /// The operations group for this extension method. @@ -61,16 +61,13 @@ public static Microsoft.Rest.Azure.IPage ListSyncDatab /// /// The name of the database on which the sync group is hosted. /// - /// - /// The name of the sync group. - /// - public static void RefreshHubSchema(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static Microsoft.Rest.Azure.IPage ListByDatabase(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName) { - ((ISyncGroupsOperations)operations).RefreshHubSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Refreshes a hub database schema. + /// Lists sync groups under a hub database. /// /// /// The operations group for this extension method. @@ -85,18 +82,18 @@ public static void RefreshHubSchema(this ISyncGroupsOperations operations, strin /// /// The name of the database on which the sync group is hosted. /// - /// - /// The name of the sync group. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RefreshHubSchemaAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByDatabaseAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.RefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets a collection of hub database schemas. + /// Gets a sync group. /// /// /// The operations group for this extension method. @@ -114,13 +111,13 @@ public static void RefreshHubSchema(this ISyncGroupsOperations operations, strin /// /// The name of the sync group. /// - public static Microsoft.Rest.Azure.IPage ListHubSchemas(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static SyncGroup Get(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).ListHubSchemasAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).GetAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Gets a collection of hub database schemas. + /// Gets a sync group. /// /// /// The operations group for this extension method. @@ -141,15 +138,15 @@ public static Microsoft.Rest.Azure.IPage ListHubSchema /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListHubSchemasAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListHubSchemasWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets a collection of sync group logs. + /// Creates or updates a sync group. /// /// /// The operations group for this extension method. @@ -167,25 +164,13 @@ public static Microsoft.Rest.Azure.IPage ListHubSchema /// /// The name of the sync group. /// - /// - /// Get logs generated after this time. - /// - /// - /// Get logs generated before this time. - /// - /// - /// The types of logs to retrieve. - /// - /// - /// The continuation token for this operation. - /// - public static Microsoft.Rest.Azure.IPage ListLogs(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string)) + public static SyncGroup CreateOrUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) { - return ((ISyncGroupsOperations)operations).ListLogsAsync(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, type, continuationToken).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); } /// - /// Gets a collection of sync group logs. + /// Creates or updates a sync group. /// /// /// The operations group for this extension method. @@ -203,30 +188,18 @@ public static Microsoft.Rest.Azure.IPage ListHubSchema /// /// The name of the sync group. /// - /// - /// Get logs generated after this time. - /// - /// - /// Get logs generated before this time. - /// - /// - /// The types of logs to retrieve. - /// - /// - /// The continuation token for this operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListLogsAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListLogsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, type, continuationToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Cancels a sync group synchronization. + /// Deletes a sync group. /// /// /// The operations group for this extension method. @@ -244,13 +217,13 @@ public static Microsoft.Rest.Azure.IPage ListHubSchema /// /// The name of the sync group. /// - public static void CancelSync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static SyncGroupsDeleteHeaders Delete(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - ((ISyncGroupsOperations)operations).CancelSyncAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).DeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Cancels a sync group synchronization. + /// Deletes a sync group. /// /// /// The operations group for this extension method. @@ -271,12 +244,15 @@ public static void CancelSync(this ISyncGroupsOperations operations, string reso /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CancelSyncAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.CancelSyncWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Triggers a sync group synchronization. + /// Updates a sync group. /// /// /// The operations group for this extension method. @@ -294,13 +270,13 @@ public static void CancelSync(this ISyncGroupsOperations operations, string reso /// /// The name of the sync group. /// - public static void TriggerSync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static SyncGroup Update(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) { - ((ISyncGroupsOperations)operations).TriggerSyncAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).UpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); } /// - /// Triggers a sync group synchronization. + /// Updates a sync group. /// /// /// The operations group for this extension method. @@ -321,12 +297,15 @@ public static void TriggerSync(this ISyncGroupsOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TriggerSyncAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.TriggerSyncWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets a sync group. + /// Cancels a sync group synchronization. /// /// /// The operations group for this extension method. @@ -344,13 +323,13 @@ public static void TriggerSync(this ISyncGroupsOperations operations, string res /// /// The name of the sync group. /// - public static SyncGroup Get(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static void CancelSync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).GetAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + ((ISyncGroupsOperations)operations).CancelSyncAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Gets a sync group. + /// Cancels a sync group synchronization. /// /// /// The operations group for this extension method. @@ -371,15 +350,12 @@ public static SyncGroup Get(this ISyncGroupsOperations operations, string resour /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CancelSyncAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.CancelSyncWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates a sync group. + /// Gets a collection of hub database schemas. /// /// /// The operations group for this extension method. @@ -397,13 +373,13 @@ public static SyncGroup Get(this ISyncGroupsOperations operations, string resour /// /// The name of the sync group. /// - public static SyncGroup CreateOrUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + public static Microsoft.Rest.Azure.IPage ListHubSchemas(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).ListHubSchemasAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Creates or updates a sync group. + /// Gets a collection of hub database schemas. /// /// /// The operations group for this extension method. @@ -424,15 +400,15 @@ public static SyncGroup CreateOrUpdate(this ISyncGroupsOperations operations, st /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListHubSchemasAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListHubSchemasWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a sync group. + /// Gets a collection of sync group logs. /// /// /// The operations group for this extension method. @@ -450,13 +426,25 @@ public static SyncGroup CreateOrUpdate(this ISyncGroupsOperations operations, st /// /// The name of the sync group. /// - public static void Delete(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. + /// + /// + /// The continuation token for this operation. + /// + public static Microsoft.Rest.Azure.IPage ListLogs(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string)) { - ((ISyncGroupsOperations)operations).DeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).ListLogsAsync(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, type, continuationToken).GetAwaiter().GetResult(); } /// - /// Deletes a sync group. + /// Gets a collection of sync group logs. /// /// /// The operations group for this extension method. @@ -474,15 +462,30 @@ public static void Delete(this ISyncGroupsOperations operations, string resource /// /// The name of the sync group. /// + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. + /// + /// + /// The continuation token for this operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListLogsAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListLogsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, type, continuationToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The operations group for this extension method. @@ -500,13 +503,13 @@ public static void Delete(this ISyncGroupsOperations operations, string resource /// /// The name of the sync group. /// - public static SyncGroup Update(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + public static SyncGroupsRefreshHubSchemaHeaders RefreshHubSchema(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).UpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).RefreshHubSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The operations group for this extension method. @@ -527,15 +530,15 @@ public static SyncGroup Update(this ISyncGroupsOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RefreshHubSchemaAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Lists sync groups under a hub database. + /// Triggers a sync group synchronization. /// /// /// The operations group for this extension method. @@ -550,13 +553,16 @@ public static SyncGroup Update(this ISyncGroupsOperations operations, string res /// /// The name of the database on which the sync group is hosted. /// - public static Microsoft.Rest.Azure.IPage ListByDatabase(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The name of the sync group. + /// + public static void TriggerSync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + ((ISyncGroupsOperations)operations).TriggerSyncAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Lists sync groups under a hub database. + /// Triggers a sync group synchronization. /// /// /// The operations group for this extension method. @@ -571,18 +577,18 @@ public static Microsoft.Rest.Azure.IPage ListByDatabase(this ISyncGro /// /// The name of the database on which the sync group is hosted. /// + /// + /// The name of the sync group. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByDatabaseAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task TriggerSyncAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.TriggerSyncWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Refreshes a hub database schema. + /// Creates or updates a sync group. /// /// /// The operations group for this extension method. @@ -600,13 +606,13 @@ public static Microsoft.Rest.Azure.IPage ListByDatabase(this ISyncGro /// /// The name of the sync group. /// - public static void BeginRefreshHubSchema(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static SyncGroup BeginCreateOrUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) { - ((ISyncGroupsOperations)operations).BeginRefreshHubSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); } /// - /// Refreshes a hub database schema. + /// Creates or updates a sync group. /// /// /// The operations group for this extension method. @@ -627,12 +633,15 @@ public static void BeginRefreshHubSchema(this ISyncGroupsOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRefreshHubSchemaAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginRefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates or updates a sync group. + /// Deletes a sync group. /// /// /// The operations group for this extension method. @@ -650,13 +659,13 @@ public static void BeginRefreshHubSchema(this ISyncGroupsOperations operations, /// /// The name of the sync group. /// - public static SyncGroup BeginCreateOrUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + public static SyncGroupsDeleteHeaders BeginDelete(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Creates or updates a sync group. + /// Deletes a sync group. /// /// /// The operations group for this extension method. @@ -677,15 +686,15 @@ public static SyncGroup BeginCreateOrUpdate(this ISyncGroupsOperations operation /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Deletes a sync group. + /// Updates a sync group. /// /// /// The operations group for this extension method. @@ -703,13 +712,13 @@ public static SyncGroup BeginCreateOrUpdate(this ISyncGroupsOperations operation /// /// The name of the sync group. /// - public static void BeginDelete(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + public static SyncGroup BeginUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) { - ((ISyncGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).BeginUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); } /// - /// Deletes a sync group. + /// Updates a sync group. /// /// /// The operations group for this extension method. @@ -730,12 +739,15 @@ public static void BeginDelete(this ISyncGroupsOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The operations group for this extension method. @@ -753,13 +765,13 @@ public static void BeginDelete(this ISyncGroupsOperations operations, string res /// /// The name of the sync group. /// - public static SyncGroup BeginUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + public static SyncGroupsRefreshHubSchemaHeaders BeginRefreshHubSchema(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncGroupsOperations)operations).BeginUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).BeginRefreshHubSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The operations group for this extension method. @@ -780,11 +792,11 @@ public static SyncGroup BeginUpdate(this ISyncGroupsOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRefreshHubSchemaAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// @@ -821,7 +833,7 @@ public static Microsoft.Rest.Azure.IPage ListSyncDatab } } /// - /// Gets a collection of hub database schemas. + /// Lists sync groups under a hub database. /// /// /// The operations group for this extension method. @@ -829,13 +841,13 @@ public static Microsoft.Rest.Azure.IPage ListSyncDatab /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListHubSchemasNext(this ISyncGroupsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListByDatabaseNext(this ISyncGroupsOperations operations, string nextPageLink) { - return ((ISyncGroupsOperations)operations).ListHubSchemasNextAsync(nextPageLink).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets a collection of hub database schemas. + /// Lists sync groups under a hub database. /// /// /// The operations group for this extension method. @@ -846,15 +858,15 @@ public static Microsoft.Rest.Azure.IPage ListHubSchema /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListHubSchemasNextAsync(this ISyncGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByDatabaseNextAsync(this ISyncGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListHubSchemasNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets a collection of sync group logs. + /// Gets a collection of hub database schemas. /// /// /// The operations group for this extension method. @@ -862,13 +874,13 @@ public static Microsoft.Rest.Azure.IPage ListHubSchema /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListLogsNext(this ISyncGroupsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListHubSchemasNext(this ISyncGroupsOperations operations, string nextPageLink) { - return ((ISyncGroupsOperations)operations).ListLogsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).ListHubSchemasNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets a collection of sync group logs. + /// Gets a collection of hub database schemas. /// /// /// The operations group for this extension method. @@ -879,15 +891,15 @@ public static Microsoft.Rest.Azure.IPage ListLogsNext(th /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListLogsNextAsync(this ISyncGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListHubSchemasNextAsync(this ISyncGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListLogsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListHubSchemasNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists sync groups under a hub database. + /// Gets a collection of sync group logs. /// /// /// The operations group for this extension method. @@ -895,13 +907,13 @@ public static Microsoft.Rest.Azure.IPage ListLogsNext(th /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListByDatabaseNext(this ISyncGroupsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListLogsNext(this ISyncGroupsOperations operations, string nextPageLink) { - return ((ISyncGroupsOperations)operations).ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + return ((ISyncGroupsOperations)operations).ListLogsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Lists sync groups under a hub database. + /// Gets a collection of sync group logs. /// /// /// The operations group for this extension method. @@ -912,9 +924,9 @@ public static Microsoft.Rest.Azure.IPage ListByDatabaseNext(this ISyn /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByDatabaseNextAsync(this ISyncGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListLogsNextAsync(this ISyncGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListLogsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperations.cs index 8f34be8e1159..4711f4712d39 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperations.cs @@ -39,7 +39,7 @@ internal SyncMembersOperations (SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a sync member. + /// Lists sync members in the given sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -52,10 +52,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// The name of the database on which the sync group is hosted. /// /// - /// The name of the sync group on which the sync member is hosted. - /// - /// - /// The name of the sync member. + /// The name of the sync group. /// /// /// Headers that will be added to request. @@ -78,7 +75,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySyncGroupWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -104,17 +101,12 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncGroupName"); } - if (syncMemberName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncMemberName"); - } - if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -126,22 +118,20 @@ internal SyncMembersOperations (SqlManagementClient client) tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("syncGroupName", syncGroupName); - tracingParameters.Add("syncMemberName", syncMemberName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySyncGroup", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers").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("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); - _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -209,14 +199,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -226,10 +215,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -242,7 +227,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -256,7 +241,7 @@ internal SyncMembersOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -280,74 +265,7 @@ internal SyncMembersOperations (SqlManagementClient client) } /// - /// Creates or updates a sync member. - /// - /// - /// 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 on which the sync group is hosted. - /// - /// - /// The name of the sync group on which the sync member is hosted. - /// - /// - /// The name of the sync member. - /// - /// - /// The requested sync member resource state. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a sync member. - /// - /// - /// 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 on which the sync group is hosted. - /// - /// - /// The name of the sync group on which the sync member is hosted. - /// - /// - /// The name of the sync member. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates an existing sync member. + /// Gets a sync member. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -365,38 +283,6 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// The name of the sync member. /// - /// - /// The requested sync member resource state. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists sync members in the given sync group. - /// - /// - /// 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 on which the sync group is hosted. - /// - /// - /// The name of the sync group. - /// /// /// Headers that will be added to request. /// @@ -418,7 +304,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListBySyncGroupWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -444,12 +330,17 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncGroupName"); } + if (syncMemberName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "syncMemberName"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -461,20 +352,22 @@ internal SyncMembersOperations (SqlManagementClient client) tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySyncGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}").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("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -542,14 +435,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -559,10 +451,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -575,7 +463,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -589,7 +477,7 @@ internal SyncMembersOperations (SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -612,6 +500,140 @@ internal SyncMembersOperations (SqlManagementClient client) } + /// + /// Creates or updates a sync member. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a sync member. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an existing sync member. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// 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 on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Gets a sync member database schema. /// @@ -688,7 +710,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -783,14 +805,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -800,10 +821,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -853,38 +870,6 @@ internal SyncMembersOperations (SqlManagementClient client) } - /// - /// Refreshes a sync member database schema. - /// - /// - /// 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 on which the sync group is hosted. - /// - /// - /// The name of the sync group on which the sync member is hosted. - /// - /// - /// The name of the sync member. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task RefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Creates or updates a sync member. /// @@ -928,7 +913,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -938,7 +923,10 @@ internal SyncMembersOperations (SqlManagementClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -969,7 +957,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1071,14 +1059,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1088,10 +1075,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1104,7 +1087,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1148,6 +1131,19 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1196,7 +1192,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1232,7 +1228,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1327,14 +1323,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1344,10 +1339,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1360,7 +1351,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1368,6 +1359,19 @@ internal SyncMembersOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1422,7 +1426,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1462,7 +1466,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1564,14 +1568,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1581,10 +1584,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1597,7 +1596,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1623,6 +1622,19 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1671,7 +1683,7 @@ internal SyncMembersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginRefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1707,7 +1719,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2025-02-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1802,14 +1814,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1819,10 +1830,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1835,7 +1842,7 @@ internal SyncMembersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1843,6 +1850,19 @@ internal SyncMembersOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1966,14 +1986,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1983,10 +2002,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2148,14 +2163,13 @@ internal SyncMembersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2165,10 +2179,6 @@ internal SyncMembersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperationsExtensions.cs b/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperationsExtensions.cs index aa86b6f0043d..98b33acdb82c 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperationsExtensions.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/SyncMembersOperationsExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class SyncMembersOperationsExtensions { /// - /// Gets a sync member. + /// Lists sync members in the given sync group. /// /// /// The operations group for this extension method. @@ -29,18 +29,15 @@ public static partial class SyncMembersOperationsExtensions /// The name of the database on which the sync group is hosted. /// /// - /// The name of the sync group on which the sync member is hosted. - /// - /// - /// The name of the sync member. + /// The name of the sync group. /// - public static SyncMember Get(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + public static Microsoft.Rest.Azure.IPage ListBySyncGroup(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) { - return ((ISyncMembersOperations)operations).GetAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).ListBySyncGroupAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); } /// - /// Gets a sync member. + /// Lists sync members in the given sync group. /// /// /// The operations group for this extension method. @@ -56,23 +53,20 @@ public static SyncMember Get(this ISyncMembersOperations operations, string reso /// The name of the database on which the sync group is hosted. /// /// - /// The name of the sync group on which the sync member is hosted. - /// - /// - /// The name of the sync member. + /// The name of the sync group. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListBySyncGroupAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListBySyncGroupWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a sync member. + /// Gets a sync member. /// /// /// The operations group for this extension method. @@ -93,13 +87,13 @@ public static SyncMember Get(this ISyncMembersOperations operations, string reso /// /// The name of the sync member. /// - public static SyncMember CreateOrUpdate(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) + public static SyncMember Get(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) { - return ((ISyncMembersOperations)operations).CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).GetAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); } /// - /// Creates or updates a sync member. + /// Gets a sync member. /// /// /// The operations group for this extension method. @@ -123,15 +117,15 @@ public static SyncMember CreateOrUpdate(this ISyncMembersOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a sync member. + /// Creates or updates a sync member. /// /// /// The operations group for this extension method. @@ -152,13 +146,13 @@ public static SyncMember CreateOrUpdate(this ISyncMembersOperations operations, /// /// The name of the sync member. /// - public static void Delete(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + public static SyncMember CreateOrUpdate(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) { - ((ISyncMembersOperations)operations).DeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); } /// - /// Deletes a sync member. + /// Creates or updates a sync member. /// /// /// The operations group for this extension method. @@ -182,12 +176,15 @@ public static void Delete(this ISyncMembersOperations operations, string resourc /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Updates an existing sync member. + /// Deletes a sync member. /// /// /// The operations group for this extension method. @@ -208,13 +205,13 @@ public static void Delete(this ISyncMembersOperations operations, string resourc /// /// The name of the sync member. /// - public static SyncMember Update(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) + public static SyncMembersDeleteHeaders Delete(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) { - return ((ISyncMembersOperations)operations).UpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).DeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); } /// - /// Updates an existing sync member. + /// Deletes a sync member. /// /// /// The operations group for this extension method. @@ -238,15 +235,15 @@ public static SyncMember Update(this ISyncMembersOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Lists sync members in the given sync group. + /// Updates an existing sync member. /// /// /// The operations group for this extension method. @@ -262,15 +259,18 @@ public static SyncMember Update(this ISyncMembersOperations operations, string r /// The name of the database on which the sync group is hosted. /// /// - /// The name of the sync group. + /// The name of the sync group on which the sync member is hosted. /// - public static Microsoft.Rest.Azure.IPage ListBySyncGroup(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + /// + /// The name of the sync member. + /// + public static SyncMember Update(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) { - return ((ISyncMembersOperations)operations).ListBySyncGroupAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).UpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); } /// - /// Lists sync members in the given sync group. + /// Updates an existing sync member. /// /// /// The operations group for this extension method. @@ -286,20 +286,23 @@ public static Microsoft.Rest.Azure.IPage ListBySyncGroup(this ISyncM /// The name of the database on which the sync group is hosted. /// /// - /// The name of the sync group. + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListBySyncGroupAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListBySyncGroupWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets a sync member database schema. + /// Refreshes a sync member database schema. /// /// /// The operations group for this extension method. @@ -320,13 +323,13 @@ public static Microsoft.Rest.Azure.IPage ListBySyncGroup(this ISyncM /// /// The name of the sync member. /// - public static Microsoft.Rest.Azure.IPage ListMemberSchemas(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + public static SyncMembersRefreshMemberSchemaHeaders RefreshMemberSchema(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) { - return ((ISyncMembersOperations)operations).ListMemberSchemasAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).RefreshMemberSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); } /// - /// Gets a sync member database schema. + /// Refreshes a sync member database schema. /// /// /// The operations group for this extension method. @@ -350,15 +353,15 @@ public static Microsoft.Rest.Azure.IPage ListMemberSch /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMemberSchemasAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RefreshMemberSchemaAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMemberSchemasWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Refreshes a sync member database schema. + /// Gets a sync member database schema. /// /// /// The operations group for this extension method. @@ -379,13 +382,13 @@ public static Microsoft.Rest.Azure.IPage ListMemberSch /// /// The name of the sync member. /// - public static void RefreshMemberSchema(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + public static Microsoft.Rest.Azure.IPage ListMemberSchemas(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) { - ((ISyncMembersOperations)operations).RefreshMemberSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).ListMemberSchemasAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); } /// - /// Refreshes a sync member database schema. + /// Gets a sync member database schema. /// /// /// The operations group for this extension method. @@ -409,9 +412,12 @@ public static void RefreshMemberSchema(this ISyncMembersOperations operations, s /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RefreshMemberSchemaAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMemberSchemasAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.RefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListMemberSchemasWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// /// Creates or updates a sync member. @@ -494,9 +500,9 @@ public static SyncMember BeginCreateOrUpdate(this ISyncMembersOperations operati /// /// The name of the sync member. /// - public static void BeginDelete(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + public static SyncMembersDeleteHeaders BeginDelete(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) { - ((ISyncMembersOperations)operations).BeginDeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).BeginDeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); } /// @@ -524,9 +530,12 @@ public static void BeginDelete(this ISyncMembersOperations operations, string re /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Updates an existing sync member. @@ -609,9 +618,9 @@ public static SyncMember BeginUpdate(this ISyncMembersOperations operations, str /// /// The name of the sync member. /// - public static void BeginRefreshMemberSchema(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + public static SyncMembersRefreshMemberSchemaHeaders BeginRefreshMemberSchema(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) { - ((ISyncMembersOperations)operations).BeginRefreshMemberSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + return ((ISyncMembersOperations)operations).BeginRefreshMemberSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); } /// @@ -639,9 +648,12 @@ public static void BeginRefreshMemberSchema(this ISyncMembersOperations operatio /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRefreshMemberSchemaAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRefreshMemberSchemaAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginRefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginRefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Lists sync members in the given sync group. diff --git a/src/Sql/Sql.Management.Sdk/README.md b/src/Sql/Sql.Management.Sdk/README.md index 9e9b53f4a474..6f030161c15e 100644 --- a/src/Sql/Sql.Management.Sdk/README.md +++ b/src/Sql/Sql.Management.Sdk/README.md @@ -32,7 +32,7 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/sql.core_legacy.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/ServerDevOpsAudit.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/BlobAuditing.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/SyncGroups.json + - SyncGroups.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/DatabaseSecurityAlertPolicies.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/DatabaseVulnerabilityAssesmentRuleBaselines.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/DatabaseVulnerabilityAssessments.json @@ -75,7 +75,7 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ServerSecurityAlertPolicies.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ServerTrustGroups.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ServerVulnerabilityAssessments.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/SyncMembers.json + - SyncMembers.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/TdeCertificates.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/VirtualNetworkRules.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/TransparentDataEncryptions.json diff --git a/src/Sql/Sql.Management.Sdk/SyncGroups.json b/src/Sql/Sql.Management.Sdk/SyncGroups.json new file mode 100644 index 000000000000..988aa0056e4b --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/SyncGroups.json @@ -0,0 +1,1195 @@ +{ + "swagger": "2.0", + "info": { + "version": "2025-02-01-preview", + "title": "SqlManagementClient", + "description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds": { + "get": { + "tags": [ + "SyncGroups" + ], + "description": "Gets a collection of sync database ids.", + "operationId": "SyncGroups_ListSyncDatabaseIds", + "parameters": [ + { + "name": "locationName", + "in": "path", + "description": "The name of the region where the resource is located.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved collection of sync database ids.", + "schema": { + "$ref": "#/definitions/SyncDatabaseIdListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get a sync database ID": { + "$ref": "./examples/SyncGroupGetSyncDatabaseId.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups": { + "get": { + "tags": [ + "SyncGroups" + ], + "description": "Lists sync groups under a hub database.", + "operationId": "SyncGroups_ListByDatabase", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of sync groups.", + "schema": { + "$ref": "#/definitions/SyncGroupListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List sync groups under a given database": { + "$ref": "./examples/SyncGroupListByDatabase.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}": { + "get": { + "tags": [ + "SyncGroups" + ], + "description": "Gets a sync group.", + "operationId": "SyncGroups_Get", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the specified sync group.", + "schema": { + "$ref": "#/definitions/SyncGroup" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a sync group": { + "$ref": "./examples/SyncGroupGet.json" + }, + "Get a sync group with user assigned identity": { + "$ref": "./examples/SyncGroupGetWithIdentity.json" + } + } + }, + "put": { + "tags": [ + "SyncGroups" + ], + "description": "Creates or updates a sync group.", + "operationId": "SyncGroups_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The requested sync group resource state.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncGroup" + } + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully updated the sync group.", + "schema": { + "$ref": "#/definitions/SyncGroup" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "Creating or updating the sync group is in progress.", + "headers": { + "Location": { + "type": "string" + } + } + }, + "201": { + "description": "Successfully created the sync group.", + "schema": { + "$ref": "#/definitions/SyncGroup" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Create a sync group": { + "$ref": "./examples/SyncGroupCreate.json" + }, + "Update a sync group": { + "$ref": "./examples/SyncGroupUpdate.json" + }, + "Create a sync group with user assigned identity": { + "$ref": "./examples/SyncGroupCreateWithIdentity.json" + } + } + }, + "delete": { + "tags": [ + "SyncGroups" + ], + "description": "Deletes a sync group.", + "operationId": "SyncGroups_Delete", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully deleted the sync group." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "Deleting the sync group is in progress.", + "headers": { + "Location": { + "type": "string" + } + } + }, + "204": { + "description": "The specified sync group does not exist." + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Delete a sync group": { + "$ref": "./examples/SyncGroupDelete.json" + } + } + }, + "patch": { + "tags": [ + "SyncGroups" + ], + "description": "Updates a sync group.", + "operationId": "SyncGroups_Update", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The requested sync group resource state.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncGroup" + } + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully updated the sync group.", + "schema": { + "$ref": "#/definitions/SyncGroup" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "Updating the sync group is in progress.", + "headers": { + "Location": { + "type": "string" + } + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Update a sync group": { + "$ref": "./examples/SyncGroupPatch.json" + }, + "Update a sync group with user assigned identity": { + "$ref": "./examples/SyncGroupPatchWithIdentity.json" + }, + "Update a sync group with new user assigned identity and remove older assigned identity": { + "$ref": "./examples/SyncGroupPatchAddAndRemoveIdentity.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync": { + "post": { + "tags": [ + "SyncGroups" + ], + "description": "Cancels a sync group synchronization.", + "operationId": "SyncGroups_CancelSync", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully cancel a sync group synchronization." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Cancel a sync group synchronization": { + "$ref": "./examples/SyncGroupCancelSync.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas": { + "get": { + "tags": [ + "SyncGroups" + ], + "description": "Gets a collection of hub database schemas.", + "operationId": "SyncGroups_ListHubSchemas", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully get a sync group hub database schema.", + "schema": { + "$ref": "#/definitions/SyncFullSchemaPropertiesListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get a hub database schema.": { + "$ref": "./examples/SyncGroupGetHubSchema.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs": { + "get": { + "tags": [ + "SyncGroups" + ], + "description": "Gets a collection of sync group logs.", + "operationId": "SyncGroups_ListLogs", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "name": "startTime", + "in": "query", + "description": "Get logs generated after this time.", + "required": true, + "type": "string" + }, + { + "name": "endTime", + "in": "query", + "description": "Get logs generated before this time.", + "required": true, + "type": "string" + }, + { + "name": "type", + "in": "query", + "description": "The types of logs to retrieve.", + "required": true, + "type": "string", + "enum": [ + "All", + "Error", + "Warning", + "Success" + ], + "x-ms-enum": { + "name": "SyncGroupsType", + "modelAsString": true + } + }, + { + "name": "continuationToken", + "in": "query", + "description": "The continuation token for this operation.", + "required": false, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved sync group logs.", + "schema": { + "$ref": "#/definitions/SyncGroupLogListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get sync group logs": { + "$ref": "./examples/SyncGroupGetLog.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema": { + "post": { + "tags": [ + "SyncGroups" + ], + "description": "Refreshes a hub database schema.", + "operationId": "SyncGroups_RefreshHubSchema", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully refreshed a sync hub schema." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidServerName - Invalid server name specified.\n\n * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.\n\n * 400 TokenTooLong - The provided token is too long.\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "The sync hub schema refresh operation is on going.", + "headers": { + "Location": { + "type": "string" + } + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Refresh a hub database schema.": { + "$ref": "./examples/SyncGroupRefreshHubSchema.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync": { + "post": { + "tags": [ + "SyncGroups" + ], + "description": "Triggers a sync group synchronization.", + "operationId": "SyncGroups_TriggerSync", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully triggered a sync group synchronization." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 400 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncGroupDrop - The sync group is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_UpdateSyncGroupWhenDropping - Cannot update the sync group because it is currently being dropped.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 400 SyncOperation_InvalidSyncInterval - Cannot create or update sync group because the sync interval is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncGroupName - Cannot create sync group because the sync group with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Trigger a sync group synchronization.": { + "$ref": "./examples/SyncGroupTriggerSync.json" + } + } + } + } + }, + "definitions": { + "DataSyncParticipantIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "description": "The Datasync identity type", + "enum": [ + "None", + "SystemAssigned", + "UserAssigned", + "SystemAssignedUserAssigned" + ], + "type": "string", + "x-ms-enum": { + "name": "DataSyncParticipantIdentityType", + "modelAsString": true + } + }, + "tenantId": { + "format": "uuid", + "description": "The DataSync participant identity tenant id", + "type": "string" + }, + "userAssignedIdentities": { + "description": "The resource ids of the user assigned identities to use", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/DataSyncParticipantUserAssignedIdentity" + } + } + } + }, + "DataSyncParticipantUserAssignedIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "type": "object", + "properties": { + "principalId": { + "format": "uuid", + "description": "The Azure Active Directory principal id.", + "type": "string", + "readOnly": true + }, + "clientId": { + "format": "uuid", + "description": "The Azure Active Directory client id.", + "type": "string", + "readOnly": true + } + } + }, + "SyncDatabaseIdListResult": { + "description": "A list of sync database ID properties.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncDatabaseIdProperties" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "SyncDatabaseIdProperties": { + "description": "Properties of the sync database id.", + "type": "object", + "properties": { + "id": { + "description": "ARM resource id of sync database.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaProperties": { + "description": "Properties of the database full schema.", + "type": "object", + "properties": { + "tables": { + "description": "List of tables in the database full schema.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncFullSchemaTable" + }, + "readOnly": true + }, + "lastUpdateTime": { + "format": "date-time", + "description": "Last update time of the database schema.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaPropertiesListResult": { + "description": "A list of sync schema properties.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncFullSchemaProperties" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaTable": { + "description": "Properties of the table in the database full schema.", + "type": "object", + "properties": { + "columns": { + "description": "List of columns in the table of database full schema.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncFullSchemaTableColumn" + }, + "readOnly": true + }, + "errorId": { + "description": "Error id of the table.", + "type": "string", + "readOnly": true + }, + "hasError": { + "description": "If there is error in the table.", + "type": "boolean", + "readOnly": true + }, + "name": { + "description": "Name of the table.", + "type": "string", + "readOnly": true + }, + "quotedName": { + "description": "Quoted name of the table.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaTableColumn": { + "description": "Properties of the column in the table of database full schema.", + "type": "object", + "properties": { + "dataSize": { + "description": "Data size of the column.", + "type": "string", + "readOnly": true + }, + "dataType": { + "description": "Data type of the column.", + "type": "string", + "readOnly": true + }, + "errorId": { + "description": "Error id of the column.", + "type": "string", + "readOnly": true + }, + "hasError": { + "description": "If there is error in the table.", + "type": "boolean", + "readOnly": true + }, + "isPrimaryKey": { + "description": "If it is the primary key of the table.", + "type": "boolean", + "readOnly": true + }, + "name": { + "description": "Name of the column.", + "type": "string", + "readOnly": true + }, + "quotedName": { + "description": "Quoted name of the column.", + "type": "string", + "readOnly": true + } + } + }, + "SyncGroup": { + "description": "An Azure SQL Database sync group.", + "required": [ + "identity" + ], + "type": "object", + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "sku": { + "$ref": "../../../common/v1/types.json#/definitions/Sku", + "description": "The name and capacity of the SKU." + }, + "identity": { + "$ref": "#/definitions/DataSyncParticipantIdentity", + "description": "Sync group authentication information." + }, + "properties": { + "$ref": "#/definitions/SyncGroupProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + }, + "SyncGroupListResult": { + "description": "A list of sync groups.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncGroup" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "SyncGroupLogListResult": { + "description": "A list of sync group log properties.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncGroupLogProperties" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "SyncGroupLogProperties": { + "description": "Properties of an Azure SQL Database sync group log.", + "type": "object", + "properties": { + "timestamp": { + "format": "date-time", + "description": "Timestamp of the sync group log.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "Type of the sync group log.", + "enum": [ + "All", + "Error", + "Warning", + "Success" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "SyncGroupLogType", + "modelAsString": true + } + }, + "source": { + "description": "Source of the sync group log.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "Details of the sync group log.", + "type": "string", + "readOnly": true + }, + "tracingId": { + "format": "uuid", + "description": "TracingId of the sync group log.", + "type": "string", + "readOnly": true + }, + "operationStatus": { + "description": "OperationStatus of the sync group log.", + "type": "string", + "readOnly": true + } + } + }, + "SyncGroupProperties": { + "description": "Properties of a sync group with support to MI.", + "type": "object", + "properties": { + "interval": { + "format": "int32", + "description": "Sync interval of the sync group.", + "type": "integer" + }, + "lastSyncTime": { + "format": "date-time", + "description": "Last sync time of the sync group.", + "type": "string", + "readOnly": true + }, + "conflictResolutionPolicy": { + "description": "Conflict resolution policy of the sync group.", + "enum": [ + "HubWin", + "MemberWin" + ], + "type": "string", + "x-ms-enum": { + "name": "SyncConflictResolutionPolicy", + "modelAsString": true + } + }, + "syncDatabaseId": { + "description": "ARM resource id of the sync database in the sync group.", + "type": "string" + }, + "hubDatabaseUserName": { + "description": "User name for the sync group hub database credential.", + "type": "string" + }, + "hubDatabasePassword": { + "description": "Password for the sync group hub database credential.", + "type": "string", + "x-ms-secret": true, + "x-ms-mutability": [ + "create", + "update" + ] + }, + "syncState": { + "description": "Sync state of the sync group.", + "enum": [ + "NotReady", + "Error", + "Warning", + "Progressing", + "Good" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "SyncGroupState", + "modelAsString": true + } + }, + "schema": { + "$ref": "#/definitions/SyncGroupSchema", + "description": "Sync schema of the sync group." + }, + "enableConflictLogging": { + "description": "If conflict logging is enabled.", + "type": "boolean" + }, + "conflictLoggingRetentionInDays": { + "format": "int32", + "description": "Conflict logging retention period.", + "type": "integer" + }, + "usePrivateLinkConnection": { + "description": "If use private link connection is enabled.", + "type": "boolean" + }, + "privateEndpointName": { + "description": "Private endpoint name of the sync group if use private link connection is enabled.", + "type": "string", + "readOnly": true + } + } + }, + "SyncGroupSchema": { + "description": "Properties of sync group schema.", + "type": "object", + "properties": { + "tables": { + "description": "List of tables in sync group schema.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncGroupSchemaTable" + } + }, + "masterSyncMemberName": { + "description": "Name of master sync member where the schema is from.", + "type": "string" + } + } + }, + "SyncGroupSchemaTable": { + "description": "Properties of table in sync group schema.", + "type": "object", + "properties": { + "columns": { + "description": "List of columns in sync group schema.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncGroupSchemaTableColumn" + } + }, + "quotedName": { + "description": "Quoted name of sync group schema table.", + "type": "string" + } + } + }, + "SyncGroupSchemaTableColumn": { + "description": "Properties of column in sync group table.", + "type": "object", + "properties": { + "quotedName": { + "description": "Quoted name of sync group table column.", + "type": "string" + }, + "dataSize": { + "description": "Data size of the column.", + "type": "string" + }, + "dataType": { + "description": "Data type of the column.", + "type": "string" + } + } + } + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "description": "The name of the server.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/SyncMembers.json b/src/Sql/Sql.Management.Sdk/SyncMembers.json new file mode 100644 index 000000000000..4b1b927a0f79 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/SyncMembers.json @@ -0,0 +1,860 @@ +{ + "swagger": "2.0", + "info": { + "version": "2025-02-01-preview", + "title": "SqlManagementClient", + "description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers": { + "get": { + "tags": [ + "SyncMembers" + ], + "description": "Lists sync members in the given sync group.", + "operationId": "SyncMembers_ListBySyncGroup", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of sync members.", + "schema": { + "$ref": "#/definitions/SyncMemberListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List sync members under a sync group": { + "$ref": "./examples/SyncMemberListBySyncGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}": { + "get": { + "tags": [ + "SyncMembers" + ], + "description": "Gets a sync member.", + "operationId": "SyncMembers_Get", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group on which the sync member is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncMemberName", + "in": "path", + "description": "The name of the sync member.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the specified sync member.", + "schema": { + "$ref": "#/definitions/SyncMember" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a sync member": { + "$ref": "./examples/SyncMemberGet.json" + }, + "Get a sync member with user assigned identity": { + "$ref": "./examples/SyncMemberGetWithIdentity.json" + } + } + }, + "put": { + "tags": [ + "SyncMembers" + ], + "description": "Creates or updates a sync member.", + "operationId": "SyncMembers_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group on which the sync member is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncMemberName", + "in": "path", + "description": "The name of the sync member.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The requested sync member resource state.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncMember" + } + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully updated the sync member.", + "schema": { + "$ref": "#/definitions/SyncMember" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "Creating or updating the sync member is in progress.", + "headers": { + "Location": { + "type": "string" + } + } + }, + "201": { + "description": "Successfully created the sync member.", + "schema": { + "$ref": "#/definitions/SyncMember" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Create a new sync member": { + "$ref": "./examples/SyncMemberCreate.json" + }, + "Create a new sync member with user assigned identity": { + "$ref": "./examples/SyncMemberCreateWithIdentity.json" + }, + "Update a sync member": { + "$ref": "./examples/SyncMemberUpdate.json" + } + } + }, + "delete": { + "tags": [ + "SyncMembers" + ], + "description": "Deletes a sync member.", + "operationId": "SyncMembers_Delete", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group on which the sync member is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncMemberName", + "in": "path", + "description": "The name of the sync member.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully deleted the sync member." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "Deleting the sync member is in progress.", + "headers": { + "Location": { + "type": "string" + } + } + }, + "204": { + "description": "The specified sync member does not exist." + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Delete a sync member": { + "$ref": "./examples/SyncMemberDelete.json" + } + } + }, + "patch": { + "tags": [ + "SyncMembers" + ], + "description": "Updates an existing sync member.", + "operationId": "SyncMembers_Update", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group on which the sync member is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncMemberName", + "in": "path", + "description": "The name of the sync member.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The requested sync member resource state.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncMember" + } + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully updated the sync member.", + "schema": { + "$ref": "#/definitions/SyncMember" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "Updating the sync member is in progress.", + "headers": { + "Location": { + "type": "string" + } + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Update an existing sync member": { + "$ref": "./examples/SyncMemberPatch.json" + }, + "Update an existing sync member with user assigned identity": { + "$ref": "./examples/SyncMemberPatchWithIdentity.json" + }, + "Update an existing sync member with new user assigned identity and removing older user assigned identity": { + "$ref": "./examples/SyncMemberPatchAddAndRemoveIdentity.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema": { + "post": { + "tags": [ + "SyncMembers" + ], + "description": "Refreshes a sync member database schema.", + "operationId": "SyncMembers_RefreshMemberSchema", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group on which the sync member is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncMemberName", + "in": "path", + "description": "The name of the sync member.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully refreshed a sync member schema." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidServerName - Invalid server name specified.\n\n * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.\n\n * 400 TokenTooLong - The provided token is too long.\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + }, + "202": { + "description": "The sync member schema refresh operation is on going.", + "headers": { + "Location": { + "type": "string" + } + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Refresh a sync member database schema": { + "$ref": "./examples/SyncMemberRefreshSchema.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas": { + "get": { + "tags": [ + "SyncMembers" + ], + "description": "Gets a sync member database schema.", + "operationId": "SyncMembers_ListMemberSchemas", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "description": "The name of the database on which the sync group is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncGroupName", + "in": "path", + "description": "The name of the sync group on which the sync member is hosted.", + "required": true, + "type": "string" + }, + { + "name": "syncMemberName", + "in": "path", + "description": "The name of the sync member.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully get a sync member schema.", + "schema": { + "$ref": "#/definitions/SyncFullSchemaPropertiesListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 InvalidSyncGroupName - The Sync Group name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 InvalidSyncMemberName - The Sync Member name is invalid. This field can contain letters, numbers, dashes and underscores.\n\n * 400 MissingSyncMemberName - The Sync Member name is missing\n\n * 400 InvalidSyncGroupInterval - Sync Interval should be greater than or equal to 5 seconds.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 MissingServerName - The Server name is missing\n\n * 400 MissingDatabaseName - The Database name is missing\n\n * 400 MissingSyncGroupName - The Sync Group name is missing\n\n * 400 MissingConflictResolutionPolicy - The Conflict Resolution Policy is missing\n\n * 400 MissingSyncAgentName - The Sync Agent name is missing\n\n * 400 DataSyncMissingIdentityType - The identity type must be specified.\n\n * 400 DataSyncMissingUserAssignedIdentities - The identity type is set to 'UserAssigned', but no user-assigned identities are listed.\n\n * 400 DataSyncMissingAuthenticationInfo - At least one authentication method must be provided.\n\n * 400 DataSyncInvalidIdentityType - An unrecognized or unsupported identity type was specified in the sync configuration.\n\n * 400 DataSyncMultipleIdentities - Only one user-assigned managed identity is supported for a sync configuration.\n\n * 400 MissingSyncMemberDatabaseType - The Sync Member database type is missing\n\n * 400 MissingUserAssignedIdentityUrl - The user assigned identity url is missing in the header\n\n * 400 SyncOperation_GenericFailure - Failed to perform data sync operation.\n\n * 400 InvalidSyncGroup - Sync group is invalid.\n\n * 400 InvalidSyncMember - Sync member is invalid.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotCreateSyncMemberDueToQuotaExceeded - Cannot create sync member due to quota exceeded.\n\n * 400 SyncOperation_DuplicateSyncMemberDrop - The sync member is already being dropped.\n\n * 400 SyncOperation_WrongSyncDatabase - The sync database specified does not match the existing one.\n\n * 400 SyncOperation_DwInSyncGroup - Cannot use datawarehouse edition in data sync.\n\n * 400 SyncOperation_MasterDbInSyncGroup - Cannot use logical master in data sync.\n\n * 400 SyncOperation_UnsupportedDataTypeColumnInSchema - Cannot add column to schema because the data type of the column is unsupported.\n\n * 400 SyncOperation_InvalidCredential - Credential of database is invalid.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SyncOperation_HubServerNotFound - Hub logical server does not exist.\n\n * 404 SyncOperation_InvalidHubDatabase - Hub database is invalid.\n\n * 409 SyncOperation_DuplicateSyncMemberName - Cannot create sync member because the sync member with the same name already exists.", + "schema": { + "$ref": "../../../common-types/resource-management/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get a sync member schema": { + "$ref": "./examples/SyncMemberGetSchema.json" + } + } + } + } + }, + "definitions": { + "DataSyncParticipantIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "description": "The Datasync identity type", + "enum": [ + "None", + "SystemAssigned", + "UserAssigned", + "SystemAssignedUserAssigned" + ], + "type": "string", + "x-ms-enum": { + "name": "DataSyncParticipantIdentityType", + "modelAsString": true + } + }, + "tenantId": { + "format": "uuid", + "description": "The DataSync participant identity tenant id", + "type": "string" + }, + "userAssignedIdentities": { + "description": "The resource ids of the user assigned identities to use", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/DataSyncParticipantUserAssignedIdentity" + } + } + } + }, + "DataSyncParticipantUserAssignedIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "type": "object", + "properties": { + "principalId": { + "format": "uuid", + "description": "The Azure Active Directory principal id.", + "type": "string", + "readOnly": true + }, + "clientId": { + "format": "uuid", + "description": "The Azure Active Directory client id.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaProperties": { + "description": "Properties of the database full schema.", + "type": "object", + "properties": { + "tables": { + "description": "List of tables in the database full schema.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncFullSchemaTable" + }, + "readOnly": true + }, + "lastUpdateTime": { + "format": "date-time", + "description": "Last update time of the database schema.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaPropertiesListResult": { + "description": "A list of sync schema properties.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncFullSchemaProperties" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaTable": { + "description": "Properties of the table in the database full schema.", + "type": "object", + "properties": { + "columns": { + "description": "List of columns in the table of database full schema.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncFullSchemaTableColumn" + }, + "readOnly": true + }, + "errorId": { + "description": "Error id of the table.", + "type": "string", + "readOnly": true + }, + "hasError": { + "description": "If there is error in the table.", + "type": "boolean", + "readOnly": true + }, + "name": { + "description": "Name of the table.", + "type": "string", + "readOnly": true + }, + "quotedName": { + "description": "Quoted name of the table.", + "type": "string", + "readOnly": true + } + } + }, + "SyncFullSchemaTableColumn": { + "description": "Properties of the column in the table of database full schema.", + "type": "object", + "properties": { + "dataSize": { + "description": "Data size of the column.", + "type": "string", + "readOnly": true + }, + "dataType": { + "description": "Data type of the column.", + "type": "string", + "readOnly": true + }, + "errorId": { + "description": "Error id of the column.", + "type": "string", + "readOnly": true + }, + "hasError": { + "description": "If there is error in the table.", + "type": "boolean", + "readOnly": true + }, + "isPrimaryKey": { + "description": "If it is the primary key of the table.", + "type": "boolean", + "readOnly": true + }, + "name": { + "description": "Name of the column.", + "type": "string", + "readOnly": true + }, + "quotedName": { + "description": "Quoted name of the column.", + "type": "string", + "readOnly": true + } + } + }, + "SyncMember": { + "description": "An Azure SQL Database sync member.", + "required": [ + "identity" + ], + "type": "object", + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "identity": { + "$ref": "#/definitions/DataSyncParticipantIdentity", + "description": "Sync member authentication information." + }, + "properties": { + "$ref": "#/definitions/SyncMemberProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + }, + "SyncMemberListResult": { + "description": "A list of Azure SQL Database sync members.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SyncMember" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "SyncMemberProperties": { + "description": "Properties of a sync member with support to MI.", + "type": "object", + "properties": { + "databaseType": { + "description": "Database type of the sync member.", + "enum": [ + "AzureSqlDatabase", + "SqlServerDatabase" + ], + "type": "string", + "x-ms-enum": { + "name": "SyncMemberDbType", + "modelAsString": true + } + }, + "syncAgentId": { + "description": "ARM resource id of the sync agent in the sync member.", + "type": "string" + }, + "sqlServerDatabaseId": { + "format": "uuid", + "description": "SQL Server database id of the sync member.", + "type": "string" + }, + "syncMemberAzureDatabaseResourceId": { + "description": "ARM resource id of the sync member logical database, for sync members in Azure.", + "type": "string" + }, + "usePrivateLinkConnection": { + "description": "Whether to use private link connection.", + "type": "boolean" + }, + "privateEndpointName": { + "description": "Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure.", + "type": "string", + "readOnly": true + }, + "serverName": { + "description": "Server name of the member database in the sync member", + "type": "string" + }, + "databaseName": { + "description": "Database name of the member database in the sync member.", + "type": "string" + }, + "userName": { + "description": "User name of the member database in the sync member.", + "type": "string" + }, + "password": { + "description": "Password of the member database in the sync member.", + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ] + }, + "syncDirection": { + "description": "Sync direction of the sync member.", + "enum": [ + "Bidirectional", + "OneWayMemberToHub", + "OneWayHubToMember" + ], + "type": "string", + "x-ms-enum": { + "name": "SyncDirection", + "modelAsString": true + } + }, + "syncState": { + "description": "Sync state of the sync member.", + "enum": [ + "SyncInProgress", + "SyncSucceeded", + "SyncFailed", + "DisabledTombstoneCleanup", + "DisabledBackupRestore", + "SyncSucceededWithWarnings", + "SyncCancelling", + "SyncCancelled", + "UnProvisioned", + "Provisioning", + "Provisioned", + "ProvisionFailed", + "DeProvisioning", + "DeProvisioned", + "DeProvisionFailed", + "Reprovisioning", + "ReprovisionFailed", + "UnReprovisioned" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "SyncMemberState", + "modelAsString": true + } + } + } + } + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "description": "The name of the server.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file diff --git a/src/Sql/Sql/ChangeLog.md b/src/Sql/Sql/ChangeLog.md index 67b126088cac..50e4ead2fd66 100644 --- a/src/Sql/Sql/ChangeLog.md +++ b/src/Sql/Sql/ChangeLog.md @@ -21,6 +21,8 @@ * Fixed `New-AzSqlDatabaseExport` and `New-AzSqlDatabaseImport` to use SQL Authentication with ManagedIdentity without any mandatory password * Added `MemorySizeInGB` parameter to `New-AzSqlInstance`, `Set-AzSqlInstance` to enable the creation of instances with flexible memory * Added `MemorySizeInGB` field to the model of the managed instance so that it displays information about flexible memory instances that are returned by `Get-AzSqlInstance`. +* Added support for User Assigned Managed Identity (UAMI) authentication in Data Sync cmdlets (`New-AzSqlSyncGroup`, `Update-AzSqlSyncGroup`, `New-AzSqlSyncMember`, `Update-AzSqlSyncMember`) + ## Version 6.0.5 * Updated `DatabaseOperations` Api to version `2024-11-01-preview` for .Net Sdk diff --git a/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs b/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs index daa35d17cdeb..6f3e6f867db2 100644 --- a/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs +++ b/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs @@ -106,6 +106,19 @@ public class NewAzureSqlSyncGroup : AzureSqlSyncGroupCmdletBase /// private string syncDatabaseId = null; + /// + /// Gets or sets the Database Authentication type of the hub database + /// + [Parameter(Mandatory = false, HelpMessage = "The Database Authentication type of the hub database.")] + [ValidateSet("password", "userAssigned", IgnoreCase = true)] + public string HubDatabaseAuthenticationType { get; set; } + + /// + /// Gets or sets the identity ID of the hub database in case of user assigned identity authentication + /// + [Parameter(Mandatory = false, HelpMessage = "The identity ID of the hub database in case of UAMI Authentication.")] + public string IdentityId { get; set; } + /// /// Get the entities from the service /// @@ -149,11 +162,48 @@ protected override IEnumerable ApplyUserInputToModel(IEn ServerName = this.ServerName, DatabaseName = this.DatabaseName, SyncGroupName = this.Name, - ConflictResolutionPolicy = this.ConflictResolutionPolicy != null ? this.ConflictResolutionPolicy.ToString() : null, - HubDatabaseUserName = this.DatabaseCredential != null ? this.DatabaseCredential.UserName : null, - HubDatabasePassword = this.DatabaseCredential != null ? this.DatabaseCredential.Password : null + ConflictResolutionPolicy = this.ConflictResolutionPolicy != null ? this.ConflictResolutionPolicy.ToString() : null }; + if (!MyInvocation.BoundParameters.ContainsKey(nameof(HubDatabaseAuthenticationType)) || + this.HubDatabaseAuthenticationType.Equals("password", System.StringComparison.OrdinalIgnoreCase)) + { + if (!MyInvocation.BoundParameters.ContainsKey(nameof(DatabaseCredential)) || + this.DatabaseCredential == null || + string.IsNullOrEmpty(this.DatabaseCredential.UserName)) + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.DatabaseCredentialRequired, + "DatabaseCredentials"); + } + + newModel.HubDatabaseUserName = this.DatabaseCredential.UserName; + newModel.HubDatabasePassword = this.DatabaseCredential.Password; + + newModel.Identity = new DataSyncParticipantIdentity + { + Type = "None" + }; + } + else if (this.HubDatabaseAuthenticationType.Equals("userAssigned", System.StringComparison.OrdinalIgnoreCase)) + { + if (!MyInvocation.BoundParameters.ContainsKey(nameof(IdentityId)) || + string.IsNullOrEmpty(this.IdentityId)) + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.IdentityIdRequired, + "IdentityId"); + } + + newModel.Identity = AzureSqlSyncIdentityHelper.CreateUserAssignedIdentity(this.IdentityId); + } + else + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.InvalidDatabaseAuthenticationType, + "HubDatabaseAuthenticationType"); + } + if (MyInvocation.BoundParameters.ContainsKey("IntervalInSeconds")) { newModel.IntervalInSeconds = this.IntervalInSeconds; diff --git a/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncMember.cs b/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncMember.cs index 0a14f3a58574..c14d24449c45 100644 --- a/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncMember.cs +++ b/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncMember.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Commands.Sql.Properties; using Microsoft.Azure.Management.Sql.LegacySdk.Models; using System; +using Microsoft.Azure.Management.Sql.Models; using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; namespace Microsoft.Azure.Commands.Sql.DataSync.Cmdlet @@ -84,7 +85,7 @@ public class NewAzureSqlSyncMember : AzureSqlSyncMemberCmdletBase /// /// Gets or sets the credential (username and password) of the Azure SQL Database. /// - [Parameter(Mandatory = true, + [Parameter(Mandatory = false, ParameterSetName = AzureSqlSet, HelpMessage = "The credential (username and password) of the Azure SQL Database.")] public PSCredential MemberDatabaseCredential { get; set; } @@ -169,6 +170,19 @@ public class NewAzureSqlSyncMember : AzureSqlSyncMemberCmdletBase /// private string syncAgentId = null; + /// + /// Gets or sets the Database Authentication type of the sync member database + /// + [Parameter(Mandatory = false, HelpMessage = "The Database Authentication type of the sync member database.")] + [ValidateSet("password", "userAssigned", IgnoreCase = true)] + public string MemberDatabaseAuthenticationType { get; set; } + + /// + /// Gets or sets the identity ID of the sync member database in case of user assigned identity authentication + /// + [Parameter(Mandatory = false, HelpMessage = "The identity ID of the sync member DB in case of UAMI Authentication")] + public string IdentityId { get; set; } + /// /// Get the entities from the service /// @@ -233,9 +247,42 @@ protected override IEnumerable ApplyUserInputToModel(IE { newModel.MemberDatabaseName = this.MemberDatabaseName; newModel.MemberServerName = this.MemberServerName; - newModel.MemberDatabaseUserName = this.MemberDatabaseCredential.UserName; - newModel.MemberDatabasePassword = this.MemberDatabaseCredential.Password; - } + + if (!MyInvocation.BoundParameters.ContainsKey(nameof(MemberDatabaseAuthenticationType)) || + this.MemberDatabaseAuthenticationType.Equals("password", StringComparison.OrdinalIgnoreCase)) + { + if (!MyInvocation.BoundParameters.ContainsKey(nameof(MemberDatabaseCredential)) + || this.MemberDatabaseCredential == null + || string.IsNullOrEmpty(this.MemberDatabaseCredential.UserName)) + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.DatabaseCredentialRequired, nameof(MemberDatabaseCredential)); + } + newModel.MemberDatabaseUserName = this.MemberDatabaseCredential.UserName; + newModel.MemberDatabasePassword = this.MemberDatabaseCredential.Password; + + newModel.Identity = new DataSyncParticipantIdentity + { + Type = "None" + }; + } + else if (this.MemberDatabaseAuthenticationType.Equals("userAssigned", StringComparison.OrdinalIgnoreCase)) + { + if (!MyInvocation.BoundParameters.ContainsKey(nameof(IdentityId)) || + string.IsNullOrEmpty(this.IdentityId)) + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.IdentityIdRequired, nameof(IdentityId)); + } + newModel.Identity = AzureSqlSyncIdentityHelper.CreateUserAssignedIdentity(this.IdentityId); + } + else + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.InvalidDatabaseAuthenticationType, nameof(MemberDatabaseAuthenticationType)); + } + + } else { newModel.SqlServerDatabaseId = this.SqlServerDatabaseId; diff --git a/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncGroup.cs b/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncGroup.cs index 4c3f4f4f0039..0187f27a56d4 100644 --- a/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncGroup.cs +++ b/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncGroup.cs @@ -62,6 +62,19 @@ public class UpdateAzureSqlSyncGroup : AzureSqlSyncGroupCmdletBase [Parameter(Mandatory = false, HelpMessage = "Whether to use a private link connection when connecting to the hub of this sync group.")] public bool UsePrivateLinkConnection { get; set; } + /// + /// Gets or sets the Database Authentication type of the hub database + /// + [Parameter(Mandatory = false)] + [ValidateSet("password", "userAssigned", IgnoreCase = true)] + public string HubDatabaseAuthenticationType { get; set; } + + /// + /// Gets or sets the identity ID of the hub database in case of user assigned identity authentication + /// + [Parameter(Mandatory = false)] + public string IdentityId { get; set; } + /// /// Get the entities from the service /// @@ -91,17 +104,6 @@ protected override IEnumerable ApplyUserInputToModel(IEn { newModel.UsePrivateLinkConnection = this.UsePrivateLinkConnection; } - - if (MyInvocation.BoundParameters.ContainsKey("DatabaseCredential")) - { - newModel.HubDatabaseUserName = this.DatabaseCredential.UserName; - newModel.HubDatabasePassword = this.DatabaseCredential.Password; - } - else - { - newModel.HubDatabaseUserName = null; - newModel.HubDatabasePassword = null; - } // if schema file is specified if (MyInvocation.BoundParameters.ContainsKey("SchemaFile")) @@ -117,6 +119,48 @@ protected override IEnumerable ApplyUserInputToModel(IEn } } + if (!MyInvocation.BoundParameters.ContainsKey(nameof(HubDatabaseAuthenticationType)) || + this.HubDatabaseAuthenticationType.Equals("password", System.StringComparison.OrdinalIgnoreCase)) + { + if (MyInvocation.BoundParameters.ContainsKey(nameof(DatabaseCredential))) + { + newModel.HubDatabaseUserName = this.DatabaseCredential.UserName; + newModel.HubDatabasePassword = this.DatabaseCredential.Password; + } + else + { + newModel.HubDatabaseUserName = null; + newModel.HubDatabasePassword = null; + } + + newModel.Identity = new DataSyncParticipantIdentity + { + Type = "None" + }; + } + else if (this.HubDatabaseAuthenticationType.Equals("userAssigned", System.StringComparison.OrdinalIgnoreCase)) + { + if (!MyInvocation.BoundParameters.ContainsKey(nameof(IdentityId)) || + string.IsNullOrEmpty(this.IdentityId)) + { + newModel.Identity = new DataSyncParticipantIdentity + { + Type = "UserAssigned" + }; + } + else + { + newModel.Identity = AzureSqlSyncIdentityHelper.CreateUserAssignedIdentity(this.IdentityId); + } + } + else + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.InvalidDatabaseAuthenticationType, + "HubDatabaseAuthenticationType"); + } + + return model; } diff --git a/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncMember.cs b/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncMember.cs index 0301ba307d07..7d2b6f2508b3 100644 --- a/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncMember.cs +++ b/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncMember.cs @@ -61,6 +61,19 @@ public class UpdateAzureSqlSyncMember : AzureSqlSyncMemberCmdletBase [Parameter(Mandatory = false, HelpMessage = "The resource ID for the sync member database, used if UsePrivateLinkConnection is set to true.")] public string SyncMemberAzureDatabaseResourceId { get; set; } + /// + /// Gets or sets the Database Authentication type of the sync member database + /// + [Parameter(Mandatory = false, HelpMessage = "The Database Authentication type of the sync member database.")] + [ValidateSet("password", "userAssigned", IgnoreCase = true)] + public string MemberDatabaseAuthenticationType { get; set; } + + /// + /// Gets or sets the identity ID of the sync member database in case of user assigned identity authentication + /// + [Parameter(Mandatory = false, HelpMessage = "The identity ID of the sync member DB in case of UAMI Authentication")] + public string IdentityId { get; set; } + /// /// Get the entities from the service /// @@ -93,15 +106,45 @@ protected override IEnumerable ApplyUserInputToModel(IE newModel.SyncMemberAzureDatabaseResourceId = this.SyncMemberAzureDatabaseResourceId; } - if (MyInvocation.BoundParameters.ContainsKey("MemberDatabaseCredential")) + if (!MyInvocation.BoundParameters.ContainsKey(nameof(MemberDatabaseAuthenticationType)) || + this.MemberDatabaseAuthenticationType.Equals("password", StringComparison.OrdinalIgnoreCase)) { - newModel.MemberDatabaseUserName = this.MemberDatabaseCredential.UserName; - newModel.MemberDatabasePassword = this.MemberDatabaseCredential.Password; + if (MyInvocation.BoundParameters.ContainsKey("MemberDatabaseCredential")) + { + newModel.MemberDatabaseUserName = this.MemberDatabaseCredential.UserName; + newModel.MemberDatabasePassword = this.MemberDatabaseCredential.Password; + } + else + { + newModel.MemberDatabaseUserName = null; + newModel.MemberDatabasePassword = null; + } + + newModel.Identity = new DataSyncParticipantIdentity + { + Type = "None" + }; + } + else if (this.MemberDatabaseAuthenticationType.Equals("userAssigned", StringComparison.OrdinalIgnoreCase)) + { + if (!MyInvocation.BoundParameters.ContainsKey(nameof(IdentityId)) || + string.IsNullOrEmpty(this.IdentityId)) + { + newModel.Identity = new DataSyncParticipantIdentity + { + Type = "UserAssigned" + }; + } + else + { + newModel.Identity = AzureSqlSyncIdentityHelper.CreateUserAssignedIdentity(this.IdentityId); + } } else { - newModel.MemberDatabaseUserName = null; - newModel.MemberDatabasePassword = null; + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.InvalidDatabaseAuthenticationType, + nameof(MemberDatabaseAuthenticationType)); } return model; diff --git a/src/Sql/Sql/Data Sync/Model/AzureSqlSyncGroupModel.cs b/src/Sql/Sql/Data Sync/Model/AzureSqlSyncGroupModel.cs index 78b899eaed44..ce214e2b0500 100644 --- a/src/Sql/Sql/Data Sync/Model/AzureSqlSyncGroupModel.cs +++ b/src/Sql/Sql/Data Sync/Model/AzureSqlSyncGroupModel.cs @@ -93,6 +93,11 @@ public class AzureSqlSyncGroupModel /// public bool? UsePrivateLinkConnection { get; set; } + /// + /// Gets or sets sync group authentication information. + /// + public DataSyncParticipantIdentity Identity { get; set; } + /// /// Construct AzureSqlSyncGroupModel /// @@ -123,6 +128,7 @@ public AzureSqlSyncGroupModel(string resourceGroupName, string serverName, strin LastSyncTime = syncGroup.LastSyncTime; Schema = syncGroup.Schema == null ? null : new AzureSqlSyncGroupSchemaModel(syncGroup.Schema); UsePrivateLinkConnection = syncGroup.UsePrivateLinkConnection; + Identity = syncGroup.Identity; } } } diff --git a/src/Sql/Sql/Data Sync/Model/AzureSqlSyncIdentityHelper.cs b/src/Sql/Sql/Data Sync/Model/AzureSqlSyncIdentityHelper.cs new file mode 100644 index 000000000000..6557431a9251 --- /dev/null +++ b/src/Sql/Sql/Data Sync/Model/AzureSqlSyncIdentityHelper.cs @@ -0,0 +1,44 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System.Collections.Generic; +using Microsoft.Azure.Management.Sql.Models; + +namespace Microsoft.Azure.Commands.Sql.DataSync.Model +{ + /// + /// Helper class for constructing DataSyncParticipantIdentity objects. + /// This class is static because it only provides stateless utility methods + /// and should not be instantiated. Can be called for both Sync Group and Sync Member scenarios. + /// + public static class AzureSqlSyncIdentityHelper + { + /// + /// Creates a DataSyncParticipantIdentity for a user-assigned managed identity. + /// + /// The resource ID of the user-assigned managed identity. + /// A DataSyncParticipantIdentity object configured for user-assigned identity. + public static DataSyncParticipantIdentity CreateUserAssignedIdentity(string identityResourceId) + { + return new DataSyncParticipantIdentity + { + Type = "UserAssigned", + UserAssignedIdentities = new Dictionary + { + [identityResourceId] = new DataSyncParticipantUserAssignedIdentity() + } + }; + } + } +} \ No newline at end of file diff --git a/src/Sql/Sql/Data Sync/Model/AzureSqlSyncMemberModel.cs b/src/Sql/Sql/Data Sync/Model/AzureSqlSyncMemberModel.cs index abd15857177b..fa8d0340cc55 100644 --- a/src/Sql/Sql/Data Sync/Model/AzureSqlSyncMemberModel.cs +++ b/src/Sql/Sql/Data Sync/Model/AzureSqlSyncMemberModel.cs @@ -107,6 +107,11 @@ public class AzureSqlSyncMemberModel /// public bool? UsePrivateLinkConnection { get; set; } + /// + /// Gets or sets sync group authentication information. + /// + public DataSyncParticipantIdentity Identity { get; set; } + /// /// Construct AzureSqlSyncMemberModel /// @@ -141,6 +146,7 @@ public AzureSqlSyncMemberModel(string resourceGroup, string serverName, string d SyncState = syncMember.SyncState; UsePrivateLinkConnection = syncMember.UsePrivateLinkConnection; SyncMemberAzureDatabaseResourceId = syncMember.SyncMemberAzureDatabaseResourceId; + Identity = syncMember.Identity; } } } diff --git a/src/Sql/Sql/Data Sync/Services/AzureSqlDataSyncAdapter.cs b/src/Sql/Sql/Data Sync/Services/AzureSqlDataSyncAdapter.cs index 05f6c7e821fa..1d4e8ed027fc 100644 --- a/src/Sql/Sql/Data Sync/Services/AzureSqlDataSyncAdapter.cs +++ b/src/Sql/Sql/Data Sync/Services/AzureSqlDataSyncAdapter.cs @@ -173,6 +173,7 @@ internal AzureSqlSyncGroupModel CreateSyncGroup(AzureSqlSyncGroupModel model, st HubDatabasePassword = model.HubDatabasePassword == null ? null : AzureSqlServerAdapter.Decrypt(model.HubDatabasePassword), Schema = model.Schema == null ? null : model.Schema.ToSyncGroupSchema(), UsePrivateLinkConnection = model.UsePrivateLinkConnection, + Identity = model.Identity }); // Workaround for Rest API return response value incorrect issue. Remove this line after backend fix is deployed @@ -194,6 +195,7 @@ internal AzureSqlSyncGroupModel UpdateSyncGroup(AzureSqlSyncGroupModel model) HubDatabasePassword = model.HubDatabasePassword == null ? null: AzureSqlServerAdapter.Decrypt(model.HubDatabasePassword), Schema = model.Schema == null ? null : model.Schema.ToSyncGroupSchema(), UsePrivateLinkConnection = model.UsePrivateLinkConnection, + Identity = model.Identity }); // Workaround for Rest API return response value incorrect issue. Remove this line after backend fix is deployed @@ -314,6 +316,7 @@ internal AzureSqlSyncMemberModel CreateSyncMember(AzureSqlSyncMemberModel model, properties.Password = model.MemberDatabasePassword == null ? null : AzureSqlServerAdapter.Decrypt(model.MemberDatabasePassword); properties.UsePrivateLinkConnection = model.UsePrivateLinkConnection; properties.SyncMemberAzureDatabaseResourceId = model.SyncMemberAzureDatabaseResourceId; + properties.Identity = model.Identity; } else { @@ -346,7 +349,8 @@ internal AzureSqlSyncMemberModel UpdateSyncMember(AzureSqlSyncMemberModel model) UserName = model.MemberDatabaseUserName, Password = model.MemberDatabasePassword == null ? null : AzureSqlServerAdapter.Decrypt(model.MemberDatabasePassword), UsePrivateLinkConnection = model.UsePrivateLinkConnection, - SyncMemberAzureDatabaseResourceId = model.SyncMemberAzureDatabaseResourceId + SyncMemberAzureDatabaseResourceId = model.SyncMemberAzureDatabaseResourceId, + Identity = model.Identity }; var updateResp = Communicator.UpdateSyncMember(model.ResourceGroupName, model.ServerName, model.DatabaseName, model.SyncGroupName, model.SyncMemberName, properties); diff --git a/src/Sql/Sql/Properties/Resources.Designer.cs b/src/Sql/Sql/Properties/Resources.Designer.cs index 697af13b41f4..a84a79ccbac0 100644 --- a/src/Sql/Sql/Properties/Resources.Designer.cs +++ b/src/Sql/Sql/Properties/Resources.Designer.cs @@ -402,6 +402,15 @@ internal static string CreateAzureSqlInstanceServerTrustCertificateWarning { } } + /// + /// Looks up a localized string similar to DatabaseCredentials (username/password) must be provided when DatabaseAuthenticationType is 'password'.. + /// + internal static string DatabaseCredentialRequired { + get { + return ResourceManager.GetString("DatabaseCredentialRequired", resourceCulture); + } + } + /// /// Looks up a localized string similar to Database with name: '{0}' already exists in server '{1}'.. /// @@ -645,6 +654,15 @@ internal static string ForwardMigrationWithGeoDRInfo { } } + /// + /// Looks up a localized string similar to IdentityId must be provided when DatabaseAuthenticationType is 'userAssigned'.. + /// + internal static string IdentityIdRequired { + get { + return ResourceManager.GetString("IdentityIdRequired", resourceCulture); + } + } + /// /// Looks up a localized string similar to The Active Directory Group '{0}' is not security enabled. Only Azure Active Directory Security Enabled Groups are supported.. /// @@ -663,6 +681,15 @@ internal static string InvalidBlobStorageSasUri { } } + /// + /// Looks up a localized string similar to Invalid DatabaseAuthenticationType. Supported authentication types are 'userAssigned' and 'password'. + /// + internal static string InvalidDatabaseAuthenticationType { + get { + return ResourceManager.GetString("InvalidDatabaseAuthenticationType", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot use the None option with other event types.. /// diff --git a/src/Sql/Sql/Properties/Resources.resx b/src/Sql/Sql/Properties/Resources.resx index 694f54c5a582..4d4cfd0c130f 100644 --- a/src/Sql/Sql/Properties/Resources.resx +++ b/src/Sql/Sql/Properties/Resources.resx @@ -766,4 +766,13 @@ Changing the service tier to Hyperscale also converts the geo-secondary replica to Hyperscale. For more information, see https://go.microsoft.com/fwlink/?linkid=2314103 + + IdentityId must be provided when DatabaseAuthenticationType is 'userAssigned'. + + + DatabaseCredentials (username/password) must be provided when DatabaseAuthenticationType is 'password'. + + + Invalid DatabaseAuthenticationType. Supported authentication types are 'userAssigned' and 'password' + \ No newline at end of file diff --git a/src/Sql/Sql/help/New-AzSqlSyncGroup.md b/src/Sql/Sql/help/New-AzSqlSyncGroup.md index 925d9bbfd08c..ed4122a0f9dd 100644 --- a/src/Sql/Sql/help/New-AzSqlSyncGroup.md +++ b/src/Sql/Sql/help/New-AzSqlSyncGroup.md @@ -16,8 +16,8 @@ Creates an Azure SQL Database Sync Group. New-AzSqlSyncGroup [-Name] -SyncDatabaseName -SyncDatabaseServerName -SyncDatabaseResourceGroupName [-IntervalInSeconds ] [-DatabaseCredential ] [-ConflictResolutionPolicy ] [-SchemaFile ] [-UsePrivateLinkConnection] [-ServerName] - [-DatabaseName] [-ResourceGroupName] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + [-DatabaseName] [-ResourceGroupName] [-DefaultProfile ] + [-HubDatabaseAuthenticationType ] [-IdentityId ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -55,6 +55,33 @@ This command creates a sync group for an Azure SQL Database. "schema.json" is a "MasterSyncMemberName": null } +### Example 2: Create a sync group for an Azure SQL Database using user-assigned managed identity authentication + +This command creates a sync group using user-assigned managed identity to authenticate to the hub database. + +```powershell +New-AzSqlSyncGroup -ResourceGroupName "ResourceGroup02" -ServerName "Server02" -DatabaseName "Database02" -Name "SyncGroup02" ` +-ConflictResolutionPolicy "HubWin" -IntervalInSeconds -1 ` +-SyncDatabaseServerName "Server02" -SyncDatabaseName "Database02" ` +-SyncDatabaseResourceGroupName "syncDatabaseResourceGroup02" ` +-HubDatabaseAuthenticationType "userAssigned" ` +-IdentityId "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" -Schema ".\schema.json" | Format-List +``` + +```output +ResourceId : /subscriptions/{subscriptionId}/resourceGroups/{syncDatabaseResourceGroup02}/providers/Microsoft.Sql/servers/{Server02}/databases/{Database02}/syncGroups/{SyncGroup02} +ResourceGroupName : ResourceGroup02 +ServerName : Server02 +DatabaseName : Database02 +SyncGroupName : SyncGroup02 +SyncDatabaseId : /subscriptions/{subscriptionId}/resourceGroups/{syncDatabaseResourceGroup02}/providers/Microsoft.Sql/servers/{Server02}/databases/{Database02} +IntervalInSeconds : -1 +ConflictResolutionPolicy : HubWin +SyncState : NotReady +LastSyncTime : 1/1/0001 12:00:00 AM +Schema : +``` + ## PARAMETERS ### -ConflictResolutionPolicy @@ -254,6 +281,35 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HubDatabaseAuthenticationType +The Database Authentication type of the hub database. +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: password, userAssigned + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityId +The identity ID of the hub database in case of UAMI Authentication. +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Sql/Sql/help/New-AzSqlSyncMember.md b/src/Sql/Sql/help/New-AzSqlSyncMember.md index 521196f3589f..52da7459f867 100644 --- a/src/Sql/Sql/help/New-AzSqlSyncMember.md +++ b/src/Sql/Sql/help/New-AzSqlSyncMember.md @@ -18,7 +18,8 @@ New-AzSqlSyncMember -Name -MemberDatabaseType -MemberServerNam -MemberDatabaseName -MemberDatabaseCredential [-SyncDirection ] [-UsePrivateLinkConnection] [-SyncMemberAzureDatabaseResourceId ] [-SyncGroupName] [-ServerName] [-DatabaseName] [-ResourceGroupName] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-DefaultProfile ] [-MemberDatabaseAuthenticationType ] + [-IdentityId ] [-WhatIf] [-Confirm] [] ``` ### OnPremisesDatabaseSyncAgentComponent @@ -99,6 +100,32 @@ SyncState : UnProvisioned This command creates a sync member for an on-premises SQL database. +### Example 3: Create a sync member for an Azure SQL database using user managed identity authentication to authenticate to member database. +```powershell +New-AzSqlSyncMember -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" -SyncGroupName "SyncGroup01" -Name "SyncMember01" -SyncDirection "OneWayMemberToHub" ` +-MemberDatabaseType "AzureSqlDatabase" -MemberServerName "memberServer01.full.dns.name" -MemberDatabaseName "memberDatabase01" -MemberDatabaseAuthenticationType "userAssigned" ` +-IdentityId "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" | Format-List +``` + +```output +ResourceId : subscriptions/{subscriptionId}/resourceGroups/{ResourceGroup01}/servers/{Server01}/databases/{Database01}/syncGroups/{SyncGroup01}/syncMembers/{SyncMember01} +ResourceGroupName : ResourceGroup01 +ServerName : Server01 +DatabaseName : Database01 +SyncGroupName : SyncGroup01 +SyncMemberName : SyncMember01 +SyncDirection : OneWayMemberToHub +MemberDatabaseType: : AzureSqlDatabase +SyncAgentId : +SqlServerDatabaseId : +MemberServerName : memberServer01.full.dns.name +MemberDatabaseName : memberDatabase01 +MemberDatabaseUserName : +MemberDatabasePassword : +SyncState : UnProvisioned +``` +This command creates a sync member for an Azure SQL database. + ## PARAMETERS ### -DatabaseName @@ -373,6 +400,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -MemberDatabaseAuthenticationType +The Database Authentication type of the sync member database. +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: password, userAssigned + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityId +The identity ID of the sync member DB in case of UAMI Authentication +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Sql/Sql/help/Update-AzSqlSyncGroup.md b/src/Sql/Sql/help/Update-AzSqlSyncGroup.md index a34948c53af5..bdc8a7358ac4 100644 --- a/src/Sql/Sql/help/Update-AzSqlSyncGroup.md +++ b/src/Sql/Sql/help/Update-AzSqlSyncGroup.md @@ -15,8 +15,8 @@ Updates an Azure SQL Database Sync Group. ``` Update-AzSqlSyncGroup [-Name] [-IntervalInSeconds ] [-DatabaseCredential ] [-SchemaFile ] [-UsePrivateLinkConnection ] [-ServerName] [-DatabaseName] - [-ResourceGroupName] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] + [-ResourceGroupName] [-DefaultProfile ] [-HubDatabaseAuthenticationType ] + [-IdentityId ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -53,6 +53,29 @@ This command updates a sync group for an Azure SQL Database. "schema.json" is a "MasterSyncMemberName": null } +### Example 2: Update a sync group for an Azure SQL Database with user assigned managed identity as the authentication type for hub db. +```powershell +Update-AzSqlSyncGroup -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" -Name "SyncGroup01" ` +-HubDatabaseAuthenticationType "userAssigned" ` +-IdentityId "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" -IntervalInSeconds 100 -Schema ".\schema.json" | Format-List +``` + +```output +ResourceId : /subscriptions/{subscriptionId}/resourceGroups/{ResourceGroup01}/servers/{Server01}/databases/{Database01}/syncGroups/{SyncGroup01} +ResourceGroupName : ResourceGroup01 +ServerName : Server01 +DatabaseName : Database01 +SyncGroupName : SyncGroup01 +SyncDatabaseId : subscriptions/{subscriptionId}/resourceGroups/{syncDatabaseResourceGroup01}/servers/{syncDatabaseServer01}/databases/{syncDatabaseName01} +IntervalInSeconds : 100 +ConflictResolutionPolicy: : HubWin +SyncState : NotReady +LastSyncTime : 1/1/0001 12:00:00 AM +Schema : +``` + +This command updates a sync group for an Azure SQL Database + ## PARAMETERS ### -DatabaseCredential @@ -191,6 +214,35 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HubDatabaseAuthenticationType +The Database Authentication type of the hub database. +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: password, userAssigned + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityId +The identity ID of the hub database in case of UAMI Authentication. +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Sql/Sql/help/Update-AzSqlSyncMember.md b/src/Sql/Sql/help/Update-AzSqlSyncMember.md index b983b482d034..c970bf1a06df 100644 --- a/src/Sql/Sql/help/Update-AzSqlSyncMember.md +++ b/src/Sql/Sql/help/Update-AzSqlSyncMember.md @@ -16,7 +16,8 @@ Updates an Azure SQL Database Sync Member. Update-AzSqlSyncMember -Name [-MemberDatabaseCredential ] [-UsePrivateLinkConnection ] [-SyncMemberAzureDatabaseResourceId ] [-SyncGroupName] [-ServerName] [-DatabaseName] [-ResourceGroupName] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-DefaultProfile ] [-MemberDatabaseAuthenticationType ] + [-IdentityId ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -62,6 +63,32 @@ Updates an Azure SQL Database Sync Member. (autogenerated) Update-AzSqlSyncMember -DatabaseName 'Database01' -MemberDatabaseCredential -Name 'SyncMember01' -ResourceGroupName 'ResourceGroup01' -ServerName 'Server01' -SyncGroupName 'SyncGroup01' -SyncMemberAzureDatabaseResourceId ``` +### Example 3 +```powershell +Update-AzSqlSyncMember -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" -SyncGroupName "SyncGroup01" -Name "SyncMember01" ` +-MemberDatabaseAuthenticationType "userAssigned" ` +-IdentityId "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" | Format-List +``` + +```output +ResourceId : subscriptions/{subscriptionId}/resourceGroups/{ResourceGroup01}/servers/{Server01}/databases/{Database01}/syncGroups/{SyncGroup01}/syncMembers/{SyncMember01} +ResourceGroupName : ResourceGroup01 +ServerName : Server01 +DatabaseName : Database01 +SyncGroupName : SyncGroup01 +SyncMemberName : SyncMember01 +SyncDirection : OneWayMemberToHub +MemberDatabaseType: : AzureSqlDatabase +SyncAgentId : +SqlServerDatabaseId : +MemberServerName : memberServer01.full.dns.name +MemberDatabaseName : memberDatabase01 +MemberDatabasePassword : +SyncState : Good + +This command updates the sync member uami identity id for the member database. + + ## PARAMETERS ### -DatabaseName @@ -199,6 +226,35 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -MemberDatabaseAuthenticationType +The Database Authentication type of the sync member database. +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: password, userAssigned + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityId +The identity ID of the sync member DB in case of UAMI Authentication +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet.