REST Export API


Introduction

In the perfino UI, the data views have an export button that allows you to extract the displayed data in a machine-readable format for further processing.

Depending on the type of data, the supported formats are JSON, XML and CSV.

To automate external data analysis, as well as to hook up perfino to other monitoring systems, this manual export is impractical. In that case, you can use the REST export API instead.

By default, the REST API service is not made available. You can enable it by setting the "restApi" property in perfino.properties to a non-zero value. The protocol on the configured port is the same as that of the web server, i.e. either HTTPS or HTTP.

Once enabled you can make HTTP(S) calls to the configured port to retrieve recorded data. Just like in the web UI, you can request data for single VMs, or ask for cumulated data for a particular VM group.

Using the API

Access to the API is protected with basic HTTP authentication. This means that the password will only be encrypted when using HTTPS as the protocol. Since the API does not make any modifications, any configured user regardless of the access mode can export data with the REST API.

The returned format depends on the "Accept" header of the HTTP request. The following mime types are supported:

A call to the REST API consists of one or more URL segments, followed by a list of query parameters. For example, if the configured API port is 8500, a call to

https://localhost:8500/groups

lists all groups that are configured in perfino. The URL

https://localhost:8500/transactions/callTree?group=Demo%2FWeb&interval=10min

retrieves the call tree data for the VM group "Demo/Web" for the last 10 minutes. Note the URL-encoded forward slash in the group name.

All start and end times can be specified in milliseconds between the current time and midnight, January 1, 1970 UTC or in one of the following formats:

FormatExampleDescription
yyyy-MM-dd'T'HH:mm:ss.SSS
yyyy-MM-dd'T'HH:mm:ss
yyyy-MM-dd
2016-03-02T22:40:00.000
2016-03-02T22:40:00
2016-03-02
Date and time in the local time of the server. All shortened versions will be equal to providing zeros.
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
yyyy-MM-dd'T'HH:mm:ss'Z'
yyyy-MM-dd'Z'
2016-03-02T22:40:00.000Z
2016-03-02T22:40:00Z
2016-03-02Z
Date and time in UTC. All shortened versions will be equal to providing zeros.

API documentation

The following URLs are available: