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: 2018-06-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/2018-06-01-preview/ServerAzureADAdministrators.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-ServerAzureADAdministrators
  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:
  BlobAuditingPolicyNameParameter:
    description: The name of the blob auditing policy.
    enum:
      - default
    in: path
    name: blobAuditingPolicyName
    required: true
    type: string
    x-ms-parameter-location: method
  DatabaseNameParameter:
    description: The name of the database.
    in: path
    name: databaseName
    required: true
    type: string
    x-ms-parameter-location: method
  ManagedInstanceNameParameter:
    description: The name of the managed instance.
    in: path
    name: managedInstanceName
    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
  SqlVirtualMachineContainerNameParameter:
    description: The name of the SqlVirtualMachineContainer.
    in: path
    name: sqlVirtualMachineContainerName
    required: true
    type: string
    x-ms-parameter-location: method
  SqlVirtualMachineInstanceNameParameter:
    description: The name of the SqlVirtualMachineInstance.
    in: path
    name: sqlVirtualMachineInstanceName
    required: true
    type: string
    x-ms-parameter-location: method
  VirtualClusterNameParameter:
    description: The name of the virtual cluster.
    in: path
    name: virtualClusterName
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators":
    get:
      description: Gets a list of server Administrators.
      operationId: ServerAzureADAdministrators_ListByServer
      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: Successfully retrieved the list of Azure Active Directory administrators.
          schema:
            $ref: "#/definitions/AdministratorListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

             * 404 ResourceNotFound - The requested resource was not found.
      tags:
        - ServerAzureADAdministrators
      x-ms-examples:
        Gets a list of Azure Active Directory administrator.:
          parameters:
            administratorName: ActiveDirectory
            api-version: 2018-06-01-preview
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory
                    name: ActiveDirectory
                    properties:
                      administratorType: ActiveDirectory
                      login: bob@contoso.com
                      sid: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                      tenantId: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                    type: Microsoft.Sql/servers/administrators
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}":
    delete:
      description: Deletes an existing server Active Directory Administrator.
      operationId: ServerAzureADAdministrators_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"
        - description: The name of server active directory administrator.
          enum:
            - ActiveDirectory
          in: path
          name: administratorName
          required: true
          type: string
          x-ms-enum:
            modelAsString: true
            name: AdministratorName
      responses:
        "200":
          description: Successfully deleted the Azure Active Directory administrator.
        "202":
          description: Accepted
        "204":
          description: The specified Azure Active Directory administrator does not exist.
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

             * 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.

             * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
      tags:
        - ServerAzureADAdministrators
      x-ms-examples:
        Delete Azure Active Directory administrator.:
          parameters:
            administratorName: ActiveDirectory
            api-version: 2018-06-01-preview
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Gets a server Administrator.
      operationId: ServerAzureADAdministrators_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"
        - description: The name of server active directory administrator.
          enum:
            - ActiveDirectory
          in: path
          name: administratorName
          required: true
          type: string
          x-ms-enum:
            modelAsString: true
            name: AdministratorName
      responses:
        "200":
          description: Successfully retrieved a specified Azure Active Directory administrator.
          schema:
            $ref: "#/definitions/ServerAzureADAdministrator"
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

             * 404 ResourceNotFound - The requested resource was not found.
      tags:
        - ServerAzureADAdministrators
      x-ms-examples:
        Gets a Azure Active Directory administrator.:
          parameters:
            administratorName: ActiveDirectory
            api-version: 2018-06-01-preview
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory
                name: activeDirectory
                properties:
                  administratorType: ActiveDirectory
                  login: bob@contoso.com
                  sid: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                  tenantId: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                type: Microsoft.Sql/servers/administrators
    put:
      description: Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator.
      operationId: ServerAzureADAdministrators_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"
        - enum:
            - ActiveDirectory
          in: path
          name: administratorName
          required: true
          type: string
          x-ms-enum:
            modelAsString: true
            name: AdministratorName
        - description: The required parameters for creating or updating an Active Directory Administrator.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ServerAzureADAdministrator"
      responses:
        "200":
          description: Successfully updated a Azure Active Directory administrator.
          schema:
            $ref: "#/definitions/ServerAzureADAdministrator"
        "201":
          description: Successfully created a Azure Active Directory administrator.
          schema:
            $ref: "#/definitions/ServerAzureADAdministrator"
        "202":
          description: Accepted
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

             * 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.

             * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
      tags:
        - ServerAzureADAdministrators
      x-ms-examples:
        Creates or updates an existing Azure Active Directory administrator.:
          parameters:
            administratorName: ActiveDirectory
            api-version: 2018-06-01-preview
            name: ActiveDirectory
            parameters:
              properties:
                administratorType: ActiveDirectory
                login: bob@contoso.com
                sid: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                tenantId: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-6440
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory
                name: ActiveDirectory
                properties:
                  administratorType: ActiveDirectory
                  login: bob@contoso.com
                  sid: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                  tenantId: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                type: Microsoft.Sql/servers/administrators
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory
                name: ActiveDirectory
                properties:
                  administratorType: ActiveDirectory
                  login: bob@contoso.com
                  sid: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                  tenantId: c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c
                type: Microsoft.Sql/servers/administrators
            "202": {}
      x-ms-long-running-operation: true
definitions:
  AdministratorListResult:
    description: A list of active directory administrators.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/ServerAzureADAdministrator"
        readOnly: true
        type: array
    type: object
  AdministratorProperties:
    description: Properties of a active directory administrator.
    properties:
      administratorType:
        description: Type of the sever administrator.
        enum:
          - ActiveDirectory
        type: string
        x-ms-enum:
          modelAsString: true
          name: AdministratorType
      login:
        description: Login name of the server administrator.
        type: string
      sid:
        description: SID (object ID) of the server administrator.
        format: uuid
        type: string
      tenantId:
        description: Tenant ID of the administrator.
        format: uuid
        type: string
    required:
      - administratorType
      - login
      - sid
    type: object
  ProxyResource:
    allOf:
      - $ref: "#/definitions/Resource"
    description: ARM proxy resource.
    properties: {}
    type: object
  Resource:
    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
  ServerAzureADAdministrator:
    allOf:
      - $ref: "#/definitions/ProxyResource"
    description: Azure Active Directory administrator.
    properties:
      properties:
        $ref: "#/definitions/AdministratorProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
