GET /api/apis/versions/{APIVersionID}/metrics/ranges

Returns a range of metric info for a specified API.

Authorization Roles/Permissions: Must be a user with Monitor permission for the API; an API Admin or Business Admin or an app developer who has a contract with the API.

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/apis/versions/{APIVersionID}/metrics/ranges

Back to top

Sample Request

The example below shows a request for ranges for a specific API version.

Request URL

https://{hostname}/api/apis/versions/apiversion400.acmepaymentscorp/metrics/ranges

Sample request headers

Accept: application/json
X-Csrf-Token_{tenant}: {TokenID}

Sample request body

Not applicable.

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept

application/json, text/xml

application/vnd.soa.v71+json, application/vnd.soa.v71+xml

application/vnd.soa.v72+json, application/vnd.soa.v72+xml

application/vnd.soa.v80+json, application/vnd.soa.v80+xml

application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
APIVersionID Path string Required The unique ID for a specific API version.
Environment Query string Required The environment (implementation) (Sandbox or Production). If not specified, defaults to Sandbox.
StartDate Query string Required The beginning point for the date range of metric information requested. Format: YYYY-MM-DD:THH:MM:SS. Example: StartDate=2011-01-01T11:55:22. If StartDate is not specified, the operation uses EndDate minus Duration. If both StartDate and EndDate are unspecified, the operation returns information for the Duration value, and if Duration is also unspecified it returns default Duration value of 2 hours.
EndDate Query string Required The ending point for the date range of metric information requested. Format: YYYY-MM-DD:THH:MM:SS. Example: EndDate=2011-01-02T11:55:22. If not specified, defaults to the current date/time of the API call.
TimeZone Query string Optional The time zone for the information. If a time zone isn't specified, the information is returned in GMT. For more information, refer to Working with Time Zones and Time Intervals.
TimeInterval Query string Optional The time interval for the metric information to be returned. For example, you might want data points every 10 seconds. If not specified, defaults to five-second intervals (5s). The StartDate, EndDate, and Duration fields work together to define the information to be returned; the TimeInterval determines the data points. For more information, refer to Working with Time Zones and Time Intervals.
Duration Query string Optional The duration for the metric information. For example, you might want metric information for a 24-hour period or only for an hour. If not specified, defaults to two hours (2h). The StartDate, EndDate, and Duration fields work together to define the information to be returned.

Back to top

Response

If successful, this operation returns HTTP status code 200, with the metric information for the specified API.

Back to top

Sample Response

The sample response below shows the metric information returned for a specific API version. In this example there is no activity.

Sample response headers: application/json

Status Code: 200 OK
Content-Type: application/json
Date: Thu, 09 May 2013 20:41:40 GMT

Sample response body: application/json

{
"StartTime": "2013-05-08T20:41:45Z",
"EndTime": "2013-05-09T20:41:45Z",
"Summary": {
"Metric": [
{
"Name": "tps",
"Value": 0
},
{
"Name": "eps",
"Value": 0
},
{
"Name": "avgResponseTime",
"Value": -1
}
],
"Duration": "P0Y0M1DT0H0M0.000S"
}
}

Back to top

Sample response headers: application/xml

Status Code: 200 OK
Content-Type: text/xml
Date: Thu, 09 May 2013 20:44:41 GMT

Sample response body: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Graph xmlns="http://soa.com/xsd/performance/1.0">
  <StartTime>2013-05-08T20:44:45Z</StartTime>
  <EndTime>2013-05-09T20:44:45Z</EndTime>
  <Summary Duration="P0Y0M1DT0H0M0.000S">
    <Metric>
      <Name>tps</Name>
      <Value>0</Value>
    </Metric>
    <Metric>
      <Name>eps</Name>
      <Value>0</Value>
    </Metric>
    <Metric>
      <Name>avgResponseTime</Name>
      <Value>-1</Value>
    </Metric>
  </Summary>
</Graph>

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type

application/json, text/xml

application/vnd.soa.v71+json, application/vnd.soa.v71+xml

application/vnd.soa.v72+json, application/vnd.soa.v72+xml

application/vnd.soa.v80+json, application/vnd.soa.v80+xml

application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Back to top

Response Body

Name Type Description
Response Graph Contains information about a graph showing metric information.

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics