From ccdcadd35a704024d0c78948bcb05eac643c6e38 Mon Sep 17 00:00:00 2001 From: Subramanya M N Date: Wed, 30 Jul 2025 17:12:09 +0530 Subject: [PATCH] Temp PR --- .../customermanagedkeys.json | 68 + .../resource-management/managedidentity.json | 114 ++ .../managedidentitywithdelegation.json | 54 + common-types/resource-management/mobo.json | 38 + .../networksecurityperimeter.json | 433 ++++++ .../resource-management/privatelinks.json | 190 +++ common-types/resource-management/types.json | 722 ++++++++++ common/v1/types.json | 212 +++ common/v2/types.json | 67 + ...DistributedAvailabilityGroupsOperations.cs | 32 +- .../Generated/ISyncGroupsOperations.cs | 184 +-- .../Generated/ISyncMembersOperations.cs | 84 +- .../Generated/ManagedInstancesOperations.cs | 4 +- .../Models/DataSyncParticipantIdentity.cs | 84 ++ .../Models/DataSyncParticipantIdentityType.cs | 21 + ...DataSyncParticipantUserAssignedIdentity.cs | 58 + .../Models/ErrorDetailAutoGenerated.cs | 88 ++ .../Models/ErrorResponseAutoGenerated.cs | 55 + .../ErrorResponseAutoGeneratedException.cs | 55 + .../Generated/Models/SyncGroup.cs | 20 +- .../Generated/Models/SyncGroupProperties.cs | 2 +- .../Models/SyncGroupsCreateOrUpdateHeaders.cs | 45 + .../Models/SyncGroupsDeleteHeaders.cs | 45 + .../SyncGroupsRefreshHubSchemaHeaders.cs | 45 + .../Models/SyncGroupsUpdateHeaders.cs | 45 + .../Generated/Models/SyncMember.cs | 39 +- .../Generated/Models/SyncMemberProperties.cs | 2 +- .../SyncMembersCreateOrUpdateHeaders.cs | 45 + .../Models/SyncMembersDeleteHeaders.cs | 45 + .../SyncMembersRefreshMemberSchemaHeaders.cs | 45 + .../Models/SyncMembersUpdateHeaders.cs | 45 + .../Generated/ReplicationLinksOperations.cs | 8 +- .../Generated/SqlManagementClient.cs | 3 + .../Generated/SyncGroupsOperations.cs | 861 ++++++------ .../SyncGroupsOperationsExtensions.cs | 294 ++-- .../Generated/SyncMembersOperations.cs | 478 +++---- .../SyncMembersOperationsExtensions.cs | 136 +- src/Sql/Sql.Management.Sdk/README.md | 4 +- src/Sql/Sql.Management.Sdk/SyncGroups.json | 1201 +++++++++++++++++ src/Sql/Sql.Management.Sdk/SyncMembers.json | 866 ++++++++++++ .../Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs | 55 +- .../Cmdlet/UpdateAzureSqlSyncGroup.cs | 65 +- .../Data Sync/Model/AzureSqlSyncGroupModel.cs | 6 + .../Model/AzureSqlSyncIdentityHelper.cs | 44 + .../Services/AzureSqlDataSyncAdapter.cs | 2 + src/Sql/Sql/Properties/Resources.Designer.cs | 27 + src/Sql/Sql/Properties/Resources.resx | 15 +- src/Sql/Sql/help/New-AzSqlSyncGroup.md | 74 +- src/Sql/Sql/help/Update-AzSqlSyncGroup.md | 62 +- 49 files changed, 6124 insertions(+), 1063 deletions(-) create mode 100644 common-types/resource-management/customermanagedkeys.json create mode 100644 common-types/resource-management/managedidentity.json create mode 100644 common-types/resource-management/managedidentitywithdelegation.json create mode 100644 common-types/resource-management/mobo.json create mode 100644 common-types/resource-management/networksecurityperimeter.json create mode 100644 common-types/resource-management/privatelinks.json create mode 100644 common-types/resource-management/types.json create mode 100644 common/v1/types.json create mode 100644 common/v2/types.json create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentity.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantIdentityType.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/DataSyncParticipantUserAssignedIdentity.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsCreateOrUpdateHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsDeleteHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsRefreshHubSchemaHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncGroupsUpdateHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersCreateOrUpdateHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersDeleteHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersRefreshMemberSchemaHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/SyncMembersUpdateHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/SyncGroups.json create mode 100644 src/Sql/Sql.Management.Sdk/SyncMembers.json create mode 100644 src/Sql/Sql/Data Sync/Model/AzureSqlSyncIdentityHelper.cs diff --git a/common-types/resource-management/customermanagedkeys.json b/common-types/resource-management/customermanagedkeys.json new file mode 100644 index 000000000000..a70d892125b5 --- /dev/null +++ b/common-types/resource-management/customermanagedkeys.json @@ -0,0 +1,68 @@ +{ + "swagger": "2.0", + "info": { + "title": "Common types", + "version": "5.0" + }, + "paths": {}, + "definitions": { + "encryption": { + "type": "object", + "description": "All encryption configuration for a resource.", + "properties": { + "infrastructureEncryption": { + "type": "string", + "description": "(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.", + "enum": [ + "enabled", + "disabled" + ], + "x-ms-enum": { + "name": "InfrastructureEncryption", + "modelAsString": true + } + }, + "customerManagedKeyEncryption": { + "type": "object", + "description": "All Customer-managed key encryption properties for the resource.", + "properties": { + "keyEncryptionKeyIdentity": { + "type": "object", + "description": "All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.", + "properties": { + "identityType": { + "type": "string", + "description": "The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity.", + "enum": [ + "systemAssignedIdentity", + "userAssignedIdentity", + "delegatedResourceIdentity" + ] + }, + "userAssignedIdentityResourceId": { + "type": "string", + "format": "arm-id", + "description": "User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity." + }, + "federatedClientId": { + "type": "string", + "format": "uuid", + "description": "application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540" + }, + "delegatedIdentityClientId": { + "type": "string", + "format": "uuid", + "description": "delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only." + } + } + }, + "keyEncryptionKeyUrl": { + "type": "string", + "description": "key encryption key Url, versioned or unversioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek." + } + } + } + } + } + } +} diff --git a/common-types/resource-management/managedidentity.json b/common-types/resource-management/managedidentity.json new file mode 100644 index 000000000000..b87ac41699c5 --- /dev/null +++ b/common-types/resource-management/managedidentity.json @@ -0,0 +1,114 @@ +{ + "swagger": "2.0", + "info": { + "title": "Common types", + "version": "5.0" + }, + "paths": {}, + "definitions": { + "ManagedServiceIdentity": { + "type": "object", + "description": "Managed service identity (system assigned and/or user assigned identities)", + "properties": { + "principalId": { + "type": "string", + "format": "uuid", + "description": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "readOnly": true + }, + "tenantId": { + "type": "string", + "format": "uuid", + "description": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "readOnly": true + }, + "type": { + "$ref": "#/definitions/ManagedServiceIdentityType" + }, + "userAssignedIdentities": { + "$ref": "#/definitions/UserAssignedIdentities" + } + }, + "required": [ + "type" + ] + }, + "ManagedServiceIdentityType": { + "type": "string", + "description": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "enum": [ + "None", + "SystemAssigned", + "UserAssigned", + "SystemAssigned,UserAssigned" + ], + "x-ms-enum": { + "name": "ManagedServiceIdentityType", + "modelAsString": true + } + }, + "SystemAssignedServiceIdentity": { + "type": "object", + "description": "Managed service identity (either system assigned, or none)", + "properties": { + "principalId": { + "type": "string", + "format": "uuid", + "description": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "readOnly": true + }, + "tenantId": { + "type": "string", + "format": "uuid", + "description": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "readOnly": true + }, + "type": { + "$ref": "#/definitions/SystemAssignedServiceIdentityType" + } + }, + "required": [ + "type" + ] + }, + "SystemAssignedServiceIdentityType": { + "type": "string", + "description": "Type of managed service identity (either system assigned, or none).", + "enum": [ + "None", + "SystemAssigned" + ], + "x-ms-enum": { + "name": "SystemAssignedServiceIdentityType", + "modelAsString": true + } + }, + "UserAssignedIdentities": { + "type": "object", + "title": "User-Assigned Identities", + "description": "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + "additionalProperties": { + "$ref": "#/definitions/UserAssignedIdentity", + "x-nullable": true + } + }, + "UserAssignedIdentity": { + "type": "object", + "description": "User assigned identity properties", + "properties": { + "principalId": { + "type": "string", + "format": "uuid", + "description": "The principal ID of the assigned identity.", + "readOnly": true + }, + "clientId": { + "type": "string", + "format": "uuid", + "description": "The client ID of the assigned identity.", + "readOnly": true + } + } + } + } +} diff --git a/common-types/resource-management/managedidentitywithdelegation.json b/common-types/resource-management/managedidentitywithdelegation.json new file mode 100644 index 000000000000..a63b85817a70 --- /dev/null +++ b/common-types/resource-management/managedidentitywithdelegation.json @@ -0,0 +1,54 @@ +{ + "swagger": "2.0", + "info": { + "title": "Common types", + "version": "5.0" + }, + "paths": {}, + "definitions": { + "DelegatedResource": { + "type": "object", + "description": "Delegated resource properties - internal use only.", + "properties": { + "resourceId": { + "type": "string", + "description": "The ARM resource id of the delegated resource - internal use only." + }, + "tenantId": { + "type": "string", + "format": "uuid", + "description": "The tenant id of the delegated resource - internal use only." + }, + "referralResource": { + "type": "string", + "description": "The delegation id of the referral delegation (optional) - internal use only." + }, + "location": { + "type": "string", + "description": "The source resource location - internal use only." + } + } + }, + "DelegatedResources": { + "type": "object", + "description": "The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal use only.", + "additionalProperties": { + "$ref": "#/definitions/DelegatedResource" + } + }, + "ManagedServiceIdentityWithDelegation": { + "type": "object", + "description": "Managed service identity (system assigned and/or user assigned identities and/or delegated identities) - internal use only.", + "properties": { + "delegatedResources": { + "$ref": "#/definitions/DelegatedResources" + } + }, + "allOf": [ + { + "$ref": "managedidentity.json#/definitions/ManagedServiceIdentity" + } + ] + } + } +} diff --git a/common-types/resource-management/mobo.json b/common-types/resource-management/mobo.json new file mode 100644 index 000000000000..b9eab1378de1 --- /dev/null +++ b/common-types/resource-management/mobo.json @@ -0,0 +1,38 @@ +{ + "swagger": "2.0", + "info": { + "title": "Common types", + "version": "5.0" + }, + "paths": {}, + "definitions": { + "ManagedOnBehalfOfConfiguration": { + "type": "object", + "description": "Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner.", + "properties": { + "moboBrokerResources": { + "type": "array", + "description": "Managed-On-Behalf-Of broker resources", + "items": { + "$ref": "#/definitions/MoboBrokerResource" + }, + "x-ms-identifiers": [ + "id" + ] + } + }, + "readOnly": true + }, + "MoboBrokerResource": { + "type": "object", + "description": "Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user.", + "properties": { + "id": { + "type": "string", + "format": "arm-id", + "description": "Resource identifier of a Managed-On-Behalf-Of broker resource" + } + } + } + } +} diff --git a/common-types/resource-management/networksecurityperimeter.json b/common-types/resource-management/networksecurityperimeter.json new file mode 100644 index 000000000000..013e558b8ce7 --- /dev/null +++ b/common-types/resource-management/networksecurityperimeter.json @@ -0,0 +1,433 @@ +{ + "swagger": "2.0", + "info": { + "title": "Network security perimeter common type definitions", + "version": "0000-00-00", + "description": "Common types for network security perimeters based on a shared API specification. These common, versioned type definitions are intended for resource providers (RPs, except Network RP) to use, and reuse, for defining their own API versions that share a set of type definitions that is consistent across providers.", + "contact": {} + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "paths": {}, + "definitions": { + "AccessRule": { + "type": "object", + "description": "Access rule in a network security perimeter configuration profile", + "properties": { + "name": { + "type": "string", + "description": "Name of the access rule" + }, + "properties": { + "$ref": "#/definitions/AccessRuleProperties" + } + } + }, + "AccessRuleDirection": { + "type": "string", + "description": "Direction of Access Rule", + "enum": [ + "Inbound", + "Outbound" + ], + "x-ms-enum": { + "name": "AccessRuleDirection", + "modelAsString": true, + "values": [ + { + "value": "Inbound", + "description": "Applies to inbound network traffic to the secured resources." + }, + { + "value": "Outbound", + "description": "Applies to outbound network traffic from the secured resources" + } + ] + } + }, + "AccessRuleProperties": { + "type": "object", + "description": "Properties of Access Rule", + "properties": { + "direction": { + "$ref": "#/definitions/AccessRuleDirection" + }, + "addressPrefixes": { + "type": "array", + "description": "Address prefixes in the CIDR format for inbound rules", + "items": { + "type": "string", + "description": "An IP address prefix (CIDR) for inbound rules" + } + }, + "subscriptions": { + "type": "array", + "description": "Subscriptions for inbound rules", + "items": { + "type": "object", + "description": "Subscription identifiers", + "properties": { + "id": { + "type": "string", + "format": "arm-id", + "description": "The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') " + } + } + } + }, + "networkSecurityPerimeters": { + "type": "array", + "description": "Network security perimeters for inbound rules", + "items": { + "$ref": "#/definitions/NetworkSecurityPerimeter" + } + }, + "fullyQualifiedDomainNames": { + "type": "array", + "description": "Fully qualified domain names (FQDN) for outbound rules", + "items": { + "type": "string", + "description": "A fully qualified domain name (FQDN)" + } + }, + "emailAddresses": { + "type": "array", + "description": "Email addresses for outbound rules", + "items": { + "type": "string", + "description": "An email address" + } + }, + "phoneNumbers": { + "type": "array", + "description": "Phone numbers for outbound rules", + "items": { + "type": "string", + "description": "A phone number" + } + } + } + }, + "NetworkSecurityPerimeter": { + "type": "object", + "description": "Information about a network security perimeter (NSP)", + "properties": { + "id": { + "type": "string", + "format": "arm-id", + "description": "Fully qualified Azure resource ID of the NSP resource", + "x-ms-arm-id-details": { + "allowedResources": [ + { + "resourceType": "Microsoft.Network/networkSecurityPerimeters" + } + ] + } + }, + "perimeterGuid": { + "type": "string", + "format": "uuid", + "description": "Universal unique ID (UUID) of the network security perimeter" + }, + "location": { + "type": "string", + "description": "Location of the network security perimeter", + "x-ms-mutability": [ + "create", + "read" + ] + } + } + }, + "NetworkSecurityPerimeterConfiguration": { + "type": "object", + "description": "Network security perimeter (NSP) configuration resource", + "properties": { + "properties": { + "$ref": "#/definitions/NetworkSecurityPerimeterConfigurationProperties" + } + }, + "allOf": [ + { + "$ref": "./types.json#/definitions/ProxyResource" + } + ] + }, + "NetworkSecurityPerimeterConfigurationListResult": { + "type": "object", + "description": "Result of a list NSP (network security perimeter) configurations request.", + "properties": { + "value": { + "type": "array", + "description": "Array of network security perimeter results.", + "items": { + "$ref": "#/definitions/NetworkSecurityPerimeterConfiguration" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link used to get the next page of results." + } + } + }, + "NetworkSecurityPerimeterConfigurationProperties": { + "type": "object", + "description": "Network security configuration properties.", + "properties": { + "provisioningState": { + "$ref": "#/definitions/NetworkSecurityPerimeterConfigurationProvisioningState", + "readOnly": true + }, + "provisioningIssues": { + "type": "array", + "description": "List of provisioning issues, if any", + "items": { + "$ref": "#/definitions/ProvisioningIssue" + }, + "readOnly": true, + "x-ms-identifiers": [] + }, + "networkSecurityPerimeter": { + "$ref": "#/definitions/NetworkSecurityPerimeter" + }, + "resourceAssociation": { + "$ref": "#/definitions/ResourceAssociation" + }, + "profile": { + "$ref": "#/definitions/NetworkSecurityProfile" + } + } + }, + "NetworkSecurityPerimeterConfigurationProvisioningState": { + "type": "string", + "description": "Provisioning state of a network security perimeter configuration that is being created or updated.", + "enum": [ + "Succeeded", + "Creating", + "Updating", + "Deleting", + "Accepted", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "NetworkSecurityPerimeterConfigurationProvisioningState", + "modelAsString": true + }, + "readOnly": true + }, + "NetworkSecurityProfile": { + "type": "object", + "description": "Network security perimeter configuration profile", + "properties": { + "name": { + "type": "string", + "description": "Name of the profile" + }, + "accessRulesVersion": { + "type": "integer", + "format": "int32", + "description": "Current access rules version" + }, + "accessRules": { + "type": "array", + "description": "List of Access Rules", + "items": { + "$ref": "#/definitions/AccessRule" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "diagnosticSettingsVersion": { + "type": "integer", + "format": "int32", + "description": "Current diagnostic settings version" + }, + "enabledLogCategories": { + "type": "array", + "description": "List of log categories that are enabled", + "items": { + "type": "string", + "description": "Log category" + } + } + } + }, + "ProvisioningIssue": { + "type": "object", + "description": "Describes a provisioning issue for a network security perimeter configuration", + "properties": { + "name": { + "type": "string", + "description": "Name of the issue", + "readOnly": true + }, + "properties": { + "$ref": "#/definitions/ProvisioningIssueProperties" + } + }, + "readOnly": true + }, + "ProvisioningIssueProperties": { + "type": "object", + "description": "Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules", + "properties": { + "issueType": { + "type": "string", + "description": "Type of issue", + "enum": [ + "Unknown", + "ConfigurationPropagationFailure", + "MissingPerimeterConfiguration", + "MissingIdentityConfiguration" + ], + "x-ms-enum": { + "name": "IssueType", + "modelAsString": true, + "values": [ + { + "value": "Unknown", + "description": "Unknown issue type" + }, + { + "value": "ConfigurationPropagationFailure", + "description": "An error occurred while applying the network security perimeter (NSP) configuration." + }, + { + "value": "MissingPerimeterConfiguration", + "description": "A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules." + }, + { + "value": "MissingIdentityConfiguration", + "description": "An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP." + } + ] + }, + "readOnly": true + }, + "severity": { + "type": "string", + "description": "Severity of the issue.", + "enum": [ + "Warning", + "Error" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + }, + "readOnly": true + }, + "description": { + "type": "string", + "description": "Description of the issue", + "readOnly": true + }, + "suggestedResourceIds": { + "type": "array", + "description": "Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue.", + "items": { + "type": "string", + "format": "arm-id", + "description": "Fully qualified resource ID of the suggested resource", + "readOnly": true + }, + "readOnly": true + }, + "suggestedAccessRules": { + "type": "array", + "description": "Access rules that can be added to the network security profile (NSP) to remediate the issue.", + "items": { + "$ref": "#/definitions/AccessRule" + }, + "readOnly": true, + "x-ms-identifiers": [] + } + }, + "readOnly": true + }, + "PublicNetworkAccess": { + "type": "string", + "description": "Allow, disallow, or let network security perimeter configuration control public network access to the protected resource. Value is optional but if passed in, it must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.", + "enum": [ + "Enabled", + "Disabled", + "SecuredByPerimeter" + ], + "x-ms-enum": { + "name": "PublicNetworkAccess", + "modelAsString": true, + "values": [ + { + "value": "Enabled", + "description": "Allows public network access to the resource" + }, + { + "value": "Disabled", + "description": "Disallows public network access to the resource" + }, + { + "value": "SecuredByPerimeter", + "description": "The network security perimeter configuration rules allow or disallow public network access to the resource. Requires an associated network security perimeter." + } + ] + } + }, + "ResourceAssociation": { + "type": "object", + "description": "Information about resource association", + "properties": { + "name": { + "type": "string", + "description": "Name of the resource association" + }, + "accessMode": { + "$ref": "#/definitions/ResourceAssociationAccessMode" + } + } + }, + "ResourceAssociationAccessMode": { + "type": "string", + "description": "Access mode of the resource association", + "enum": [ + "Enforced", + "Learning", + "Audit" + ], + "x-ms-enum": { + "name": "ResourceAssociationAccessMode", + "modelAsString": true, + "values": [ + { + "value": "Enforced", + "description": "Enforced access mode - traffic to the resource that failed access checks is blocked" + }, + { + "value": "Learning", + "description": "Learning access mode - traffic to the resource is enabled for analysis but not blocked" + }, + { + "value": "Audit", + "description": "Audit access mode - traffic to the resource that fails access checks is logged but not blocked" + } + ] + } + } + }, + "parameters": { + "NetworkSecurityPerimeterConfigurationNameParameter": { + "name": "networkSecurityPerimeterConfigurationName", + "in": "path", + "description": "The name for a network security perimeter configuration", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 512, + "x-ms-parameter-location": "method" + } + } +} diff --git a/common-types/resource-management/privatelinks.json b/common-types/resource-management/privatelinks.json new file mode 100644 index 000000000000..844cea2e5916 --- /dev/null +++ b/common-types/resource-management/privatelinks.json @@ -0,0 +1,190 @@ +{ + "swagger": "2.0", + "info": { + "title": "Common types", + "version": "5.0" + }, + "paths": {}, + "definitions": { + "PrivateEndpoint": { + "type": "object", + "description": "The private endpoint resource.", + "properties": { + "id": { + "type": "string", + "description": "The ARM identifier for private endpoint.", + "readOnly": true + } + } + }, + "PrivateEndpointConnection": { + "type": "object", + "description": "The private endpoint connection resource.", + "properties": { + "properties": { + "$ref": "#/definitions/PrivateEndpointConnectionProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../v5/types.json#/definitions/Resource" + } + ] + }, + "PrivateEndpointConnectionListResult": { + "type": "object", + "description": "List of private endpoint connections associated with the specified resource.", + "properties": { + "value": { + "type": "array", + "description": "Array of private endpoint connections.", + "items": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + } + } + }, + "PrivateEndpointConnectionProperties": { + "type": "object", + "description": "Properties of the private endpoint connection.", + "properties": { + "groupIds": { + "type": "array", + "description": "The group ids for the private endpoint resource.", + "items": { + "type": "string" + }, + "readOnly": true + }, + "privateEndpoint": { + "$ref": "#/definitions/PrivateEndpoint", + "description": "The private endpoint resource." + }, + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/PrivateLinkServiceConnectionState", + "description": "A collection of information about the state of the connection between service consumer and provider." + }, + "provisioningState": { + "$ref": "#/definitions/PrivateEndpointConnectionProvisioningState", + "description": "The provisioning state of the private endpoint connection resource." + } + }, + "required": [ + "privateLinkServiceConnectionState" + ] + }, + "PrivateEndpointConnectionProvisioningState": { + "type": "string", + "description": "The current provisioning state.", + "enum": [ + "Succeeded", + "Creating", + "Deleting", + "Failed" + ], + "x-ms-enum": { + "name": "PrivateEndpointConnectionProvisioningState", + "modelAsString": true + }, + "readOnly": true + }, + "PrivateEndpointServiceConnectionStatus": { + "type": "string", + "description": "The private endpoint connection status.", + "enum": [ + "Pending", + "Approved", + "Rejected" + ], + "x-ms-enum": { + "name": "PrivateEndpointServiceConnectionStatus", + "modelAsString": true + } + }, + "PrivateLinkResource": { + "type": "object", + "description": "A private link resource.", + "properties": { + "properties": { + "$ref": "#/definitions/PrivateLinkResourceProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../v5/types.json#/definitions/Resource" + } + ] + }, + "PrivateLinkResourceListResult": { + "type": "object", + "description": "A list of private link resources.", + "properties": { + "value": { + "type": "array", + "description": "Array of private link resources", + "items": { + "$ref": "#/definitions/PrivateLinkResource" + } + } + } + }, + "PrivateLinkResourceProperties": { + "type": "object", + "description": "Properties of a private link resource.", + "properties": { + "groupId": { + "type": "string", + "description": "The private link resource group id.", + "readOnly": true + }, + "requiredMembers": { + "type": "array", + "description": "The private link resource required member names.", + "items": { + "type": "string" + }, + "readOnly": true + }, + "requiredZoneNames": { + "type": "array", + "description": "The private link resource private link DNS zone name.", + "items": { + "type": "string" + } + } + } + }, + "PrivateLinkServiceConnectionState": { + "type": "object", + "description": "A collection of information about the state of the connection between service consumer and provider.", + "properties": { + "status": { + "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", + "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." + }, + "description": { + "type": "string", + "description": "The reason for approval/rejection of the connection." + }, + "actionsRequired": { + "type": "string", + "description": "A message indicating if changes on the service provider require any updates on the consumer." + } + } + } + }, + "parameters": { + "PrivateEndpointConnectionName": { + "name": "privateEndpointConnectionName", + "in": "path", + "description": "The name of the private endpoint connection associated with the Azure resource.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/common-types/resource-management/types.json b/common-types/resource-management/types.json new file mode 100644 index 000000000000..600190811bf8 --- /dev/null +++ b/common-types/resource-management/types.json @@ -0,0 +1,722 @@ +{ + "swagger": "2.0", + "info": { + "title": "Common types", + "version": "5.0" + }, + "paths": {}, + "definitions": { + "AzureEntityResource": { + "type": "object", + "title": "Entity Resource", + "description": "The resource model definition for an Azure Resource Manager resource with an etag.", + "properties": { + "etag": { + "type": "string", + "description": "Resource Etag.", + "readOnly": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "x-ms-client-name": "AzureEntityResource" + }, + "CheckNameAvailabilityRequest": { + "type": "object", + "description": "The check availability request body.", + "properties": { + "name": { + "type": "string", + "description": "The name of the resource for which availability needs to be checked." + }, + "type": { + "type": "string", + "description": "The resource type." + } + } + }, + "CheckNameAvailabilityResponse": { + "type": "object", + "description": "The check availability result.", + "properties": { + "nameAvailable": { + "type": "boolean", + "description": "Indicates if the resource name is available." + }, + "reason": { + "type": "string", + "description": "The reason why the given name is not available.", + "enum": [ + "Invalid", + "AlreadyExists" + ], + "x-ms-enum": { + "name": "CheckNameAvailabilityReason", + "modelAsString": true + } + }, + "message": { + "type": "string", + "description": "Detailed reason why the given name is available." + } + } + }, + "ErrorAdditionalInfo": { + "type": "object", + "description": "The resource management error additional info.", + "properties": { + "type": { + "type": "string", + "description": "The additional info type.", + "readOnly": true + }, + "info": { + "type": "object", + "description": "The additional info.", + "readOnly": true + } + } + }, + "ErrorDetail": { + "type": "object", + "description": "The error detail.", + "properties": { + "code": { + "type": "string", + "description": "The error code.", + "readOnly": true + }, + "message": { + "type": "string", + "description": "The error message.", + "readOnly": true + }, + "target": { + "type": "string", + "description": "The error target.", + "readOnly": true + }, + "details": { + "type": "array", + "description": "The error details.", + "items": { + "$ref": "#/definitions/ErrorDetail" + }, + "readOnly": true, + "x-ms-identifiers": [ + "message", + "target" + ] + }, + "additionalInfo": { + "type": "array", + "description": "The error additional info.", + "items": { + "$ref": "#/definitions/ErrorAdditionalInfo" + }, + "readOnly": true, + "x-ms-identifiers": [] + } + } + }, + "ErrorResponse": { + "type": "object", + "title": "Error response", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDetail", + "description": "The error object." + } + } + }, + "Identity": { + "type": "object", + "description": "Identity for the resource.", + "properties": { + "principalId": { + "type": "string", + "format": "uuid", + "description": "The principal ID of resource identity. The value must be an UUID.", + "readOnly": true + }, + "tenantId": { + "type": "string", + "format": "uuid", + "description": "The tenant ID of resource. The value must be an UUID.", + "readOnly": true + }, + "type": { + "type": "string", + "description": "The identity type.", + "enum": [ + "SystemAssigned" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false + } + } + } + }, + "KeyVaultProperties": { + "type": "object", + "properties": { + "keyIdentifier": { + "type": "string", + "description": "Key vault uri to access the encryption key." + }, + "identity": { + "type": "string", + "description": "The client ID of the identity which will be used to access key vault." + } + } + }, + "Operation": { + "type": "object", + "title": "REST API Operation", + "description": "Details of a REST API operation, returned from the Resource Provider Operations API", + "properties": { + "name": { + "type": "string", + "description": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "readOnly": true + }, + "isDataAction": { + "type": "boolean", + "description": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations.", + "readOnly": true + }, + "display": { + "type": "object", + "description": "Localized display information for this particular operation.", + "properties": { + "provider": { + "type": "string", + "description": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "readOnly": true + }, + "resource": { + "type": "string", + "description": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "readOnly": true + }, + "operation": { + "type": "string", + "description": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "readOnly": true + }, + "description": { + "type": "string", + "description": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "readOnly": true + } + } + }, + "origin": { + "type": "string", + "description": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "enum": [ + "user", + "system", + "user,system" + ], + "x-ms-enum": { + "name": "Origin", + "modelAsString": true + }, + "readOnly": true + }, + "actionType": { + "type": "string", + "description": "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "enum": [ + "Internal" + ], + "x-ms-enum": { + "name": "ActionType", + "modelAsString": true + }, + "readOnly": true + } + } + }, + "OperationListResult": { + "type": "object", + "description": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "properties": { + "value": { + "type": "array", + "description": "List of operations supported by the resource provider", + "items": { + "$ref": "#/definitions/Operation" + }, + "readOnly": true, + "x-ms-identifiers": [ + "name" + ] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "URL to get the next set of operation list results (if there are any).", + "readOnly": true + } + } + }, + "OperationStatusResult": { + "type": "object", + "description": "The current status of an async operation.", + "properties": { + "id": { + "type": "string", + "format": "arm-id", + "description": "Fully qualified ID for the async operation." + }, + "resourceId": { + "type": "string", + "format": "arm-id", + "description": "Fully qualified ID of the resource against which the original async operation was started.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Name of the async operation." + }, + "status": { + "type": "string", + "description": "Operation status." + }, + "percentComplete": { + "type": "number", + "description": "Percent of the operation that is complete.", + "minimum": 0, + "maximum": 100 + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "The start time of the operation." + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "The end time of the operation." + }, + "operations": { + "type": "array", + "description": "The operations list.", + "items": { + "$ref": "#/definitions/OperationStatusResult" + } + }, + "error": { + "$ref": "#/definitions/ErrorDetail", + "description": "If present, details of the operation error." + } + }, + "required": [ + "status" + ] + }, + "Plan": { + "type": "object", + "description": "Plan for the resource.", + "properties": { + "name": { + "type": "string", + "description": "A user defined name of the 3rd Party Artifact that is being procured." + }, + "publisher": { + "type": "string", + "description": "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic" + }, + "product": { + "type": "string", + "description": "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. " + }, + "promotionCode": { + "type": "string", + "description": "A publisher provided promotion code as provisioned in Data Market for the said product/artifact." + }, + "version": { + "type": "string", + "description": "The version of the desired product/artifact." + } + }, + "required": [ + "name", + "publisher", + "product" + ] + }, + "ProxyResource": { + "type": "object", + "title": "Proxy Resource", + "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "Resource": { + "type": "object", + "title": "Resource", + "description": "Common fields that are returned in the response for all Azure Resource Manager resources", + "properties": { + "id": { + "type": "string", + "format": "arm-id", + "description": "Fully qualified resource ID for the resource. E.g. \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}\"", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the resource", + "readOnly": true + }, + "type": { + "type": "string", + "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "readOnly": true + }, + "systemData": { + "$ref": "#/definitions/systemData", + "description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "readOnly": true + } + }, + "x-ms-azure-resource": true + }, + "ResourceModelWithAllowedPropertySet": { + "type": "object", + "description": "The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set.", + "properties": { + "managedBy": { + "type": "string", + "description": "The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource.", + "x-ms-mutability": [ + "read", + "create", + "update" + ] + }, + "kind": { + "type": "string", + "description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.", + "pattern": "^[-\\w\\._,\\(\\)]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "etag": { + "type": "string", + "description": "The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. ", + "readOnly": true + }, + "identity": { + "allOf": [ + { + "$ref": "#/definitions/Identity" + } + ] + }, + "sku": { + "allOf": [ + { + "$ref": "#/definitions/Sku" + } + ] + }, + "plan": { + "allOf": [ + { + "$ref": "#/definitions/Plan" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/TrackedResource" + } + ], + "x-ms-azure-resource": true + }, + "Sku": { + "type": "object", + "description": "The resource model definition representing SKU", + "properties": { + "name": { + "type": "string", + "description": "The name of the SKU. E.g. P3. It is typically a letter+number code" + }, + "tier": { + "$ref": "#/definitions/SkuTier" + }, + "size": { + "type": "string", + "description": "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. " + }, + "family": { + "type": "string", + "description": "If the service has different generations of hardware, for the same SKU, then that can be captured here." + }, + "capacity": { + "type": "integer", + "format": "int32", + "description": "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted." + } + }, + "required": [ + "name" + ] + }, + "SkuTier": { + "type": "string", + "description": "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.", + "enum": [ + "Free", + "Basic", + "Standard", + "Premium" + ], + "x-ms-enum": { + "name": "SkuTier", + "modelAsString": false + } + }, + "TrackedResource": { + "type": "object", + "title": "Tracked Resource", + "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ] + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives", + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "required": [ + "location" + ], + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "encryptionProperties": { + "type": "object", + "description": "Configuration of key for data encryption", + "properties": { + "status": { + "type": "string", + "description": "Indicates whether or not the encryption is enabled for container registry.", + "enum": [ + "enabled", + "disabled" + ], + "x-ms-enum": { + "name": "EncryptionStatus", + "modelAsString": true + } + }, + "keyVaultProperties": { + "$ref": "#/definitions/KeyVaultProperties", + "description": "Key vault properties." + } + } + }, + "locationData": { + "type": "object", + "description": "Metadata pertaining to the geographic location of the resource.", + "properties": { + "name": { + "type": "string", + "description": "A canonical name for the geographic or physical location.", + "maxLength": 256 + }, + "city": { + "type": "string", + "description": "The city or locality where the resource is located." + }, + "district": { + "type": "string", + "description": "The district, state, or province where the resource is located." + }, + "countryOrRegion": { + "type": "string", + "description": "The country or region where the resource is located" + } + }, + "required": [ + "name" + ] + }, + "systemData": { + "type": "object", + "description": "Metadata pertaining to creation and last modification of the resource.", + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created the resource." + }, + "createdByType": { + "type": "string", + "description": "The type of identity that created the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the resource." + }, + "lastModifiedByType": { + "type": "string", + "description": "The type of identity that last modified the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource last modification (UTC)" + } + }, + "readOnly": true + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1 + }, + "If-Match": { + "name": "ifMatch", + "in": "header", + "description": "The If-Match header that makes a request conditional.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "If-None-Match": { + "name": "ifNoneMatch", + "in": "header", + "description": "The If-None-Match header that makes a request conditional.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "LocationParameter": { + "name": "location", + "in": "path", + "description": "The name of the Azure region.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method" + }, + "ManagementGroupNameParameter": { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method" + }, + "OperationIdParameter": { + "name": "operationId", + "in": "path", + "description": "The ID of an ongoing async operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method" + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the resource group. The name is case insensitive.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method" + }, + "ScopeParameter": { + "name": "scope", + "in": "path", + "description": "The scope at which the operation is performed.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "The ID of the target subscription. The value must be an UUID.", + "required": true, + "type": "string", + "format": "uuid" + }, + "TenantIdParameter": { + "name": "tenantId", + "in": "path", + "description": "The Azure tenant ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)", + "required": true, + "type": "string", + "format": "uuid", + "x-ms-parameter-location": "method" + } + } +} diff --git a/common/v1/types.json b/common/v1/types.json new file mode 100644 index 000000000000..53499340e882 --- /dev/null +++ b/common/v1/types.json @@ -0,0 +1,212 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "Resource": { + "description": "ARM resource.", + "type": "object", + "properties": { + "id": { + "description": "Resource ID.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "Resource name.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "Resource type.", + "type": "string", + "readOnly": true + } + }, + "x-ms-azure-resource": true + }, + "ProxyResource": { + "description": "ARM proxy resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": {} + }, + "TrackedResource": { + "description": "ARM tracked top level resource.", + "required": [ + "location" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "location": { + "description": "Resource location.", + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "tags": { + "description": "Resource tags.", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Sku": { + "description": "An ARM Resource SKU.", + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "description": "The name of the SKU, typically, a letter + Number code, e.g. P3.", + "type": "string" + }, + "tier": { + "description": "The tier or edition of the particular SKU, e.g. Basic, Premium.", + "type": "string" + }, + "size": { + "description": "Size of the particular SKU", + "type": "string" + }, + "family": { + "description": "If the service has different generations of hardware, for the same SKU, then that can be captured here.", + "type": "string" + }, + "capacity": { + "format": "int32", + "description": "Capacity of the particular SKU.", + "type": "integer" + } + } + }, + "systemData": { + "description": "Metadata pertaining to creation and last modification of the resource.", + "type": "object", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created the resource." + }, + "createdByType": { + "type": "string", + "description": "The type of identity that created the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the resource." + }, + "lastModifiedByType": { + "type": "string", + "description": "The type of identity that last modified the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource last modification (UTC)" + } + } + }, + "ResourceIdentity": { + "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 + }, + "type": { + "description": "The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.", + "enum": [ + "None", + "SystemAssigned", + "UserAssigned", + "SystemAssigned,UserAssigned" + ], + "type": "string", + "x-ms-enum": { + "name": "IdentityType", + "modelAsString": true + } + }, + "tenantId": { + "format": "uuid", + "description": "The Azure Active Directory tenant id.", + "type": "string", + "readOnly": true + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "The subscription ID that identifies an Azure subscription.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for the request.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }, + "ResourceGroupParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/common/v2/types.json b/common/v2/types.json new file mode 100644 index 000000000000..ed376ed6fca2 --- /dev/null +++ b/common/v2/types.json @@ -0,0 +1,67 @@ +{ + "swagger": "2.0", + "info": { + "version": "v2", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "UserIdentity": { + "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 + } + } + }, + "ResourceIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "type": "object", + "properties": { + "userAssignedIdentities": { + "description": "The resource ids of the user assigned identities to use", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UserIdentity" + } + }, + "principalId": { + "format": "uuid", + "description": "The Azure Active Directory principal id.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.", + "enum": [ + "None", + "SystemAssigned", + "UserAssigned", + "SystemAssigned,UserAssigned" + ], + "type": "string", + "x-ms-enum": { + "name": "IdentityType", + "modelAsString": true + } + }, + "tenantId": { + "format": "uuid", + "description": "The Azure Active Directory tenant id.", + "type": "string", + "readOnly": true + } + } + } + } +} diff --git a/src/Sql/Sql.Management.Sdk/Generated/DistributedAvailabilityGroupsOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/DistributedAvailabilityGroupsOperations.cs index af24ac472988..7e157a211331 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/DistributedAvailabilityGroupsOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/DistributedAvailabilityGroupsOperations.cs @@ -179,11 +179,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -395,11 +395,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -771,11 +771,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1003,11 +1003,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1215,11 +1215,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1477,11 +1477,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1724,11 +1724,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1901,11 +1901,11 @@ internal DistributedAvailabilityGroupsOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/Sql/Sql.Management.Sdk/Generated/ISyncGroupsOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/ISyncGroupsOperations.cs index f9644a37e88d..4b85088a5879 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/ISyncGroupsOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/ISyncGroupsOperations.cs @@ -37,10 +37,10 @@ public partial interface ISyncGroupsOperations System.Threading.Tasks.Task>> ListSyncDatabaseIdsWithHttpMessagesAsync(string locationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Refreshes a hub database schema. + /// Lists sync groups under a hub database. /// /// - /// Refreshes a hub database schema. + /// Lists sync groups under a hub database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -52,9 +52,6 @@ public partial interface ISyncGroupsOperations /// /// The name of the database on which the sync group is hosted. /// - /// - /// The name of the sync group. - /// /// /// The headers that will be added to request. /// @@ -64,13 +61,16 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + 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)); /// - /// Gets a collection of hub database schemas. + /// Gets a sync group. /// /// - /// Gets a collection of hub database schemas. + /// Gets a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -97,13 +97,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// - /// Gets a collection of sync group logs. + /// Creates or updates a sync group. /// /// - /// Gets a collection of sync group logs. + /// Creates or updates a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -118,17 +118,8 @@ public partial interface ISyncGroupsOperations /// /// 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 requested sync group resource state. /// /// /// The headers that will be added to request. @@ -142,13 +133,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// - /// Cancels a sync group synchronization. + /// Deletes a sync group. /// /// - /// Cancels a sync group synchronization. + /// Deletes a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -172,13 +163,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task CancelSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + 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)); /// - /// Triggers a sync group synchronization. + /// Updates a sync group. /// /// - /// Triggers a sync group synchronization. + /// Updates a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -193,6 +184,9 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// + /// + /// The requested sync group resource state. + /// /// /// The headers that will be added to request. /// @@ -202,13 +196,16 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + 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)); /// - /// Gets a sync group. + /// Cancels a sync group synchronization. /// /// - /// Gets a sync group. + /// Cancels a sync group synchronization. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -232,16 +229,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - 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)); + System.Threading.Tasks.Task CancelSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates a sync group. + /// Gets a collection of hub database schemas. /// /// - /// Creates or updates a sync group. + /// Gets a collection of hub database schemas. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -256,9 +250,6 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// /// /// The headers that will be added to request. /// @@ -271,13 +262,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// - /// Deletes a sync group. + /// Gets a collection of sync group logs. /// /// - /// Deletes a sync group. + /// Gets a collection of sync group logs. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -292,6 +283,18 @@ public partial interface ISyncGroupsOperations /// /// 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 headers that will be added to request. /// @@ -301,13 +304,16 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + 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)); /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -322,9 +328,6 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// /// /// The headers that will be added to request. /// @@ -334,16 +337,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - 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)); + 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)); /// - /// Lists sync groups under a hub database. + /// Triggers a sync group synchronization. /// /// - /// Lists sync groups under a hub database. + /// Triggers a sync group synchronization. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -355,6 +355,9 @@ public partial interface ISyncGroupsOperations /// /// The name of the database on which the sync group is hosted. /// + /// + /// The name of the sync group. + /// /// /// The headers that will be added to request. /// @@ -364,16 +367,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - 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)); + 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)); /// - /// Refreshes a hub database schema. + /// Creates or updates a sync group. /// /// - /// Refreshes a hub database schema. + /// Creates or updates a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -388,6 +388,9 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// + /// + /// The requested sync group resource state. + /// /// /// The headers that will be added to request. /// @@ -397,13 +400,16 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + 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)); /// - /// Creates or updates a sync group. + /// Deletes a sync group. /// /// - /// Creates or updates a sync group. + /// Deletes a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -418,9 +424,6 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// /// /// The headers that will be added to request. /// @@ -430,16 +433,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - 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)); + 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)); /// - /// Deletes a sync group. + /// Updates a sync group. /// /// - /// Deletes a sync group. + /// Updates a sync group. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -454,6 +454,9 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// + /// + /// The requested sync group resource state. + /// /// /// The headers that will be added to request. /// @@ -463,13 +466,16 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + 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)); /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// - /// Updates a sync group. + /// Refreshes a hub database schema. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -484,9 +490,6 @@ public partial interface ISyncGroupsOperations /// /// The name of the sync group. /// - /// - /// The requested sync group resource state. - /// /// /// The headers that will be added to request. /// @@ -496,10 +499,7 @@ public partial interface ISyncGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - 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)); + 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)); /// /// Gets a collection of sync database ids. @@ -525,10 +525,10 @@ public partial interface ISyncGroupsOperations System.Threading.Tasks.Task>> ListSyncDatabaseIdsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets a collection of hub database schemas. + /// Lists sync groups under a hub database. /// /// - /// Gets a collection of hub database schemas. + /// Lists sync groups under a hub database. /// /// /// The NextLink from the previous successful call to List operation. @@ -545,13 +545,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListHubSchemasNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets a collection of sync group logs. + /// Gets a collection of hub database schemas. /// /// - /// Gets a collection of sync group logs. + /// Gets a collection of hub database schemas. /// /// /// The NextLink from the previous successful call to List operation. @@ -568,13 +568,13 @@ public partial interface ISyncGroupsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListLogsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListHubSchemasNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists sync groups under a hub database. + /// Gets a collection of sync group logs. /// /// - /// Lists sync groups under a hub database. + /// Gets a collection of sync group logs. /// /// /// The NextLink from the previous successful call to List operation. @@ -591,7 +591,7 @@ public partial interface ISyncGroupsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListLogsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/ISyncMembersOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/ISyncMembersOperations.cs index 3b2df0b0bc9f..42c872d780f7 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/ISyncMembersOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/ISyncMembersOperations.cs @@ -14,10 +14,10 @@ namespace Microsoft.Azure.Management.Sql public partial interface ISyncMembersOperations { /// - /// Gets a sync member. + /// Lists sync members in the given sync group. /// /// - /// 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 @@ -30,10 +30,7 @@ public partial interface ISyncMembersOperations /// 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 headers that will be added to request. @@ -47,13 +44,13 @@ public partial interface ISyncMembersOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// - /// Creates or updates a sync member. + /// Gets a sync member. /// /// - /// Creates or updates a sync member. + /// Gets a sync member. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -71,9 +68,6 @@ public partial interface ISyncMembersOperations /// /// The name of the sync member. /// - /// - /// The requested sync member resource state. - /// /// /// The headers that will be added to request. /// @@ -86,13 +80,13 @@ public partial interface ISyncMembersOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// - /// Deletes a sync member. + /// Creates or updates a sync member. /// /// - /// Deletes a sync member. + /// Creates or updates a sync member. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -110,6 +104,9 @@ public partial interface ISyncMembersOperations /// /// The name of the sync member. /// + /// + /// The requested sync member resource state. + /// /// /// The headers that will be added to request. /// @@ -119,13 +116,16 @@ public partial interface ISyncMembersOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + 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)); /// - /// Updates an existing sync member. + /// Deletes a sync member. /// /// - /// Updates an existing sync member. + /// Deletes a sync member. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -143,9 +143,6 @@ public partial interface ISyncMembersOperations /// /// The name of the sync member. /// - /// - /// The requested sync member resource state. - /// /// /// The headers that will be added to request. /// @@ -155,16 +152,13 @@ public partial interface ISyncMembersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - 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)); + 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)); /// - /// Lists sync members in the given sync group. + /// Updates an existing sync member. /// /// - /// Lists sync members in the given sync group. + /// Updates an existing sync member. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -177,7 +171,13 @@ public partial interface ISyncMembersOperations /// 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 requested sync member resource state. /// /// /// The headers that will be added to request. @@ -191,13 +191,13 @@ public partial interface ISyncMembersOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// - /// Gets a sync member database schema. + /// Refreshes a sync member database schema. /// /// - /// Gets a sync member database schema. + /// Refreshes a sync member database schema. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -224,16 +224,13 @@ public partial interface ISyncMembersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task>> ListMemberSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + 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)); /// - /// Refreshes a sync member database schema. + /// Gets a sync member database schema. /// /// - /// Refreshes a sync member database schema. + /// Gets a sync member database schema. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -260,7 +257,10 @@ public partial interface ISyncMembersOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListMemberSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates a sync member. @@ -299,7 +299,7 @@ public partial interface ISyncMembersOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// /// Deletes a sync member. @@ -332,7 +332,7 @@ public partial interface ISyncMembersOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + 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)); /// /// Updates an existing sync member. @@ -371,7 +371,7 @@ public partial interface ISyncMembersOperations /// /// Thrown when unable to deserialize the response /// - 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)); + 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)); /// /// Refreshes a sync member database schema. @@ -404,7 +404,7 @@ public partial interface ISyncMembersOperations /// /// Thrown when the operation returned an invalid status code /// - 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)); + 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)); /// /// Lists sync members in the given sync group. diff --git a/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs index 0d785a7151fa..0809971948be 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs @@ -2547,11 +2547,11 @@ internal ManagedInstancesOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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..aed0349d45d7 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 group 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 group 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/SyncMemberProperties.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMemberProperties.cs index 610598afc1f3..3c16e9242801 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMemberProperties.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/SyncMemberProperties.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Management.Sql.Models using System.Linq; /// - /// Properties of a sync member. + /// Properties of a sync member with support to MI. /// public partial class SyncMemberProperties { 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/ReplicationLinksOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/ReplicationLinksOperations.cs index 85ef74f9909a..b99411d556a4 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/ReplicationLinksOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/ReplicationLinksOperations.cs @@ -1029,11 +1029,11 @@ internal ReplicationLinksOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1479,11 +1479,11 @@ internal ReplicationLinksOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs b/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs index a5bfb78d8cb9..c3b3fe70e6a7 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs @@ -633,6 +633,9 @@ public SqlManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCrede /// /// Optional. The http client handler used to handle http transport. /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// /// /// Thrown when a required parameter is null /// diff --git a/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/SyncGroupsOperations.cs index 5ab2e8aba833..5298207958a9 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) @@ -1874,8 +1854,14 @@ internal SyncGroupsOperations (SqlManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request - string _requestContent = null; + // 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 && (int)_statusCode != 404 && (int)_statusCode != 500) { - 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..7cb094f1cfae 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; @@ -1562,16 +1566,15 @@ internal SyncMembersOperations (SqlManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404 && (int)_statusCode != 500) { - 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 bb4828ac721d..c046ae93f10e 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..f5c54e33cb86 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/SyncGroups.json @@ -0,0 +1,1201 @@ +{ + "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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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" + } + } + }, + "404": { + "description": "An internal server error occurred." + }, + "500": { + "description": "An internal server error occurred." + } + }, + "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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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..c4438b6ca817 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/SyncMembers.json @@ -0,0 +1,866 @@ +{ + "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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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" + } + } + }, + "404": { + "description": "An internal server error occurred." + }, + "500": { + "description": "An internal server error occurred." + } + }, + "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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 MissingUserAssignedIdenityUrl - The user assigned identity url is mising 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 group 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/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs b/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs index daa35d17cdeb..d71d77359c9a 100644 --- a/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs +++ b/src/Sql/Sql/Data Sync/Cmdlet/NewAzureSqlSyncGroup.cs @@ -101,6 +101,19 @@ public class NewAzureSqlSyncGroup : AzureSqlSyncGroupCmdletBase [Parameter(Mandatory = false, HelpMessage = "Use a private link connection when connecting to the hub of this sync group.")] public SwitchParameter 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; } + /// /// The id of database used to store sync related metadata /// @@ -150,10 +163,48 @@ protected override IEnumerable ApplyUserInputToModel(IEn 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 }; + 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, + "HubDatabaseCredentials"); + } + + 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, + "UserAssignedIdentityId"); + } + + newModel.Identity = AzureSqlSyncIdentityHelper.CreateUserAssignedIdentity(this.IdentityId); + } + else + { + throw new PSArgumentException( + Microsoft.Azure.Commands.Sql.Properties.Resources.InvalidHubDatabaseAuthenticationType, + "HubDatabaseAuthenticationType"); + } + + if (MyInvocation.BoundParameters.ContainsKey("IntervalInSeconds")) { newModel.IntervalInSeconds = this.IntervalInSeconds; diff --git a/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncGroup.cs b/src/Sql/Sql/Data Sync/Cmdlet/UpdateAzureSqlSyncGroup.cs index 4c3f4f4f0039..374c8cbb8410 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 /// @@ -92,17 +105,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,47 @@ 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.InvalidHubDatabaseAuthenticationType, + "HubDatabaseAuthenticationType"); + } + 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/Services/AzureSqlDataSyncAdapter.cs b/src/Sql/Sql/Data Sync/Services/AzureSqlDataSyncAdapter.cs index 05f6c7e821fa..9af4cada1fba 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 diff --git a/src/Sql/Sql/Properties/Resources.Designer.cs b/src/Sql/Sql/Properties/Resources.Designer.cs index 697af13b41f4..b542be3f80bd 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 HubDatabaseAuthenticationType 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 HubDatabaseAuthenticationType 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.. /// @@ -699,6 +717,15 @@ internal static string InvalidGraphEndpoint { } } + /// + /// Looks up a localized string similar to Invalid HubDatabaseAuthenticationType. Supported authentication types are 'userAssigned' and 'Password'. + /// + internal static string InvalidHubDatabaseAuthenticationType { + get { + return ResourceManager.GetString("InvalidHubDatabaseAuthenticationType", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid parameter format for keyId: '{0}'. It should be a well formed Azure Key Vault KeyId like: https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901. /// diff --git a/src/Sql/Sql/Properties/Resources.resx b/src/Sql/Sql/Properties/Resources.resx index 694f54c5a582..bcbcff64e220 100644 --- a/src/Sql/Sql/Properties/Resources.resx +++ b/src/Sql/Sql/Properties/Resources.resx @@ -441,9 +441,6 @@ ScanId is a required parameter for this cmdlet. Please explicitly provide it or pass the Get-AzSqlDatabaseVulnerabilityAssessmentScanRecord output via pipe. - - Failed retrieving id of storage account '{0}' under subscription '{1}'. - Failed retrieving keys of storage '{0}'. @@ -766,4 +763,16 @@ 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 HubDatabaseAuthenticationType is 'userAssigned'. + + + DatabaseCredentials (username/password) must be provided when HubDatabaseAuthenticationType is 'password'. + + + Failed retrieving id of storage account '{0}' under subscription '{1}'. + + + Invalid HubDatabaseAuthenticationType. 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..a81521e64cf8 100644 --- a/src/Sql/Sql/help/New-AzSqlSyncGroup.md +++ b/src/Sql/Sql/help/New-AzSqlSyncGroup.md @@ -14,10 +14,10 @@ Creates an Azure SQL Database Sync Group. ``` New-AzSqlSyncGroup [-Name] -SyncDatabaseName -SyncDatabaseServerName - -SyncDatabaseResourceGroupName [-IntervalInSeconds ] [-DatabaseCredential ] - [-ConflictResolutionPolicy ] [-SchemaFile ] [-UsePrivateLinkConnection] [-ServerName] - [-DatabaseName] [-ResourceGroupName] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + -SyncDatabaseResourceGroupName [-IntervalInSeconds ] [-DatabaseCredential ] + [-HubDatabaseAuthenticationType ] [-IdentityId ] [-ConflictResolutionPolicy ] + [-SchemaFile ] [-UsePrivateLinkConnection] [-ServerName] [-DatabaseName] + [-ResourceGroupName] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -55,6 +55,41 @@ 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 a **user-assigned managed identity** to authenticate to the hub database. This allows secure, passwordless authentication by referencing the Azure resource ID of the identity. + +```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 +Identity.Type : UserAssigned +UserAssignedIdentities : { + "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": { + "clientId": "{clientId}", + "principalId": "{principalId}" + } + } +SyncState : NotReady +LastSyncTime : 1/1/0001 12:00:00 AM +Schema : +``` + ## PARAMETERS ### -ConflictResolutionPolicy @@ -88,6 +123,37 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HubDatabaseAuthenticationType +The authentication type used to connect to the hub database. Use `"password"` for SQL authentication with `-DatabaseCredential`, or `"userAssigned"` for user-assigned managed identity with `-IdentityId`. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: +Accepted values: password, userAssigned + +Required: False +Position: Named +Default value: password +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityId +The Identity ID of the user-assigned managed identity to use when HubDatabaseAuthenticationType is set to "userAssigned". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DatabaseName The name of the Azure SQL Database. diff --git a/src/Sql/Sql/help/Update-AzSqlSyncGroup.md b/src/Sql/Sql/help/Update-AzSqlSyncGroup.md index a34948c53af5..6aae634c143e 100644 --- a/src/Sql/Sql/help/Update-AzSqlSyncGroup.md +++ b/src/Sql/Sql/help/Update-AzSqlSyncGroup.md @@ -14,8 +14,8 @@ Updates an Azure SQL Database Sync Group. ``` Update-AzSqlSyncGroup [-Name] [-IntervalInSeconds ] [-DatabaseCredential ] - [-SchemaFile ] [-UsePrivateLinkConnection ] [-ServerName] [-DatabaseName] - [-ResourceGroupName] [-DefaultProfile ] [-WhatIf] [-Confirm] + [-HubDatabaseAuthenticationType ] [-IdentityId ] [-SchemaFile ] [-UsePrivateLinkConnection ] + [-ServerName] [-DatabaseName] [-ResourceGroupName] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -53,6 +53,33 @@ 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 DB using a user-assigned managed identity. +```powershell +$credential = Get-Credential +Update-AzSqlSyncGroup -ResourceGroupName "ResourceGroup02" -ServerName "Server02" -DatabaseName "Database02" -Name "SyncGroup02" ` +-HubDatabaseAuthenticationType "userAssigned" -IdentityId "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" -Schema ".\schema.json" | Format-List +``` + +```output +ResourceId : /subscriptions/{subscriptionId}/resourceGroups/{ResourceGroup02}/servers/{Server02}/databases/{Database02}/syncGroups/{SyncGroup02} +ResourceGroupName : ResourceGroup02 +ServerName : Server02 +DatabaseName : Database02 +SyncGroupName : SyncGroup02 +SyncDatabaseId : subscriptions/{subscriptionId}/resourceGroups/{syncDatabaseResourceGroup02}/servers/{syncDatabaseServer02}/databases/{syncDatabaseName02} +IntervalInSeconds : -1 +ConflictResolutionPolicy: : HubWin +UserAssignedIdentities : { + "/subscriptions/{subscriptionId}/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": { + "clientId": "{clientId}", + "principalId": "{principalId}" + } + } +SyncState : NotReady +LastSyncTime : 1/1/0001 12:00:00 AM +Schema : +``` + ## PARAMETERS ### -DatabaseCredential @@ -70,6 +97,37 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HubDatabaseAuthenticationType +The authentication type used to connect to the hub database. Use `"password"` for SQL authentication with `-DatabaseCredential`, or `"userAssigned"` for user-assigned managed identity with `-IdentityId`. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: +Accepted values: password, userAssigned + +Required: False +Position: Named +Default value: password +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityId +The Identity ID of the user-assigned managed identity to use when HubDatabaseAuthenticationType is set to "userAssigned". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DatabaseName SQL Database name.