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/instancePools.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-instancePools
  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
  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
  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
  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
  SubscriptionIdParameter:
    description: The subscription ID that identifies an Azure subscription.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: client
  VirtualClusterNameParameter:
    description: The name of the virtual cluster.
    in: path
    name: virtualClusterName
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools":
    get:
      description: Gets a list of all instance pools in the subscription.
      operationId: InstancePools_List
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the list of instance pools in a subscription.
          schema:
            $ref: "#/definitions/InstancePoolListResult"
        default:
          description: "*** Error Responses: ***"
      tags:
        - InstancePools
      x-ms-examples:
        List instance pools in the subscription:
          parameters:
            api-version: 2018-06-01-preview
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                    location: onebox
                    name: testIP
                    properties:
                      licenseType: LicenseIncluded
                      subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                      vCores: 8
                    sku:
                      family: Gen5
                      name: GP_Gen5
                      tier: GeneralPurpose
                    tags:
                      a: b
                    type: Microsoft.Sql/instancePools
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group2/providers/Microsoft.Sql/instancePools/testIP2
                    location: onebox
                    name: testIP2
                    properties:
                      licenseType: LicenseIncluded
                      subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group2/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                      vCores: 8
                    sku:
                      family: Gen5
                      name: GP_Gen5
                      tier: GeneralPurpose
                    tags:
                      a: b
                    type: Microsoft.Sql/instancePools
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools":
    get:
      description: Gets a list of instance pools in the resource group
      operationId: InstancePools_ListByResourceGroup
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the list of instance pools.
          schema:
            $ref: "#/definitions/InstancePoolListResult"
        default:
          description: "*** Error Responses: ***"
      tags:
        - InstancePools
      x-ms-examples:
        List instance pools by resource group:
          parameters:
            api-version: 2018-06-01-preview
            resourceGroupName: group1
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                    location: onebox
                    name: testIP
                    properties:
                      licenseType: LicenseIncluded
                      subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                      vCores: 8
                    sku:
                      family: Gen5
                      name: GP_Gen5
                      tier: GeneralPurpose
                    tags:
                      a: b
                    type: Microsoft.Sql/instancePools
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP2
                    location: onebox
                    name: testIP2
                    properties:
                      licenseType: LicenseIncluded
                      subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                      vCores: 8
                    sku:
                      family: Gen5
                      name: GP_Gen5
                      tier: GeneralPurpose
                    tags:
                      a: b
                    type: Microsoft.Sql/instancePools
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}":
    delete:
      description: Deletes an instance pool
      operationId: InstancePools_Delete
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the instance pool to be deleted
          in: path
          name: instancePoolName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully deleted the instance pool.
        "202":
          description: Accepted
        "204":
          description: The specified instance pool does not exist.
        default:
          description: |-
            *** Error Responses: ***

             * 400 InstancePoolNotEmpty - An instance pool is not empty

             * 404 InstancePoolNotFound - An instance pool cannot be found

             * 404 InstancePoolNotFound - An instance pool cannot be found

             * 409 InstancePoolBusy - An instance pool is busy with another ongoing operation
      tags:
        - InstancePools
      x-ms-examples:
        Delete an instance pool:
          parameters:
            api-version: 2018-06-01-preview
            instancePoolName: testIP
            resourceGroupName: group1
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Gets an instance pool.
      operationId: InstancePools_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the instance pool to be retrieved.
          in: path
          name: instancePoolName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved the specified instance pool.
          schema:
            $ref: "#/definitions/InstancePool"
        default:
          description: |-
            *** Error Responses: ***

             * 404 InstancePoolNotFound - An instance pool cannot be found
      tags:
        - InstancePools
      x-ms-examples:
        Get an instance pool:
          parameters:
            api-version: 2018-06-01-preview
            instancePoolName: testIP
            resourceGroupName: group1
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                location: onebox
                name: testIP
                properties:
                  licenseType: LicenseIncluded
                  subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                  vCores: 8
                sku:
                  family: Gen5
                  name: GP_Gen5
                  tier: GeneralPurpose
                tags:
                  a: b
                type: Microsoft.Sql/instancePools
    patch:
      description: Updates an instance pool.
      operationId: InstancePools_Update
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the instance pool to be updated.
          in: path
          name: instancePoolName
          required: true
          type: string
        - description: The requested instance pool resource state.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/InstancePoolUpdate"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the instance pool.
          schema:
            $ref: "#/definitions/InstancePool"
        "202":
          description: Accepted
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidResourceRequestBody - The resource or resource properties in the request body is empty or invalid.
      tags:
        - InstancePools
      x-ms-examples:
        Patch an instance pool:
          parameters:
            api-version: 2018-06-01-preview
            instancePoolName: testIP
            parameters:
              tags:
                x: y
            resourceGroupName: group1
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                location: onebox
                name: testIP
                properties:
                  licenseType: LicenseIncluded
                  subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                  vCores: 8
                sku:
                  family: Gen5
                  name: GP_Gen5
                  tier: GeneralPurpose
                tags:
                  x: y
                type: Microsoft.Sql/instancePools
            "202": {}
      x-ms-long-running-operation: true
    put:
      description: Creates or updates an instance pool.
      operationId: InstancePools_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the instance pool to be created or updated.
          in: path
          name: instancePoolName
          required: true
          type: string
        - description: The requested instance pool resource state.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/InstancePool"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully updated the instance pool.
          schema:
            $ref: "#/definitions/InstancePool"
        "201":
          description: Successfully created the instance pool.
          schema:
            $ref: "#/definitions/InstancePool"
        "202":
          description: Accepted
        default:
          description: |-
            *** Error Responses: ***

             * 400 InvalidResourceRequestBody - The resource or resource properties in the request body is empty or invalid.

             * 400 MissingSkuName - Sku name is required.

             * 400 InstancePoolRequestedVcoreCountIsInvalid - Requested vcore count for instance pool is invalid

             * 400 InstancePoolRequestMissingSku - Instance pool request is missing sku

             * 400 InstancePoolRequestMissingSkuTier - Instance pool request is missing sku tier

             * 400 InstancePoolRequestMissingSkuFamily - Instance pool request is missing sku family

             * 400 InstancePoolRequestedSubnetResourceIdIsInvalid - Subnet id for instance pool is null or empty

             * 409 InstancePoolBusy - An instance pool is busy with another ongoing operation
      tags:
        - InstancePools
      x-ms-examples:
        Create an instance pool with all properties.:
          parameters:
            api-version: 2018-06-01-preview
            instancePoolName: testIP
            parameters:
              properties:
                licenseType: LicenseIncluded
                subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                vCores: 8
              sku:
                family: Gen5
                name: GP_Gen5
                tier: GeneralPurpose
              tags:
                a: b
            resourceGroupName: group1
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                location: onebox
                name: testIP
                properties:
                  licenseType: LicenseIncluded
                  subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                  vCores: 8
                sku:
                  family: Gen5
                  name: GP_Gen5
                  tier: GeneralPurpose
                tags:
                  a: b
                type: Microsoft.Sql/instancePools
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                location: onebox
                name: testIP
                properties:
                  licenseType: LicenseIncluded
                  subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                  vCores: 8
                sku:
                  family: Gen5
                  name: GP_Gen5
                  tier: GeneralPurpose
                tags:
                  a: b
                type: Microsoft.Sql/instancePools
            "202": {}
        Create an instance pool with min properties.:
          parameters:
            api-version: 2018-06-01-preview
            instancePoolName: testIP
            parameters:
              properties:
                licenseType: LicenseIncluded
                subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                vCores: 8
              sku:
                family: Gen5
                name: GP_Gen5
                tier: GeneralPurpose
            resourceGroupName: group1
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                location: onebox
                name: testIP
                properties:
                  licenseType: LicenseIncluded
                  subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                  vCores: 8
                sku:
                  family: Gen5
                  name: GP_Gen5
                  tier: GeneralPurpose
                tags: {}
                type: Microsoft.Sql/instancePools
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP
                location: onebox
                name: testIP
                properties:
                  licenseType: LicenseIncluded
                  subnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1
                  vCores: 8
                sku:
                  family: Gen5
                  name: GP_Gen5
                  tier: GeneralPurpose
                tags: {}
                type: Microsoft.Sql/instancePools
            "202": {}
      x-ms-long-running-operation: true
definitions:
  InstancePool:
    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 instance pool.
    properties:
      properties:
        $ref: "#/definitions/InstancePoolProperties"
        description: Resource properties.
        x-ms-client-flatten: true
      sku:
        description: An ARM Resource SKU.
        properties:
          capacity:
            description: Capacity of the particular SKU.
            format: int32
            type: integer
          family:
            description: If the service has different generations of hardware, for the same SKU, then that can be captured here.
            type: string
          name:
            description: The name of the SKU, typically, a letter + Number code, e.g. P3.
            type: string
          size:
            description: Size of the particular SKU
            type: string
          tier:
            description: The tier or edition of the particular SKU, e.g. Basic, Premium.
            type: string
        required:
          - name
        type: object
    required:
      - location
    type: object
  InstancePoolListResult:
    description: A list of Azure SQL instance pools.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/InstancePool"
        readOnly: true
        type: array
    type: object
  InstancePoolProperties:
    description: Properties of an instance pool.
    properties:
      licenseType:
        description: The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without SQL license price).
        enum:
          - LicenseIncluded
          - BasePrice
        type: string
        x-ms-enum:
          modelAsString: true
          name: InstancePoolLicenseType
        x-ms-mutability:
          - read
          - create
      subnetId:
        description: Resource ID of the subnet to place this instance pool in.
        type: string
        x-ms-mutability:
          - read
          - create
      vCores:
        description: Count of vCores belonging to this instance pool.
        format: int32
        type: integer
        x-ms-mutability:
          - read
          - create
    required:
      - subnetId
      - vCores
      - licenseType
    type: object
  InstancePoolUpdate:
    description: An update to an Instance pool.
    properties:
      tags:
        additionalProperties:
          type: string
        description: Resource tags.
        type: object
    type: object
