Skip to content

API guide

skovzhaw edited this page Jul 1, 2016 · 45 revisions

Universal interface

All the core RCB Cyclops micro services offer the same HTTP RESTful API interface. You can rely on this structure to be always present, therefore you can write your own applications or visual interfaces on top of them, where it doesn't matter whether it is UDR, CDR or Billing micro service, as they all work in the same fashion.

Performant queries

In order to guarantee that all API queries are performant (based on administrator's wishes), all responses are paginated. Which means that if your query execution would contain 20'000 records, but administrator specified page size limit of 5'000, you will only get a subset of data. However, you will also see the following metadata:

  • displayedRecords - number of returned records
  • totalRecords - number of total records
  • pageNumber - what page are you looking at
  • pageSize - what is the page limit size

If you are running autoscaler or are scaling in/out containers, effectively spawning new instances on peak loads, you can easily parallelise these queries and ask for more than just one page at the time. You will still need to collect all the data for queries you want to execute manually and traverse all the pages, in order to have a guarantee that micro services will have desired performance.

Version

To see what version of the RCB Cyclops micro service you are running, visit this endpoint:

List

In case that you need to programatically access the list of currently supported endpoints:

Status

At any time you can request statistics about the individual micro services, telling you how many times a certain endpoint was queried, as well as what is the running average of latency in fulfilling certain API requests. Keep in mind that by accessing this statistics they get reseted and therefore start counting from zero again. You can use this to build an overall picture about the performance characterisation of your RCB Cyclops deployment.

Measurements

If you want to see the list of persisted measurements that are available to you, simply query:

In order to request a certain measurement to be displayed (with pagination support):

All the fields and tags you have stored for a particular measurement are accessible and you can utilise them in order to query for a specific subset of data, like for example an account like this:

You can easily combine them and slice data accordingly:

If you see that what you've received is just a first page of many, you can simply add page:

Clone this wiki locally