Share via


Retrieve Usage Data for Tenant Resources

 

Applies To: Windows Azure Pack

Retrieves the usage data for tenant resources.

Request

Replace <UsageEndpoint> with the name of the computer that hosts the usage endpoint for the Windows Azure Pack.

Method

Request URI

HTTP version

GET

https://<UsageEndpoint>:30022/usage

HTTP/1.1

URI Parameters

The following table describes the URI parameters.

URI parameter

Description

startId

The identifier of the first record to retrieve.

batchSize

The maximum number of records to retrieve.

Request Headers

The following table describes required and optional request headers.

Request header

Description

Authorization: Basic

Required. The basic authorization token.

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

UsageRecordList

A list of usage records. For more information, see UsageRecord (Usage Metering Object).

Example

The following code example shows a Get Usage Data request.

https://<Computer>:30022/usage?startId=0&batchSize=1 HTTP/1.1
Accept: application/json
Authorization: basic <Token>
Host: <Computer>:30022
Connection: Keep-Alive

The following code example shows a Get Usage Data response.

[
  {
    "EventId": 1,
    "ExternalRecordId": "1",
    "ResourceId": "neozyoediqv",
    "StartTime": "2013-08-09T19:00:00",
    "EndTime": "2013-08-09T20:00:00",
    "ProviderName": "webspaces",
    "ServiceType": "Website",
    "SubscriptionId": "3ccb3846-fa6c-4cb1-aa56-513dc6f114ad",
    "Properties": {
      "Webspace": "defaultwebspace",
      "ComputeMode": "Free",
      "SiteMode": "Limited"
    },
    "Resources": {
      "TotalIncomingRequestBytes": "0",
      "TotalIncomingRequestResponseBytes": "0",
      "TotalLocalReadBytes": "0",
      "TotalLocalWrittenBytes": "0",
      "TotalNetworkReadBytes": "0",
      "TotalNetworkWrittenBytes": "0",
      "TotalOutgoingRequestBytes": "0",
      "TotalOutgoingRequestResponseBytes": "0",
      "TotalProcessorTime": "0",
      "TotalRequestCount": "0",
      "TotalStopRequestsCount": "0",
      "MaxMemoryWorkingSet": "0",
      "MinMemoryWorkingSet": "0",
      "TotalMemoryWorkingSet": "0",
      "TotalIncomingFtpRequestBytes": "0",
      "TotalIncomingFtpRequestResponseBytes": "0",
      "TotalFtpCommandsCount": "0",
      "TotalIncomingWebDeployRequestBytes": "0",
      "TotalIncomingWebDeployRequestResponseBytes": "0",
      "TotalWebDeployRequestsCount": "0",
      "HostNamesUsage": "2",
      "NumberOfWorkers": "0.948405021666667",
      "SslIpUsage": "0",
      "SslSniUsage": "0",
      "WebSocketsUsage": "0",
      "Site64BitsUsage": "0"
    }
  }
]

See Also

Windows Azure Pack Usage Service Usage REST API Reference