From f0ecd0158d91986f73d8b0f61d6e16a35e11fc6a Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Wed, 28 Oct 2020 15:03:20 -0700 Subject: [PATCH 1/7] Add Databases APIs to PostgreSQL 2020-02-14-preview --- .../examples/DatabaseCreate.json | 40 +++ .../examples/DatabaseDelete.json | 14 + .../examples/DatabaseGet.json | 22 ++ .../examples/DatabasesListByServer.json | 34 +++ .../2020-02-14-preview/postgresql.json | 252 ++++++++++++++++++ 5 files changed, 362 insertions(+) create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json new file mode 100644 index 000000000000..58eb49347daf --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "databaseName": "db1", + "serverName": "testserver", + "resourceGroupName": "TestGroup", + "api-version": "2020-02-14-preview", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "parameters": { + "properties": { + "charset": "utf8", + "collation": "en_US.utf8" + } + } + }, + "responses": { + "201": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1", + "name": "db1", + "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases", + "properties": { + "charset": "utf8", + "collation": "en_US.utf8" + } + } + }, + "200": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1", + "name": "db1", + "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases", + "properties": { + "charset": "utf8", + "collation": "en_US.utf8" + } + } + }, + "202": {} + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json new file mode 100644 index 000000000000..44736a9459b1 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "databaseName": "db1", + "serverName": "testserver", + "resourceGroupName": "TestGroup", + "api-version": "2020-02-14-preview", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json new file mode 100644 index 000000000000..977203d2bc41 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "databaseName": "db1", + "serverName": "testserver", + "resourceGroupName": "TestGroup", + "api-version": "2020-02-14-preview", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1", + "name": "db1", + "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases", + "properties": { + "charset": "utf8", + "collation": "en_US.utf8" + } + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json new file mode 100644 index 000000000000..afcedf62ab94 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "serverName": "testserver", + "resourceGroupName": "TestGroup", + "api-version": "2020-02-14-preview", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1", + "name": "db1", + "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases", + "properties": { + "charset": "utf8", + "collation": "en_US.utf8" + } + }, + { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db2", + "name": "db2", + "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases", + "properties": { + "charset": "utf8", + "collation": "en_US.utf8" + } + } + ] + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json index 689e6b053dd1..9cb3444c261b 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json @@ -650,6 +650,205 @@ } } }, + "/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 or updates an existing database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Database" + }, + "description": "The required parameters for creating or updating a database." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "Databases" + ], + "operationId": "Databases_Delete", + "x-ms-examples": { + "Delete a database": { + "$ref": "./examples/DatabaseDelete.json" + } + }, + "description": "Deletes a database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "NoContent" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "Databases" + ], + "operationId": "Databases_Get", + "x-ms-examples": { + "Get a database": { + "$ref": "./examples/DatabaseGet.json" + } + }, + "description": "Gets information about a database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/databases": { + "get": { + "tags": [ + "Databases" + ], + "operationId": "Databases_ListByServer", + "x-ms-examples": { + "List databases in a server": { + "$ref": "./examples/DatabasesListByServer.json" + } + }, + "description": "List all the databases in a given server.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DatabaseListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations": { "get": { "tags": [ @@ -1536,6 +1735,51 @@ }, "description": "A list of firewall rules." }, + "DatabaseProperties": { + "properties": { + "charset": { + "type": "string", + "description": "The charset of the database." + }, + "collation": { + "type": "string", + "description": "The collation of the database." + } + }, + "description": "The properties of a database." + }, + "Database": { + "properties": { + "properties": { + "$ref": "#/definitions/DatabaseProperties", + "x-ms-client-flatten": true, + "description": "The properties of a database." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Database." + }, + "DatabaseListResult": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Database" + }, + "description": "The list of databases housed in a server" + }, + "nextLink": { + "description": "The link used to get the next page of operations.", + "type": "string" + } + }, + "description": "A List of databases." + }, "ConfigurationProperties": { "properties": { "value": { @@ -1768,6 +2012,14 @@ "description": "The name of the server firewall rule.", "x-ms-parameter-location": "method" }, + "DatabaseNameParameter": { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database.", + "x-ms-parameter-location": "method" + }, "ConfigurationNameParameter": { "name": "configurationName", "in": "path", From 2c1426a915859e3cfc5be1f7a47af8ea46c76304 Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Tue, 3 Nov 2020 09:12:08 -0800 Subject: [PATCH 2/7] Change DatabaseListResult nextLink description --- .../Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json index aae90e29117a..a92052e2eb55 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json @@ -1991,7 +1991,7 @@ "description": "The list of databases housed in a server" }, "nextLink": { - "description": "The link used to get the next page of operations.", + "description": "The link used to get the next page of databases.", "type": "string" } }, From 00fc70f597ff5440f47f8cb0689015ac5254b5e6 Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Tue, 3 Nov 2020 09:52:22 -0800 Subject: [PATCH 3/7] Revert "Change DatabaseListResult nextLink description" This reverts commit 2c1426a915859e3cfc5be1f7a47af8ea46c76304. --- .../Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json index a92052e2eb55..aae90e29117a 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2020-07-01-preview/mysql.json @@ -1991,7 +1991,7 @@ "description": "The list of databases housed in a server" }, "nextLink": { - "description": "The link used to get the next page of databases.", + "description": "The link used to get the next page of operations.", "type": "string" } }, From e835aa90548da5aede6169debbe3b15fcd50569b Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Tue, 3 Nov 2020 09:55:37 -0800 Subject: [PATCH 4/7] Fixed the description of the DatabaseListResult nextLink item --- .../preview/2020-02-14-preview/postgresql.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json index 9cb3444c261b..6c6985a4ed82 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json @@ -1774,7 +1774,7 @@ "description": "The list of databases housed in a server" }, "nextLink": { - "description": "The link used to get the next page of operations.", + "description": "The link used to get the next page of databases.", "type": "string" } }, From 78099746416f7eab487c39f4ccde0784984aa202 Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Sun, 8 Nov 2020 21:57:09 -0800 Subject: [PATCH 5/7] Added new 2020-11-05 version for the database APIs --- .../2020-02-14-preview/postgresql.json | 253 +------------- .../preview/2020-11-05-preview/Databases.json | 311 ++++++++++++++++++ .../examples/DatabaseCreate.json | 2 +- .../examples/DatabaseDelete.json | 2 +- .../examples/DatabaseGet.json | 2 +- .../examples/DatabasesListByServer.json | 2 +- .../postgresql/resource-manager/readme.go.md | 12 + .../postgresql/resource-manager/readme.md | 13 + .../resource-manager/readme.python.md | 10 +- 9 files changed, 346 insertions(+), 261 deletions(-) create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json rename specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/{2020-02-14-preview => 2020-11-05-preview}/examples/DatabaseCreate.json (96%) rename specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/{2020-02-14-preview => 2020-11-05-preview}/examples/DatabaseDelete.json (85%) rename specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/{2020-02-14-preview => 2020-11-05-preview}/examples/DatabaseGet.json (93%) rename specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/{2020-02-14-preview => 2020-11-05-preview}/examples/DatabasesListByServer.json (96%) diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json index 6c6985a4ed82..043008cfaaff 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json @@ -650,205 +650,6 @@ } } }, - "/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 or updates an existing database.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "$ref": "#/parameters/DatabaseNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Database" - }, - "description": "The required parameters for creating or updating a database." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Database" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/Database" - } - }, - "202": { - "description": "Accepted" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - }, - "x-ms-long-running-operation": true - }, - "delete": { - "tags": [ - "Databases" - ], - "operationId": "Databases_Delete", - "x-ms-examples": { - "Delete a database": { - "$ref": "./examples/DatabaseDelete.json" - } - }, - "description": "Deletes a database.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "$ref": "#/parameters/DatabaseNameParameter" - } - ], - "responses": { - "200": { - "description": "OK" - }, - "202": { - "description": "Accepted" - }, - "204": { - "description": "NoContent" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - }, - "x-ms-long-running-operation": true - }, - "get": { - "tags": [ - "Databases" - ], - "operationId": "Databases_Get", - "x-ms-examples": { - "Get a database": { - "$ref": "./examples/DatabaseGet.json" - } - }, - "description": "Gets information about a database.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "$ref": "#/parameters/DatabaseNameParameter" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Database" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/databases": { - "get": { - "tags": [ - "Databases" - ], - "operationId": "Databases_ListByServer", - "x-ms-examples": { - "List databases in a server": { - "$ref": "./examples/DatabasesListByServer.json" - } - }, - "description": "List all the databases in a given server.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DatabaseListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations": { "get": { "tags": [ @@ -1735,51 +1536,6 @@ }, "description": "A list of firewall rules." }, - "DatabaseProperties": { - "properties": { - "charset": { - "type": "string", - "description": "The charset of the database." - }, - "collation": { - "type": "string", - "description": "The collation of the database." - } - }, - "description": "The properties of a database." - }, - "Database": { - "properties": { - "properties": { - "$ref": "#/definitions/DatabaseProperties", - "x-ms-client-flatten": true, - "description": "The properties of a database." - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" - } - ], - "description": "Represents a Database." - }, - "DatabaseListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/Database" - }, - "description": "The list of databases housed in a server" - }, - "nextLink": { - "description": "The link used to get the next page of databases.", - "type": "string" - } - }, - "description": "A List of databases." - }, "ConfigurationProperties": { "properties": { "value": { @@ -2012,14 +1768,7 @@ "description": "The name of the server firewall rule.", "x-ms-parameter-location": "method" }, - "DatabaseNameParameter": { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database.", - "x-ms-parameter-location": "method" - }, + "ConfigurationNameParameter": { "name": "configurationName", "in": "path", diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json new file mode 100644 index 000000000000..43b09a83dfbb --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json @@ -0,0 +1,311 @@ +{ + "swagger": "2.0", + "info": { + "title": "PostgreSQLServerManagementClient", + "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model.", + "version": "2020-11-05-preview" + }, + "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": "Azure Active Directory 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 or updates an existing database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Database" + }, + "description": "The required parameters for creating or updating a database." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "Databases" + ], + "operationId": "Databases_Delete", + "x-ms-examples": { + "Delete a database": { + "$ref": "./examples/DatabaseDelete.json" + } + }, + "description": "Deletes a database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "NoContent" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "Databases" + ], + "operationId": "Databases_Get", + "x-ms-examples": { + "Get a database": { + "$ref": "./examples/DatabaseGet.json" + } + }, + "description": "Gets information about a database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/databases": { + "get": { + "tags": [ + "Databases" + ], + "operationId": "Databases_ListByServer", + "x-ms-examples": { + "List databases in a server": { + "$ref": "./examples/DatabasesListByServer.json" + } + }, + "description": "List all the databases in a given server.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DatabaseListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "DatabaseProperties": { + "properties": { + "charset": { + "type": "string", + "description": "The charset of the database." + }, + "collation": { + "type": "string", + "description": "The collation of the database." + } + }, + "description": "The properties of a database." + }, + "Database": { + "properties": { + "properties": { + "$ref": "#/definitions/DatabaseProperties", + "x-ms-client-flatten": true, + "description": "The properties of a database." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Database." + }, + "DatabaseListResult": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Database" + }, + "description": "The list of databases housed in a server" + }, + "nextLink": { + "description": "The link used to get the next page of databases.", + "type": "string" + } + }, + "description": "A List of databases." + }, + "CloudError": { + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + }, + "description": "An error response from the Batch service." + } + }, + "parameters": { + "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", + "required": true, + "type": "string", + "description": "The name of the database.", + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseCreate.json similarity index 96% rename from specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json rename to specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseCreate.json index 58eb49347daf..6aab697cd844 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseCreate.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseCreate.json @@ -3,7 +3,7 @@ "databaseName": "db1", "serverName": "testserver", "resourceGroupName": "TestGroup", - "api-version": "2020-02-14-preview", + "api-version": "2020-11-05-preview", "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", "parameters": { "properties": { diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseDelete.json similarity index 85% rename from specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json rename to specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseDelete.json index 44736a9459b1..88e5b22a4519 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseDelete.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseDelete.json @@ -3,7 +3,7 @@ "databaseName": "db1", "serverName": "testserver", "resourceGroupName": "TestGroup", - "api-version": "2020-02-14-preview", + "api-version": "2020-11-05-preview", "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseGet.json similarity index 93% rename from specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json rename to specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseGet.json index 977203d2bc41..ec82b011b8ce 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabaseGet.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabaseGet.json @@ -3,7 +3,7 @@ "databaseName": "db1", "serverName": "testserver", "resourceGroupName": "TestGroup", - "api-version": "2020-02-14-preview", + "api-version": "2020-11-05-preview", "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabasesListByServer.json similarity index 96% rename from specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json rename to specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabasesListByServer.json index afcedf62ab94..047a261f9ea5 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/examples/DatabasesListByServer.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/examples/DatabasesListByServer.json @@ -2,7 +2,7 @@ "parameters": { "serverName": "testserver", "resourceGroupName": "TestGroup", - "api-version": "2020-02-14-preview", + "api-version": "2020-11-05-preview", "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { diff --git a/specification/postgresql/resource-manager/readme.go.md b/specification/postgresql/resource-manager/readme.go.md index 371cc48113e3..1c09c23611b1 100644 --- a/specification/postgresql/resource-manager/readme.go.md +++ b/specification/postgresql/resource-manager/readme.go.md @@ -12,12 +12,24 @@ go: ``` yaml $(go) && $(multiapi) batch: + - tag: package-2020-11-05-preview - tag: package-2020-02-14-preview - tag: package-2020-01-01 - tag: package-2017-12-01-preview - tag: package-2017-12-01 ``` +### Tag: package-2020-11-05 and go + +These settings apply only when `--tag=package-2020-11-05-preview --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2020-11-05-preview' && $(go) +rpname: postgresql +namespace: postgresqlflexibleservers +output-folder: $(go-sdk-folder)/services/preview/$(rpname)/mgmt/2020-11-05-preview/$(namespace) +``` + ### Tag: package-2020-02-14 and go These settings apply only when `--tag=package-2020-02-14-preview --go` is specified on the command line. diff --git a/specification/postgresql/resource-manager/readme.md b/specification/postgresql/resource-manager/readme.md index 9ec87bd2f7a0..f48a74cea5ca 100644 --- a/specification/postgresql/resource-manager/readme.md +++ b/specification/postgresql/resource-manager/readme.md @@ -30,6 +30,18 @@ description: The Microsoft Azure management API provides create, read, update, a openapi-type: arm tag: package-2020-01-01 ``` +### Tag: package-2020-11-05-preview + +These settings apply only when `--tag=package-2020-11-05-preview` is specified on the command line. + + +``` yaml $(tag) == 'package-2020-11-05-preview' +input-file: +- Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json +- Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json +``` + + ### Tag: package-2020-02-14-preview These settings apply only when `--tag=package-2020-02-14-preview` is specified on the command line. @@ -196,6 +208,7 @@ require: $(this-folder)/../../../profiles/readme.md # all the input files across all versions input-file: + - $(this-folder)/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json - $(this-folder)/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json - $(this-folder)/Microsoft.DBforPostgreSQL/preview/2020-02-14-privatepreview/postgresql.json - $(this-folder)/Microsoft.DBforPostgreSQL/preview/2020-01-01-privatepreview/DataEncryptionKeys.json diff --git a/specification/postgresql/resource-manager/readme.python.md b/specification/postgresql/resource-manager/readme.python.md index a0c7fe2f1884..61a53aefce6e 100644 --- a/specification/postgresql/resource-manager/readme.python.md +++ b/specification/postgresql/resource-manager/readme.python.md @@ -30,14 +30,14 @@ Generate all API versions currently shipped for this package ```yaml !$(track2) batch: - tag: package-2020-01-01 - - tag: package-2020-02-14-preview + - tag: package-2020-11-05-preview ``` ```yaml $(track2) clear-output-folder: true batch: - tag: package-2020-01-01 - - tag: package-2020-02-14-preview + - tag: package-2020-11-05-preview ``` ### Tag: package-2020-01-01 and python @@ -53,12 +53,12 @@ python: output-folder: $(python-sdks-folder)/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql ``` -### Tag: package-2020-02-14-preview and python +### Tag: package-2020-11-05-preview and python -These settings apply only when `--tag=package-2020-02-14-preview --python` is specified on the command line. +These settings apply only when `--tag=package-2020-11-05-preview --python` is specified on the command line. Please also specify `--python-sdks-folder=`. -``` yaml $(tag) == 'package-2020-02-14-preview' && $(python) +``` yaml $(tag) == 'package-2020-11-05-preview' && $(python) namespace: azure.mgmt.rdbms.postgresql_flexibleservers output-folder: $(python-sdks-folder)/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers python: From eb8fe39c5f49a4cc4f173072e3a8b8432b410605 Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Sun, 8 Nov 2020 21:58:12 -0800 Subject: [PATCH 6/7] Revert changes to postgresql.json file --- .../preview/2020-02-14-preview/postgresql.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json index 043008cfaaff..689e6b053dd1 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-02-14-preview/postgresql.json @@ -1768,7 +1768,6 @@ "description": "The name of the server firewall rule.", "x-ms-parameter-location": "method" }, - "ConfigurationNameParameter": { "name": "configurationName", "in": "path", From 02c968af913f8d5fd55aec9f1aca209b782853d4 Mon Sep 17 00:00:00 2001 From: Georgios Christoglou Date: Mon, 9 Nov 2020 09:55:40 -0800 Subject: [PATCH 7/7] Run prettier on new files --- .../preview/2020-11-05-preview/Databases.json | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json index 43b09a83dfbb..91d2cfe912d6 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-11-05-preview/Databases.json @@ -249,37 +249,37 @@ "description": "The properties of a database." }, "Database": { - "properties": { "properties": { - "$ref": "#/definitions/DatabaseProperties", - "x-ms-client-flatten": true, - "description": "The properties of a database." - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" - } - ], - "description": "Represents a Database." + "properties": { + "$ref": "#/definitions/DatabaseProperties", + "x-ms-client-flatten": true, + "description": "The properties of a database." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Database." }, "DatabaseListResult": { "type": "object", "properties": { "value": { - "type": "array", - "items": { + "type": "array", + "items": { "$ref": "#/definitions/Database" - }, - "description": "The list of databases housed in a server" + }, + "description": "The list of databases housed in a server" }, "nextLink": { - "description": "The link used to get the next page of databases.", - "type": "string" + "description": "The link used to get the next page of databases.", + "type": "string" } }, "description": "A List of databases." - }, + }, "CloudError": { "x-ms-external": true, "properties": { @@ -308,4 +308,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +}