共用方式為


更新資源提供者的配額設定

 

適用于:Windows Azure Pack

更新資源提供者的配額設定。

要求

將 NotificationEndpoint > 取代 < 為 Windows Azure Pack 自訂資源提供者通知 REST API 的端點位址。

方法

要求 URI

HTTP 版本

PUT

<HTTP:// NotificationEndpoint > /quota

HTTP/1.1

URI 參數

無。

要求標頭

下表描述必要的和選用的要求標頭。

要求標頭

描述

授權:基本

必要。 基本授權權杖。

x-ms-principal-id

必要。 主體識別碼。

x-ms-client-request-id

選擇性。 用戶端要求識別碼。

x-ms-client-session-id

選擇性。 用戶端會話識別碼。

x-ms-principal-liveid

選擇性。 主體 Live 識別碼。

要求本文

下表說明要求主體的元素。

元素名稱

描述

QuotaUpdateBatch

要更新的配額設定批次。 如需詳細資訊,請參閱 QuotaUpdateBatch (Notification Endpoint Object)

回應

回應包括 HTTP 狀態碼、一組回應標頭和回應主體。

狀態碼

成功的作業會傳回狀態碼 200 (OK)。

如需狀態碼的相關資訊,請參閱狀態和錯誤碼 (Windows Azure Pack Service Management)

回應標頭

此作業的回應包括標準 HTTP 標頭。 所有標準標頭都符合 HTTP/1.1 通訊協定規格

回應本文

下表描述回應主體的重要元素:

元素名稱

描述

QuotaUpdateResultBatch

更新配額設定的批次。 如需詳細資訊,請參閱 QuotaUpdateResultBatch (通知端點物件)

範例

下列範例顯示更新資源提供者要求的配額設定

PUT https://<NotificationEndpoint>:30012/quota HTTP/1.1
Referer: https://<Computer>:30004/plans/MyServicePlanX18aa6bac-5e8d-439e-b4d9-4a7dea4e843a/quota
Accept-Language: en-US
x-ms-client-request-id: 0ee49d13-7b86-4840-b0e1-046106a8d813-2014-07-09 23:16:21Z
x-ms-client-session-id: a519f0aa-53e9-4522-94fd-3c55607a6b65
x-ms-principal-id: <Computer>%5cAdministrator
x-ms-request-id: 840de34d9d9a484a8ddd7255a44cb1fd.2014-07-09T23:16:22.6545190Z
Authorization: Basic <encoded username and password>
Content-Type: application/json; charset=utf-8
Host: <Computer>:30012
Content-Length: 467
Expect: 100-continue

{
  "BaseQuota": [
    {
      "Key": "Editions",
      "Value": "[{\"displayName\":\"Default\",\"groupName\":\"Default\",\"resourceCount\":11,\"resourceSize\":1024,\"offerEditionId\":\"040814101717\",\"groupType\":null,\"resourceSizeLimit\":null}]"
    }
  ],
  "AddOnQuotas": [

  ],
  "SubscriptionIdsToUpdate": [
    "da506abb-1658-4abf-971c-e0e5a9c47b83",
    "603e36b5-4f30-4ccf-8c90-9b37ded24149",
    "d5715678-aea4-49e5-b37d-7e65abdae793",
    "718fb765-72fe-4201-be6a-4b31fb396805",
    "f3fca3c5-1dca-411e-97f7-9891325aa78f"
  ]
}

下列程式碼範例顯示資源提供者的更新配額設定JSON 回應。

{
  "UpdatedSubscriptionIds": [
    "da506abb-1658-4abf-971c-e0e5a9c47b83",
    "603e36b5-4f30-4ccf-8c90-9b37ded24149",
    "d5715678-aea4-49e5-b37d-7e65abdae793",
    "718fb765-72fe-4201-be6a-4b31fb396805",
    "f3fca3c5-1dca-411e-97f7-9891325aa78f"
  ],
  "FailedSubscriptionIds": null,
  "Error": null
}

備註

更新資源提供者的配額設定是用來以新配額更新屬於方案的所有訂用帳戶。

另請參閱

Windows Azure Pack 自訂資源提供者通知 REST API 參考