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

Quota - Update

将特定资源的配额限制更新为指定值:

  1. 使用 Usages-GET 和 Quota-GET作来确定特定资源的剩余配额,并计算新的配额限制。 本示例 详细介绍这些步骤。
  2. 使用此 PUT作更新配额限制。 请检查位置标头中的 URI,了解请求的详细状态。
PATCH https://management.azure.com/{scope}/providers/Microsoft.Quota/quotas/{resourceName}?api-version=2025-03-01

URI 参数

名称 必需 类型 说明
resourceName
path True

string

给定资源提供程序的资源名称。 例如:

  • Microsoft.Compute 的 SKU 名称
  • 适用于 Microsoft.MachineLearningServices 的 SKU 或 TotalLowPriorityCores

对于 Microsoft.Network PublicIPAddresses。

scope
path True

string

目标 Azure 资源 URI。 例如,/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/。 这是列表 GET作的目标 Azure 资源 URI。 如果在 {resourceName}后添加了 /quotas,则它是特定资源的 GET作中的目标 Azure 资源 URI。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

请求正文

名称 类型 说明
properties

QuotaProperties

指定资源的配额属性,基于调用的 API Quotas 或 Usages。

响应

名称 类型 说明
200 OK

CurrentQuotaLimitBase

还行。 返回配额请求详细信息。

202 Accepted

请求已接受并正在处理。 若要检查此请求的状态,请在 配额请求状态 GET作中使用配额请求 ID ID 的值。

Other Status Codes

ExceptionResponse

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

安全性

azure_auth

Azure Active Directory OAuth 2.0 授权

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

作用域

名称 说明
user_impersonation 模拟用户帐户。

示例

Quotas_Request_PatchForCompute
Quotas_Request_PatchForNetwork

Quotas_Request_PatchForCompute

示例请求

PATCH https://management.azure.com/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/quotas/standardFSv2Family?api-version=2025-03-01

{
  "properties": {
    "limit": {
      "limitObjectType": "LimitValue",
      "value": 10
    },
    "name": {
      "value": "standardFSv2Family"
    }
  }
}

示例响应

Retry-After: 30
location: https://management.azure.com/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/operationsStatus/2B5C8515-37D8-4B6A-879B-CD641A2CF605?api-version=2023-02-01
location: https://management.azure.com/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/quotaRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605?api-version=2023-02-01
{
  "id": "/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/quotas/standardFSv2Family",
  "type": "Microsoft.Quota/quotas",
  "name": "standardFSv2Family",
  "properties": {
    "limit": {
      "limitObjectType": "LimitValue",
      "value": 10
    },
    "name": {
      "value": "standardFSv2Family",
      "localizedValue": "Standard FSv2 Family vCPUs"
    }
  }
}

Quotas_Request_PatchForNetwork

示例请求

PATCH https://management.azure.com/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas/MinPublicIpInterNetworkPrefixLength?api-version=2025-03-01

{
  "properties": {
    "limit": {
      "limitObjectType": "LimitValue",
      "value": 10
    },
    "name": {
      "value": "MinPublicIpInterNetworkPrefixLength"
    },
    "resourceType": "MinPublicIpInterNetworkPrefixLength"
  }
}

示例响应

Retry-After: 30
location: https://management.azure.com/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/operationsStatus/2B5C8515-37D8-4B6A-879B-CD641A2CF605?api-version=2023-02-01
location: https://management.azure.com/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotaRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605?api-version=2023-02-01
{
  "id": "/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotaRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605",
  "type": "Microsoft.Quota/quotas",
  "name": "2B5C8515-37D8-4B6A-879B-CD641A2CF605",
  "properties": {
    "limit": {
      "limitObjectType": "LimitValue",
      "value": 10
    },
    "name": {
      "value": "MinPublicIpInterNetworkPrefixLength"
    },
    "resourceType": "MinPublicIpInterNetworkPrefixLength"
  }
}

定义

名称 说明
CurrentQuotaLimitBase

配额限制。

ExceptionResponse

错误。

LimitObject

资源配额限制值。

quotaLimitTypes

配额或使用情况限制类型。

QuotaProperties

指定资源的配额属性。

ResourceName

资源提供程序提供的资源的名称。 请求配额时,请使用此属性名称。

ServiceError

API 错误详细信息。

ServiceErrorDetail

错误详细信息。

CurrentQuotaLimitBase

配额限制。

名称 类型 说明
id

string

资源 ID。

name

string

资源名称。

properties

QuotaProperties

指定资源的配额属性,基于调用的 API Quotas 或 Usages。

type

string

资源类型。

ExceptionResponse

错误。

名称 类型 说明
error

ServiceError

API 错误详细信息。

LimitObject

资源配额限制值。

名称 类型 说明
limitObjectType string:

LimitValue

limit 对象类型。

limitType

quotaLimitTypes

配额或使用情况限制类型。

value

integer (int32)

配额/限制值

quotaLimitTypes

配额或使用情况限制类型。

说明
Independent
Shared

QuotaProperties

指定资源的配额属性。

名称 类型 说明
isQuotaApplicable

boolean

如果可以请求此资源的配额,则为状态。

limit LimitJsonObject:

LimitObject

资源配额限制属性。

name

ResourceName

资源提供程序提供的资源名称。 在请求配额时使用此属性名称。

properties

object

特定资源提供程序的其他属性。

quotaPeriod

string

汇总配额使用情况值的时间段。 例如:*P1D(每一天) *PT1M (每分钟) *PT1S (每一秒)。 此参数是可选的,因为对于某些资源(如计算)而言,周期无关紧要。

resourceType

string

资源类型的名称。 可选字段。

unit

string

配额单位,如计数和字节数。 请求配额时,请在 PUT作的请求正文中使用 GET 响应中返回 单元 值。

ResourceName

资源提供程序提供的资源的名称。 请求配额时,请使用此属性名称。

名称 类型 说明
localizedValue

string

资源显示名称。

value

string

资源名称。

ServiceError

API 错误详细信息。

名称 类型 说明
code

string

错误代码。

details

ServiceErrorDetail[]

错误详细信息列表。

message

string

错误消息。

ServiceErrorDetail

错误详细信息。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。