{ "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, network configuration, security alert policies, log files and configurations 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}/databases/{databaseName}": { "put": { "tags": [ "Databases" ], "operationId": "Databases_Create", "x-ms-examples": { "Create a database.": { "$ref": "./examples/DatabaseCreate.json" } }, "description": "Creates a new database.", "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/DatabaseNameParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Database" }, "description": "Parameters required to create a new database." } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Database" } }, "201": { "description": "Created", "schema": { "$ref": "#/definitions/Database" } }, "202": { "description": "Accepted", "headers": { "Location": { "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "delete": { "tags": [ "Databases" ], "operationId": "Databases_Delete", "x-ms-examples": { "Delete an existing database": { "$ref": "./examples/DatabaseDelete.json" } }, "description": "Deletes an existing database.", "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/DatabaseNameParameter" } ], "responses": { "200": { "description": "OK" }, "202": { "description": "Accepted", "headers": { "Location": { "type": "string" } } }, "204": { "description": "NoContent" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "Databases" ], "operationId": "Databases_Get", "x-ms-examples": { "Get information about an existing database.": { "$ref": "./examples/DatabaseGet.json" } }, "description": "Gets information about an existing database.", "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/DatabaseNameParameter" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Database" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases": { "get": { "tags": [ "Databases" ], "operationId": "Databases_ListByServer", "x-ms-examples": { "List all databases in a flexible server.": { "$ref": "./examples/DatabasesListByServer.json" } }, "description": "Lists all databases in a flexible server.", "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": "OK", "schema": { "$ref": "#/definitions/DatabaseListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "DatabaseProperties": { "type": "object", "properties": { "charset": { "type": "string", "description": "Character set of the database.", "pattern": "^[a-zA-Z]+\\w*$" }, "collation": { "type": "string", "description": "Collation of the database.", "pattern": "^[a-zA-Z\\-]+([. ]|\\w)*$" } }, "description": "Properties of a database." }, "Database": { "type": "object", "properties": { "properties": { "$ref": "#/definitions/DatabaseProperties", "x-ms-client-flatten": true, "description": "Properties of a database." } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ], "description": "Represents a Database." }, "DatabaseListResult": { "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Database" }, "description": "List of all databases in a flexible server." }, "nextLink": { "description": "Link used to get the next page of results.", "type": "string", "format": "uri" } }, "description": "List of all databases in a flexible server." } }, "parameters": { "DatabaseNameParameter": { "name": "databaseName", "in": "path", "required": true, "type": "string", "description": "Name of the database.", "minLength": 1, "pattern": "^[-\\w\\._]+$", "x-ms-parameter-location": "method" } } }