你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Servers - Restart

重启服务器。

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

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

serverName
path True

string

服务器的名称。

Regex pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

subscriptionId
path True

string

目标订阅的 ID。

api-version
query True

string

要用于此操作的 API 版本。

请求正文

名称 类型 说明
failoverMode

FailoverMode

故障转移模式。

restartWithFailover

boolean

指示是否通过故障转移重启服务器。

响应

名称 类型 说明
200 OK

确定

202 Accepted

已接受

Headers

Location: string

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ServerRestart
ServerRestartWithFailover

ServerRestart

Sample Request

POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/restart?api-version=2022-12-01

Sample Response

Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2022-12-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2022-12-01

ServerRestartWithFailover

Sample Request

POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/restart?api-version=2022-12-01

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

Sample Response

Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2022-12-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2022-12-01

定义

名称 说明
ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

FailoverMode

故障转移模式。

RestartParameter

表示服务器重启参数。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

FailoverMode

故障转移模式。

名称 类型 说明
ForcedFailover

string

ForcedSwitchover

string

PlannedFailover

string

PlannedSwitchover

string

RestartParameter

表示服务器重启参数。

名称 类型 说明
failoverMode

FailoverMode

故障转移模式。

restartWithFailover

boolean

指示是否通过故障转移重启服务器。