检索订阅

 

适用于:Windows Azure Pack

检索订阅。

请求

将 ServiceMgmt> 替换为<服务管理 API 终结点地址。 将 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 标识符。

请求正文

响应

响应包括 HTTP 状态代码、一组响应标头和响应正文。

状态代码

此操作成功后返回状态代码 200(正常)。

有关状态代码的信息,请参阅状态和错误代码 (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"
}

另请参阅

管理员订阅接口