{ "swagger": "2.0", "info": { "title": "PostgreSQLManagementClient", "description": "The Azure Database for PostgreSQL management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, administrators, log files, configurations, migrations, advanced threat protection settings with new business model.", "version": "2024-08-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Microsoft Entra OAuth2 Flow", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings": { "get": { "tags": [ "AdvancedThreatProtectionSettings" ], "description": "Lists state of advanced threat protection settings for a flexible server.", "operationId": "ServerThreatProtectionSettings_ListByServer", "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" }, { "$ref": "./types/common-types.json#/parameters/ServerNameParameter" } ], "responses": { "200": { "description": "Successfully retrieved the server threat detection policy.", "schema": { "$ref": "#/definitions/ServerThreatProtectionListResult" } }, "default": { "description": "Error response describing why the operation of advanced threat protection on the flexible server failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "List state of advanced threat protection settings for a flexible server.": { "$ref": "./examples/ServerThreatProtectionSettingsListByServer.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}": { "get": { "tags": [ "AdvancedThreatProtectionSettings" ], "description": "Gets state of advanced threat protection settings for a flexible server.", "operationId": "ServerThreatProtectionSettings_Get", "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" }, { "$ref": "./types/common-types.json#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/ThreatProtectionNameParameter" } ], "responses": { "200": { "description": "Successfully retrieved the server advanced threat protection settings.", "schema": { "$ref": "#/definitions/ServerThreatProtectionSettingsModel" } }, "default": { "description": "Error response describing why the operation of threat protection on the flexible server failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get state of advanced threat protection settings for a flexible server.": { "$ref": "./examples/ServerThreatProtectionSettingsGet.json" } } }, "put": { "tags": [ "AdvancedThreatProtectionSettings" ], "description": "Creates or updates a server's Advanced Threat Protection settings.", "operationId": "ServerThreatProtectionSettings_CreateOrUpdate", "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" }, { "$ref": "./types/common-types.json#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/ThreatProtectionNameParameter" }, { "name": "parameters", "in": "body", "description": "The Advanced Threat Protection state for the flexible server.", "required": true, "schema": { "$ref": "#/definitions/ServerThreatProtectionSettingsModel" } } ], "responses": { "200": { "description": "Successfully set or update the server Threat Protection settings.", "schema": { "$ref": "#/definitions/ServerThreatProtectionSettingsModel" } }, "default": { "description": "Error response describing why the operation of setting Threat Protection failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } }, "201": { "description": "Successfully created the server Threat Protection settings.", "schema": { "$ref": "#/definitions/ServerThreatProtectionSettingsModel" } }, "202": { "description": "Accepted", "headers": { "Location": { "type": "string" } } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Update a server's Threat Protection settings": { "$ref": "./examples/ServerThreatProtectionSettingsCreateOrUpdate.json" } } } } }, "definitions": { "ServerThreatProtectionProperties": { "description": "Properties of advanced threat protection state for a flexible server.", "required": [ "state" ], "type": "object", "properties": { "state": { "description": "Specifies the state of the advanced threat protection, whether it is enabled, disabled, or a state has not been applied yet on the flexible server.", "enum": [ "Enabled", "Disabled" ], "type": "string", "x-ms-enum": { "name": "ThreatProtectionState", "modelAsString": false } }, "creationTime": { "format": "date-time", "description": "Specifies the creation time (UTC) of the policy.", "type": "string", "readOnly": true } } }, "ServerThreatProtectionSettingsModel": { "description": "Advanced threat protection settings of the flexible server.", "type": "object", "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ], "properties": { "properties": { "$ref": "#/definitions/ServerThreatProtectionProperties", "description": "Advanced threat protection properties.", "x-ms-client-flatten": true } } }, "ServerThreatProtectionListResult": { "description": "List of advanced threat protection settings for a flexible server.", "type": "object", "properties": { "value": { "description": "Array of results.", "type": "array", "items": { "$ref": "#/definitions/ServerThreatProtectionSettingsModel" }, "readOnly": true }, "nextLink": { "description": "Link used to get the next page of results.", "type": "string", "readOnly": true } } } }, "parameters": { "ThreatProtectionNameParameter": { "name": "threatProtectionName", "in": "path", "description": "Name of the advanced threat protection settings.", "required": true, "type": "string", "enum": [ "Default" ], "x-ms-enum": { "name": "ThreatProtectionName", "modelAsString": true }, "pattern": "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*", "x-ms-parameter-location": "method" } } }