{ "basePath": "/", "swaggerVersion": "1.1", "apiVersion": "0.1", "apis": [ { "operations": [ { "errorResponses": [ { "reason": "is returned if the graph was created successfully and waitForSync was true.

", "code": "201" }, { "reason": "is returned if the graph was created successfully and waitForSync was false.

", "code": "202" }, { "reason": "is returned if it failed. The response body contains an error document in this case.

Examples

", "code": "400" } ], "parameters": [ { "dataType": "Boolean", "paramType": "query", "required": false, "name": "waitForSync", "description": "Wait until document has been synced to disk.

" }, { "dataType": "Json", "paramType": "body", "required": true, "name": "graph", "description": "The call expects a JSON object as body with the following attributes: _key: The name of the new graph. vertices: The name of the vertices collection. edges: The name of the egde collection.

" } ], "notes": "Creates a new graph.

Returns an object with an attribute graph containing a list of all graph properties.

", "summary": "create graph", "httpMethod": "POST", "examples": "

shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/ <<EOF\n{ \n  \"_key\" : \"graph\", \n  \"vertices\" : \"vertices\", \n  \"edges\" : \"edges\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1334191157\n\n{ \n  \"graph\" : { \n    \"_id\" : \"_graphs/graph\", \n    \"_key\" : \"graph\", \n    \"_rev\" : \"1334191157\", \n    \"edgeDefinitions\" : [ \n      { \n        \"collection\" : \"edges\", \n        \"from\" : [ \n          \"vertices\" \n        ], \n        \"to\" : [ \n          \"vertices\" \n        ] \n      } \n    ] \n  }, \n  \"error\" : false, \n  \"code\" : 202 \n}\n

", "nickname": "createGraph" } ], "path": "/_api/graph" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the graph was found (in case graph-name was specified) or the list of graphs was assembled successfully (in case graph-name was not specified).

", "code": "200" }, { "reason": "is returned if the graph was not found. This response code may only be returned if graph-name is specified in the request. The response body contains an error document in this case.

", "code": "404" }, { "reason": "\"If-None-Match\" header is given and the current graph has not a different version. This response code may only be returned if graph-name is specified in the request.

", "code": "304" }, { "reason": "\"If-Match\" header or rev is given and the current graph has a different version. This response code may only be returned if graph-name is specified in the request.

Examples

get graph by name

", "code": "412" } ], "parameters": [ { "dataType": "String", "paramType": "path", "required": false, "name": "graph-name", "description": "The name of the graph.

" }, { "dataType": "String", "paramType": "header", "name": "If-None-Match", "description": "If graph-name is specified, then this header can be used to check whether a specific graph has changed or not.

If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned if it has a different revision than the given etag. Otherwise a HTTP 304 is returned.

" }, { "dataType": "String", "paramType": "header", "name": "If-Match", "description": "If graph-name is specified, then this header can be used to check whether a specific graph has changed or not.

If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the etag in an attribute rev in the URL.

" } ], "notes": "

If graph-name is specified, returns an object with an attribute graph containing a JSON object with all properties of the specified graph.

If graph-name is not specified, returns a list of graph objects.

", "summary": "get the properties of a specific or all graphs", "httpMethod": "GET", "examples": "

shell> curl --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1335501877\n\n{ \n  \"graph\" : { \n    \"_id\" : \"_graphs/graph\", \n    \"_key\" : \"graph\", \n    \"_rev\" : \"1335501877\", \n    \"edgeDefinitions\" : [ \n      { \n        \"collection\" : \"edges\", \n        \"from\" : [ \n          \"vertices\" \n        ], \n        \"to\" : [ \n          \"vertices\" \n        ] \n      } \n    ] \n  }, \n  \"error\" : false, \n  \"code\" : 200 \n}\n



get all graphs



shell> curl --dump - http://localhost:8529/_api/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"graphs\" : [ \n    { \n      \"_id\" : \"_graphs/graph2\", \n      \"_key\" : \"graph2\", \n      \"_rev\" : \"1338188853\", \n      \"edgeDefinitions\" : [ \n        { \n          \"collection\" : \"edges2\", \n          \"from\" : [ \n            \"vertices2\" \n          ], \n          \"to\" : [ \n            \"vertices2\" \n          ] \n        } \n      ] \n    }, \n    { \n      \"_id\" : \"_graphs/graph1\", \n      \"_key\" : \"graph1\", \n      \"_rev\" : \"1337205813\", \n      \"edgeDefinitions\" : [ \n        { \n          \"collection\" : \"edges1\", \n          \"from\" : [ \n            \"vertices1\" \n          ], \n          \"to\" : [ \n            \"vertices1\" \n          ] \n        } \n      ] \n    } \n  ], \n  \"error\" : false, \n  \"code\" : 200 \n}\n

", "nickname": "getThePropertiesOfASpecificOrAllGraphs" } ], "path": "/_api/graph/{graph-name}" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the graph was deleted and waitForSync was true.

", "code": "200" }, { "reason": "is returned if the graph was deleted and waitForSync was false.

", "code": "202" }, { "reason": "is returned if the graph was not found. The response body contains an error document in this case.

", "code": "404" }, { "reason": "\"If-Match\" header or rev is given and the current graph has a different version

Examples

delete graph by name

", "code": "412" } ], "parameters": [ { "dataType": "String", "paramType": "path", "required": true, "name": "graph-name", "description": "The name of the graph

" }, { "dataType": "String", "paramType": "header", "name": "If-Match", "description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the etag in an attribute rev in the URL.

" } ], "notes": "Deletes graph, edges and vertices

", "summary": "delete graph", "httpMethod": "DELETE", "examples": "

shell> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"deleted\" : true, \n  \"error\" : false, \n  \"code\" : 202 \n}\n

", "nickname": "deleteGraph" } ], "path": "/_api/graph/{graph-name}" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the graph was created successfully and waitForSync was true.

", "code": "201" }, { "reason": "is returned if the graph was created successfully and waitForSync was false.

Examples

", "code": "202" } ], "parameters": [ { "dataType": "String", "paramType": "path", "required": true, "name": "graph-name", "description": "The name of the graph

" }, { "dataType": "Boolean", "paramType": "query", "required": false, "name": "waitForSync", "description": "Wait until document has been sync to disk.

" }, { "dataType": "Json", "paramType": "body", "required": true, "name": "vertex", "description": "The call expects a JSON object as body with the vertex properties: