{ "swagger": "2.0", "info": { "version": "2015-05-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}/auditingSettings/{blobAuditingPolicyName}": { "get": { "tags": [ "BlobAuditing" ], "description": "Gets a database's blob auditing policy.", "operationId": "DatabaseBlobAuditingPolicies_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "databaseName", "in": "path", "description": "The name of the database for which the blob audit policy is defined.", "required": true, "type": "string" }, { "name": "blobAuditingPolicyName", "in": "path", "description": "The name of the blob auditing policy.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "BlobAuditingPolicyName", "modelAsString": true } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the database blob auditing policy.", "schema": { "$ref": "#/definitions/DatabaseBlobAuditingPolicy" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.\n\n * 400 InvalidDatabaseBlobAuditingPolicyCreateRequest - The create database blob auditing policy request does not exist or has no properties object.\n\n * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 GetBlobAuditingPolicyFailed - Failed to get Auditing settings" } }, "x-ms-examples": { "Get a database's blob auditing policy": { "$ref": "./examples/DatabaseBlobAuditingGet.json" } } }, "put": { "tags": [ "BlobAuditing" ], "description": "Creates or updates a database's blob auditing policy.", "operationId": "DatabaseBlobAuditingPolicies_CreateOrUpdate", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "databaseName", "in": "path", "description": "The name of the database for which the blob auditing policy will be defined.", "required": true, "type": "string" }, { "name": "blobAuditingPolicyName", "in": "path", "description": "The name of the blob auditing policy.", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "BlobAuditingPolicyName", "modelAsString": true } }, { "name": "parameters", "in": "body", "description": "The database blob auditing policy.", "required": true, "schema": { "$ref": "#/definitions/DatabaseBlobAuditingPolicy" } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully set the database blob auditing policy.", "schema": { "$ref": "#/definitions/DatabaseBlobAuditingPolicy" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 BlobAuditingIsNotSupportedOnResourceType - Blob Auditing is currently not supported for this resource type.\n\n * 400 InvalidDatabaseBlobAuditingPolicyCreateRequest - The create database blob auditing policy request does not exist or has no properties object.\n\n * 400 InvalidBlobAuditActionsAndGroups - Invalid audit actions or action groups.\n\n * 400 DataSecurityInvalidUserSuppliedParameter - An invalid parameter value was provided by the client.\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertBlobAuditingPolicyFailed - An error has occurred while saving Auditing settings, please try again later" }, "201": { "description": "Successfully created the database blob auditing policy.", "schema": { "$ref": "#/definitions/DatabaseBlobAuditingPolicy" } } }, "x-ms-examples": { "Create or update a database's blob auditing policy with all parameters": { "$ref": "./examples/DatabaseBlobAuditingCreateMax.json" }, "Create or update a database's blob auditing policy with minimal parameters": { "$ref": "./examples/DatabaseBlobAuditingCreateMin.json" } } } } }, "definitions": { "DatabaseBlobAuditingPolicyProperties": { "description": "Properties of a database blob auditing policy.", "required": [ "state" ], "type": "object", "properties": { "state": { "description": "Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required.", "enum": [ "Enabled", "Disabled" ], "type": "string", "x-ms-enum": { "name": "BlobAuditingPolicyState", "modelAsString": false } }, "storageEndpoint": { "description": "Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.", "type": "string" }, "storageAccountAccessKey": { "description": "Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required.", "type": "string", "x-ms-mutability": [ "create", "update" ] }, "retentionDays": { "format": "int32", "description": "Specifies the number of days to keep in the audit logs.", "type": "integer" }, "auditActionsAndGroups": { "description": "Specifies the Actions and Actions-Groups to audit.", "type": "array", "items": { "type": "string" } }, "storageAccountSubscriptionId": { "format": "uuid", "description": "Specifies the blob storage subscription Id.", "type": "string" }, "isStorageSecondaryKeyInUse": { "description": "Specifies whether storageAccountAccessKey value is the storage’s secondary key.", "type": "boolean" } } }, "DatabaseBlobAuditingPolicy": { "description": "A database blob auditing policy.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "kind": { "description": "Resource kind.", "type": "string", "readOnly": true }, "properties": { "$ref": "#/definitions/DatabaseBlobAuditingPolicyProperties", "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" }, "DatabaseNameParameter": { "name": "databaseName", "in": "path", "description": "The name of the database.", "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" } } } }