swagger: '2.0' info: version: 2020-08-01-preview title: Microsoft Azure AccessControlClient AccessConnector UsageAggregates API schemes: - https tags: - name: UsageAggregates paths: /subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates: get: tags: - UsageAggregates operationId: microsoftAzureUsageaggregatesList description: Query aggregated Azure subscription consumption data for a date range. externalDocs: url: https://docs.microsoft.com/rest/api/commerce/usageaggregates x-ms-examples: GetUsageAggregatesList: $ref: ./examples/GetUsageAggregatesList.json parameters: - name: reportedStartTime in: query required: true type: string format: date-time description: The start of the time range to retrieve data for. - name: reportedEndTime in: query required: true type: string format: date-time description: The end of the time range to retrieve data for. - name: showDetails in: query required: false type: boolean description: '`True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).' - name: aggregationGranularity in: query required: false type: string default: Daily description: '`Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity.' enum: - Daily - Hourly x-ms-enum: name: AggregationGranularity modelAsString: false - name: continuationToken in: query required: false type: string description: 'Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. ' - $ref: '#/parameters/ApiVersionParameter' - $ref: '#/parameters/SubscriptionIdParameter' responses: '200': description: Normal response for a successful query. The response body will contain the data that matches the filters specified in the query parameters. schema: $ref: '#/definitions/UsageAggregationListResult' '202': description: Response indicating that a request has been accepted for processing. However, the processing has not been completed. schema: $ref: '#/definitions/ErrorObjectResponse' default: description: Error response describing why the operation failed. schema: $ref: '#/definitions/ErrorObjectResponse' x-ms-pageable: nextLinkName: nextLink summary: Microsoft Azure Get Subscriptions Subscriptionid Providers Microsoft Commerce Usageaggregates definitions: ErrorResponse: description: Describes the format of Error response. type: object properties: code: description: Error code type: string message: description: Error message indicating why the operation failed. type: string UsageSample: properties: subscriptionId: type: string format: uuid description: The subscription identifier for the Azure user. meterId: type: string description: Unique ID for the resource that was consumed (aka ResourceID). usageStartTime: type: string format: date-time description: UTC start time for the usage bucket to which this usage aggregate belongs. usageEndTime: type: string format: date-time description: UTC end time for the usage bucket to which this usage aggregate belongs. quantity: type: number format: float description: The amount of the resource consumption that occurred in this time frame. unit: type: string description: The unit in which the usage for this resource is being counted, e.g. Hours, GB. meterName: type: string description: Friendly name of the resource being consumed. meterCategory: type: string description: Category of the consumed resource. meterSubCategory: type: string description: Sub-category of the consumed resource. meterRegion: type: string description: Region of the meterId used for billing purposes infoFields: $ref: '#/definitions/InfoField' description: Key-value pairs of instance details (legacy format). instanceData: type: string description: Key-value pairs of instance details represented as a string. description: Describes a sample of the usageAggregation. UsageAggregation: properties: id: type: string description: Unique Id for the usage aggregate. name: type: string description: Name of the usage aggregate. type: type: string description: Type of the resource being returned. properties: $ref: '#/definitions/UsageSample' x-ms-client-flatten: true description: Usage data. description: Describes the usageAggregation. InfoField: description: Key-value pairs of instance details in the legacy format. ErrorObjectResponse: description: Describes the format of Error response with a wrapper object type: object properties: error: description: Wrapper object for error information $ref: '#/definitions/ErrorResponse' UsageAggregationListResult: properties: value: type: array items: $ref: '#/definitions/UsageAggregation' description: Gets or sets details for the requested aggregation. nextLink: type: string description: Gets or sets the link to the next set of results. description: The Get UsageAggregates operation response. parameters: ApiVersionParameter: name: api-version in: query required: true type: string description: Client Api Version. SubscriptionIdParameter: name: subscriptionId in: path required: true type: string description: It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. x-ms-parameterized-host: hostTemplate: '{endpoint}' useSchemePrefix: false parameters: - $ref: '#/parameters/Endpoint'