Updating Dublin docs
[aai/aai-common.git] / docs / AAI REST API Documentation / recentsApi.rst
diff --git a/docs/AAI REST API Documentation/recentsApi.rst b/docs/AAI REST API Documentation/recentsApi.rst
new file mode 100644 (file)
index 0000000..f0f65c3
--- /dev/null
@@ -0,0 +1,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"
+     },...]
+  
+ }