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
.
API Explorer is only accessible through the API Portal/Ingress tenant.
To try out the API in the API Portal using Swagger UI:
  1. Log in to the API Portal as a Portal administrator.
  2. Navigate to
    Publish > APIs
    .
  3. Select the API you wish to view. The
    API Details
    page opens.
  4. Click the
    Spec
    tab to open the Swagger UI.
  5. Ensure your session is authorized.
    If applicable, the
    Padlock
    button next to your selected endpoint indicates whether an endpoint is locked. If required, authorize your session by clicking the
    Padlock
    button and completing the information required in the
    Authorization
    window.
  6. Expand your selected endpoint, and click
    Try it out
    .
  7. The example values in the
    Request Body
    field becomes editable. Make changes to the example request, and click
    Execute
    .
Authentication
All API calls require a valid OAuth token.
Example
Download a sample Swagger JSON file from here.
alpha
{ "basePath" : "/apimdemo/analytics/metrics/v1", "definitions" : { "BadRequest" : { "properties" : { "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } }, "example" : { "requestId" : "Gen-bbe12799-9e1f-4b66-84a0-1fb0c3937c25", "respCode" : 16004, "respMsg" : "Missing/Invalid request parameter value" } }, "Errors" : { "type" : "object", "properties" : { "buckets" : { "items" : { "$ref" : "#/definitions/ErrorsBucket" }, "type" : "array" }, "errorRate" : { "format" : "double", "type" : "number" }, "errors" : { "format" : "int64", "type" : "integer" } } }, "ErrorsBucket" : { "type" : "object", "properties" : { "apiId" : { "type" : "string" }, "appId" : { "type" : "string" }, "authorizedFlag" : { "type" : "boolean" }, "errorDist" : { "format" : "double", "type" : "number" }, "errorRate" : { "format" : "double", "type" : "number" }, "errors" : { "format" : "int64", "type" : "integer" }, "methodType" : { "type" : "string" }, "orgId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" } } }, "ErrorsRequestParams" : { "type" : "object", "properties" : { "apiIds" : { "type" : "string" }, "appIds" : { "type" : "string" }, "buckets" : { "type" : "string" }, "endTimeGMT" : { "type" : "string" }, "limit" : { "type" : "string" }, "orgIds" : { "type" : "string" }, "proxyIds" : { "type" : "string" }, "sortby" : { "type" : "string" }, "sortorder" : { "type" : "string" }, "startTimeGMT" : { "type" : "string" }, "timerange" : { "type" : "string" } } }, "ErrorsResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/Errors" }, "query" : { "$ref" : "#/definitions/ErrorsRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "ErrorsTs" : { "type" : "object", "properties" : { "buckets" : { "items" : { "$ref" : "#/definitions/ErrorsBucket" }, "type" : "array" }, "date" : { "type" : "string" }, "errorRate" : { "format" : "double", "type" : "number" }, "errors" : { "format" : "int64", "type" : "integer" } } }, "ErrorsTsEntry" : { "type" : "object", "properties" : { "errors" : { "$ref" : "#/definitions/Errors" }, "errorsTs" : { "items" : { "$ref" : "#/definitions/ErrorsTs" }, "type" : "array" } } }, "ErrorsTsResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/ErrorsTsEntry" }, "query" : { "$ref" : "#/definitions/ErrorsRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "ExceptionResponse" : { "type" : "object", "properties" : { "errorMessages" : { "additionalProperties" : { "type" : "string" }, "type" : "object" }, "query" : { "properties" : { }, "type" : "object" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "Hits" : { "type" : "object", "properties" : { "buckets" : { "items" : { "$ref" : "#/definitions/HitsBucket" }, "type" : "array" }, "hits" : { "format" : "int64", "type" : "integer" } } }, "HitsBucket" : { "type" : "object", "properties" : { "apiId" : { "type" : "string" }, "appId" : { "type" : "string" }, "hits" : { "format" : "int64", "type" : "integer" }, "orgId" : { "type" : "string" } } }, "HitsRequestParams" : { "type" : "object", "properties" : { "apiIds" : { "type" : "string" }, "appIds" : { "type" : "string" }, "buckets" : { "type" : "string" }, "endTimeGMT" : { "type" : "string" }, "limit" : { "type" : "string" }, "orgIds" : { "type" : "string" }, "proxyIds" : { "type" : "string" }, "sortby" : { "type" : "string" }, "sortorder" : { "type" : "string" }, "startTimeGMT" : { "type" : "string" }, "timerange" : { "type" : "string" } } }, "HitsResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/Hits" }, "query" : { "$ref" : "#/definitions/HitsRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "HitsTs" : { "type" : "object", "properties" : { "buckets" : { "items" : { "$ref" : "#/definitions/HitsBucket" }, "type" : "array" }, "date" : { "type" : "string" }, "hits" : { "format" : "int64", "type" : "integer" } } }, "HitsTsEntry" : { "type" : "object", "properties" : { "hits" : { "$ref" : "#/definitions/Hits" }, "hitsTs" : { "items" : { "$ref" : "#/definitions/HitsTs" }, "type" : "array" } } }, "HitsTsResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/HitsTsEntry" }, "query" : { "$ref" : "#/definitions/HitsRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "Latencies" : { "type" : "object", "properties" : { "avg" : { "format" : "double", "type" : "number" }, "buckets" : { "items" : { "$ref" : "#/definitions/LatenciesBucket" }, "type" : "array" }, "max" : { "format" : "double", "type" : "number" }, "min" : { "format" : "double", "type" : "number" } } }, "LatenciesBucket" : { "type" : "object", "properties" : { "apiId" : { "type" : "string" }, "appId" : { "type" : "string" }, "avg" : { "format" : "double", "type" : "number" }, "max" : { "format" : "double", "type" : "number" }, "min" : { "format" : "double", "type" : "number" }, "orgId" : { "type" : "string" } } }, "LatenciesResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/Latencies" }, "query" : { "$ref" : "#/definitions/LatencyRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "LatenciesTs" : { "type" : "object", "properties" : { "avg" : { "format" : "double", "type" : "number" }, "buckets" : { "items" : { "$ref" : "#/definitions/LatenciesBucket" }, "type" : "array" }, "date" : { "type" : "string" }, "max" : { "format" : "double", "type" : "number" }, "min" : { "format" : "double", "type" : "number" } } }, "LatenciesTsEntry" : { "type" : "object", "properties" : { "latencies" : { "$ref" : "#/definitions/Latencies" }, "latenciesTs" : { "items" : { "$ref" : "#/definitions/LatenciesTs" }, "type" : "array" } } }, "LatenciesTsResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/LatenciesTsEntry" }, "query" : { "$ref" : "#/definitions/LatencyRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "LatencyRequestParams" : { "type" : "object", "properties" : { "apiIds" : { "type" : "string" }, "appIds" : { "type" : "string" }, "buckets" : { "type" : "string" }, "endTimeGMT" : { "type" : "string" }, "limit" : { "type" : "string" }, "orgIds" : { "type" : "string" }, "proxyIds" : { "type" : "string" }, "sortby" : { "type" : "string" }, "sortorder" : { "type" : "string" }, "startTimeGMT" : { "type" : "string" }, "stats" : { "type" : "string" }, "timerange" : { "type" : "string" } } }, "MetricsRequest" : { "properties" : { "filter" : { "description" : "Add one or more filters on dimensions.<br> Supported filters are <br> <b> &nbsp;&nbsp; and,or </b>logical AND,OR expression on dimension <br> &nbsp;&nbsp; <b> in </b>allows to specify multiple values for a dimension <br> &nbsp;&nbsp; <b> bound </b> used to filter on ranges of dimension values specify lower,upper bound values. <br> &nbsp;&nbsp; <b> regex </b> matches the specified dimension with the given pattern.", "properties" : { "fields" : { "properties" : { "dimension" : { "type" : "string" }, "lower" : { "type" : "string" }, "lowerStrict" : { "type" : "string" }, "pattern" : { "type" : "string" }, "type" : { "type" : "string" }, "upper" : { "type" : "string" }, "upperStrict" : { "type" : "string" }, "value" : { "type" : "string" } }, "type" : "object" } }, "type" : "object" }, "groupBy" : { "description" : "Groupby the metrics data based on dimension.<br> Supported values are <br> &nbsp;&nbsp; <b>default </b> group metrics data by name <br> &nbsp;&nbsp; <b>top </b> get top n results specified by limit field <br> &nbsp;&nbsp; <b>range </b> group metrics data by range by specifying lower and upper range <br> &nbsp;&nbsp; <b>pattern </b> group metrics data by regex pattern <br>&nbsp;&nbsp;&nbsp;&nbsp;<b>[d] </b> - any number,can be placed anywhere in the pattern /portal/api/[d],/porta/api[d]/test <br>&nbsp;&nbsp;&nbsp;&nbsp;<b>[w]</b> - any word, can be place anywhere in the pattern eg/portal/[w]/test <br> &nbsp;&nbsp;&nbsp;&nbsp;<b>[x]</b> - matches for anything. This placeholder can be put only at the end of the pattern eg /portal/api/[x]", "properties" : { "dimension" : { "type" : "string" }, "limit" : { "type" : "string" }, "pattern" : { "type" : "string" }, "type" : { "type" : "string" } }, "type" : "object" }, "metrics" : { "description" : "Fetch hits/latency metrics with aggregation.<br>Supported values:<br> &nbsp;&nbsp; Metric type <b>hits </b> with aggregation <b> count </b> <br> &nbsp;&nbsp; Metric type <b>latency </b> with aggregation <b> avg </b> .", "properties" : { "aggregation" : { "type" : "string" }, "type" : { "type" : "string" } }, "required" : [ "aggregation", "type" ], "type" : "object" }, "timeRange" : { "description" : "TimeRange is used to specify the timerange and time based aggregation <br>Supported values: <br> &nbsp;&nbsp; <b>type</b> type of timerange period/interval <br> &nbsp;&nbsp; <b>period </b> xH, xD like 24H,7D <br>&nbsp;&nbsp; <b>interval</b> as startDate/endDate like 2019-11-01T00:00:00/2019-11-31T:00:00:00 in GMT <br> &nbsp;&nbsp; <b>aggregation</b> Aggregate data by time. Supported aggregations are hour,day,week,month", "properties" : { "aggregation" : { "type" : "string" }, "interval" : { "type" : "string" }, "period" : { "type" : "string" }, "type" : { "type" : "string" } }, "required" : [ "aggregation", "interval", "period", "type" ], "type" : "object" } }, "example" : { "filter" : { "fields" : [ { "dimension" : "apiId", "type" : "in", "values" : [ "apiId1", "apiId2" ] }, { "dimension" : "appId", "type" : "selector", "value" : "appId1" }, { "dimension" : "respCode", "lower" : 200, "lowerStrict" : false, "type" : "bound", "upper" : 600, "upperStrict" : true } ], "type" : "and" }, "groupBy" : [ { "dimension" : "apiId", "type" : "default" }, { "dimension" : "appId", "limit" : 3, "type" : "top" }, { "dimension" : "uri", "patterns" : [ { "name" : "Accounts", "type" : "regex", "value" : "/accounts/[x]" } ], "type" : "pattern" } ], "metrics" : { "aggregation" : "count", "type" : "hits" }, "timeRange" : { "aggregation" : "day", "period" : "7D", "type" : "period" } } }, "MetricsResponse" : { "properties" : { "data" : { "properties" : { "apiId" : { "type" : "string" }, "apiName" : { "type" : "string" }, "appId" : { "type" : "string" }, "appName" : { "type" : "string" }, "buckets" : { "properties" : { "date" : { "type" : "string" } }, "type" : "object" }, "gatewayServerId" : { "type" : "string" }, "gatewayServerName" : { "type" : "string" }, "orgId" : { "type" : "string" }, "orgName" : { "type" : "string" }, "respCode" : { "type" : "string" }, "uri" : { "type" : "string" } }, "type" : "object" }, "query" : { "properties" : { "aggregation" : { "type" : "string" }, "endDate" : { "type" : "string" }, "period" : { "type" : "string" }, "startDate" : { "type" : "string" } }, "type" : "object" } } }, "Usage" : { "type" : "object", "properties" : { "buckets" : { "items" : { "$ref" : "#/definitions/UsageBucket" }, "type" : "array" }, "dailyQuota" : { "format" : "int64", "type" : "integer" }, "hits" : { "format" : "double", "type" : "number" }, "monthlyQuota" : { "format" : "int64", "type" : "integer" }, "orgId" : { "type" : "string" }, "orgName" : { "type" : "string" }, "usage" : { "format" : "double", "type" : "number" } } }, "UsageBucket" : { "type" : "object", "properties" : { "apiId" : { "type" : "string" }, "appId" : { "type" : "string" }, "hits" : { "format" : "double", "type" : "number" }, "orgId" : { "type" : "string" }, "usage" : { "format" : "double", "type" : "number" } } }, "UsageRequestParams" : { "type" : "object", "properties" : { "apiIds" : { "type" : "string" }, "appIds" : { "type" : "string" }, "endTimeGMT" : { "type" : "string" }, "limit" : { "type" : "string" }, "orgIds" : { "type" : "string" }, "planType" : { "type" : "string" }, "sortby" : { "type" : "string" }, "sortorder" : { "type" : "string" }, "startTimeGMT" : { "type" : "string" }, "timerange" : { "type" : "string" } } }, "UsageTs" : { "type" : "object", "properties" : { "date" : { "type" : "string" }, "usage" : { "items" : { "$ref" : "#/definitions/Usage" }, "type" : "array" } } }, "UsageTsEntry" : { "type" : "object", "properties" : { "usage" : { "items" : { "$ref" : "#/definitions/Usage" }, "type" : "array" }, "usageTs" : { "items" : { "$ref" : "#/definitions/UsageTs" }, "type" : "array" } } }, "UsageTsResponse" : { "type" : "object", "properties" : { "data" : { "$ref" : "#/definitions/UsageTsEntry" }, "query" : { "$ref" : "#/definitions/UsageRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } }, "UsagesResponse" : { "type" : "object", "properties" : { "data" : { "items" : { "$ref" : "#/definitions/Usage" }, "type" : "array" }, "query" : { "$ref" : "#/definitions/UsageRequestParams" }, "requestId" : { "type" : "string" }, "respCode" : { "format" : "int32", "type" : "integer" }, "respMsg" : { "type" : "string" } } } }, "host" : "apim-ssg.ca.com:9443", "info" : { "title" : "", "version" : "" }, "paths" : { "/_query" : { "post" : { "consumes" : [ "application/json;charset=UTF-8" ], "description" : "Portal captures a plethora of Analytics related metrics. These metrics are further sieved to derive valuable insights that help users understand the adoption and performance details of their entities(dimensions). This generic API helps users fetch these insights. Broadly, every insight consists of a metric, a set of filters, and a set of bucketed fields(groupBy fields). The query(request body) needs to be populated as per need and the response is served based on query input. The hence derived insights can represent either a trend(time-based) or a wholistic picture of entities. For more details regarding the usage of the API, refer link.", "operationId" : "getMetricsUsingPOST", "parameters" : [ { "name" : "APIM-OrgUuid", "in" : "header", "description" : "APIM-OrgUuid", "required" : false, "type" : "string" }, { "description" : "Metrics query", "in" : "body", "name" : "body", "required" : true, "schema" : { "$ref" : "#/definitions/MetricsRequest" } } ], "responses" : { "200" : { "description" : "Created", "examples" : { "application/json" : { "data" : [ { "apiId" : "3e742ee8-1241-4a9b-91e7-0e9dda1ec970", "apiName" : "api1", "appId" : "67c9b1cc-b0f3-4fd0-9d77-1186e8f9730c", "appName" : "app1", "buckets" : { "count" : 26803, "date" : "2020-02-18T00:00:00.000Z" }, "count" : 155132, "uri" : "/accounts/v1/2/transactions/2" }, { "apiId" : "3e87dc9a-b59f-4ef3-88a0-21576df5bbb4", "apiName" : "test", "appId" : "67c9b1cc-b0f3-4fd0-9d77-1186e8f9730c", "appName" : "testApp", "buckets" : [ { "count" : 19938, "date" : "2020-02-16T00:00:00.000Z" }, { "count" : 29135, "date" : "2020-02-15T00:00:00.000Z" } ], "count" : 49073, "uri" : "/users/v1" } ], "query" : { "aggregation" : "day", "endDate" : "2020-02-25T16:39:47", "period" : "7D", "startDate" : "2020-02-19T00:00:00" } } }, "schema" : { "$ref" : "#/definitions/MetricsResponse" } }, "400" : { "description" : "Invalid request.", "schema" : { "$ref" : "#/definitions/BadRequest" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieve portal metrics based on input query", "tags" : [ "Metrics Query API" ] }, "parameters" : [ ] }, "/errors/{type}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getErrorMetricsUsingGET", "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" : "orgIds", "in" : "query", "description" : "comma seperated org 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| orgs| serviceErrors| policyErrors| methodType", "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" : "errors", "enum" : [ "errors", "errorRate", "errorDist", "appName", "apiName", "orgName" ] }, { "name" : "limit", "in" : "query", "description" : "Comma separated limits. Number of Bucketed Results to be returned", "required" : false, "type" : "string" }, { "name" : "stats", "in" : "query", "description" : "Avaliable stats: errorRate, errorDist", "required" : false, "type" : "string" }, { "name" : "APIM-OrgUuid", "in" : "header", "description" : "Org Id", "required" : false, "type" : "string" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/ErrorsResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Error Metrics based on type parameter", "tags" : [ "Error Metric Apis" ] }, "parameters" : [ ] }, "/errors/{type}/by-{timeAggregation}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getErrorMetricsByAggrUsingGET", "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", "default" : "day", "enum" : [ "minute", "hour", "day", "week", "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" : "orgIds", "in" : "query", "description" : "comma seperated org 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| orgs| serviceErrors| policyErrors| methodType", "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" : "errors", "enum" : [ "date", "errors", "errorRate", "errorDist", "appName", "apiName" ] }, { "name" : "limit", "in" : "query", "description" : "Comma separated limits. Number of Bucketed Results to be returned", "required" : false, "type" : "string" }, { "name" : "stats", "in" : "query", "description" : "Avaliable stats: errorRate, errorDist", "required" : false, "type" : "string" }, { "name" : "APIM-OrgUuid", "in" : "header", "description" : "Org Id", "required" : false, "type" : "string" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/ErrorsTsResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Error Metrics aggregated by time based on type parameter", "tags" : [ "Error Metric Apis" ] }, "parameters" : [ ] }, "/hits/{type}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getHitMetricsUsingGET", "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" : "orgIds", "in" : "query", "description" : "comma seperated org 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, orgs", "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" : "Comma separated limits. Number of Bucketed Results to be returned", "required" : false, "type" : "string" }, { "name" : "APIM-OrgUuid", "in" : "header", "description" : "Org Id", "required" : false, "type" : "string" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/HitsResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Hit Metrics based on type parameter", "tags" : [ "Hit Metric Apis" ] }, "parameters" : [ ] }, "/hits/{type}/by-{timeAggregation}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getHitMetricsByAggrUsingGET", "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", "default" : "day", "enum" : [ "minute", "hour", "day", "week", "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" : "orgIds", "in" : "query", "description" : "comma seperated org 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, org", "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" : "Comma separated limits. Number of Bucketed Results to be returned", "required" : false, "type" : "string" }, { "name" : "APIM-OrgUuid", "in" : "header", "description" : "Org Id", "required" : false, "type" : "string" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/HitsTsResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Hit Metrics based on type and aggregation parameter", "tags" : [ "Hit Metric Apis" ] }, "parameters" : [ ] }, "/latency/{type}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getLatencyMetricsUsingGET", "parameters" : [ { "name" : "type", "in" : "path", "description" : "Request Type", "required" : true, "type" : "string", "default" : "apis", "enum" : [ "apis", "apps" ] }, { "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" : "appIds", "in" : "query", "description" : "comma seperated app Ids", "required" : false, "type" : "string" }, { "name" : "orgIds", "in" : "query", "description" : "comma seperated org 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, orgs", "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" : "avg", "enum" : [ "avg", "min", "max", "apiName", "apiId" ] }, { "name" : "limit", "in" : "query", "description" : "Comma separated limits. Number of Bucketed Results to be returned", "required" : false, "type" : "string" }, { "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" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/LatenciesResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Latency Metrics based on type parameter", "tags" : [ "Latency Metric Apis" ] }, "parameters" : [ ] }, "/latency/{type}/by-{timeAggregation}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getLatencyMetricsByAggrUsingGET", "parameters" : [ { "name" : "type", "in" : "path", "description" : "Request Type", "required" : true, "type" : "string", "default" : "apis", "enum" : [ "apis", "apps" ] }, { "name" : "timeAggregation", "in" : "path", "description" : "Time Buckets", "required" : true, "type" : "string", "default" : "day", "enum" : [ "minute", "hour", "day", "week", "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" : "appIds", "in" : "query", "description" : "comma seperated app Ids", "required" : false, "type" : "string" }, { "name" : "orgIds", "in" : "query", "description" : "comma seperated org Ids", "required" : false, "type" : "string" }, { "name" : "buckets", "in" : "query", "description" : "Buckets. Available buckets: apis, apps, orgs", "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. Applicable only to the stats selected.", "required" : false, "type" : "string", "default" : "date", "enum" : [ "date", "avg", "min", "max", "apiName", "apiId" ] }, { "name" : "limit", "in" : "query", "description" : "Comma separated limits. Number of Bucketed Results to be returned", "required" : false, "type" : "string" }, { "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" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/LatenciesTsResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Latency Metrics based on type and timeaggregation parameter", "tags" : [ "Latency Metric Apis" ] }, "parameters" : [ ] }, "/usage/{type}/plan" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getOrgUsageMetricsUsingGET", "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" : "apiIds", "in" : "query", "description" : "comma seperated api Ids", "required" : false, "type" : "string" }, { "name" : "appIds", "in" : "query", "description" : "comma seperated app 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" : "buckets", "in" : "query", "description" : "Comma separated buckets. Available buckets: apis, apps", "required" : false, "type" : "string" }, { "name" : "orgLimit", "in" : "query", "description" : "Number of Orgs to be returned", "required" : false, "type" : "integer", "format" : "int32" }, { "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" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/UsagesResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Usage Metrics of Organizations", "tags" : [ "Usage Metric Apis" ] }, "parameters" : [ ] }, "/usage/{type}/plan/by-{timeAggregation}" : { "get" : { "consumes" : [ "application/json" ], "operationId" : "getOrgUsageMetricsByTimeAggrUsingGET", "parameters" : [ { "name" : "type", "in" : "path", "description" : "Request Type", "required" : true, "type" : "string", "enum" : [ "orgs" ] }, { "name" : "timeAggregation", "in" : "path", "description" : "Time Interval", "required" : true, "type" : "string", "default" : "day", "enum" : [ "hour", "day", "week", "month" ] }, { "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", "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" : "orgIds", "in" : "query", "description" : "comma seperated org Ids", "required" : false, "type" : "string" }, { "name" : "apiIds", "in" : "query", "description" : "comma seperated api Ids", "required" : false, "type" : "string" }, { "name" : "appIds", "in" : "query", "description" : "comma seperated app 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 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" : [ "date", "usage", "orgName", "orgId" ] }, { "name" : "orgLimit", "in" : "query", "description" : "Number of Orgs to be returned", "required" : false, "type" : "integer", "format" : "int32" }, { "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" } ], "produces" : [ "application/json" ], "responses" : { "200" : { "description" : "Success", "schema" : { "$ref" : "#/definitions/UsagesResponse" } }, "400" : { "description" : "Bad Request", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } }, "500" : { "description" : "Internal Server Error", "schema" : { "$ref" : "#/definitions/ExceptionResponse" } } }, "security" : [ { "portal_oauth2" : [ ] } ], "summary" : "Retrieves Usage Metrics of Organizations", "tags" : [ "Usage Metric Apis" ] }, "parameters" : [ ] } }, "schemes" : [ "https" ], "securityDefinitions" : { "portal_oauth2" : { "flow" : "application", "tokenUrl" : "https://apim-ssg.ca.com:9443/auth/oauth/v2/token", "type" : "oauth2" } }, "swagger" : "2.0", "tags" : [ { "description" : "Provides hit metrics of Apis and Apps", "name" : "Hit Metric Apis" }, { "description" : "Provides latency metrics of Apis", "name" : "Latency Metric Apis" }, { "description" : "Provides error metrics of Apis and Apps", "name" : "Error Metric Apis" }, { "description" : "Provides Usage metrics", "name" : "Usage Metric Apis" }, { "description" : "Query Analytics Data", "name" : "Metrics Query API" } ] }