diff --git a/docs/api.rst b/docs/api.rst --- a/docs/api.rst +++ b/docs/api.rst @@ -188,74 +188,6 @@ swh:1:rev:8d517bdfb57154b8a11d7f1682ecc0f79abf8e02 ... -.. http:get:: /graph/randomwalk/:src/:dst - - Performs a graph *random* traversal, i.e., picking one random successor - node at each hop, from source to destination (final destination node - included). - - :param string src: starting node specified as a SWHID - :param string dst: destination node, either as a node SWHID or a node type. - The traversal will stop at the first node encountered matching the - desired destination. - - :query string edges: edges types the traversal can follow; default to - ``"*"`` - :query string direction: direction in which graph edges will be followed; - can be either ``forward`` or ``backward``, default to ``forward`` - :query int limit: limit the number of nodes returned. You can use positive - numbers to get the first N results, or negative numbers to get the last - N results starting from the tail; - default to ``0``, meaning no limit. - :query integer max_edges: how many edges can be traversed during the visit; - default to 0 (not restricted) - :query string return_types: only return the nodes matching this type; - default to ``"*"`` - - :statuscode 200: success - :statuscode 400: invalid query string provided - :statuscode 404: starting node cannot be found - - **Example:** - - .. sourcecode:: http - - GET /graph/randomwalk/swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2/ori?direction=backward HTTP/1.1 - - Content-Type: text/plain - Transfer-Encoding: chunked - - .. sourcecode:: http - - HTTP/1.1 200 OK - - swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2 - swh:1:dir:8de8a8823a0780524529c94464ee6ef60b98e2ed - swh:1:dir:7146ea6cbd5ffbfec58cc8df5e0552da45e69cb7 - swh:1:rev:b12563e00026b48b817fd3532fc3df2db2a0f460 - swh:1:rev:13e8ebe80fb878bade776131e738d5772aa0ad1b - swh:1:rev:cb39b849f167c70c1f86d4356f02d1285d49ee13 - ... - swh:1:rev:ff70949f336593d6c59b18e4989edf24d7f0f254 - swh:1:snp:a511810642b7795e725033febdd82075064ed863 - swh:1:ori:98aa0e71f5c789b12673717a97f6e9fa20aa1161 - - **Limit example:** - - .. sourcecode:: http - - GET /graph/randomwalk/swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2/ori?direction=backward&limit=-2 HTTP/1.1 - - Content-Type: text/plain - Transfer-Encoding: chunked - - .. sourcecode:: http - - HTTP/1.1 200 OK - - swh:1:ori:98aa0e71f5c789b12673717a97f6e9fa20aa1161 - swh:1:snp:a511810642b7795e725033febdd82075064ed863 - Visit ~~~~~