{ "swagger": "2.0", "info": { "title": "SqlManagementClient", "version": "2025-01-01", "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.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "host": "management.azure.com", "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "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" } } }, "tags": [ { "name": "ServerSecurityAlertPolicies" } ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies": { "get": { "operationId": "ServerSecurityAlertPolicies_ListByServer", "tags": [ "ServerSecurityAlertPolicies" ], "description": "Get the server's threat detection policies.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/LogicalServerSecurityAlertPolicyListResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "List the server's threat detection policies": { "$ref": "./examples/ServerSecurityAlertsListByServer.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}": { "get": { "operationId": "ServerSecurityAlertPolicies_Get", "tags": [ "ServerSecurityAlertPolicies" ], "description": "Get a server's security alert policy.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string" }, { "name": "securityAlertPolicyName", "in": "path", "description": "The name of the security alert policy.", "required": true, "type": "string", "enum": [ "Default" ], "x-ms-enum": { "name": "SecurityAlertPolicyName", "modelAsString": true, "values": [ { "name": "Default", "value": "Default", "description": "Default" } ] } } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ServerSecurityAlertPolicy" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get a server's threat detection policy": { "$ref": "./examples/ServerSecurityAlertsGet.json" } } }, "put": { "operationId": "ServerSecurityAlertPolicies_CreateOrUpdate", "tags": [ "ServerSecurityAlertPolicies" ], "description": "Creates or updates a threat detection policy.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string" }, { "name": "securityAlertPolicyName", "in": "path", "description": "The name of the security alert policy.", "required": true, "type": "string", "enum": [ "Default" ], "x-ms-enum": { "name": "SecurityAlertPolicyName", "modelAsString": true, "values": [ { "name": "Default", "value": "Default", "description": "Default" } ] } }, { "name": "parameters", "in": "body", "description": "The server security alert policy.", "required": true, "schema": { "$ref": "#/definitions/ServerSecurityAlertPolicy" } } ], "responses": { "200": { "description": "Resource 'ServerSecurityAlertPolicy' update operation succeeded", "schema": { "$ref": "#/definitions/ServerSecurityAlertPolicy" } }, "202": { "description": "Resource operation accepted.", "headers": { "Location": { "type": "string", "description": "The Location header contains the URL where the status of the long running operation can be checked." }, "Retry-After": { "type": "integer", "format": "int32", "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Update a server's threat detection policy with all parameters": { "$ref": "./examples/ServerSecurityAlertsCreateMax.json" }, "Update a server's threat detection policy with minimal parameters": { "$ref": "./examples/ServerSecurityAlertsCreateMin.json" } }, "x-ms-long-running-operation-options": { "final-state-via": "location", "final-state-schema": "#/definitions/ServerSecurityAlertPolicy" }, "x-ms-long-running-operation": true } } }, "definitions": { "LogicalServerSecurityAlertPolicyListResult": { "type": "object", "description": "A list of the server's security alert policies.", "properties": { "value": { "type": "array", "description": "Array of results.", "items": { "$ref": "#/definitions/ServerSecurityAlertPolicy" }, "readOnly": true }, "nextLink": { "type": "string", "description": "Link to retrieve next page of results.", "readOnly": true } } }, "ServerSecurityAlertPolicy": { "type": "object", "description": "A server security alert policy.", "properties": { "properties": { "$ref": "./common.json#/definitions/SecurityAlertsPolicyProperties", "description": "Resource properties.", "x-ms-client-flatten": true } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] } }, "parameters": {} }