swagger: "2.0"
schemes:
  - https
host: management.local.azurestack.external
info:
  description: The Admin Commerce Management Client.
  title: CommerceManagementClient
  version: 2015-06-01-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/azsadmin/resource-manager/commerce/Microsoft.Commerce.Admin/preview/2015-06-01-preview/CommerceAdmin.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: azsadmin-CommerceAdmin
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  AggregationGranularityParameter:
    description: The aggregation granularity.
    in: query
    name: aggregationGranularity
    required: false
    type: string
    x-ms-parameter-location: method
  ApiVersionParameter:
    default: 2015-06-01-preview
    description: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
  ContinuationTokenParameter:
    description: The continuation token.
    in: query
    name: continuationToken
    required: false
    type: string
    x-ms-parameter-location: method
  ReportedEndTimeParameter:
    description: The reported end time (exclusive).
    format: date-time
    in: query
    name: reportedEndTime
    required: true
    type: string
    x-ms-parameter-location: method
  ReportedStartTimeParameter:
    description: The reported start time (inclusive).
    format: date-time
    in: query
    name: reportedStartTime
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: Subscription credentials which uniquely identify Microsoft Azure subscription.The subscription ID forms part of the URI for every service call.
    in: path
    name: subscriptionId
    required: true
    type: string
  TenantSubscriptionIdParameter:
    description: The tenant subscription identifier.
    in: query
    name: subscriberId
    required: false
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/subscriberUsageAggregates":
    get:
      description: Gets a collection of SubscriberUsageAggregates, which are UsageAggregates from direct tenants.
      operationId: SubscriberUsageAggregates_List
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ReportedStartTimeParameter"
        - $ref: "#/parameters/ReportedEndTimeParameter"
        - $ref: "#/parameters/AggregationGranularityParameter"
        - $ref: "#/parameters/TenantSubscriptionIdParameter"
        - $ref: "#/parameters/ContinuationTokenParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/UsageAggregatePage"
      tags:
        - Commerce
      x-ms-examples:
        Get the list of usage aggregates for all tenants.:
          parameters:
            aggregationGranularity: ""
            api-version: 2015-06-01-preview
            continuationToken: ""
            location: local
            reportedEndTime: 2017-08-02T00:00:00.00Z
            reportedStartTime: 2017-08-01T00:00:00.00Z
            subscriberId: ""
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
          responses:
            "200":
              body:
                nextLink: ""
                value: []
definitions:
  Resource:
    description: Base Resource Object
    properties:
      id:
        description: URI of the resource.
        readOnly: true
        type: string
      location:
        description: Location where resource is location.
        readOnly: true
        type: string
      name:
        description: Name of the resource.
        readOnly: true
        type: string
      tags:
        additionalProperties:
          type: string
        description: List of key value pairs.
        readOnly: true
        type: object
      type:
        description: Type of resource.
        readOnly: true
        type: string
    type: object
    x-ms-azure-resource: true
  UsageAggregate:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Aggregate usage values for resource.
    properties:
      properties:
        $ref: "#/definitions/UsageAggregateModel"
        description: Properties for aggregate usage.
        x-ms-client-flatten: true
    type: object
  UsageAggregateModel:
    description: Properties for aggregate usage.
    properties:
      instanceData:
        description: Key-value pairs of instance details represented as a string.
        type: string
      meterId:
        description: Unique ID for the resource that was consumed (aka ResourceID).
        type: string
      quantity:
        description: The amount of the resource consumption that occurred in this time frame.
        type: string
      subscriptionId:
        description: Subscription id of tenant using plan.
        type: string
      usageEndTime:
        description: UTC end time for the usage bucket to which this usage aggregate belongs.
        format: date-time
        type: string
      usageStartTime:
        description: UTC start time for the usage bucket to which this usage aggregate belongs.
        format: date-time
        type: string
    type: object
  UsageAggregatePage:
    description: Holds an array of usage aggregates and the continuation token.
    properties:
      nextLink:
        description: Continuation token
        type: string
      value:
        description: Array of usage aggregates.
        items:
          $ref: "#/definitions/UsageAggregate"
        type: array
