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/managedInstanceOperations.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-managedInstanceOperations
  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/managedInstances/{managedInstanceName}/operations":
    get:
      description: Gets a list of operations performed on the managed instance.
      operationId: ManagedInstanceOperations_ListByManagedInstance
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ManagedInstanceNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The request for getting managed instance operations has been executed successfully.
          schema:
            $ref: "#/definitions/ManagedInstanceOperationListResult"
        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.
      tags:
        - ManagedInstanceOperations
      x-ms-examples:
        List the managed instance management operations:
          parameters:
            api-version: 2018-06-01-preview
            managedInstanceName: sqlcrudtest-4645
            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/managedInstances/sqlcrudtest-4645/operations/11111111-1111-1111-1111-111111111111
                    name: 11111111-1111-1111-1111-111111111111
                    properties:
                      managedInstanceName: sqlcrudtest-4645
                      operation: UpsertManagedServer
                      operationFriendlyName: MANAGED SERVER UPDATE
                      percentComplete: 0
                      startTime: 2017-06-01T09:10:08.10Z
                      state: InProgress
                    type: Microsoft.Sql/managedInstances/operations
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/22222222-2222-2222-2222-222222222222
                    name: 22222222-2222-2222-2222-222222222222
                    properties:
                      managedInstanceName: sqlcrudtest-4645
                      operation: UpsertManagedServer
                      operationFriendlyName: MANAGED SERVER UPDATE
                      percentComplete: 100
                      startTime: 2019-09-23T08:05:28.687Z
                      state: Succeeded
                    type: Microsoft.Sql/managedInstances/operations
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/33333333-3333-3333-3333-333333333333
                    name: 33333333-3333-3333-3333-333333333333
                    properties:
                      errorCode: 45157
                      errorDescription: Server 'testcl' is busy with another operation. Please try your operation later.
                      errorSeverity: 16
                      isUserError: true
                      managedInstanceName: sqlcrudtest-4645
                      operation: UpsertManagedServer
                      operationFriendlyName: MANAGED SERVER UPDATE
                      percentComplete: 55
                      startTime: 2019-09-23T08:05:28.687Z
                      state: Failed
                    type: Microsoft.Sql/managedInstances/operations
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/44444444-4444-4444-4444-444444444444
                    name: 44444444-4444-4444-4444-444444444444
                    properties:
                      managedInstanceName: sqlcrudtest-4645
                      operation: MakeAllManagedDatabasesAccessible
                      operationFriendlyName: MAKE ALL MANAGED DBS ACCESSIBLE
                      percentComplete: 100
                      startTime: 2017-06-01T09:00:08.10Z
                      state: Succeeded
                    type: Microsoft.Sql/managedInstances/operations
      x-ms-pageable:
        nextLinkName: nextLink
definitions:
  ManagedInstanceOperation:
    allOf:
      - $ref: "#/definitions/ProxyResource"
    description: A managed instance operation.
    properties:
      properties:
        $ref: "#/definitions/ManagedInstanceOperationProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  ManagedInstanceOperationListResult:
    description: The response to a list managed instance operations request
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/ManagedInstanceOperation"
        readOnly: true
        type: array
    type: object
  ManagedInstanceOperationProperties:
    description: The properties of a managed instance operation.
    properties:
      description:
        description: The operation description.
        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
      managedInstanceName:
        description: The name of the managed instance the operation is being performed on.
        readOnly: true
        type: string
      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
      startTime:
        description: The operation start time.
        format: date-time
        readOnly: true
        type: string
      state:
        description: The operation state.
        enum:
          - Pending
          - InProgress
          - Succeeded
          - Failed
          - CancelInProgress
          - Cancelled
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: ManagementOperationState
    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
