{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "description": "Use these REST APIs to get the analytics reports associated with your Azure API Management deployment.",
    "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/apimreports.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "x-providerName": "azure.com",
    "x-serviceName": "apimanagement-apimreports",
    "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}/reports/{aggregation}": {
      "get": {
        "description": "Lists report records.",
        "operationId": "Reports_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": "Report aggregation.",
            "enum": [
              "byApi",
              "byGeo",
              "byOperation",
              "byProduct",
              "bySubscription",
              "byTime",
              "byUser"
            ],
            "in": "path",
            "name": "aggregation",
            "required": true,
            "type": "string",
            "x-ms-enum": {
              "modelAsString": false,
              "name": "ReportsAggregation"
            }
          },
          {
            "description": "The filter to apply on the operation.",
            "in": "query",
            "name": "$filter",
            "required": false,
            "type": "string"
          },
          {
            "description": "Number of records to return.",
            "format": "int32",
            "in": "query",
            "minimum": 1,
            "name": "$top",
            "required": false,
            "type": "integer",
            "x-ms-parameter-location": "method"
          },
          {
            "description": "Number of records to skip.",
            "format": "int32",
            "in": "query",
            "minimum": 0,
            "name": "$skip",
            "required": false,
            "type": "integer",
            "x-ms-parameter-location": "method"
          },
          {
            "description": "By time interval. This value is only applicable to ByTime aggregation. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO  8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds))",
            "format": "duration",
            "in": "query",
            "name": "interval",
            "required": false,
            "type": "string"
          },
          {
            "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 Report record.",
            "schema": {
              "$ref": "#/definitions/ReportCollection"
            }
          }
        },
        "tags": [
          "Reports"
        ],
        "x-ms-odata": "#/definitions/ReportRecordContract",
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    }
  },
  "definitions": {
    "ReportCollection": {
      "description": "Paged Report records 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": "Page values.",
          "items": {
            "$ref": "#/definitions/ReportRecordContract"
          },
          "type": "array"
        }
      }
    },
    "ReportRecordContract": {
      "description": "Report data.",
      "properties": {
        "apiId": {
          "description": "API identifier path. /apis/{apiId}",
          "type": "string"
        },
        "apiRegion": {
          "description": "API region identifier.",
          "type": "string"
        },
        "apiTimeAvg": {
          "description": "Average time it took to process request.",
          "format": "double",
          "type": "number"
        },
        "apiTimeMax": {
          "description": "Maximum time it took to process request.",
          "format": "double",
          "type": "number"
        },
        "apiTimeMin": {
          "description": "Minimum time it took to process request.",
          "format": "double",
          "type": "number"
        },
        "bandwidth": {
          "description": "Bandwidth consumed.",
          "format": "int64",
          "type": "integer"
        },
        "cacheHitCount": {
          "description": "Number of times when content was served from cache policy.",
          "format": "int32",
          "type": "integer"
        },
        "cacheMissCount": {
          "description": "Number of times content was fetched from backend.",
          "format": "int32",
          "type": "integer"
        },
        "callCountBlocked": {
          "description": "Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests",
          "format": "int32",
          "type": "integer"
        },
        "callCountFailed": {
          "description": "Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600",
          "format": "int32",
          "type": "integer"
        },
        "callCountOther": {
          "description": "Number of other calls.",
          "format": "int32",
          "type": "integer"
        },
        "callCountSuccess": {
          "description": "Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect",
          "format": "int32",
          "type": "integer"
        },
        "callCountTotal": {
          "description": "Total number of calls.",
          "format": "int32",
          "type": "integer"
        },
        "country": {
          "description": "Country to which this record data is related.",
          "type": "string"
        },
        "interval": {
          "description": "Length of aggregation period.",
          "format": "int64",
          "type": "integer"
        },
        "name": {
          "description": "Name depending on report endpoint specifies product, API, operation or developer name.",
          "type": "string"
        },
        "operationId": {
          "description": "Operation identifier path. /apis/{apiId}/operations/{operationId}",
          "type": "string"
        },
        "productId": {
          "description": "Product identifier path. /products/{productId}",
          "readOnly": true,
          "type": "string"
        },
        "region": {
          "description": "Country region to which this record data is related.",
          "type": "string"
        },
        "serviceTimeAvg": {
          "description": "Average time it took to process request on backend.",
          "format": "double",
          "type": "number"
        },
        "serviceTimeMax": {
          "description": "Maximum time it took to process request on backend.",
          "format": "double",
          "type": "number"
        },
        "serviceTimeMin": {
          "description": "Minimum time it took to process request on backend.",
          "format": "double",
          "type": "number"
        },
        "subscriptionId": {
          "description": "Subscription identifier path. /subscriptions/{subscriptionId}",
          "type": "string"
        },
        "timestamp": {
          "description": "Start of aggregation 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"
        },
        "userId": {
          "description": "User identifier path. /users/{userId}",
          "readOnly": true,
          "type": "string"
        },
        "zip": {
          "description": "Zip code to which this record data is related.",
          "type": "string"
        }
      }
    }
  }
}