swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Provides create, read, update and delete functionality for Azure SQL Database resources including servers, databases, elastic pools, recommendations, operations, and usage metrics.
  title: Azure SQL Database
  version: 2014-04-01
  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/stable/2014-04-01/servers.json
      version: "2.0"
  x-preferred: false
  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:
  DatabaseExpandParameter:
    description: "A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption."
    in: query
    name: $expand
    required: false
    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
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers":
    get:
      description: Returns a list of servers.
      operationId: Servers_List
      parameters:
        - description: The API version to use for the request.
          in: query
          name: api-version
          required: true
          type: string
          x-ms-parameter-location: client
        - description: The subscription ID that identifies an Azure subscription.
          in: path
          name: subscriptionId
          required: true
          type: string
          x-ms-parameter-location: client
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ServerListResult"
      tags:
        - Servers
      x-ms-examples:
        List servers:
          parameters:
            api-version: 2014-04-01
            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: Japan East
                    name: sqlcrudtest-4645
                    properties:
                      administratorLogin: dummylogin
                      administratorLoginPassword: null
                      externalAdministratorLogin: null
                      externalAdministratorSid: null
                      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: Japan East
                    name: sqlcrudtest-6661
                    properties:
                      administratorLogin: dummylogin
                      administratorLoginPassword: null
                      externalAdministratorLogin: null
                      externalAdministratorSid: null
                      fullyQualifiedDomainName: sqlcrudtest-6661.database.windows.net
                      state: Ready
                      version: "12.0"
                    type: Microsoft.Sql/servers
      x-ms-pageable:
        nextLinkName: null
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers":
    get:
      description: Returns a list of servers in a resource group.
      operationId: Servers_ListByResourceGroup
      parameters:
        - description: The API version to use for the request.
          in: query
          name: api-version
          required: true
          type: string
          x-ms-parameter-location: client
        - description: The subscription ID that identifies an Azure subscription.
          in: path
          name: subscriptionId
          required: true
          type: string
          x-ms-parameter-location: client
        - 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
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ServerListResult"
      tags:
        - Servers
      x-ms-examples:
        List servers by resource group:
          parameters:
            api-version: 2014-04-01
            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: Japan East
                    name: sqlcrudtest-4645
                    properties:
                      administratorLogin: dummylogin
                      administratorLoginPassword: null
                      externalAdministratorLogin: null
                      externalAdministratorSid: null
                      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: Japan East
                    name: sqlcrudtest-6661
                    properties:
                      administratorLogin: dummylogin
                      administratorLoginPassword: null
                      externalAdministratorLogin: null
                      externalAdministratorSid: null
                      fullyQualifiedDomainName: sqlcrudtest-6661.database.windows.net
                      state: Ready
                      version: "12.0"
                    type: Microsoft.Sql/servers
      x-ms-pageable:
        nextLinkName: null
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}":
    delete:
      description: Deletes a SQL server.
      operationId: Servers_Delete
      parameters:
        - description: The API version to use for the request.
          in: query
          name: api-version
          required: true
          type: string
          x-ms-parameter-location: client
        - description: The subscription ID that identifies an Azure subscription.
          in: path
          name: subscriptionId
          required: true
          type: string
          x-ms-parameter-location: client
        - 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
        - $ref: "#/parameters/ServerNameParameter"
      responses:
        "200":
          description: OK
        "204":
          description: Accepted
      tags:
        - Servers
      x-ms-examples:
        Delete SQL Server:
          parameters:
            api-version: 2014-04-01
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-6661
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
            "204": {}
    get:
      description: Gets a server.
      operationId: Servers_Get
      parameters:
        - description: The API version to use for the request.
          in: query
          name: api-version
          required: true
          type: string
          x-ms-parameter-location: client
        - description: The subscription ID that identifies an Azure subscription.
          in: path
          name: subscriptionId
          required: true
          type: string
          x-ms-parameter-location: client
        - 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
        - $ref: "#/parameters/ServerNameParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Server"
      tags:
        - Servers
      x-ms-examples:
        Get Server:
          parameters:
            api-version: 2014-04-01
            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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: null
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
    patch:
      description: Updates an existing server.
      operationId: Servers_Update
      parameters:
        - description: The API version to use for the request.
          in: query
          name: api-version
          required: true
          type: string
          x-ms-parameter-location: client
        - description: The subscription ID that identifies an Azure subscription.
          in: path
          name: subscriptionId
          required: true
          type: string
          x-ms-parameter-location: client
        - 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
        - $ref: "#/parameters/ServerNameParameter"
        - description: The required parameters for updating a server.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ServerUpdate"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Server"
      tags:
        - Servers
      x-ms-examples:
        Create server max:
          parameters:
            api-version: 2014-04-01
            parameters:
              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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: Un53cuRE!
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
        Create server min:
          parameters:
            api-version: 2014-04-01
            parameters:
              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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: Un53cuRE!
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
    put:
      description: Creates or updates a new server.
      operationId: Servers_CreateOrUpdate
      parameters:
        - description: The API version to use for the request.
          in: query
          name: api-version
          required: true
          type: string
          x-ms-parameter-location: client
        - description: The subscription ID that identifies an Azure subscription.
          in: path
          name: subscriptionId
          required: true
          type: string
          x-ms-parameter-location: client
        - 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
        - $ref: "#/parameters/ServerNameParameter"
        - description: The required parameters for creating or updating a server.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Server"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Server"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/Server"
      tags:
        - Servers
      x-ms-examples:
        Create server max:
          parameters:
            api-version: 2014-04-01
            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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: Un53cuRE!
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: Un53cuRE!
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                tags:
                  tagKey1: TagValue1
                type: Microsoft.Sql/servers
        Create server min:
          parameters:
            api-version: 2014-04-01
            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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: Un53cuRE!
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  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: Japan East
                name: sqlcrudtest-4645
                properties:
                  administratorLogin: dummylogin
                  administratorLoginPassword: Un53cuRE!
                  externalAdministratorLogin: null
                  externalAdministratorSid: null
                  fullyQualifiedDomainName: sqlcrudtest-4645.database.windows.net
                  state: Ready
                  version: "12.0"
                type: Microsoft.Sql/servers
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: Represents a server.
    properties:
      kind:
        description: Kind of sql server.  This is metadata used for the Azure portal experience.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/ServerProperties"
        description: Represents the properties of the resource.
        x-ms-client-flatten: true
  ServerListResult:
    description: Represents the response to a get server request.
    properties:
      value:
        description: The list of servers.
        items:
          $ref: "#/definitions/Server"
        type: array
    required:
      - value
  ServerProperties:
    description: Represents the properties of a server.
    properties:
      administratorLogin:
        description: Administrator username for the server. Can only be specified when the server is being created (and is required for creation).
        type: string
        x-ms-mutability:
          - create
          - read
      administratorLoginPassword:
        description: The administrator login password (required for server creation).
        type: string
        x-ms-mutability:
          - create
          - update
      externalAdministratorLogin:
        description: The display name of the Azure Active Directory object with admin permissions on this server. Legacy parameter, always null. To check for Active Directory admin, query .../servers/{serverName}/administrators
        readOnly: true
        type: string
      externalAdministratorSid:
        description: The ID of the Active Azure Directory object with admin permissions on this server. Legacy parameter, always null. To check for Active Directory admin, query .../servers/{serverName}/administrators.
        format: uuid
        readOnly: true
        type: string
      fullyQualifiedDomainName:
        description: The fully qualified domain name of the server.
        readOnly: true
        type: string
      state:
        description: The state of the server.
        enum:
          - Ready
          - Disabled
        readOnly: true
        type: string
        x-ms-enum:
          name: ServerState
      version:
        description: The version of the server.
        enum:
          - "2.0"
          - "12.0"
        type: string
        x-ms-enum:
          modelAsString: true
          name: ServerVersion
  ServerUpdate:
    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: Represents an update to a server.
    properties:
      properties:
        $ref: "#/definitions/ServerProperties"
        description: Represents the properties of the resource.
        x-ms-client-flatten: true
      tags:
        additionalProperties:
          type: string
        description: Resource tags.
        type: object
