Share via


Retrieve the Usage Summaries for a Subscription

 

Applies To: Windows Azure Pack

Retrieves the usage summaries for a subscription.

Request

Replace <ServiceMgmt> with your Service Management API endpoint address. Replace <SubscriptionId> with the identifier of the subscription. Replace <Port> with either 30005 for the tenant API or 30004 for the administrator API. Replace <SubscriptionId> with the subscription identifier of the subscription that usage summaries are required for.

Method

Request URI

HTTP version

GET

https://<ServiceMgmt>:<Port>/subscriptions/<SubscriptionId>/usagesummaries

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes required and optional request headers.

Request header

Description

Authorization: Bearer

Required. Authorization bearer token.

x-ms-client-request-id:

Optional. The client request identifier.

x-ms-client-session-id:

Optional. The client session identifier.

x-ms-principal-liveid:

Optional. The principal Live identifier.

Request Body

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

A successful operation returns status code 200 (OK).

For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).

Response Headers

The response for this operation includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

The following table describes the key elements of the response body:

Element name

Description

ServiceName

The service name.

ServiceDisplayName

The service display name.

RetrievedSuccessfully

True if the usage date was retrieved successfully, otherwise False.

ErrorMessage

The error message.

Usages

A list of usage items. For more information, see Usage (Common object).

Example

The following code example shows a List Subscription Usage Summaries request.

GET https://<Computer>:30005/subscriptions/d001ad25-2639-4475-b6f6-f54e8842c902/usagesummaries HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjVHUjRtOWdTRkhJc3Vtb2JKa1hMbWV0eXkwMCJ9.eyJhdWQiOiJodHRwOi8vYXp1cmVzZXJ2aWNlcy9UZW5hbnRTaXRlIiwiaXNzIjoiaHR0cDovL2F6dXJlc2VydmljZXMvQXV0aFNpdGUiLCJuYmYiOjEzNzI0NTQ0NzYsImV4cCI6MTM3MjQ4MzI3NiwidXBuIjoibXJhZHRlc0AzdGVzdC5jb210In0.hnEhHiYV62YyxIKExczoAksWZeclMbU5sQESK2UeuRfmqoqodAzCYBn-EOG19CKs_QAGjQ22jX63tzreBCCoDQqV2vHESIIRq_93_vOIsJHUyKOc_iD8hn9CGyPGVuVgjHdh5aFoi0p1OxJhD3Li6I4nPI64bWZD_2ADHGBgrMInoZ1g_jBI2XF0qvSYO1yjKcxWHgrZh5pcGZYhwNT-RS8XbufSXLYKpRj7Os0B5sYtq5QM-t-aAjxkthZmwn1mFm3y0GRfUTxfi9G0MmxWye2TvHYi56qHtJi7JdJj7M76t4zjWoFPcpFkbceOOtbAX7pSFwEj3JDaaxzkGm6fIg
x-ms-client-request-id: 95767e1d-d6a6-41f1-93a6-0fcbabdda925-2013-06-28 22:03:19Z
x-ms-client-session-id: 4933f1c7-aabf-4944-b250-3a57062d093c
x-ms-principal-id: mradtes@3test.comt
Accept-Language: en-US
x-ms-principal-liveid: mradtes@3test.comt
Host: <Computer>:30005

The following code example shows a List Subscription Usage Summaries response.

[
  {
    "ServiceName": "webspaces",
    "ServiceDisplayName": "Web Site Cloud",
    "RetrievedSuccessfully": true,
    "ErrorMessage": null,
    "Usages": [

    ]
  },
  {
    "ServiceName": "sqlservers",
    "ServiceDisplayName": "SQL Servers",
    "RetrievedSuccessfully": true,
    "ErrorMessage": null,
    "Usages": [

    ]
  },
  {
    "ServiceName": "servicebus",
    "ServiceDisplayName": "Service Bus Cloud",
    "RetrievedSuccessfully": true,
    "ErrorMessage": null,
    "Usages": [

    ]
  },
  {
    "ServiceName": "mysqlservers",
    "ServiceDisplayName": "MySQL Servers",
    "RetrievedSuccessfully": true,
    "ErrorMessage": null,
    "Usages": [

    ]
  }
]

See Also

Common Subscription Interfaces