swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Use these REST APIs for performing operations on Quota entity associated with your Azure API Management deployment. To configure call rate limit and quota policies refer to [how to configure call rate limit and quota](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-product-with-rules#a-namepolicies-ato-configure-call-rate-limit-and-quota-policies).
  title: ApiManagementClient
  version: 2019-01-01
  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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2019-01-01/apimquotas.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: apimanagement-apimquotas
  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: {}
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}":
    get:
      description: Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified service instance. The api does not support paging yet.
      externalDocs:
        description: Document describing how to configure the quota policies.
        url: https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-product-with-rules#a-namepolicies-ato-configure-call-rate-limit-and-quota-policies
      operationId: QuotaByCounterKeys_ListByService
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
          in: path
          name: quotaCounterKey
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - 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
      responses:
        "200":
          description: Lists a collection of the quota counter values.
          schema:
            description: Paged Quota Counter list representation.
            properties:
              count:
                description: Total record count number across all pages.
                format: int64
                type: integer
              nextLink:
                description: Next page link if any.
                type: string
              value:
                description: Quota counter values.
                items:
                  description: Quota counter details.
                  properties:
                    counterKey:
                      description: The Key value of the Counter. Must not be empty.
                      minLength: 1
                      type: string
                    periodEndTime:
                      description: |
                        The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                      format: date-time
                      type: string
                    periodKey:
                      description: Identifier of the Period for which the counter was collected. Must not be empty.
                      minLength: 1
                      type: string
                    periodStartTime:
                      description: |
                        The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                      format: date-time
                      type: string
                    value:
                      description: Quota counter value details.
                      properties:
                        callsCount:
                          description: Number of times Counter was called.
                          format: int32
                          type: integer
                        kbTransferred:
                          description: Data Transferred in KiloBytes.
                          format: double
                          type: number
                  required:
                    - counterKey
                    - periodKey
                    - periodStartTime
                    - periodEndTime
                type: array
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - QuotaByCounterKeys
      x-ms-examples:
        ApiManagementGetQuotaCounterKeys:
          parameters:
            api-version: 2019-01-01
            quotaCounterKey: ba
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                nextLink: ""
                value:
                  - counterKey: ba
                    periodEndTime: 2018-02-08T16:54:40Z
                    periodKey: 0_P3Y6M4DT12H30M5S
                    periodStartTime: 2014-08-04T04:24:35Z
                    value:
                      callsCount: 5
                      kbTransferred: 2.5830078125
    patch:
      description: Updates all the quota counter values specified with the existing quota counter key to a value in the specified service instance. This should be used for reset of the quota counter values.
      operationId: QuotaByCounterKeys_Update
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
          in: path
          name: quotaCounterKey
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The value of the quota counter to be applied to all quota counter periods.
          in: body
          name: parameters
          required: true
          schema:
            description: Quota counter value details.
            properties:
              callsCount:
                description: Number of times Counter was called.
                format: int32
                type: integer
              kbTransferred:
                description: Data Transferred in KiloBytes.
                format: double
                type: number
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - 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
      responses:
        "204":
          description: Quota counter period was successfully updated.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - QuotaByCounterKeys
      x-ms-examples:
        ApiManagementUpdateQuotaCounterKey:
          parameters:
            api-version: 2019-01-01
            parameters:
              callsCount: 0
              kbTransferred: 2.5630078125
            quotaCounterKey: ba
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "204": {}
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}":
    get:
      description: Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service instance.
      externalDocs:
        description: Document describing how to configure the quota policies.
        url: https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-product-with-rules#a-namepolicies-ato-configure-call-rate-limit-and-quota-policies
      operationId: QuotaByPeriodKeys_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
          in: path
          name: quotaCounterKey
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Quota period key identifier.
          in: path
          name: quotaPeriodKey
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - 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
      responses:
        "200":
          description: The response body contains the Quota counter details for the specified period.
          schema:
            description: Quota counter details.
            properties:
              counterKey:
                description: The Key value of the Counter. Must not be empty.
                minLength: 1
                type: string
              periodEndTime:
                description: |
                  The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                format: date-time
                type: string
              periodKey:
                description: Identifier of the Period for which the counter was collected. Must not be empty.
                minLength: 1
                type: string
              periodStartTime:
                description: |
                  The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                format: date-time
                type: string
              value:
                description: Quota counter value details.
                properties:
                  callsCount:
                    description: Number of times Counter was called.
                    format: int32
                    type: integer
                  kbTransferred:
                    description: Data Transferred in KiloBytes.
                    format: double
                    type: number
            required:
              - counterKey
              - periodKey
              - periodStartTime
              - periodEndTime
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - QuotaByPeriodKeys
      x-ms-examples:
        ApiManagementGetQuotaCounterKeysByQuotaPeriod:
          parameters:
            api-version: 2019-01-01
            quotaCounterKey: ba
            quotaPeriodKey: 0_P3Y6M4DT12H30M5S
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                counterKey: ba
                periodEndTime: 2018-02-08T16:54:40Z
                periodKey: 0_P3Y6M4DT12H30M5S
                periodStartTime: 2014-08-04T04:24:35Z
                value:
                  callsCount: 0
                  kbTransferred: 2.5625
    patch:
      description: Updates an existing quota counter value in the specified service instance.
      operationId: QuotaByPeriodKeys_Update
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
          in: path
          name: quotaCounterKey
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Quota period key identifier.
          in: path
          name: quotaPeriodKey
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The value of the Quota counter to be applied on the specified period.
          in: body
          name: parameters
          required: true
          schema:
            description: Quota counter value details.
            properties:
              callsCount:
                description: Number of times Counter was called.
                format: int32
                type: integer
              kbTransferred:
                description: Data Transferred in KiloBytes.
                format: double
                type: number
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - 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
      responses:
        "204":
          description: The quota counter value was successfully updated.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - QuotaByPeriodKeys
      x-ms-examples:
        ApiManagementUpdateQuotaCounterKeyByQuotaPeriod:
          parameters:
            api-version: 2019-01-01
            parameters:
              callsCount: 0
              kbTransferred: 0
            quotaCounterKey: ba
            quotaPeriodKey: 0_P3Y6M4DT12H30M5S
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "204": {}
definitions: {}
