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

Configurations - Put

使用 Put 动词更新分配给服务器的特定可修改配置(也称为服务器参数)的值。

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

URI 参数

名称 必需 类型 说明
configurationName
path True

string

minLength: 1
maxLength: 256
pattern: ^[-\w\._]+$

配置的名称(也称为服务器参数)。

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)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

请求正文

名称 类型 说明
properties.source

string

分配给配置的值的源(也称为服务器参数)。 更新分配给特定可修改配置的值时需要。

properties.value

string

配置的值(也称为服务器参数)。 更新分配给特定可修改配置的值时需要。

响应

名称 类型 说明
202 Accepted

已接受资源作。

标头

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

ErrorResponse

意外错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow.

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Update, using Put verb, the value assigned to a specific modifiable configuration (also known as server parameter) of a server.

示例请求

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

{
  "properties": {
    "source": "user-override",
    "value": "on"
  }
}

示例响应

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

定义

名称 说明
ConfigurationDataType

配置的数据类型(也称为服务器参数)。

ConfigurationForUpdate

配置(也称为服务器参数)。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ConfigurationDataType

配置的数据类型(也称为服务器参数)。

说明
Boolean

一个布尔值。

Numeric

数值。

Integer

一个整数值。

Enumeration

枚举值。

String

字符串值。

Set

一组值。

ConfigurationForUpdate

配置(也称为服务器参数)。

名称 类型 说明
properties.allowedValues

string

配置的允许值(也称为服务器参数)。

properties.dataType

ConfigurationDataType

配置的数据类型(也称为服务器参数)。

properties.defaultValue

string

默认分配给配置的值(也称为服务器参数)。

properties.description

string

配置说明(也称为服务器参数)。

properties.documentationLink

string

指向配置文档的链接(也称为服务器参数)。

properties.isConfigPendingRestart

boolean

指示分配给配置的值(也称为服务器参数)是否正在等待服务器重新启动才能生效。

properties.isDynamicConfig

boolean

指示它是动态 (true) 还是静态 (false) 配置(也称为服务器参数)。 静态服务器参数需要在更改分配给它们的值后重新启动服务器,更改才能生效。 动态服务器参数在更改分配给它们的值后不需要重新启动服务器,更改就会生效。

properties.isReadOnly

boolean

指示它是只读 (true) 还是可修改 (false) 配置(也称为服务器参数)。

properties.source

string

分配给配置的值的源(也称为服务器参数)。 更新分配给特定可修改配置的值时需要。

properties.unit

string

表示配置(也称为服务器参数)值的单位。

properties.value

string

配置的值(也称为服务器参数)。 更新分配给特定可修改配置的值时需要。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

附加信息。

type

string

附加信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。