swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  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.
  title: SqlManagementClient
  version: 2015-05-01-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/sql/resource-manager/Microsoft.Sql/preview/2015-05-01-preview/syncGroups.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-syncGroups
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
parameters:
  ApiVersionParameter:
    description: The API version to use for the request.
    in: query
    name: api-version
    required: true
    type: string
    x-ms-parameter-location: client
  DatabaseNameParameter:
    description: The name of the database.
    in: path
    name: databaseName
    required: true
    type: string
    x-ms-parameter-location: method
  ResourceGroupParameter:
    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.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  ServerNameParameter:
    description: The name of the server.
    in: path
    name: serverName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The subscription ID that identifies an Azure subscription.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: client
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds":
    get:
      description: Gets a collection of sync database ids.
      operationId: SyncGroups_ListSyncDatabaseIds
      parameters:
        - description: The name of the region where the resource is located.
          in: path
          name: locationName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved collection of sync database ids.
          schema:
            $ref: "#/definitions/SyncDatabaseIdListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.
      tags:
        - SyncGroups
      x-ms-examples:
        Get a sync database ID:
          parameters:
            api-version: 2015-05-01-preview
            locationName: westus
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups":
    get:
      description: Lists sync groups under a hub database.
      operationId: SyncGroups_ListByDatabase
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the list of sync groups.
          schema:
            $ref: "#/definitions/SyncGroupListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        List sync groups under a given database:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                    name: syncgroupcrud-3187
                    properties:
                      conflictResolutionPolicy: HubWin
                      hubDatabaseUserName: hubUser
                      interval: -1
                      lastSyncTime: 0001-01-01T08:00:00Z
                      syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                      syncState: NotReady
                    type: Microsoft.Sql/servers/databases/syncGroups
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-5374
                    name: syncgroupcrud-5374
                    properties:
                      conflictResolutionPolicy: HubWin
                      hubDatabaseUserName: hubUser
                      interval: -1
                      lastSyncTime: 0001-01-01T08:00:00Z
                      syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                      syncState: NotReady
                    type: Microsoft.Sql/servers/databases/syncGroups
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}":
    delete:
      description: Deletes a sync group.
      operationId: SyncGroups_Delete
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully deleted the sync group.
        "202":
          description: Deleting the sync group is in progress.
        "204":
          description: The specified sync group does not exist.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Delete a sync group:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Gets a sync group.
      operationId: SyncGroups_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the specified sync group.
          schema:
            $ref: "#/definitions/SyncGroup"
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 ResourceNotFound - The requested resource was not found.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Get a sync group:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                name: syncgroupcrud-3187
                properties:
                  conflictResolutionPolicy: HubWin
                  hubDatabaseUserName: hubUser
                  interval: -1
                  lastSyncTime: 0001-01-01T08:00:00Z
                  syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                  syncState: NotReady
                type: Microsoft.Sql/servers/databases/syncGroups
    patch:
      description: Updates a sync group.
      operationId: SyncGroups_Update
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - description: The requested sync group resource state.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/SyncGroup"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the sync group.
          schema:
            $ref: "#/definitions/SyncGroup"
        "202":
          description: Updating the sync group is in progress.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Update a sync group:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            parameters:
              properties:
                conflictResolutionPolicy: HubWin
                hubDatabasePassword: hubPassword
                hubDatabaseUserName: hubUser
                interval: -1
                lastSyncTime: 0001-01-01T08:00:00Z
                syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                name: syncgroup
                properties:
                  conflictResolutionPolicy: HubWin
                  hubDatabaseUserName: hubUser
                  interval: -1
                  lastSyncTime: 0001-01-01T08:00:00Z
                  syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                  syncState: NotReady
                type: Microsoft.Sql/servers/databases/syncGroups
            "202": {}
      x-ms-long-running-operation: true
    put:
      description: Creates or updates a sync group.
      operationId: SyncGroups_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - description: The requested sync group resource state.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/SyncGroup"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the sync group.
          schema:
            $ref: "#/definitions/SyncGroup"
        "201":
          description: Successfully created the sync group.
          schema:
            $ref: "#/definitions/SyncGroup"
        "202":
          description: Creating or updating the sync group is in progress.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Create a sync group:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            parameters:
              properties:
                conflictResolutionPolicy: HubWin
                hubDatabaseUserName: hubUser
                interval: -1
                lastSyncTime: 0001-01-01T08:00:00Z
                syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                name: syncgroupcrud-3187
                properties:
                  conflictResolutionPolicy: HubWin
                  hubDatabaseUserName: hubUser
                  interval: -1
                  lastSyncTime: 0001-01-01T08:00:00Z
                  syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                  syncState: NotReady
                type: Microsoft.Sql/servers/databases/syncGroups
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                name: syncgroupcrud-3187
                properties:
                  conflictResolutionPolicy: HubWin
                  hubDatabaseUserName: hubUser
                  interval: -1
                  lastSyncTime: 0001-01-01T08:00:00Z
                  syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                  syncState: NotReady
                type: Microsoft.Sql/servers/databases/syncGroups
            "202": {}
        Update a sync group:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            parameters:
              properties:
                conflictResolutionPolicy: HubWin
                hubDatabaseUserName: hubUser
                interval: -1
                lastSyncTime: 0001-01-01T08:00:00Z
                syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                name: syncgroupcrud-3187
                properties:
                  conflictResolutionPolicy: HubWin
                  hubDatabaseUserName: hubUser
                  interval: -1
                  lastSyncTime: 0001-01-01T08:00:00Z
                  syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                  syncState: NotReady
                type: Microsoft.Sql/servers/databases/syncGroups
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187
                name: syncgroupcrud-3187
                properties:
                  conflictResolutionPolicy: HubWin
                  hubDatabaseUserName: hubUser
                  interval: -1
                  lastSyncTime: 0001-01-01T08:00:00Z
                  syncDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328
                  syncState: NotReady
                type: Microsoft.Sql/servers/databases/syncGroups
            "202": {}
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync":
    post:
      description: Cancels a sync group synchronization.
      operationId: SyncGroups_CancelSync
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully cancel a sync group synchronization.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Cancel a sync group synchronization:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200": {}
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas":
    get:
      description: Gets a collection of hub database schemas.
      operationId: SyncGroups_ListHubSchemas
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully get a sync group hub database schema.
          schema:
            $ref: "#/definitions/SyncFullSchemaPropertiesListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Get a hub database schema.:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200":
              body:
                value:
                  - lastUpdateTime: 2017-05-30T07:16:08.21Z
                    tables:
                      - columns:
                          - dataSize: "4"
                            dataType: int
                            hasError: false
                            isPrimaryKey: false
                            name: intField
                            quotedName: "[intField]"
                          - dataSize: "100"
                            dataType: nvarchar
                            hasError: false
                            isPrimaryKey: false
                            name: charField
                            quotedName: "[charField]"
                        errorId: Schema_TableHasNoPrimaryKey
                        hasError: true
                        name: dbo.myTable
                        quotedName: "[dbo].[myTable]"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs":
    get:
      description: Gets a collection of sync group logs.
      operationId: SyncGroups_ListLogs
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - description: Get logs generated after this time.
          in: query
          name: startTime
          required: true
          type: string
        - description: Get logs generated before this time.
          in: query
          name: endTime
          required: true
          type: string
        - description: The types of logs to retrieve.
          enum:
            - All
            - Error
            - Warning
            - Success
          in: query
          name: type
          required: true
          type: string
        - description: The continuation token for this operation.
          in: query
          name: continuationToken
          required: false
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved sync group logs.
          schema:
            $ref: "#/definitions/SyncGroupLogListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Get sync group logs:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            endTime: 2017-12-31T00:00:00
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            startTime: 2017-01-01T00:00:00
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
            type: All
          responses:
            "200":
              body:
                value:
                  - details: Schema information obtained successfully.
                    operationStatus: SchemaRefreshSuccess
                    source: syncgroupcrud-8475.database.windows.net/hub
                    timestamp: 2017-05-30T07:16:08.25Z
                    tracingId: c0480c8e-6269-424e-9404-b00efce0ebae
                    type: Success
                  - details: |-
                      Getting schema information for the database failed with the exception "Failed to connect to server .
                      Inner exception: SqlException Error Code: -2146232060 - SqlError Number:53, Message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 
                      Inner exception: The network path was not found
                       For more information, provide tracing ID ‘cd3aa28c-0c31-471f-8a77-f1b21c908cbd’ to customer support."
                    operationStatus: SchemaRefreshFailure
                    source: syncgroupcrud-8475.database.windows.net/member
                    timestamp: 2017-05-30T07:03:37.5733333Z
                    tracingId: cd3aa28c-0c31-471f-8a77-f1b21c908cbd
                    type: Error
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema":
    post:
      description: Refreshes a hub database schema.
      operationId: SyncGroups_RefreshHubSchema
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully refreshed a sync hub schema.
        "202":
          description: The sync hub schema refresh operation is on going.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Refresh a hub database schema.:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200": {}
            "202": {}
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync":
    post:
      description: Triggers a sync group synchronization.
      operationId: SyncGroups_TriggerSync
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the database on which the sync group is hosted.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the sync group.
          in: path
          name: syncGroupName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully triggered a sync group synchronization.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.

             * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.

             * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.

             * 400 InvalidDatabaseResourceId - Invalid database resource identifier.

             * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

             * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.

             * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

             * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

             * 400 InvalidSyncGroup - Sync group is invalid.

             * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 409 CannotCreateSyncGroupDueToQuotaExceeded - Cannot create sync group due to quota exceeded.
      tags:
        - SyncGroups
      x-ms-examples:
        Trigger a sync group synchronization.:
          parameters:
            api-version: 2015-05-01-preview
            databaseName: syncgroupcrud-4328
            resourceGroupName: syncgroupcrud-65440
            serverName: syncgroupcrud-8475
            subscriptionId: 00000000-1111-2222-3333-444444444444
            syncGroupName: syncgroupcrud-3187
          responses:
            "200": {}
definitions:
  SyncDatabaseIdListResult:
    description: A list of sync database ID properties.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/SyncDatabaseIdProperties"
        readOnly: true
        type: array
    type: object
  SyncDatabaseIdProperties:
    description: Properties of the sync database id.
    properties:
      id:
        description: ARM resource id of sync database.
        readOnly: true
        type: string
    type: object
  SyncFullSchemaProperties:
    description: Properties of the database full schema.
    properties:
      lastUpdateTime:
        description: Last update time of the database schema.
        format: date-time
        readOnly: true
        type: string
      tables:
        description: List of tables in the database full schema.
        items:
          $ref: "#/definitions/SyncFullSchemaTable"
        readOnly: true
        type: array
    type: object
  SyncFullSchemaPropertiesListResult:
    description: A list of sync schema properties.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/SyncFullSchemaProperties"
        readOnly: true
        type: array
    type: object
  SyncFullSchemaTable:
    description: Properties of the table in the database full schema.
    properties:
      columns:
        description: List of columns in the table of database full schema.
        items:
          $ref: "#/definitions/SyncFullSchemaTableColumn"
        readOnly: true
        type: array
      errorId:
        description: Error id of the table.
        readOnly: true
        type: string
      hasError:
        description: If there is error in the table.
        readOnly: true
        type: boolean
      name:
        description: Name of the table.
        readOnly: true
        type: string
      quotedName:
        description: Quoted name of the table.
        readOnly: true
        type: string
    type: object
  SyncFullSchemaTableColumn:
    description: Properties of the column in the table of database full schema.
    properties:
      dataSize:
        description: Data size of the column.
        readOnly: true
        type: string
      dataType:
        description: Data type of the column.
        readOnly: true
        type: string
      errorId:
        description: Error id of the column.
        readOnly: true
        type: string
      hasError:
        description: If there is error in the table.
        readOnly: true
        type: boolean
      isPrimaryKey:
        description: If it is the primary key of the table.
        readOnly: true
        type: boolean
      name:
        description: Name of the column.
        readOnly: true
        type: string
      quotedName:
        description: Quoted name of the column.
        readOnly: true
        type: string
    type: object
  SyncGroup:
    allOf:
      - allOf:
          - description: ARM resource.
            properties:
              id:
                description: Resource ID.
                readOnly: true
                type: string
              name:
                description: Resource name.
                readOnly: true
                type: string
              type:
                description: Resource type.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: An Azure SQL Database sync group.
    properties:
      properties:
        $ref: "#/definitions/SyncGroupProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  SyncGroupListResult:
    description: A list of sync groups.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/SyncGroup"
        readOnly: true
        type: array
    type: object
  SyncGroupLogListResult:
    description: A list of sync group log properties.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/SyncGroupLogProperties"
        readOnly: true
        type: array
    type: object
  SyncGroupLogProperties:
    description: Properties of an Azure SQL Database sync group log.
    properties:
      details:
        description: Details of the sync group log.
        readOnly: true
        type: string
      operationStatus:
        description: OperationStatus of the sync group log.
        readOnly: true
        type: string
      source:
        description: Source of the sync group log.
        readOnly: true
        type: string
      timestamp:
        description: Timestamp of the sync group log.
        format: date-time
        readOnly: true
        type: string
      tracingId:
        description: TracingId of the sync group log.
        format: uuid
        readOnly: true
        type: string
      type:
        description: Type of the sync group log.
        enum:
          - All
          - Error
          - Warning
          - Success
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: SyncGroupLogType
    type: object
  SyncGroupProperties:
    description: Properties of a sync group.
    properties:
      conflictResolutionPolicy:
        description: Conflict resolution policy of the sync group.
        enum:
          - HubWin
          - MemberWin
        type: string
        x-ms-enum:
          modelAsString: true
          name: SyncConflictResolutionPolicy
      hubDatabasePassword:
        description: Password for the sync group hub database credential.
        type: string
        x-ms-mutability:
          - create
          - update
      hubDatabaseUserName:
        description: User name for the sync group hub database credential.
        type: string
      interval:
        description: Sync interval of the sync group.
        format: int32
        type: integer
      lastSyncTime:
        description: Last sync time of the sync group.
        format: date-time
        readOnly: true
        type: string
      schema:
        $ref: "#/definitions/SyncGroupSchema"
        description: Sync schema of the sync group.
      syncDatabaseId:
        description: ARM resource id of the sync database in the sync group.
        type: string
      syncState:
        description: Sync state of the sync group.
        enum:
          - NotReady
          - Error
          - Warning
          - Progressing
          - Good
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: SyncGroupState
    type: object
  SyncGroupSchema:
    description: Properties of sync group schema.
    properties:
      masterSyncMemberName:
        description: Name of master sync member where the schema is from.
        type: string
      tables:
        description: List of tables in sync group schema.
        items:
          $ref: "#/definitions/SyncGroupSchemaTable"
        type: array
    type: object
  SyncGroupSchemaTable:
    description: Properties of table in sync group schema.
    properties:
      columns:
        description: List of columns in sync group schema.
        items:
          $ref: "#/definitions/SyncGroupSchemaTableColumn"
        type: array
      quotedName:
        description: Quoted name of sync group schema table.
        type: string
    type: object
  SyncGroupSchemaTableColumn:
    description: Properties of column in sync group table.
    properties:
      dataSize:
        description: Data size of the column.
        type: string
      dataType:
        description: Data type of the column.
        type: string
      quotedName:
        description: Quoted name of sync group table column.
        type: string
    type: object
