{
  "openapi": "3.0.1",
  "info": {
    "title": "SqlManagementClient",
    "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.",
    "version": "2017-03-01-preview"
  },
  "servers": [
    {
      "url": "https://management.azure.com/"
    }
  ],
  "paths": {
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments": {
      "get": {
        "tags": [
          "DatabaseVulnerabilityAssessments"
        ],
        "description": "Lists the vulnerability assessment policies associated with a database.",
        "operationId": "DatabaseVulnerabilityAssessments_ListByDatabase",
        "parameters": [
          {
            "name": "resourceGroupName",
            "in": "path",
            "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.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serverName",
            "in": "path",
            "description": "The name of the server.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "databaseName",
            "in": "path",
            "description": "The name of the database for which the vulnerability assessment policies are defined.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The subscription ID that identifies an Azure subscription.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to use for the request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the database vulnerability assessment policies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseVulnerabilityAssessmentListResult"
                }
              }
            }
          },
          "default": {
            "description": "*** Error Responses: ***\n\n * 400 InvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 InvalidStorageAccountCredentials - The provided storage account shared access signature or account storage key is not valid.\n\n * 400 VulnerabilityAssessmentInvalidPolicy - Vulnerability Assessment settings don't exist or invalid storage specified in settings. \n\n * 400 DatabaseVulnerabilityAssessmentMissingStorageContainerPath - Storage container path must be provided if it isn't set in server level policy\n\n * 400 VulnerabilityAssessmentDatawarehouseDatabaseIsDeactivated - Could not execute Vulnerability Assessment operation because the database is paused. Please resume it.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 409 DatabaseVulnerabilityAssessmentScanIsAlreadyInProgress - Vulnerability Assessment scan is already in progress.\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later."
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}": {
      "get": {
        "tags": [
          "DatabaseVulnerabilityAssessments"
        ],
        "description": "Gets the database's vulnerability assessment.",
        "operationId": "DatabaseVulnerabilityAssessments_Get",
        "parameters": [
          {
            "name": "resourceGroupName",
            "in": "path",
            "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.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serverName",
            "in": "path",
            "description": "The name of the server.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "databaseName",
            "in": "path",
            "description": "The name of the database for which the vulnerability assessment is defined.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vulnerabilityAssessmentName",
            "in": "path",
            "description": "The name of the vulnerability assessment.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            }
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The subscription ID that identifies an Azure subscription.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to use for the request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the database vulnerability assessment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseVulnerabilityAssessment"
                }
              }
            }
          },
          "default": {
            "description": "*** Error Responses: ***\n\n * 400 InvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 InvalidStorageAccountCredentials - The provided storage account shared access signature or account storage key is not valid.\n\n * 400 DatabaseVulnerabilityAssessmentMissingStorageContainerPath - Storage container path must be provided if it isn't set in server level policy\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later."
          }
        }
      },
      "put": {
        "tags": [
          "DatabaseVulnerabilityAssessments"
        ],
        "description": "Creates or updates the database's vulnerability assessment.",
        "operationId": "DatabaseVulnerabilityAssessments_CreateOrUpdate",
        "parameters": [
          {
            "name": "resourceGroupName",
            "in": "path",
            "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.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serverName",
            "in": "path",
            "description": "The name of the server.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "databaseName",
            "in": "path",
            "description": "The name of the database for which the vulnerability assessment is defined.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vulnerabilityAssessmentName",
            "in": "path",
            "description": "The name of the vulnerability assessment.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            }
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The subscription ID that identifies an Azure subscription.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to use for the request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The requested resource.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseVulnerabilityAssessment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully set the vulnerability assessment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseVulnerabilityAssessment"
                }
              }
            }
          },
          "201": {
            "description": "Successfully created the vulnerability assessment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseVulnerabilityAssessment"
                }
              }
            }
          },
          "default": {
            "description": "*** Error Responses: ***\n\n * 400 InvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 InvalidStorageAccountCredentials - The provided storage account shared access signature or account storage key is not valid.\n\n * 400 DatabaseVulnerabilityAssessmentMissingStorageContainerPath - Storage container path must be provided if it isn't set in server level policy\n\n * 400 InvalidVulnerabilityAssessmentOperationRequest - The vulnerability assessment operation request does not exist or has no properties object.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later."
          }
        }
      },
      "delete": {
        "tags": [
          "DatabaseVulnerabilityAssessments"
        ],
        "description": "Removes the database's vulnerability assessment.",
        "operationId": "DatabaseVulnerabilityAssessments_Delete",
        "parameters": [
          {
            "name": "resourceGroupName",
            "in": "path",
            "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.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serverName",
            "in": "path",
            "description": "The name of the server.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "databaseName",
            "in": "path",
            "description": "The name of the database for which the vulnerability assessment is defined.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vulnerabilityAssessmentName",
            "in": "path",
            "description": "The name of the vulnerability assessment.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            }
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The subscription ID that identifies an Azure subscription.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to use for the request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully removed the database vulnerability assessment."
          },
          "default": {
            "description": "*** Error Responses: ***\n\n * 400 InvalidStorageAccountName - The provided storage account is not valid or does not exist.\n\n * 400 InvalidStorageAccountCredentials - The provided storage account shared access signature or account storage key is not valid.\n\n * 400 DatabaseVulnerabilityAssessmentMissingStorageContainerPath - Storage container path must be provided if it isn't set in server level policy\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DatabaseVulnerabilityAssessment": {
        "properties": {
          "properties": {
            "$ref": "#/components/schemas/DatabaseVulnerabilityAssessmentProperties"
          }
        },
        "description": "A database vulnerability assessment.",
        "allOf": [
          {
            "description": "ARM proxy resource.",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Resource ID.",
                    "readOnly": true
                  },
                  "name": {
                    "type": "string",
                    "description": "Resource name.",
                    "readOnly": true
                  },
                  "type": {
                    "type": "string",
                    "description": "Resource type.",
                    "readOnly": true
                  }
                },
                "description": "ARM resource."
              }
            ]
          }
        ]
      },
      "DatabaseVulnerabilityAssessmentListResult": {
        "type": "object",
        "properties": {
          "nextLink": {
            "type": "string",
            "description": "Link to retrieve next page of results.",
            "readOnly": true
          },
          "value": {
            "type": "array",
            "description": "Array of results.",
            "readOnly": true,
            "items": {
              "$ref": "#/components/schemas/DatabaseVulnerabilityAssessment"
            }
          }
        },
        "description": "A list of the database's vulnerability assessments."
      },
      "DatabaseVulnerabilityAssessmentProperties": {
        "type": "object",
        "properties": {
          "recurringScans": {
            "$ref": "#/components/schemas/VulnerabilityAssessmentRecurringScansProperties"
          },
          "storageAccountAccessKey": {
            "type": "string",
            "description": "Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required."
          },
          "storageContainerPath": {
            "type": "string",
            "description": "A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).  It is required if server level vulnerability assessment policy doesn't set"
          },
          "storageContainerSasKey": {
            "type": "string",
            "description": "A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required."
          }
        },
        "description": "Properties of a database Vulnerability Assessment."
      },
      "VulnerabilityAssessmentRecurringScansProperties": {
        "type": "object",
        "properties": {
          "emailSubscriptionAdmins": {
            "type": "boolean",
            "description": "Specifies that the schedule scan notification will be is sent to the subscription administrators.",
            "default": true
          },
          "emails": {
            "type": "array",
            "description": "Specifies an array of e-mail addresses to which the scan notification is sent.",
            "items": {
              "type": "string"
            }
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Recurring scans state."
          }
        },
        "description": "Properties of a Vulnerability Assessment recurring scans."
      }
    },
    "parameters": {
      "ApiVersionParameter": {
        "name": "api-version",
        "in": "query",
        "description": "The API version to use for the request.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "BlobAuditingPolicyNameParameter": {
        "name": "blobAuditingPolicyName",
        "in": "path",
        "description": "The name of the blob auditing policy.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "default"
          ]
        }
      },
      "DatabaseNameParameter": {
        "name": "databaseName",
        "in": "path",
        "description": "The name of the database.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ManagedInstanceNameParameter": {
        "name": "managedInstanceName",
        "in": "path",
        "description": "The name of the managed instance.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ResourceGroupParameter": {
        "name": "resourceGroupName",
        "in": "path",
        "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.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ServerNameParameter": {
        "name": "serverName",
        "in": "path",
        "description": "The name of the server.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "SqlVirtualMachineContainerNameParameter": {
        "name": "sqlVirtualMachineContainerName",
        "in": "path",
        "description": "The name of the SqlVirtualMachineContainer.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "SqlVirtualMachineInstanceNameParameter": {
        "name": "sqlVirtualMachineInstanceName",
        "in": "path",
        "description": "The name of the SqlVirtualMachineInstance.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "SubscriptionIdParameter": {
        "name": "subscriptionId",
        "in": "path",
        "description": "The subscription ID that identifies an Azure subscription.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "VirtualClusterNameParameter": {
        "name": "virtualClusterName",
        "in": "path",
        "description": "The name of the virtual cluster.",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "azure_auth": {
        "type": "oauth2",
        "description": "Azure Active Directory OAuth2 Flow"
      }
    }
  }
}