{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the graph was created sucessfully and `waitForSync` was `true`. ",
"code": "201"
},
{
"reason": "is returned if the graph was created sucessfully and `waitForSync` was `false`. ",
"code": "202"
},
{
"reason": "is returned if it failed. The response body contains an error document in this case. ",
"code": "400"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "body",
"required": "false",
"name": "body",
"description": "A valid json document for your data, for instance {\"hello\": \"world\"}."
},
{
"dataType": "Boolean",
"paramType": "query",
"required": "false",
"name": "waitForSync",
"description": "Wait until document has been sync to disk. "
}
],
"notes": "Creates a new graph.
The call expects a JSON hash array 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.
Returns an object with an attribute graph containing a list of all graph properties.
",
"summary": "create graph",
"httpMethod": "POST",
"examples": "
> curl --data @- -X POST --dump - http://localhost:8529/_api/graph\n{\"_key\" : \"graph1\", \"vertices\" : \"v\", \"edges\" : \"e\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 11767958\n\n{\n \"graph\": {\n \"_id\": \"_graphs/graph1\",\n \"_rev\": \"11767958\",\n \"_key\": \"graph1\",\n \"vertices\": \"v\",\n \"edges\": \"e\"\n },\n \"error\": false,\n \"code\": 201\n}\n
> curl -X GET --dump - http://localhost:8529/_api/graph/graph1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 11767958\n\n{\n \"graph\": {\n \"_id\": \"_graphs/graph1\",\n \"_rev\": \"11767958\",\n \"_key\": \"graph1\",\n \"vertices\": \"v\",\n \"edges\": \"e\"\n },\n \"error\": false,\n \"code\": 200\n}\n
> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{\n \"deleted\": true,\n \"error\": false,\n \"code\": 200\n}\n
> curl --data @- -X POST --dump - http://localhost:8529/_api/graph/graph1/vertex\n{\"_key\" : \"v1\", \"optional1\" : \"val1\", \"optional2\" : \"val2\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 24332177\n\n{\n \"vertex\": {\n \"_id\": \"v/v1\",\n \"_rev\": \"24332177\",\n \"_key\": \"v1\",\n \"optional1\": \"val1\",\n \"optional2\": \"val2\"\n },\n \"error\": false,\n \"code\": 201\n}\n
> curl -X GET --dump - http://localhost:8529/_api/graph/graph1/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 24332177\n\n{\n \"vertex\": {\n \"_id\": \"v/v1\",\n \"_rev\": \"24332177\",\n \"_key\": \"v1\",\n \"optional1\": \"val1\",\n \"optional2\": \"val2\"\n },\n \"error\": false,\n \"code\": 200\n}\n
> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph1/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{\n \"deleted\": true,\n \"error\": false,\n \"code\": 200\n}\n
> curl --data @- -X PUT --dump - http://localhost:8529/_api/graph/graph1/vertex/v1\n{\"optional1\" : \"val2\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 24332190\n\n{\n \"vertex\": {\n \"_id\": \"v/v1\",\n \"_rev\": \"24332190\",\n \"_key\": \"v1\",\n \"optional1\": \"val2\"\n },\n \"error\": false,\n \"code\": 200\n}\n
> curl --data @- -X PATCH --dump - http://localhost:8529/_api/graph/graph1/vertex/v1\n{\"optional2\" : \"vertexPatch2\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 24332193\n\n{\n \"vertex\": {\n \"_id\": \"v/v1\",\n \"_rev\": \"24332193\",\n \"_key\": \"v1\",\n \"optional1\": \"val2\",\n \"optional2\": \"vertexPatch2\"\n },\n \"error\": false,\n \"code\": 200\n}\n\n> curl --data @- -X PATCH --dump - http://localhost:8529/_api/graph/graph1/vertex/v1?keepNull=false\n{\"optional2\" : null}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 24332199\n\n{\n \"vertex\": {\n \"_id\": \"v/v1\",\n \"_rev\": \"24332199\",\n \"_key\": \"v1\",\n \"optional1\": \"val2\"\n },\n \"error\": false,\n \"code\": 200\n}\n
> curl --data @- -X POST --dump - http://localhost:8529/_api/graph/graph1/edge\n{\"_key\" : \"edge1\", \"_from\" : \"vert2\", \"_to\" : \"vert1\", \"optional1\" : \"val1\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 57595366\n\n{\n \"edge\": {\n \"_id\": \"e/edge1\",\n \"_rev\": \"57595366\",\n \"_key\": \"edge1\",\n \"_from\": \"v/vert2\",\n \"_to\": \"v/vert1\",\n \"$label\": null,\n \"optional1\": \"val1\"\n },\n \"error\": false,\n \"code\": 201\n}\n
> curl -X GET --dump - http://localhost:8529/_api/graph/graph1/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 57595366\n\n{\n \"edge\": {\n \"_id\": \"e/edge1\",\n \"_rev\": \"57595366\",\n \"_key\": \"edge1\",\n \"_from\": \"v/vert2\",\n \"_to\": \"v/vert1\",\n \"$label\": null,\n \"optional1\": \"val1\"\n },\n \"error\": false,\n \"code\": 200\n}\n
> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph1/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{\n \"deleted\": true,\n \"error\": false,\n \"code\": 200\n}\n
> curl --data @- -X PUT --dump - http://localhost:8529/_api/graph/graph1/edge/edge1\n{\"optional2\" : \"val2\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 57595391\n\n{\n \"edge\": {\n \"_id\": \"e/edge1\",\n \"_rev\": \"57595391\",\n \"_key\": \"edge1\",\n \"_from\": \"v/vert2\",\n \"_to\": \"v/vert1\",\n \"$label\": null,\n \"optional2\": \"val2\"\n },\n \"error\": false,\n \"code\": 200\n}\n
> curl --data @- -X PATCH --dump - http://localhost:8529/_api/graph/graph1/edge/edge1\n{\"optional3\" : \"val3\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 57595398\n\n{\n \"edge\": {\n \"_id\": \"e/edge1\",\n \"_rev\": \"57595398\",\n \"_key\": \"edge1\",\n \"_from\": \"v/vert2\",\n \"_to\": \"v/vert1\",\n \"$label\": null,\n \"optional2\": \"val2\",\n \"optional3\": \"val3\"\n },\n \"error\": false,\n \"code\": 200\n}\n