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/managedDatabaseVulnerabilityAssesmentRuleBaselines.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: sql-managedDatabaseVulnerabilityAssesmentRuleBaselines
  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}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}":
    delete:
      description: Removes the database's vulnerability assessment rule baseline.
      operationId: ManagedDatabaseVulnerabilityAssessmentRuleBaselines_Delete
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the managed instance.
          in: path
          name: managedInstanceName
          required: true
          type: string
        - description: The name of the database for which the vulnerability assessment rule baseline is defined.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the vulnerability assessment.
          enum:
            - default
          in: path
          name: vulnerabilityAssessmentName
          required: true
          type: string
          x-ms-enum:
            modelAsString: true
            name: VulnerabilityAssessmentName
        - description: The vulnerability assessment rule ID.
          in: path
          name: ruleId
          required: true
          type: string
        - description: The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).
          enum:
            - master
            - default
          in: path
          name: baselineName
          required: true
          type: string
          x-ms-enum:
            modelAsString: false
            name: VulnerabilityAssessmentPolicyBaselineName
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully removed the database vulnerability assessment rule baseline.
        default:
          description: |-
            *** Error Responses: ***

             * 400 VulnerabilityAssessmentStorageAuthenticationFailed - Could not authenticate to storage account '{0}' .

             * 400 VulnerabilityAssessmentInvalidPolicy - Vulnerability Assessment settings don't exist or invalid storage specified in settings. 

             * 400 VulnerabilityAssessmentDatawarehouseDatabaseIsDeactivated - Could not execute Vulnerability Assessment operation because the database is paused. Please resume it.

             * 400 InvalidVulnerabilityAssessmentOperationRequest - The vulnerability assessment operation request does not exist or has no properties object.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 404 VulnerabilityAssessmentInvalidStorageAccount - The storage account '{0}' that was defined in the policy is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 404 VulnerabilityAssessmentRuleDoesNotExists - Rule '{0}' does not exist.

             * 404 VulnerabilityAssessmentBaselineDoesNotExists - Baseline does not exist for rule '{0}'

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - ManagedDatabaseVulnerabilityAssesmentRuleBaselines
      x-ms-examples:
        Removes a database's vulnerability assessment rule baseline.:
          parameters:
            api-version: 2017-10-01-preview
            baselineName: default
            databaseName: testdb
            managedInstanceName: vulnerabilityaseessmenttest-6440
            resourceGroupName: vulnerabilityaseessmenttest-4799
            ruleId: VA1001
            subscriptionId: 00000000-1111-2222-3333-444444444444
            vulnerabilityAssessmentName: default
          responses:
            "200": {}
    get:
      description: Gets a database's vulnerability assessment rule baseline.
      operationId: ManagedDatabaseVulnerabilityAssessmentRuleBaselines_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the managed instance.
          in: path
          name: managedInstanceName
          required: true
          type: string
        - description: The name of the database for which the vulnerability assessment rule baseline is defined.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the vulnerability assessment.
          enum:
            - default
          in: path
          name: vulnerabilityAssessmentName
          required: true
          type: string
          x-ms-enum:
            modelAsString: true
            name: VulnerabilityAssessmentName
        - description: The vulnerability assessment rule ID.
          in: path
          name: ruleId
          required: true
          type: string
        - description: The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).
          enum:
            - master
            - default
          in: path
          name: baselineName
          required: true
          type: string
          x-ms-enum:
            modelAsString: false
            name: VulnerabilityAssessmentPolicyBaselineName
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully got the vulnerability assessment rule baseline.
          schema:
            $ref: "#/definitions/DatabaseVulnerabilityAssessmentRuleBaseline"
        default:
          description: |-
            *** Error Responses: ***

             * 400 VulnerabilityAssessmentStorageAuthenticationFailed - Could not authenticate to storage account '{0}' .

             * 400 VulnerabilityAssessmentInvalidPolicy - Vulnerability Assessment settings don't exist or invalid storage specified in settings. 

             * 400 VulnerabilityAssessmentDatawarehouseDatabaseIsDeactivated - Could not execute Vulnerability Assessment operation because the database is paused. Please resume it.

             * 400 InvalidVulnerabilityAssessmentOperationRequest - The vulnerability assessment operation request does not exist or has no properties object.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 404 VulnerabilityAssessmentInvalidStorageAccount - The storage account '{0}' that was defined in the policy is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 404 VulnerabilityAssessmentRuleDoesNotExists - Rule '{0}' does not exist.

             * 404 VulnerabilityAssessmentBaselineDoesNotExists - Baseline does not exist for rule '{0}'

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - ManagedDatabaseVulnerabilityAssesmentRuleBaselines
      x-ms-examples:
        Gets a database's vulnerability assessment rule baseline.:
          parameters:
            api-version: 2017-10-01-preview
            baselineName: master
            databaseName: testdb
            managedInstanceName: vulnerabilityaseessmenttest-6411
            resourceGroupName: vulnerabilityaseessmenttest-4711
            ruleId: VA1001
            subscriptionId: 00000000-1111-2222-3333-444444444444
            vulnerabilityAssessmentName: default
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default
                name: default
                properties:
                  baselineResults:
                    - result:
                        - userA
                        - SELECT
                    - result:
                        - userB
                        - SELECT
                    - result:
                        - userC
                        - SELECT
                        - tableId_4
                type: Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines
    put:
      description: Creates or updates a database's vulnerability assessment rule baseline.
      operationId: ManagedDatabaseVulnerabilityAssessmentRuleBaselines_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - description: The name of the managed instance.
          in: path
          name: managedInstanceName
          required: true
          type: string
        - description: The name of the database for which the vulnerability assessment rule baseline is defined.
          in: path
          name: databaseName
          required: true
          type: string
        - description: The name of the vulnerability assessment.
          enum:
            - default
          in: path
          name: vulnerabilityAssessmentName
          required: true
          type: string
          x-ms-enum:
            modelAsString: true
            name: VulnerabilityAssessmentName
        - description: The vulnerability assessment rule ID.
          in: path
          name: ruleId
          required: true
          type: string
        - description: The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).
          enum:
            - master
            - default
          in: path
          name: baselineName
          required: true
          type: string
          x-ms-enum:
            modelAsString: false
            name: VulnerabilityAssessmentPolicyBaselineName
        - description: The requested rule baseline resource.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/DatabaseVulnerabilityAssessmentRuleBaseline"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully set the vulnerability assessment rule baseline.
          schema:
            $ref: "#/definitions/DatabaseVulnerabilityAssessmentRuleBaseline"
        default:
          description: |-
            *** Error Responses: ***

             * 400 VulnerabilityAssessmentStorageAuthenticationFailed - Could not authenticate to storage account '{0}' .

             * 400 VulnerabilityAssessmentInvalidPolicy - Vulnerability Assessment settings don't exist or invalid storage specified in settings. 

             * 400 VulnerabilityAssessmentDatawarehouseDatabaseIsDeactivated - Could not execute Vulnerability Assessment operation because the database is paused. Please resume it.

             * 400 InvalidVulnerabilityAssessmentOperationRequest - The vulnerability assessment operation request does not exist or has no properties object.

             * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.

             * 404 VulnerabilityAssessmentInvalidStorageAccount - The storage account '{0}' that was defined in the policy is invalid.

             * 404 SubscriptionDoesNotHaveServer - The requested server was not found

             * 404 SourceDatabaseNotFound - The source database does not exist.

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

             * 404 VulnerabilityAssessmentRuleDoesNotExists - Rule '{0}' does not exist.

             * 404 VulnerabilityAssessmentBaselineDoesNotExists - Baseline does not exist for rule '{0}'

             * 500 DatabaseIsUnavailable - Loading failed. Please try again later.
      tags:
        - ManagedDatabaseVulnerabilityAssesmentRuleBaselines
      x-ms-examples:
        Creates or updates a database's vulnerability assessment rule baseline.:
          parameters:
            api-version: 2017-10-01-preview
            baselineName: default
            databaseName: testdb
            managedInstanceName: vulnerabilityaseessmenttest-6440
            parameters:
              properties:
                baselineResults:
                  - result:
                      - userA
                      - SELECT
                  - result:
                      - userB
                      - SELECT
                  - result:
                      - userC
                      - SELECT
                      - tableId_4
            resourceGroupName: vulnerabilityaseessmenttest-4799
            ruleId: VA1001
            subscriptionId: 00000000-1111-2222-3333-444444444444
            vulnerabilityAssessmentName: default
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default
                name: default
                properties:
                  baselineResults:
                    - result:
                        - userA
                        - SELECT
                    - result:
                        - userB
                        - SELECT
                    - result:
                        - userC
                        - SELECT
                        - tableId_4
                type: Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines
definitions:
  DatabaseVulnerabilityAssessmentRuleBaseline:
    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 vulnerability assessment rule baseline.
    properties:
      properties:
        $ref: "#/definitions/DatabaseVulnerabilityAssessmentRuleBaselineProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  DatabaseVulnerabilityAssessmentRuleBaselineItem:
    description: Properties for an Azure SQL Database Vulnerability Assessment rule baseline's result.
    properties:
      result:
        description: The rule baseline result
        items:
          type: string
        type: array
    required:
      - result
    type: object
  DatabaseVulnerabilityAssessmentRuleBaselineProperties:
    description: Properties of a database Vulnerability Assessment rule baseline.
    properties:
      baselineResults:
        description: The rule baseline result
        items:
          $ref: "#/definitions/DatabaseVulnerabilityAssessmentRuleBaselineItem"
        type: array
    required:
      - baselineResults
    type: object
