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/servers.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: sql-servers
  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/servers":
    get:
      description: Gets a list of all servers in the subscription.
      operationId: Servers_List
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the list of servers.
          schema:
            $ref: "#/definitions/ServerListResult"
        default:
          description: "*** Error Responses: ***"
      tags:
        - Servers
      x-ms-examples:
        List servers:
          parameters:
            api-version: 2015-05-01-preview
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                    kind: v12.0
                    location: japaneast
                    name: sqlcrudtest-4645
                    properties:
                      administratorLogin: dummylogin
                      fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                      state: Ready
                      version: "12.0"
                    type: Microsoft.Sql/servers
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661
                    kind: v12.0
                    location: japaneast
                    name: sqlcrudtest-6661
                    properties:
                      administratorLogin: dummylogin
                      fullyQualifiedDomainName: sqlcrudtest-6661.database.windows.net
                      state: Ready
                      version: "12.0"
                    type: Microsoft.Sql/servers
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers":
    get:
      description: Gets a list of servers in a resource groups.
      operationId: Servers_ListByResourceGroup
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the list of servers.
          schema:
            $ref: "#/definitions/ServerListResult"
        default:
          description: "*** Error Responses: ***"
      tags:
        - Servers
      x-ms-examples:
        List servers by resource group:
          parameters:
            api-version: 2015-05-01-preview
            resourceGroupName: sqlcrudtest-7398
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                    kind: v12.0
                    location: japaneast
                    name: sqlcrudtest-4645
                    properties:
                      administratorLogin: dummylogin
                      fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                      state: Ready
                      version: "12.0"
                    type: Microsoft.Sql/servers
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661
                    kind: v12.0
                    location: japaneast
                    name: sqlcrudtest-6661
                    properties:
                      administratorLogin: dummylogin
                      fullyQualifiedDomainName: sqlcrudtest-6661.database.windows.net
                      state: Ready
                      version: "12.0"
                    type: Microsoft.Sql/servers
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}":
    delete:
      description: Deletes a server.
      operationId: Servers_Delete
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully deleted the server.
        "202":
          description: Accepted
        "204":
          description: The specified server does not exist.
        default:
          description: |-
            *** Error Responses: ***

             * 400 SubscriptionNotFound - The requested subscription was not found.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 OperationIdNotFound - The operation with Id does not exist.

             * 409 OperationCancelled - The operation has been cancelled by user.

             * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

             * 429 ConflictingServerOperation - An operation is currently in progress for the server.

             * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
      tags:
        - Servers
      x-ms-examples:
        Delete server:
          parameters:
            api-version: 2015-05-01-preview
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-6661
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Gets a server.
      operationId: Servers_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the specified server.
          schema:
            $ref: "#/definitions/Server"
        default:
          description: |-
            *** Error Responses: ***

             * 404 ResourceNotFound - The requested resource was not found.
      tags:
        - Servers
      x-ms-examples:
        Get server:
          parameters:
            api-version: 2015-05-01-preview
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-4645
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
    patch:
      description: Updates a server.
      operationId: Servers_Update
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The requested server resource state.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ServerUpdate"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the server.
          schema:
            $ref: "#/definitions/Server"
        "202":
          description: Accepted
        default:
          description: |-
            *** Error Responses: ***

             * 400 NameAlreadyExists - The provided name already exists.

             * 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported.

             * 400 ServerNotFound - The requested server was not found.

             * 400 InvalidUsername - Supplied user name contains invalid characters.

             * 400 InvalidParameterValue - An invalid value was given to a parameter.

             * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

             * 400 TokenTooLong - The provided token is too long.

             * 400 InvalidLoginName - The provided login name is invalid.

             * 400 PasswordTooShort - The provided password is too short

             * 400 PasswordTooLong - The provided password is too long.

             * 400 PasswordNotComplex - The provided password is not complex enough.

             * 400 SubscriptionNotFound - The requested subscription was not found.

             * 400 InvalidLocation - An invalid location was specified.

             * 400 InvalidServerName - Invalid server name specified.

             * 400 RegionDoesNotAllowProvisioning - The selected location is not accepting new Windows Azure SQL Database servers. This may change at a later time.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 OperationIdNotFound - The operation with Id does not exist.

             * 409 OperationCancelled - The operation has been cancelled by user.

             * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

             * 409 ServerAlreadyExists - Duplicate server name.

             * 409 SubscriptionDisabled - Subscription is disabled.

             * 409 ServerDisabled - Server is disabled.

             * 409 ServerQuotaExceeded - Server cannot be added to a subscription because it will exceed quota.

             * 429 ConflictingSubscriptionOperation - An operation is currently in progress for the subscription.

             * 429 ConflictingServerOperation - An operation is currently in progress for the server.

             * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
      tags:
        - Servers
      x-ms-examples:
        Update a server with all properties:
          parameters:
            api-version: 2015-05-01-preview
            parameters:
              location: Japan East
              properties:
                administratorLogin: dummylogin
                administratorLoginPassword: Un53cuRE!
                fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                state: Ready
                version: "12.0"
              tags:
                tagKey1: TagValue1
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-4645
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
            "202": {}
        Update a server with minimal properties:
          parameters:
            api-version: 2015-05-01-preview
            parameters:
              location: Japan East
              properties:
                administratorLogin: dummylogin
                administratorLoginPassword: Un53cuRE!
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-4645
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
            "202": {}
      x-ms-long-running-operation: true
    put:
      description: Creates or updates a server.
      operationId: Servers_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The requested server resource state.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Server"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the server.
          schema:
            $ref: "#/definitions/Server"
        "201":
          description: Successfully created the server.
          schema:
            $ref: "#/definitions/Server"
        "202":
          description: Accepted
        default:
          description: |-
            *** Error Responses: ***

             * 400 NameAlreadyExists - The provided name already exists.

             * 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported.

             * 400 ServerNotFound - The requested server was not found.

             * 400 InvalidUsername - Supplied user name contains invalid characters.

             * 400 InvalidParameterValue - An invalid value was given to a parameter.

             * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

             * 400 TokenTooLong - The provided token is too long.

             * 400 InvalidLoginName - The provided login name is invalid.

             * 400 PasswordTooShort - The provided password is too short

             * 400 PasswordTooLong - The provided password is too long.

             * 400 PasswordNotComplex - The provided password is not complex enough.

             * 400 SubscriptionNotFound - The requested subscription was not found.

             * 400 InvalidLocation - An invalid location was specified.

             * 400 InvalidServerName - Invalid server name specified.

             * 400 RegionDoesNotAllowProvisioning - The selected location is not accepting new Windows Azure SQL Database servers. This may change at a later time.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 OperationIdNotFound - The operation with Id does not exist.

             * 409 OperationCancelled - The operation has been cancelled by user.

             * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

             * 409 ServerAlreadyExists - Duplicate server name.

             * 409 SubscriptionDisabled - Subscription is disabled.

             * 409 ServerDisabled - Server is disabled.

             * 409 ServerQuotaExceeded - Server cannot be added to a subscription because it will exceed quota.

             * 429 ConflictingSubscriptionOperation - An operation is currently in progress for the subscription.

             * 429 ConflictingServerOperation - An operation is currently in progress for the server.

             * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
      tags:
        - Servers
      x-ms-examples:
        Create server with all properties:
          parameters:
            api-version: 2015-05-01-preview
            parameters:
              location: Japan East
              properties:
                administratorLogin: dummylogin
                administratorLoginPassword: Un53cuRE!
                fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                state: Ready
                version: "12.0"
              tags:
                tagKey1: TagValue1
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-4645
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
            "202": {}
        Create server with minimal properties:
          parameters:
            api-version: 2015-05-01-preview
            parameters:
              location: Japan East
              properties:
                administratorLogin: dummylogin
                administratorLoginPassword: Un53cuRE!
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-4645
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                type: Microsoft.Sql/servers
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645
                kind: v12.0
                location: japaneast
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                type: Microsoft.Sql/servers
            "202": {}
      x-ms-long-running-operation: true
definitions:
  Server:
    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 tracked top level resource.
        properties:
          location:
            description: Resource location.
            type: string
            x-ms-mutability:
              - read
              - create
          tags:
            additionalProperties:
              type: string
            description: Resource tags.
            type: object
        required:
          - location
        type: object
    description: An Azure SQL Database server.
    properties:
      identity:
        description: Azure Active Directory identity configuration for a resource.
        properties:
          principalId:
            description: The Azure Active Directory principal id.
            format: uuid
            readOnly: true
            type: string
          tenantId:
            description: The Azure Active Directory tenant id.
            format: uuid
            readOnly: true
            type: string
          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:
              - SystemAssigned
            type: string
            x-ms-enum:
              modelAsString: true
              name: IdentityType
        type: object
      kind:
        description: Kind of sql server. This is metadata used for the Azure portal experience.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/ServerProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    required:
      - location
    type: object
  ServerListResult:
    description: A list of servers.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/Server"
        readOnly: true
        type: array
    type: object
  ServerProperties:
    description: The properties of a server.
    properties:
      administratorLogin:
        description: Administrator username for the server. Once created it cannot be changed.
        type: string
        x-ms-mutability:
          - read
          - create
      administratorLoginPassword:
        description: The administrator login password (required for server creation).
        type: string
        x-ms-mutability:
          - create
          - update
      fullyQualifiedDomainName:
        description: The fully qualified domain name of the server.
        readOnly: true
        type: string
      state:
        description: The state of the server.
        readOnly: true
        type: string
      version:
        description: The version of the server.
        type: string
    type: object
  ServerUpdate:
    description: An update request for an Azure SQL Database server.
    properties:
      properties:
        $ref: "#/definitions/ServerProperties"
        description: Resource properties.
        x-ms-client-flatten: true
      tags:
        additionalProperties:
          type: string
        description: Resource tags.
        type: object
    type: object
