Manage billing - Get a customer's utilization records for Azure

Gets the utilization for resources that belong to an Azure subscription owned by a customer of the partner.

GET https://api.partnercenter.microsoft.com/v1/customers/{customer_id}/subscriptions/{subscription_id}/utilizations/azure
GET https://api.partnercenter.microsoft.com/v1/customers/{customer_id}/subscriptions/{subscription_id}/utilizations/azure?start_time={start_time}&end_time={end_time}&size={size}&granularity={granularity}&show_details={show_details}&seek_operation={seek_operation}

URI Parameters

Name In Required Type Description
customer_id
path True

string

The id of the customer who owns the subscription.

subscription_id
path True

string

The id of the Azure subscription to retrieve the utilization for.

end_time
query

string

date-time

The ending time of when the utilization was metered in the billing system.

granularity
query

string

The resource usage time granularity. Can either be daily or hourly. Defalt is daily.

seek_operation
query

string

The seek operation to perform. Only Next is supported.

show_details
query

boolean

If set to true, the utilization records will be split by the resource instance levels. If set to false, the utilization records will be aggregated on the resource level. Default is true.

size
query

integer

int32

An optional maximum number of records to return. Default is 1000. The returned resource collection will specify a next link in case there were more utilization records available.

start_time
query

string

date-time

The starting time of when the utilization was metered in the billing system.

Request Header

Name Required Type Description
Authorization True

string

Authorization Bearer token

ms-correlationid

string

Used for tracking requests internally. If a ms-correlationid is not provided, the server will generate a new one for each request

ms-cv

string

Used for tracking requests internally. If a ms-cv is not provided, the server will generate a new one for each request

ms-requestid

string

Used for idempotency of requests. If a ms-requestid is not provided, the server will generate a new one for each request

Responses

Name Type Description
200 OK

Collections.ResourceCollection[Utilizations.AzureUtilizationRecord]

The request was successful. The response body contains the Azure utilization records resource collection.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

204 No Content

Collections.ResourceCollection[Utilizations.AzureUtilizationRecord]

Data is not available for the given start and end time. No content is returned with a retry-after header.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

400 Bad Request

There was a missing or an invalid input. The response body will provide the error details.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

401 Unauthorized

The request was not authenticated. The client needs to authenticate with the partner API service first.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

403 Forbidden

The request was authenticated but was refused since the caller does not have the rights to invoke it.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

404 Not Found

The resource is not found or not available with the given input parameters.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

500 Internal Server Error

The partner API service or one of its dependencies failed to fulfill the request. Callers may retry this.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

Definitions

Name Description
Collections.ResourceCollection[Utilizations.AzureUtilizationRecord]
Link
ResourceAttributes
ResourceLinks
System.Collections.Generic.KeyValuePair[System.String,System.String]
Utilizations.AzureInstanceData
Utilizations.AzureResource
Utilizations.AzureUtilizationRecord

Collections.ResourceCollection[Utilizations.AzureUtilizationRecord]

Name Type Description
attributes

ResourceAttributes

items

Utilizations.AzureUtilizationRecord[]

links

ResourceLinks

totalCount

integer

Name Type Description
headers

System.Collections.Generic.KeyValuePair[System.String,System.String][]

method

string

uri

string

ResourceAttributes

Name Type Description
etag

string

objectType

string

Name Type Description
next

Link

previous

Link

self

Link

System.Collections.Generic.KeyValuePair[System.String,System.String]

Name Type Description
key

string

value

string

Utilizations.AzureInstanceData

Name Type Description
additionalInfo

object

location

string

orderNumber

string

partNumber

string

resourceUri

string

tags

object

Utilizations.AzureResource

Name Type Description
category

string

id

string

name

string

region

string

subcategory

string

Utilizations.AzureUtilizationRecord

Name Type Description
attributes

ResourceAttributes

infoFields

object

instanceData

Utilizations.AzureInstanceData

quantity

number

resource

Utilizations.AzureResource

unit

string

usageEndTime

string

usageStartTime

string