共用方式為


擷取訂用帳戶

 

適用于:Windows Azure Pack

擷取訂用帳戶。

要求

以您的服務管理 API 端點位址取代 < ServiceMgmt > 。 將 SubscriptionId > 取代 < 為必要訂用帳戶的訂用帳戶識別碼。

方法

要求 URI

HTTP 版本

GET

HTTPs:// < ServiceMgmt > :30004/subscriptions/ < SubscriptionId>

HTTP/1.1

要求標頭

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

要求標頭

描述

授權:持有人

必要。 授權持有人權杖。

x-ms-principal-id

必要。 主體識別碼。

x-ms-client-request-id

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

x-ms-client-session-id

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

x-ms-principal-liveid

選擇性。 主體 Live 識別碼。

要求本文

None

回應

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

狀態碼

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

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

回應標頭

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

回應本文

下表描述回應本文的主要元素。

元素名稱

描述

AdminSubscription

擷取的訂用帳戶。 如需詳細資訊,請參閱 AdminSubscription (Administrator 物件)

範例

下列程式碼範例顯示 取得訂用帳戶 要求。

GET https://<Computer>:30004/subscriptions/512d113d-44e0-4fb4-81d1-2770be611d14 HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: d9ed35a1-6f98-4a6a-88c3-42bf11d552da-2013-06-28 19:42:37Z
x-ms-client-session-id: 36d65d7b-42b5-4fc0-8334-93c10e7a90f2
x-ms-principal-id: <COMPUTER>\Administrator
Accept-Language: en-US
x-ms-principal-liveid: <COMPUTER>\Administrator
Host: <Computer>:30004

下列程式碼範例顯示 取得訂用帳戶 回應。

{
  "SubscriptionID": "512d113d-44e0-4fb4-81d1-2770be611d14",
  "SubscriptionName": "WebWeb",
  "AccountAdminLiveEmailId": "aaa@ccc.com",
  "ServiceAdminLiveEmailId": null,
  "CoAdminNames": [
    "aaa@bbb.com"
  ],
  "AddOnReferences": [
    {
      "AddOnId": "SqlAOzu4r2rvczcwyhwn2",
      "AddOnInstanceId": "f4e9c1de-0cd0-4e9c-b902-01b081b30096",
      "AcquisitionTime": "2013-06-28T19:40:59.233"
    }
  ],
  "AddOns": [
    {
      "Id": "SqlAOzu4r2rvczcwyhwn2",
      "DisplayName": "SqlAOzu4r2rvc",
      "State": 0,
      "ConfigState": 1,
      "QuotaSyncState": 0,
      "LastErrorMessage": null,
      "Advertisements": [
        {
          "LanguageCode": "en-us",
          "DisplayName": "SqlAOzu4r2rvc",
          "Description": null
        }
      ],
      "ServiceQuotas": [
        {
          "ServiceName": "sqlservers",
          "ServiceInstanceId": "7BAD5022-79CA-4B53-8177-1ACAEEAFA099",
          "ServiceDisplayName": "SQL Servers",
          "ServiceInstanceDisplayName": "SQL Servers",
          "ConfigState": 1,
          "QuotaSyncState": 0,
          "Settings": [
            {
              "Key": "Editions",
              "Value": "[{\"groupName\":\"Default\",\"resourceCount\":\"2\",\"resourceSize\":\"10\",\"offerEditionId\":\"1367541399669\"}]"
            }
          ]
        }
      ],
      "SubscriptionCount": 2,
      "AssociatedPlans": [

      ],
      "MaxOccurrencesPerPlan": 1,
      "Price": null
    }
  ],
  "State": 1,
  "QuotaSyncState": 0,
  "ActivationSyncState": 2,
  "PlanId": "WebWehig9z4ua",
  "Services": [
    {
      "Type": "webspaces",
      "State": "registered",
      "QuotaSyncState": 0,
      "ActivationSyncState": 0,
      "BaseQuotaSettings": [
        {
          "Key": "BytesReceived_Shared_WebSpace_Limited",
          "Value": "{\"ComputeMode\":0,\"CustomActionName\":null,\"EnforcementScope\":0,\"ExceededAction\":0,\"Limit\":-1,\"Period\":1440,\"QuotaName\":\"BytesReceived\",\"ResourceName\":\"BytesReceived\",\"SiteMode\":\"Limited\",\"Unit\":1,\"WebPlan\":null}"
        },

        {
          "Key": "NumberOfVirtualWorkers_Dedicated_WebSpace_NULL",
          "Value": "{\"ComputeMode\":1,\"CustomActionName\":null,\"EnforcementScope\":0,\"ExceededAction\":0,\"Limit\":-1,\"Period\":1440,\"QuotaName\":\"NumberOfVirtualWorkers\",\"ResourceName\":\"NumberOfVirtualWorkers\",\"SiteMode\":null,\"Unit\":1,\"WebPlan\":null}"
        }
      ]
    },
    {
      "Type": "sqlservers",
      "State": "registered",
      "QuotaSyncState": 0,
      "ActivationSyncState": 0,
      "BaseQuotaSettings": [
        {
          "Key": "Editions",
          "Value": "[{\"displayName\":\"Default\",\"groupName\":\"Default\",\"resourceCount\":\"10\",\"resourceSize\":\"1024\",\"resourceSizeLimit\":\"1024\",\"offerEditionId\":\"062713061814\",\"groupType\":null}]"
        }
      ]
    },
    {
      "Type": "mysqlservers",
      "State": "registered",
      "QuotaSyncState": 0,
      "ActivationSyncState": 2,
      "BaseQuotaSettings": [
        {
          "Key": "Editions",
          "Value": "[{\"displayName\":\"Default\",\"groupName\":\"Default\",\"resourceCount\":\"10\",\"resourceSize\":\"1024\",\"offerEditionId\":\"062713061814\",\"groupType\":null}]"
        }
      ]
    }
  ],
  "LastErrorMessage": null,
  "Features": null,
  "OfferFriendlyName": "WebWeb",
  "OfferCategory": null,
  "Created": "2013-06-28T19:26:03.373"
}

另請參閱

系統管理員訂用帳戶介面