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: 2017-10-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/2017-10-01-preview/cancelPoolOperations.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-cancelPoolOperations
  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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations":
    get:
      description: Gets a list of operations performed on the elastic pool.
      operationId: ElasticPoolOperations_ListByElasticPool
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - in: path
          name: elasticPoolName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The request for getting elastic pool operations has been executed successfully.
          schema:
            $ref: "#/definitions/ElasticPoolOperationListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

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

             * 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:
        - ElasticPools
      x-ms-examples:
        List the elastic pool management operations:
          parameters:
            api-version: 2017-10-01-preview
            elasticPoolName: testpool
            resourceGroupName: sqlcrudtestgroup
            serverName: sqlcrudtestserver
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtestgroup/providers/Microsoft.Sql/servers/sqlcrudtestserver/elasticPools/testpool/operations/11111111-1111-1111-1111-111111111111
                    name: 11111111-1111-1111-1111-111111111111
                    properties:
                      description: UpdateLogicalResourcePool on pool 'testpool', target Edition 'Standard', target pool DTU 300
                      elasticPoolName: testpool
                      estimatedCompletionTime: 2017-10-30T13:10:10Z
                      isCancellable: false
                      operation: UPDATE
                      operationFriendlyName: UPDATE
                      percentComplete: 100
                      serverName: sqlcrudtestserver
                      startTime: 2017-10-30T09:10:08.10Z
                      state: COMPLETED
                    type: Microsoft.Sql/servers/elasticPools/operations
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtestgroup/providers/Microsoft.Sql/servers/sqlcrudtestserver/elasticPools/testpool/operations/55555555-5555-5555-5555-555555555555
                    name: 55555555-5555-5555-5555-555555555555
                    properties:
                      description: UpdateLogicalResourcePool on pool 'testpool', target Edition 'Standard', target pool DTU 300
                      elasticPoolName: testpool
                      estimatedCompletionTime: 2017-10-31T09:10:10Z
                      isCancellable: true
                      operation: UPDATE
                      operationFriendlyName: UPDATE
                      percentComplete: 0
                      serverName: sqlcrudtestserver
                      startTime: 2017-10-30T10:10:08.10Z
                      state: IN_PROGRESS
                    type: Microsoft.Sql/servers/elasticPools/operations
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel":
    post:
      description: Cancels the asynchronous operation on the elastic pool.
      operationId: ElasticPoolOperations_Cancel
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - in: path
          name: elasticPoolName
          required: true
          type: string
        - description: The operation identifier.
          format: uuid
          in: path
          name: operationId
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The request for cancel has been executed successfully.
        default:
          description: |-
            *** Error Responses: ***

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

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

             * 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 CannotCancelOperation - The management operation is in a state that cannot be cancelled.

             * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.
      tags:
        - ElasticPools
      x-ms-examples:
        Cancel the elastic pool management operation:
          parameters:
            api-version: 2017-10-01-preview
            elasticPoolName: testpool
            operationId: f779414b-e748-4925-8cfe-c8598f7660ae
            resourceGroupName: sqlcrudtest-7398
            serverName: sqlcrudtest-6661
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
definitions:
  ElasticPoolOperation:
    allOf:
      - allOf:
          - description: ARM resource.
            properties:
              id:
                description: Resource ID.
                readOnly: true
                type: string
              name:
                description: Resource name.
                readOnly: true
                type: string
              type:
                description: Resource type.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: A elastic pool operation.
    properties:
      properties:
        $ref: "#/definitions/ElasticPoolOperationProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  ElasticPoolOperationListResult:
    description: The response to a list elastic pool operations request
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/ElasticPoolOperation"
        readOnly: true
        type: array
    type: object
  ElasticPoolOperationProperties:
    description: The properties of a elastic pool operation.
    properties:
      description:
        description: The operation description.
        readOnly: true
        type: string
      elasticPoolName:
        description: The name of the elastic pool the operation is being performed on.
        readOnly: true
        type: string
      errorCode:
        description: The operation error code.
        format: int32
        readOnly: true
        type: integer
      errorDescription:
        description: The operation error description.
        readOnly: true
        type: string
      errorSeverity:
        description: The operation error severity.
        format: int32
        readOnly: true
        type: integer
      estimatedCompletionTime:
        description: The estimated completion time of the operation.
        format: date-time
        readOnly: true
        type: string
      isCancellable:
        description: Whether the operation can be cancelled.
        readOnly: true
        type: boolean
      isUserError:
        description: Whether or not the error is a user error.
        readOnly: true
        type: boolean
      operation:
        description: The name of operation.
        readOnly: true
        type: string
      operationFriendlyName:
        description: The friendly name of operation.
        readOnly: true
        type: string
      percentComplete:
        description: The percentage of the operation completed.
        format: int32
        readOnly: true
        type: integer
      serverName:
        description: The name of the server.
        readOnly: true
        type: string
      startTime:
        description: The operation start time.
        format: date-time
        readOnly: true
        type: string
      state:
        description: The operation state.
        readOnly: true
        type: string
    type: object
