Changeset View
Changeset View
Standalone View
Standalone View
docs/api.rst
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | [ | ||||
"swh:1:rev:cea92e843e40452c08ba313abc39f59efbb4c29c", | "swh:1:rev:cea92e843e40452c08ba313abc39f59efbb4c29c", | ||||
"swh:1:rev:8d517bdfb57154b8a11d7f1682ecc0f79abf8e02", | "swh:1:rev:8d517bdfb57154b8a11d7f1682ecc0f79abf8e02", | ||||
... | ... | ||||
] | ] | ||||
Visit | Visit | ||||
----- | ----- | ||||
.. http:get:: /graph/visit/:src | |||||
.. http:get:: /graph/visit/nodes/:src | .. http:get:: /graph/visit/nodes/:src | ||||
.. http:get:: /graph/visit/paths/:src | .. http:get:: /graph/visit/paths/:src | ||||
Performs a graph traversal and returns explored nodes and/or paths (in the | Performs a graph traversal and returns explored nodes or paths (in the order | ||||
order of the traversal). | of the traversal). | ||||
:param string src: starting node specified as a SWH PID | :param string src: starting node specified as a SWH PID | ||||
:query string edges: edges types the traversal can follow; default to | :query string edges: edges types the traversal can follow; default to | ||||
``"*"`` | ``"*"`` | ||||
:query string direction: direction in which graph edges will be followed; | :query string direction: direction in which graph edges will be followed; | ||||
can be either ``forward`` or ``backward``, default to ``forward`` | can be either ``forward`` or ``backward``, default to ``forward`` | ||||
:statuscode 200: success | :statuscode 200: success | ||||
:statuscode 400: invalid query string provided | :statuscode 400: invalid query string provided | ||||
:statuscode 404: starting node cannot be found | :statuscode 404: starting node cannot be found | ||||
.. sourcecode:: http | .. sourcecode:: http | ||||
GET /graph/visit/ | |||||
HTTP/1.1 200 OK | |||||
Content-Type: application/json | |||||
{ | |||||
"paths": [ | |||||
[ | |||||
"swh:1:rev:f39d7d78b70e0f39facb1e4fab77ad3df5c52a35", | |||||
"swh:1:rev:52c90f2d32bfa7d6eccd66a56c44ace1f78fbadd", | |||||
... | |||||
], | |||||
[ | |||||
"swh:1:rev:f39d7d78b70e0f39facb1e4fab77ad3df5c52a35", | |||||
"swh:1:rev:a31e58e129f73ab5b04016330b13ed51fde7a961", | |||||
... | |||||
], | |||||
... | |||||
], | |||||
"nodes": [ | |||||
"swh:1:rev:f39d7d78b70e0f39facb1e4fab77ad3df5c52a35", | |||||
"swh:1:rev:52c90f2d32bfa7d6eccd66a56c44ace1f78fbadd", | |||||
... | |||||
"swh:1:rev:a31e58e129f73ab5b04016330b13ed51fde7a961", | |||||
... | |||||
] | |||||
} | |||||
.. sourcecode:: http | |||||
GET /graph/visit/nodes/ | GET /graph/visit/nodes/ | ||||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | ||||
Content-Type: application/json | Content-Type: application/json | ||||
[ | [ | ||||
"swh:1:rev:f39d7d78b70e0f39facb1e4fab77ad3df5c52a35", | "swh:1:rev:f39d7d78b70e0f39facb1e4fab77ad3df5c52a35", | ||||
"swh:1:rev:52c90f2d32bfa7d6eccd66a56c44ace1f78fbadd", | "swh:1:rev:52c90f2d32bfa7d6eccd66a56c44ace1f78fbadd", | ||||
... | ... | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |