swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Provides read and update functionality for Azure SQL Database geo backup policies.
  title: Azure SQL Database
  version: 2014-04-01
  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/stable/2014-04-01/geoBackupPolicies.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-geoBackupPolicies
  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:
  GeoBackupPolicyNameParameter:
    description: The name of the geo backup policy.
    enum:
      - Default
    in: path
    name: geoBackupPolicyName
    required: true
    type: string
    x-ms-enum:
      modelAsString: true
      name: GeoBackupPolicyName
    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
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies":
    get:
      description: Returns a list of geo backup policies.
      operationId: GeoBackupPolicies_ListByDatabase
      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 the database.
          in: path
          name: databaseName
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GeoBackupPolicyListResult"
      tags:
        - GeoBackupPolicies
      x-ms-examples:
        List geo backup policies:
          parameters:
            api-version: 2014-04-01
            databaseName: testdw
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-5961
            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-5961/databases/testdw/geoBackupPolicies/Default
                    kind: null
                    location: Central US
                    name: Default
                    properties:
                      state: Enabled
                      storageType: Premium
                    type: Microsoft.Sql/servers/databases/geoBackupPolicies
      x-ms-pageable:
        nextLinkName: null
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}":
    get:
      description: Gets a geo backup policy.
      operationId: GeoBackupPolicies_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 the database.
          in: path
          name: databaseName
          required: true
          type: string
        - $ref: "#/parameters/GeoBackupPolicyNameParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GeoBackupPolicy"
      tags:
        - GeoBackupPolicies
      x-ms-examples:
        Get geo backup policy:
          parameters:
            api-version: 2014-04-01
            databaseName: testdw
            geoBackupPolicyName: Default
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-5961
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdw/geoBackupPolicies/Default
                kind: null
                location: Central US
                name: Default
                properties:
                  state: Enabled
                  storageType: Premium
                type: Microsoft.Sql/servers/databases/geoBackupPolicies
    put:
      description: Updates a database geo backup policy.
      operationId: GeoBackupPolicies_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"
        - description: The name of the database.
          in: path
          name: databaseName
          required: true
          type: string
        - $ref: "#/parameters/GeoBackupPolicyNameParameter"
        - description: The required parameters for creating or updating the geo backup policy.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/GeoBackupPolicy"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GeoBackupPolicy"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/GeoBackupPolicy"
      tags:
        - GeoBackupPolicies
      x-ms-examples:
        Update geo backup policy:
          parameters:
            api-version: 2014-04-01
            databaseName: testdw
            geoBackupPolicyName: Default
            parameters:
              properties:
                state: Enabled
            resourceGroupName: sqlcrudtest-4799
            serverName: sqlcrudtest-5961
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdw/geoBackupPolicies/Default
                kind: null
                location: null
                name: Default
                properties:
                  state: Enabled
                  storageType: null
                type: Microsoft.Sql/servers/databases/geoBackupPolicies
            "201":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdw/geoBackupPolicies/Default
                kind: null
                location: null
                name: Default
                properties:
                  state: Enabled
                  storageType: null
                type: Microsoft.Sql/servers/databases/geoBackupPolicies
definitions:
  GeoBackupPolicy:
    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 database geo backup policy.
    properties:
      kind:
        description: Kind of geo backup policy.  This is metadata used for the Azure portal experience.
        readOnly: true
        type: string
      location:
        description: Backup policy location.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/GeoBackupPolicyProperties"
        description: The properties of the geo backup policy.
        x-ms-client-flatten: true
    required:
      - properties
  GeoBackupPolicyListResult:
    description: The response to a list geo backup policies request.
    properties:
      value:
        description: The list of geo backup policies.
        items:
          $ref: "#/definitions/GeoBackupPolicy"
        type: array
  GeoBackupPolicyProperties:
    description: The properties of the geo backup policy.
    properties:
      state:
        description: The state of the geo backup policy.
        enum:
          - Disabled
          - Enabled
        type: string
        x-ms-enum:
          modelAsString: false
          name: GeoBackupPolicyState
      storageType:
        description: The storage type of the geo backup policy.
        readOnly: true
        type: string
    required:
      - state
