Portal Metrics API

The Portal Metrics API can be used to retrieve various metrics for the aan. The API consists of the following RESTful resources: 
apip43
The Portal Metrics API can be used to retrieve various metrics for the 
API Portal
. The API consists of the following RESTful resources: 
  •  
    errors 
    Lets you retrieve error metrics for APIs or applications.
  •  
    hits 
    Lets you retrieve hit metrics for APIs or applications. 
  •  
    latency 
    Lets you retrieve latency metrics for APIs.
  •  
    usage 
    Lets you retrieve usage metrics for account plans.
Requests and responses are in JSON format.
The Real-Time Analytics page in the 
API Portal
 (accessible from 
Analytics
 in the menu) uses this API to visualize metrics data. Integrating with the Portal Metrics API lets you retrieve metrics data for use with your own BI tools, potentially create mash-ups with other corporate data to generate a richer data set, and allows you to create your own custom data visualizations, among other potential benefits.
Accessing the Portal Metrics API
You can call the Portal Metrics API from your external client application, and try it out using the API Explorer in the 
API Portal
.
 
To try out the API in the API Portal:
 
  1. Log in to the 
    API Portal
     as a Portal administrator for the intended tenant. 
  2. Select 
    Publish
    Portal
     
    APIs
    .
  3. Select the 
    Portal Metrics API
     option from the drop-down list. The API Explorer appears in the right pane, showing the Portal Metrics API.
Authentication
All API calls require a valid OAuth token.
Example
A sample Swagger JSON file can be downloaded from here
alpha
{ "swagger": "2.0", "info" : { "title" : "Portal Metrics API", "version" : "4.3.1" }, "host": "PAPI_Portal_TSSG:9443", "basePath": "/TENANT_API_NAME/analytics/metrics/v1", "tags": [ { "name": "Hit Metric Apis", "description": "Provides hit metrics of Apis and Apps" }, { "name": "Latency Metric Apis", "description": "Provides latency metrics of Apis" }, { "name": "Error Metric Apis", "description": "Provides error metrics of Apis and Apps" }, { "name": "Usage Metric Apis", "description": "Provides Usage metrics" } ], "schemes": [ "https" ], "paths": { "/errors/{type}": { "get": { "tags": [ "Error Metric Apis" ], "summary": "Retrieves Error Metrics based on type parameter", "operationId": "getErrorMetricsUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "enum": [ "apis", "apps" ] }, { "name": "timerange", "in": "query", "description": "Request Time Period", "required": false, "type": "string", "default": "week", "enum": [ "hour", "day", "week", "month", "year", "custom" ] }, { "name": "startDate", "in": "query", "description": "Start Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "endDate", "in": "query", "description": "End Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "appIds", "in": "query", "description": "comma seperated app Ids", "required": false, "type": "string" }, { "name": "apiIds", "in": "query", "description": "comma seperated api Ids", "required": false, "type": "string" }, { "name": "proxyIds", "in": "query", "description": "comma seperated proxy (gateway server) Ids", "required": false, "type": "string" }, { "name": "buckets", "in": "query", "description": "Buckets. Available buckets: apis| apps| serviceErrors| policyErrors| methodType", "required": false, "type": "string", "enum": [ "apis", "apps", "serviceErrors", "policyErrors", "methodType" ] }, { "name": "sortorder", "in": "query", "description": "Sort Order for Bucketed entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Bucketed entries", "required": false, "type": "string", "default": "errors", "enum": [ "errors", "errorrate", "appName", "apiName" ] }, { "name": "limit", "in": "query", "description": "Number of Bucketed Results to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } }, "/errors/{type}/by-{timeAggregation}": { "get": { "tags": [ "Error Metric Apis" ], "summary": "Retrieves Error Metrics aggregated by time based on type parameter", "operationId": "getErrorMetricsByAggrUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "enum": [ "apis", "apps" ] }, { "name": "timeAggregation", "in": "path", "description": "Time Buckets", "required": true, "type": "string", "enum": [ "hour", "day", "month" ] }, { "name": "timerange", "in": "query", "description": "Request Time Period", "required": false, "type": "string", "default": "week", "enum": [ "hour", "day", "week", "month", "year", "custom" ] }, { "name": "startDate", "in": "query", "description": "Start Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "endDate", "in": "query", "description": "End Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "appIds", "in": "query", "description": "comma seperated app Ids", "required": false, "type": "string" }, { "name": "apiIds", "in": "query", "description": "comma seperated api Ids", "required": false, "type": "string" }, { "name": "proxyIds", "in": "query", "description": "comma seperated proxy (gateway server) Ids", "required": false, "type": "string" }, { "name": "buckets", "in": "query", "description": "Buckets. Available buckets: apis| apps| serviceErrors| policyErrors| methodType", "required": false, "type": "string", "enum": [ "apis", "apps", "serviceErrors", "policyErrors", "methodType" ] }, { "name": "sortorder", "in": "query", "description": "Sort Order for Bucketed entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Bucketed entries", "required": false, "type": "string", "default": "errors", "enum": [ "errors", "errorrate", "appName", "apiName" ] }, { "name": "limit", "in": "query", "description": "Number of Bucketed Results to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "errors": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "errorsTs": { "type": "array", "items": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "date": { "type": "string" }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } } } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } }, "/hits/{type}": { "get": { "tags": [ "Hit Metric Apis" ], "summary": "Retrieves Hit Metrics based on type parameter", "operationId": "getHitMetricsUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "enum": [ "apis", "apps" ] }, { "name": "timerange", "in": "query", "description": "Request Time Period", "required": false, "type": "string", "default": "week", "enum": [ "hour", "day", "week", "month", "year", "custom" ] }, { "name": "startDate", "in": "query", "description": "Start Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "endDate", "in": "query", "description": "End Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "appIds", "in": "query", "description": "comma seperated app Ids", "required": false, "type": "string" }, { "name": "apiIds", "in": "query", "description": "comma seperated api Ids", "required": false, "type": "string" }, { "name": "proxyIds", "in": "query", "description": "comma seperated proxy (gateway server) Ids", "required": false, "type": "string" }, { "name": "buckets", "in": "query", "description": "Comma separated buckets. Available buckets: apis, apps", "required": false, "type": "string" }, { "name": "sortorder", "in": "query", "description": "Sort Order for Bucketed entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Bucketed entries", "required": false, "type": "string", "default": "hits", "enum": [ "hits", "appName", "apiName" ] }, { "name": "limit", "in": "query", "description": "Number of Bucketed Results to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "hits": { "type": "integer", "format": "int64" } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } }, "/hits/{type}/by-{timeAggregation}": { "get": { "tags": [ "Hit Metric Apis" ], "summary": "Retrieves Hit Metrics based on type and aggregation parameter", "operationId": "getHitMetricsByAggrUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "enum": [ "apis", "apps" ] }, { "name": "timeAggregation", "in": "path", "description": "Time Buckets", "required": true, "type": "string", "enum": [ "hour", "day", "month" ] }, { "name": "timerange", "in": "query", "description": "Request Time Range", "required": false, "type": "string", "default": "week", "enum": [ "hour", "day", "week", "month", "year", "custom" ] }, { "name": "startDate", "in": "query", "description": "Start Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "endDate", "in": "query", "description": "End Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "appIds", "in": "query", "description": "comma seperated app Ids", "required": false, "type": "string" }, { "name": "apiIds", "in": "query", "description": "comma seperated api Ids", "required": false, "type": "string" }, { "name": "proxyIds", "in": "query", "description": "comma seperated proxy (gateway server) Ids", "required": false, "type": "string" }, { "name": "buckets", "in": "query", "description": "Comma separated buckets. Available buckets: apis, apps", "required": false, "type": "string" }, { "name": "sortorder", "in": "query", "description": "Sort Order for Bucketed entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Bucketed entries", "required": false, "type": "string", "default": "date", "enum": [ "date", "hits", "appName", "apiName" ] }, { "name": "limit", "in": "query", "description": "Number of Bucketed Results to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "hits": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "hits": { "type": "integer", "format": "int64" } } }, "hitsTs": { "type": "array", "items": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "date": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } }, "/latency/{type}": { "get": { "tags": [ "Latency Metric Apis" ], "summary": "Retrieves Latency Metrics based on type parameter", "operationId": "getLatencyMetricsUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "default": "apis", "enum": [ "apis" ] }, { "name": "timerange", "in": "query", "description": "Request Time Range", "required": false, "type": "string", "default": "week", "enum": [ "hour", "day", "week", "month", "year", "custom" ] }, { "name": "startDate", "in": "query", "description": "Start Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "endDate", "in": "query", "description": "End Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "apiIds", "in": "query", "description": "comma seperated api Ids", "required": false, "type": "string" }, { "name": "proxyIds", "in": "query", "description": "comma seperated proxy (gateway server) Ids", "required": false, "type": "string" }, { "name": "buckets", "in": "query", "description": "Buckets. Available buckets: apis", "required": false, "type": "string", "enum": [ "apis" ] }, { "name": "sortorder", "in": "query", "description": "Sort Order for Bucketed entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Bucketed entries", "required": false, "type": "string", "default": "avg", "enum": [ "avg", "min", "max", "apiName", "apiId" ] }, { "name": "limit", "in": "query", "description": "Number of Bucketed Results to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "stats", "in": "query", "description": "Comma separated stats. Avaliable stats: avg, min, max", "required": false, "type": "string" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "stats": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } }, "/latency/{type}/by-{timeAggregation}": { "get": { "tags": [ "Latency Metric Apis" ], "summary": "Retrieves Latency Metrics based on type and timeaggregation parameter", "operationId": "getLatencyMetricsByAggrUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "default": "apis", "enum": [ "apis" ] }, { "name": "timeAggregation", "in": "path", "description": "Time Buckets", "required": true, "type": "string", "enum": [ "hour", "day", "month", "hod", "dow" ] }, { "name": "timerange", "in": "query", "description": "Request Time Range", "required": false, "type": "string", "default": "week", "enum": [ "hour", "day", "week", "month", "year", "custom" ] }, { "name": "startDate", "in": "query", "description": "Start Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "endDate", "in": "query", "description": "End Date (yyyy-MM-dd)", "required": false, "type": "string" }, { "name": "proxyIds", "in": "query", "description": "comma seperated proxy (gateway server) Ids", "required": false, "type": "string" }, { "name": "apiIds", "in": "query", "description": "comma seperated api Ids", "required": false, "type": "string" }, { "name": "buckets", "in": "query", "description": "Buckets. Available buckets: apis", "required": false, "type": "string", "enum": [ "apis" ] }, { "name": "sortorder", "in": "query", "description": "Sort Order for Bucketed entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Bucketed entries. Applicable only to the stats selected.", "required": false, "type": "string", "default": "date", "enum": [ "date", "avg", "min", "max", "apiName", "apiId" ] }, { "name": "limit", "in": "query", "description": "Number of Bucketed Results to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "stats", "in": "query", "description": "Comma separated stats. Avaliable stats: avg, min, max", "required": false, "type": "string" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "latencies": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "latenciesTs": { "type": "array", "items": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "date": { "type": "string" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "stats": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } }, "/usage/{type}/plan": { "get": { "tags": [ "Usage Metric Apis" ], "summary": "Retrieves Usage Metrics of Organizations", "operationId": "getOrgUsageMetricsUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "type", "in": "path", "description": "Request Type", "required": true, "type": "string", "enum": [ "orgs" ] }, { "name": "planType", "in": "query", "description": "Plan Type", "required": false, "type": "string", "default": "monthly", "enum": [ "monthly", "daily" ] }, { "name": "timerange", "in": "query", "description": "Request Time Period. Should be used only with planType 'monthly'", "required": false, "type": "string", "enum": [ "week", "day", "month" ] }, { "name": "orgIds", "in": "query", "description": "comma seperated org Ids", "required": false, "type": "string" }, { "name": "sortorder", "in": "query", "description": "Sort Order for Usage Entries", "required": false, "type": "string", "default": "desc", "enum": [ "desc", "asc" ] }, { "name": "sortby", "in": "query", "description": "Sort Field for Usage Entries", "required": false, "type": "string", "default": "usage", "enum": [ "usage", "orgName", "orgId" ] }, { "name": "limit", "in": "query", "description": "Number of Usage Entries to be returned", "required": false, "type": "integer", "format": "int32" }, { "name": "APIM-OrgUuid", "in": "header", "description": "Org Id", "required": false, "type": "string" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "orgId": { "type": "string" }, "orgName": { "type": "string" }, "usage": { "type": "number", "format": "double" } } } }, "query": { "type": "object", "properties": { "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "orgIds": { "type": "string" }, "planType": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } } } } } } }, "definitions": { "Hits": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "hits": { "type": "integer", "format": "int64" } } }, "ErrorsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "LatencyRequestParams": { "type": "object", "properties": { "apiIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "stats": { "type": "string" }, "timerange": { "type": "string" } } }, "HitsBucket": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } }, "HitsTsEntry": { "type": "object", "properties": { "hits": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "hits": { "type": "integer", "format": "int64" } } }, "hitsTs": { "type": "array", "items": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "date": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } } } }, "ErrorsTsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "errors": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "errorsTs": { "type": "array", "items": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "date": { "type": "string" }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } } } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "ErrorsRequestParams": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "UsageRequestParams": { "type": "object", "properties": { "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "orgIds": { "type": "string" }, "planType": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "LatenciesTsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "latencies": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "latenciesTs": { "type": "array", "items": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "date": { "type": "string" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "stats": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "HitsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "hits": { "type": "integer", "format": "int64" } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "ErrorsBucket": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } }, "LatenciesTsEntry": { "type": "object", "properties": { "latencies": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "latenciesTs": { "type": "array", "items": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "date": { "type": "string" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } } } }, "HitsTsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "hits": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "hits": { "type": "integer", "format": "int64" } } }, "hitsTs": { "type": "array", "items": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "date": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "Usage": { "type": "object", "properties": { "orgId": { "type": "string" }, "orgName": { "type": "string" }, "usage": { "type": "number", "format": "double" } } }, "ExceptionResponse": { "type": "object", "properties": { "query": { "type": "object", "properties": {} }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "HitsTs": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } } }, "date": { "type": "string" }, "hits": { "type": "integer", "format": "int64" } } }, "LatenciesBucket": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "LatenciesResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "query": { "type": "object", "properties": { "apiIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "stats": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "ErrorsTsEntry": { "type": "object", "properties": { "errors": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "errorsTs": { "type": "array", "items": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "date": { "type": "string" }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } } } } }, "UsagesResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "orgId": { "type": "string" }, "orgName": { "type": "string" }, "usage": { "type": "number", "format": "double" } } } }, "query": { "type": "object", "properties": { "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "orgIds": { "type": "string" }, "planType": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "requestId": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" }, "respMsg": { "type": "string" } } }, "Errors": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "HitsRequestParams": { "type": "object", "properties": { "apiIds": { "type": "string" }, "appIds": { "type": "string" }, "buckets": { "type": "string" }, "endTimeGMT": { "type": "string" }, "limit": { "type": "string" }, "proxyIds": { "type": "string" }, "sortby": { "type": "string" }, "sortorder": { "type": "string" }, "startTimeGMT": { "type": "string" }, "timerange": { "type": "string" } } }, "Latencies": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } }, "ErrorsTs": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "appId": { "type": "string" }, "appName": { "type": "string" }, "authorizedFlag": { "type": "boolean" }, "errorDist": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" }, "methodType": { "type": "string" }, "respCode": { "type": "integer", "format": "int32" } } } }, "date": { "type": "string" }, "errorRate": { "type": "number", "format": "double" }, "errors": { "type": "integer", "format": "int64" } } }, "LatenciesTs": { "type": "object", "properties": { "avg": { "type": "number", "format": "double" }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "apiId": { "type": "string" }, "apiName": { "type": "string" }, "avg": { "type": "number", "format": "double" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } }, "date": { "type": "string" }, "max": { "type": "number", "format": "double" }, "min": { "type": "number", "format": "double" } } } } }