Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions specification/postgresql/DBforPostgreSQL.Management/Server.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "@typespec/versioning";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
using TypeSpec.Versioning;

namespace Microsoft.DBforPostgreSQL;
/**
Expand Down Expand Up @@ -199,6 +201,21 @@ interface Servers {
Azure.Core.Foundations.RetryAfterHeader>,
BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters<Server>
>;

/**
* Migrates the network configuration of a PostgreSQL flexible server from customer owned VNET to Microsoft owned VNET with support for private endpoints, or from Microsoft owned VNET with no support for private endpoints to Microsoft owned VNET with support for private endpoints.
*/
@added(Versions.v2026_01_01)
@action("migrateNetwork")
migrateNetworkMode is ArmResourceActionAsyncBase<
Server,
void,
(MigrateNetworkStatus &
RequestIdResponseHeader) | (ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = MigrateNetworkStatus> &
Azure.Core.Foundations.RetryAfterHeader> &
RequestIdResponseHeader),
BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters<Server>
>;
}

@@maxLength(Server.name, 63);
Expand All @@ -219,3 +236,6 @@ interface Servers {
"Parameters required to check if a migration name is valid and available."
);
@@doc(Servers.restart::parameters.body, "Parameters to restart a server.");
@@doc(Servers.migrateNetworkMode::parameters.body,
"Parameters to migrate the network configuration of a server."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"objectId": "oooooooo-oooo-oooo-oooo-oooooooooooo",
"parameters": {
"properties": {
"principalName": "exampleuser@contoso.com",
"principalType": "User",
"tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt"
}
},
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview"
}
}
},
"operationId": "AdministratorsMicrosoftEntra_CreateOrUpdate",
"title": "Add a server administrator associated to a Microsoft Entra principal."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"objectId": "oooooooo-oooo-oooo-oooo-oooooooooooo",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview"
}
},
"204": {}
},
"operationId": "AdministratorsMicrosoftEntra_Delete",
"title": "Delete a server administrator associated to a Microsoft Entra principal."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"objectId": "oooooooo-oooo-oooo-oooo-oooooooooooo",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"name": "exampleuser@contoso.com",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/administrators",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo",
"properties": {
"objectId": "oooooooo-oooo-oooo-oooo-oooooooooooo",
"principalName": "exampleuser@contoso.com",
"principalType": "User",
"tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt"
}
}
}
},
"operationId": "AdministratorsMicrosoftEntra_Get",
"title": "Get information about a server administrator associated to a Microsoft Entra principal."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"value": [
{
"type": "Microsoft.DBforPostgreSQL/flexibleServers/administrators",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo",
"properties": {
"objectId": "oooooooo-oooo-oooo-oooo-oooooooooooo",
"principalName": "exampleuser@contoso.com",
"principalType": "User",
"tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt"
}
},
{
"type": "Microsoft.DBforPostgreSQL/flexibleServers/administrators",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/gggggggg-gggg-gggg-gggg-gggggggggggg",
"properties": {
"objectId": "gggggggg-gggg-gggg-gggg-gggggggggggg",
"principalName": "examplegroup@contoso.com",
"principalType": "Group",
"tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt"
}
}
]
}
}
},
"operationId": "AdministratorsMicrosoftEntra_ListByServer",
"title": "List information about all server administrators associated to Microsoft Entra principals."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"parameters": {
"properties": {
"state": "Enabled"
}
},
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"threatProtectionName": "Default"
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview"
}
}
},
"operationId": "ServerThreatProtectionSettings_CreateOrUpdate",
"title": "Update the advanced threat protection settings of a server."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"threatProtectionName": "Default"
},
"responses": {
"200": {
"body": {
"name": "Default",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/advancedThreatProtectionSettings/Default",
"properties": {
"creationTime": "2025-06-01T18:30:22.123456Z",
"state": "Enabled"
}
}
}
},
"operationId": "AdvancedThreatProtectionSettings_Get",
"title": "Get state of advanced threat protection settings for a server."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "Default",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/advancedThreatProtectionSettings/Default",
"properties": {
"creationTime": "2025-06-01T18:30:22.123456Z",
"state": "Enabled"
}
}
]
}
}
},
"operationId": "AdvancedThreatProtectionSettings_ListByServer",
"title": "List state of advanced threat protection settings for a server."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"backupName": "ondemandbackup-20250601T183022",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview"
}
}
},
"operationId": "BackupsAutomaticAndOnDemand_Create",
"title": "Create an on demand backup of a server."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"backupName": "ondemandbackup-20250601T183022",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview"
}
},
"204": {}
},
"operationId": "BackupsAutomaticAndOnDemand_Delete",
"title": "Delete an on demand backup, given its name."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"backupName": "backup_638830782181266873",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"name": "backup_20250601T183022",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/backups",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/backup_638830782181266873",
"properties": {
"backupType": "Full",
"completedTime": "2025-06-01T14:30:22.123456+00:00",
"source": "Automatic"
}
}
}
},
"operationId": "BackupsAutomaticAndOnDemand_Get",
"title": "Get an on demand backup, given its name."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "backup_638830782181266873",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/backups",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/backup_638830782181266873",
"properties": {
"backupType": "Full",
"completedTime": "2025-06-01T14:30:22.123456+00:00",
"source": "Automatic"
}
},
{
"name": "ondemandbackup-20250601T183022",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/backups",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/ondemandbackup-20250601T183022",
"properties": {
"backupType": "Customer On-Demand",
"completedTime": "2025-06-01T18:30:22.123456+00:00",
"source": "Customer Initiated"
}
}
]
}
}
},
"operationId": "BackupsAutomaticAndOnDemand_ListByServer",
"title": "List all available backups of a server."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"parameters": {
"backupSettings": {
"backupName": "exampleltrbackup"
}
},
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"properties": {
"numberOfContainers": 1
}
}
}
},
"operationId": "BackupsLongTermRetention_CheckPrerequisites",
"title": "Perform all checks required for a long term retention backup operation to succeed."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"parameters": {
"api-version": "2026-01-01-preview",
"backupName": "exampleltrbackup",
"resourceGroupName": "exampleresourcegroup",
"serverName": "exampleserver",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"name": "exampleltrbackup",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"properties": {
"backupMetadata": "backupMetadata",
"backupName": "exampleltrbackup",
"dataTransferredInBytes": 9,
"datasourceSizeInBytes": 21,
"endTime": "2025-06-01T18:35:22.123Z",
"percentComplete": 4,
"startTime": "2025-06-01T18:30:22.123Z",
"status": "Running"
}
}
}
},
"operationId": "BackupsLongTermRetention_Get",
"title": "Get the results of a long retention backup operation for a server."
}
Loading
Loading