The Format of List Resources

List resources like the /r/calls/recent resource are structures with the fields listed in Table 10-14:

Table 10-14 List Resources Fields

Field Description

data

The actual list. The format of the list item depends on the resource.

limit

The number of returned items.

start

The index of the first returned item.

total

The total number of items that exist.

All list resources allow paging. Paging is enabled by default and can be controlled by giving the start and limit GET parameters when requesting the resource. The start parameter gives the index of the first item to be returned, the limit parameter gives the number of items to be returned.

Note, that limit cannot exceed the value given in the vsp.rest.max_limit system setting and is adjusted if it does exceed this value. For the counter seconds, minutes and hours resource you can also give start_ts instead of start, meaning that the request will only return items with an associated timestamp that is greater or equal than the given timestamp.

Some list resources also allow filtering. Filtering is controlled by additional GET request parameters. A filter controlling parameter must have the form <fieldname>_<verb>, where <fieldname> is the name of a field of the list items of the resource and <verb> determines the logic of the filter. The known verbs and their meaning are listed in Table 10-15:

Table 10-15 List Resources Verbs

Verb Description

contains

This filter applies if the set valued field contains the set given. The parameter must be given as a list separated by '+'.

deq

This filter applies if the date contained in the field and the given date are equal.

The date must be given as "mm/dd/yyyy", where mm is the month, dd the day of the month and yyyy the year.

dgeq

This filter applies if the date contained in the field is younger or equal to the given date.

The date must be given as "mm/dd/yyyy", where mm is the month, dd the day of the month and yyyy the year.

dgt

This filter applies if the date contained in the field is younger than the date given in the parameter.

The date must be given as "mm/dd/yyyy", where mm is the month, dd the day of the month and yyyy the year.

dleq

This filter applies if the date contained in the field is older or equal to the given date.

The date must be given as "mm/dd/yyyy", where mm is the month, dd the day of the month and yyyy the year.

dlt

This filter applies if the date contained in the field is older.

The date must be given as "mm/dd/yyyy", where mm is the month, dd the day of the month and yyyy the year.

dteq

This filter applies if the date and time contained in the field is equal to the date and time given.

The date and time must be given as "yyyy/mm/dd HH:MM:SS", where yyyy is the year, mm the month, dd the day of the month, HH the hour, MM the minute and SS the second.

dtgeq

This filter applies if the date and time contained in the field is younger or equal to the date and time given.

The date and time must be given as "yyyy/mm/dd HH:MM:SS", where yyyy is the year, mm the month, dd the day of the month, HH the hour, MM the minute and SS the second.

dtgt

This filter applies if the date and time contained in the field is younger than the date and time given in the parameter.

The date and time must be given as "yyyy/mm/dd HH:MM:SS", where yyyy is the year, mm the month, dd the day of the month, HH the hour, MM the minute and SS the second.

dtleq

This filter applies if the date and time contained in the field is older or equal to the date and time given.

The date and time must be given as "yyyy/mm/dd HH:MM:SS", where yyyy is the year, mm the month, dd the day of the month, HH the hour, MM the minute and SS the second.

dtlt

This filter applies if the date and time contained in the field is older than the given date and time.

The date and time must be given as "yyyy/mm/dd HH:MM:SS", where yyyy is the year, mm the month, dd the day of the month, HH the hour, MM the minute and SS the second.

eq

This filter applies if the numeric value contained in the field is equal to the number given.

geq

This filter applies if the numeric value contained in the field is greater than or equal to the number given.

gt

This filter applies if the numeric value contained in the field is greater than the numeric value given in the parameter.

leq

This filter applies if the numeric value contained in the field is smaller than or equal to the number given.

lt

This filter applies if the numeric value contained in the field is smaller than the number given.

oneof

This filter applies if the value contained in the field is equal to one of the values given. The values must be given as a list separated by '+'.

substr

This filter applies if the value of the parameter is contained in the field.

In case the GET request parameters cannot be parsed, an HTTP 400 Bad Request status code is returned.