共用方式為


Servers - Restart

在伺服器中重新啟動 PostgreSQL 資料庫引擎。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/restart?api-version=2025-08-01

URI 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

serverName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

伺服器的名稱。

subscriptionId
path True

string (uuid)

目標訂用帳戶的標識碼。 此值必須是 UUID。

api-version
query True

string

minLength: 1

用於此作業的 API 版本。

要求本文

名稱 類型 Description
failoverMode

FailoverMode

故障轉移模式。

restartWithFailover

boolean

指示重新啟動 PostgreSQL 資料庫引擎是否應進行故障轉移或從主資料庫引擎切換到備用資料庫。 這僅在伺服器啟用了高可用性時才有效。

回應

名稱 類型 Description
202 Accepted

已接受資源作業。

標題

  • Azure-AsyncOperation: string
  • Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

未預期的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 流程。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Restart PostgreSQL database engine in a server with a forced failover to standby server.
Restart PostgreSQL database engine in a server.

Restart PostgreSQL database engine in a server with a forced failover to standby server.

範例要求

POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/restart?api-version=2025-08-01

{
  "failoverMode": "ForcedFailover",
  "restartWithFailover": true
}

範例回覆

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

Restart PostgreSQL database engine in a server.

範例要求

POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/restart?api-version=2025-08-01

範例回覆

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

定義

名稱 Description
ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細資料。

ErrorResponse

錯誤回應

FailoverMode

故障轉移模式。

RestartParameter

PostgreSQL 資料庫引擎重啟參數。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細資料。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細數據。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

FailoverMode

故障轉移模式。

Description
PlannedFailover
ForcedFailover
PlannedSwitchover
ForcedSwitchover

RestartParameter

PostgreSQL 資料庫引擎重啟參數。

名稱 類型 Description
failoverMode

FailoverMode

故障轉移模式。

restartWithFailover

boolean

指示重新啟動 PostgreSQL 資料庫引擎是否應進行故障轉移或從主資料庫引擎切換到備用資料庫。 這僅在伺服器啟用了高可用性時才有效。