{
  "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": "2016-10-10",
    "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/2016-10-10/apimquotas.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "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": {
    "QuotaCounterKeyParameter": {
      "description": "Quota counter key identifier.",
      "in": "path",
      "name": "quotaCounterKey",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "QuotaPeriodKeyParameter": {
      "description": "Quota period key identifier.",
      "in": "path",
      "name": "quotaPeriodKey",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    }
  },
  "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": "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"
          },
          {
            "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"
          },
          {
            "$ref": "#/parameters/QuotaCounterKeyParameter"
          },
          {
            "description": "Version of the API to be used with the client request.",
            "in": "query",
            "name": "api-version",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Lists a collection of the quota counter values.",
            "schema": {
              "$ref": "#/definitions/QuotaCounterCollection"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "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"
        ]
      },
      "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"
          },
          {
            "$ref": "#/parameters/QuotaCounterKeyParameter"
          },
          {
            "description": "The value of the quota counter to be applied to all quota counter periods.",
            "in": "body",
            "name": "parameters",
            "required": true,
            "schema": {
              "$ref": "#/definitions/QuotaCounterValueContract"
            }
          },
          {
            "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": "All the quota counter periods were successfully updated."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "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"
        ]
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/{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": "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"
          },
          {
            "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"
          },
          {
            "$ref": "#/parameters/QuotaCounterKeyParameter"
          },
          {
            "$ref": "#/parameters/QuotaPeriodKeyParameter"
          },
          {
            "description": "Version of the API to be used with the client request.",
            "in": "query",
            "name": "api-version",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "The response body contains the Quota counter details for the specified period.",
            "schema": {
              "$ref": "#/definitions/QuotaCounterContract"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "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"
        ]
      },
      "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"
          },
          {
            "$ref": "#/parameters/QuotaCounterKeyParameter"
          },
          {
            "$ref": "#/parameters/QuotaPeriodKeyParameter"
          },
          {
            "description": "The value of the Quota counter to be applied on the specified period.",
            "in": "body",
            "name": "parameters",
            "required": true,
            "schema": {
              "$ref": "#/definitions/QuotaCounterValueContract"
            }
          },
          {
            "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 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"
        ]
      }
    }
  },
  "definitions": {
    "QuotaCounterCollection": {
      "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": {
            "$ref": "#/definitions/QuotaCounterContract"
          },
          "type": "array"
        }
      }
    },
    "QuotaCounterContract": {
      "allOf": [
        {
          "$ref": "#/definitions/QuotaCounterValueContract"
        }
      ],
      "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.\n",
          "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.\n",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "counterKey",
        "periodKey",
        "periodStartTime",
        "periodEndTime"
      ]
    },
    "QuotaCounterValueContract": {
      "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"
        }
      }
    }
  }
}