{ "swagger": "2.0", "info": { "version": "2017-10-01-preview", "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." }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans": { "get": { "tags": [ "DatabaseVulnerabilityAssessmentScans" ], "description": "Lists the vulnerability assessment scans of a database.", "operationId": "DatabaseVulnerabilityAssessmentScans_ListByDatabase", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "name": "vulnerabilityAssessmentName", "in": "path", "description": "The name of the vulnerability assessment.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "VulnerabilityAssessmentName", "modelAsString": true } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the database vulnerability assessment scan records.", "schema": { "$ref": "#/definitions/VulnerabilityAssessmentScanRecordListResult" } }, "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." } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "Gets the list of a database vulnerability assessment scan records": { "$ref": "./examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}": { "get": { "tags": [ "DatabaseVulnerabilityAssessmentScans" ], "description": "Gets a vulnerability assessment scan record of a database.", "operationId": "DatabaseVulnerabilityAssessmentScans_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "name": "vulnerabilityAssessmentName", "in": "path", "description": "The name of the vulnerability assessment.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "VulnerabilityAssessmentName", "modelAsString": true } }, { "name": "scanId", "in": "path", "description": "The vulnerability assessment scan Id of the scan to retrieve.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the database vulnerability assessment scan record.", "schema": { "$ref": "#/definitions/VulnerabilityAssessmentScanRecord" } }, "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." } }, "x-ms-examples": { "Gets a database vulnerability assessment scan record by scan ID": { "$ref": "./examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan": { "post": { "tags": [ "DatabaseVulnerabilityAssessmentScansExecute" ], "description": "Executes a Vulnerability Assessment database scan.", "operationId": "DatabaseVulnerabilityAssessmentScans_InitiateScan", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "name": "vulnerabilityAssessmentName", "in": "path", "description": "The name of the vulnerability assessment.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "VulnerabilityAssessmentName", "modelAsString": true } }, { "name": "scanId", "in": "path", "description": "The vulnerability assessment scan Id of the scan to retrieve.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully executed a Vulnerability Assessment database scan." }, "default": { "description": "*** Error Responses: ***\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 * 400 InvalidVulnerabilityAssessmentScanIdLength - The vulnerability assessment scan ID length must be below {0} characters.\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." }, "202": { "description": "Successfully started a Vulnerability Assessment database scan." } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Executes a database's vulnerability assessment scan.": { "$ref": "./examples/DatabaseVulnerabilityAssessmentScansExecute.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export": { "post": { "tags": [ "DatabaseVulnerabilityAssessmentScansExport" ], "description": "Convert an existing scan result to a human readable format. If already exists nothing happens", "operationId": "DatabaseVulnerabilityAssessmentScans_Export", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "databaseName", "in": "path", "description": "The name of the scanned database.", "required": true, "type": "string" }, { "name": "vulnerabilityAssessmentName", "in": "path", "description": "The name of the vulnerability assessment.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "VulnerabilityAssessmentName", "modelAsString": true } }, { "name": "scanId", "in": "path", "description": "The vulnerability assessment scan Id.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Scan result was converted successfully.", "schema": { "$ref": "#/definitions/DatabaseVulnerabilityAssessmentScansExport" } }, "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 * 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 * 409 DatabaseVulnerabilityAssessmentScanIsAlreadyInProgress - Vulnerability Assessment scan is already in progress.\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later." }, "201": { "description": "Scan result was converted successfully.", "schema": { "$ref": "#/definitions/DatabaseVulnerabilityAssessmentScansExport" } } }, "x-ms-examples": { "Export a database's vulnerability assessment scan results.": { "$ref": "./examples/DatabaseVulnerabilityAssessmentScanExport.json" } } } } }, "definitions": { "VulnerabilityAssessmentScanRecordListResult": { "description": "A list of vulnerability assessment scan records.", "type": "object", "properties": { "value": { "description": "Array of results.", "type": "array", "items": { "$ref": "#/definitions/VulnerabilityAssessmentScanRecord" }, "readOnly": true }, "nextLink": { "description": "Link to retrieve next page of results.", "type": "string", "readOnly": true } } }, "VulnerabilityAssessmentScanRecordProperties": { "description": "Properties of a vulnerability assessment scan record.", "type": "object", "properties": { "scanId": { "description": "The scan ID.", "type": "string", "readOnly": true }, "triggerType": { "description": "The scan trigger type.", "enum": [ "OnDemand", "Recurring" ], "type": "string", "readOnly": true, "x-ms-enum": { "name": "VulnerabilityAssessmentScanTriggerType", "modelAsString": true } }, "state": { "description": "The scan status.", "enum": [ "Passed", "Failed", "FailedToRun", "InProgress" ], "type": "string", "readOnly": true, "x-ms-enum": { "name": "VulnerabilityAssessmentScanState", "modelAsString": true } }, "startTime": { "format": "date-time", "description": "The scan start time (UTC).", "type": "string", "readOnly": true }, "endTime": { "format": "date-time", "description": "The scan end time (UTC).", "type": "string", "readOnly": true }, "errors": { "description": "The scan errors.", "type": "array", "items": { "$ref": "#/definitions/VulnerabilityAssessmentScanError" }, "readOnly": true }, "storageContainerPath": { "description": "The scan results storage container path.", "type": "string", "readOnly": true }, "numberOfFailedSecurityChecks": { "format": "int32", "description": "The number of failed security checks.", "type": "integer", "readOnly": true } } }, "VulnerabilityAssessmentScanError": { "description": "Properties of a vulnerability assessment scan error.", "type": "object", "properties": { "code": { "description": "The error code.", "type": "string", "readOnly": true }, "message": { "description": "The error message.", "type": "string", "readOnly": true } } }, "VulnerabilityAssessmentScanRecord": { "description": "A vulnerability assessment scan record.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "properties": { "$ref": "#/definitions/VulnerabilityAssessmentScanRecordProperties", "description": "Resource properties.", "x-ms-client-flatten": true } } }, "DatabaseVulnerabilityAssessmentScanExportProperties": { "description": "Properties of the export operation's result.", "type": "object", "properties": { "exportedReportLocation": { "description": "Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).", "type": "string", "readOnly": true } } }, "DatabaseVulnerabilityAssessmentScansExport": { "description": "A database Vulnerability Assessment scan export resource.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "properties": { "$ref": "#/definitions/DatabaseVulnerabilityAssessmentScanExportProperties", "description": "Resource properties.", "x-ms-client-flatten": true } } } }, "parameters": { "SubscriptionIdParameter": { "name": "subscriptionId", "in": "path", "description": "The subscription ID that identifies an Azure subscription.", "required": true, "type": "string", "x-ms-parameter-location": "client" }, "ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for the request.", "required": true, "type": "string", "x-ms-parameter-location": "client" }, "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, "type": "string", "x-ms-parameter-location": "method" }, "ServerNameParameter": { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "ManagedInstanceNameParameter": { "name": "managedInstanceName", "in": "path", "description": "The name of the managed instance.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "DatabaseNameParameter": { "name": "databaseName", "in": "path", "description": "The name of the database.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "BlobAuditingPolicyNameParameter": { "name": "blobAuditingPolicyName", "in": "path", "description": "The name of the blob auditing policy.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-parameter-location": "method" }, "SqlVirtualMachineInstanceNameParameter": { "name": "sqlVirtualMachineInstanceName", "in": "path", "description": "The name of the SqlVirtualMachineInstance.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "SqlVirtualMachineContainerNameParameter": { "name": "sqlVirtualMachineContainerName", "in": "path", "description": "The name of the SqlVirtualMachineContainer.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "VirtualClusterNameParameter": { "name": "virtualClusterName", "in": "path", "description": "The name of the virtual cluster.", "required": true, "type": "string", "x-ms-parameter-location": "method" } }, "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } } }