Updating Dublin docs
[aai/aai-common.git] / docs / AAI REST API Documentation / recentsApi.rst
1 .. contents::
2    :depth: 3
3 ..
4 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
5 .. http://creativecommons.org/licenses/by/4.0
6
7 AAI Recents API
8 ===============
9
10 Recents API Overview
11 --------------------
12
13 The Recents API will allow a client to get the list of objects that
14 has been created or updated recently, up to a maximum of 1 week back.
15 This API is accessed through the NARAD Rest Interface, utilizing the
16 same certificates and headers.
17
18 Request
19 -------
20
21 The API can be accessed by using sending a GET request to the Recents
22 API and sending a single node-type and a parameter to specify either
23 timestamp to start the search or the number of hours to look back.
24  
25 Querying with number of hours
26
27 .. code::
28
29    GET /narad/recents/v$/{node-type}?hours={hours}
30
31 Querying with an epoch timestamp
32
33 .. code::
34
35    GET /narad/v$/{node-type}?date-time={timestamp}
36
37    Example:
38    GET /narad/recents/v1/pnf?date-time=1531413113815
39
40 Response
41 --------
42
43 The Recents API sends a response in a new format, which includes the
44 object type, URI, and resource-version.
45
46 Sample response:
47
48 .. code-block:: json
49
50   {
51    "results": [
52      {
53        "resource-type": "pnf",
54        "resource-link": "/narad/v1/network/pnfs/pnf/lab20105v"
55        "resource-version": "1531413113815"
56      },
57      {
58        "resource-type": "pnf",
59        "resource-link": "/narad/v1/network/pnfs/pnf/ro-stack01"
60        "resource-version": "1531413113612"
61      },...]
62   
63  }