summaryrefslogtreecommitdiffstats
path: root/docs/AAI REST API Documentation/recentsApi.rst
blob: f0f65c3f5ced9f7dc750cd41190467b633903ab0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.. contents::
   :depth: 3
..
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

AAI Recents API
===============

Recents API Overview
--------------------

The Recents API will allow a client to get the list of objects that
has been created or updated recently, up to a maximum of 1 week back.
This API is accessed through the NARAD Rest Interface, utilizing the
same certificates and headers.

Request
-------

The API can be accessed by using sending a GET request to the Recents
API and sending a single node-type and a parameter to specify either
timestamp to start the search or the number of hours to look back.
 
Querying with number of hours

.. code::

   GET /narad/recents/v$/{node-type}?hours={hours}

Querying with an epoch timestamp

.. code::

   GET /narad/v$/{node-type}?date-time={timestamp}

   Example:
   GET /narad/recents/v1/pnf?date-time=1531413113815

Response
--------

The Recents API sends a response in a new format, which includes the
object type, URI, and resource-version.

Sample response:

.. code-block:: json

  {
   "results": [
     {
       "resource-type": "pnf",
       "resource-link": "/narad/v1/network/pnfs/pnf/lab20105v"
       "resource-version": "1531413113815"
     },
     {
       "resource-type": "pnf",
       "resource-link": "/narad/v1/network/pnfs/pnf/ro-stack01"
       "resource-version": "1531413113612"
     },...]
  
 }