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-03-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-03-01-preview/restorePoints.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: sql-restorePoints
  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}/databases/{databaseName}/restorePoints":
    get:
      description: Gets a list of database restore points.
      operationId: RestorePoints_ListByDatabase
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully returned restore points.
          schema:
            $ref: "#/definitions/RestorePointListResult"
        default:
          description: |-
            *** Error Responses: ***

             * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.

             * 400 BackupNotAllowedOnDeactivatedDatabase - Cannot create restore point on a deactivated database.

             * 400 RestorePointLimitReached - A restore point cannot be created because database would exceed the allowed quota of restore points.

             * 400 RestorePointAttemptToDeleteSystemBackup - Cannot delete system restore point.

             * 404 DatabaseRestorePointNotFound - Can not find database restore point.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 408 DatabaseRestorePointTimedOut - Create database restore point failed.
      tags:
        - RestorePoints
      x-ms-examples:
        List database restore points.:
          parameters:
            api-version: 2017-03-01-preview
            databaseName: "3481"
            resourceGroupName: sqlcrudtest-6730
            serverName: sqlcrudtest-9007
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6730/providers/Microsoft.Sql/servers/sqlcrudtest-9007/databases/3481/restorepoints/ContinuousRestorePoint
                    location: West US
                    name: ContinuousRestorePoint
                    properties:
                      earliestRestoreDate: 2017-06-12T00:00:00Z
                      restorePointType: CONTINUOUS
                    type: Microsoft.Sql/servers/databases/restorePoints
        List datawarehouse database restore points.:
          parameters:
            api-version: 2017-03-01-preview
            databaseName: testDatabase
            location: japaneast
            resourceGroupName: Default-SQL-SouthEastAsia
            serverName: testserver
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131546477590000000
                    location: japaneast
                    name: "131546477590000000"
                    properties:
                      restorePointCreationDate: 2017-03-10T08:00:00.000Z
                      restorePointLabel: mylabel1
                      restorePointType: DISCRETE
                    type: Microsoft.Sql/servers/databases/restorePoints
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131553636140000000
                    location: japaneast
                    name: "131553636140000000"
                    properties:
                      restorePointCreationDate: 2017-11-17T03:40:14Z
                      restorePointLabel: mylabel2
                      restorePointType: DISCRETE
                    type: Microsoft.Sql/servers/databases/restorePoints
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131553619750000000
                    location: japaneast
                    name: "131553619750000000"
                    properties:
                      restorePointCreationDate: 2017-11-17T03:12:55Z
                      restorePointType: DISCRETE
                    type: Microsoft.Sql/servers/databases/restorePoints
      x-ms-pageable:
        nextLinkName: null
    post:
      description: Creates a restore point for a data warehouse.
      operationId: RestorePoints_Create
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - description: The definition for creating the restore point of this database.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/CreateDatabaseRestorePointDefinition"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully created the restore point request.
          schema:
            $ref: "#/definitions/RestorePoint"
        "201":
          description: Successfully created the restore point request.
          schema:
            $ref: "#/definitions/RestorePoint"
        "202":
          description: Accepted
        default:
          description: |-
            *** Error Responses: ***

             * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.

             * 400 BackupNotAllowedOnDeactivatedDatabase - Cannot create restore point on a deactivated database.

             * 400 RestorePointLimitReached - A restore point cannot be created because database would exceed the allowed quota of restore points.

             * 400 RestorePointAttemptToDeleteSystemBackup - Cannot delete system restore point.

             * 404 DatabaseRestorePointNotFound - Can not find database restore point.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 408 DatabaseRestorePointTimedOut - Create database restore point failed.
      tags:
        - RestorePoints
      x-ms-examples:
        Creates datawarehouse database restore point.:
          parameters:
            api-version: 2017-03-01-preview
            databaseName: testDatabase
            location: japaneast
            parameters:
              restorePointLabel: mylabel
            resourceGroupName: Default-SQL-SouthEastAsia
            serverName: testserver
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131546477590000000
                location: japaneast
                name: "131546477590000000"
                properties:
                  restorePointCreationDate: 2017-03-10T08:00:00.000Z
                  restorePointLabel: mylabel
                  restorePointType: DISCRETE
                type: Microsoft.Sql/servers/databases/restorePoints
            "202": {}
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}":
    delete:
      description: Deletes a restore point.
      operationId: RestorePoints_Delete
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - description: The name of the restore point.
          in: path
          name: restorePointName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully deleted the restore point.
        default:
          description: |-
            *** Error Responses: ***

             * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.

             * 400 BackupNotAllowedOnDeactivatedDatabase - Cannot create restore point on a deactivated database.

             * 400 RestorePointLimitReached - A restore point cannot be created because database would exceed the allowed quota of restore points.

             * 400 RestorePointAttemptToDeleteSystemBackup - Cannot delete system restore point.

             * 404 DatabaseRestorePointNotFound - Can not find database restore point.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 408 DatabaseRestorePointTimedOut - Create database restore point failed.
      tags:
        - RestorePoints
      x-ms-examples:
        Deletes a restore point.:
          parameters:
            api-version: 2017-03-01-preview
            databaseName: testDatabase
            location: japaneast
            resourceGroupName: Default-SQL-SouthEastAsia
            restorePointName: "131546477590000000"
            serverName: testserver
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
    get:
      description: Gets a restore point.
      operationId: RestorePoints_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/DatabaseNameParameter"
        - description: The name of the restore point.
          in: path
          name: restorePointName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully returned the restore point.
          schema:
            $ref: "#/definitions/RestorePoint"
        default:
          description: |-
            *** Error Responses: ***

             * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.

             * 400 BackupNotAllowedOnDeactivatedDatabase - Cannot create restore point on a deactivated database.

             * 400 RestorePointLimitReached - A restore point cannot be created because database would exceed the allowed quota of restore points.

             * 400 RestorePointAttemptToDeleteSystemBackup - Cannot delete system restore point.

             * 404 DatabaseRestorePointNotFound - Can not find database restore point.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

             * 408 DatabaseRestorePointTimedOut - Create database restore point failed.
      tags:
        - RestorePoints
      x-ms-examples:
        Gets a database restore point.:
          parameters:
            api-version: 2017-03-01-preview
            databaseName: testDatabase
            location: japaneast
            resourceGroupName: Default-SQL-SouthEastAsia
            restorePointName: "131546477590000000"
            serverName: testserver
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/ContinuousRestorePoint
                location: japaneast
                name: ContinuousRestorePoint
                properties:
                  earliestRestoreDate: 2017-03-10T08:00:00.000Z
                  restorePointType: CONTINUOUS
                type: Microsoft.Sql/servers/databases/restorePoints
        Gets a datawarehouse database restore point.:
          parameters:
            api-version: 2017-03-01-preview
            databaseName: testDatabase
            location: japaneast
            resourceGroupName: Default-SQL-SouthEastAsia
            restorePointName: "131546477590000000"
            serverName: testserver
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131546477590000000
                location: japaneast
                name: "131546477590000000"
                properties:
                  restorePointCreationDate: 2017-03-10T08:00:00.000Z
                  restorePointLabel: mylabel
                  restorePointType: DISCRETE
                type: Microsoft.Sql/servers/databases/restorePoints
definitions:
  CreateDatabaseRestorePointDefinition:
    description: Contains the information necessary to perform a create database restore point operation.
    properties:
      restorePointLabel:
        description: The restore point label to apply
        type: string
    required:
      - restorePointLabel
    type: object
  RestorePoint:
    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: Database restore points.
    properties:
      location:
        description: Resource location.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/RestorePointProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  RestorePointListResult:
    description: A list of long term retention backups.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/RestorePoint"
        readOnly: true
        type: array
    type: object
  RestorePointProperties:
    description: Properties of a database restore point
    properties:
      earliestRestoreDate:
        description: The earliest time to which this database can be restored
        format: date-time
        readOnly: true
        type: string
      restorePointCreationDate:
        description: The time the backup was taken
        format: date-time
        readOnly: true
        type: string
      restorePointLabel:
        description: The label of restore point for backup request by user
        readOnly: true
        type: string
      restorePointType:
        description: The type of restore point
        enum:
          - CONTINUOUS
          - DISCRETE
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: false
          name: RestorePointType
    type: object
