Skip to content

Variable API

Variable REST API: Store and manage key-value pairs as global variables for graph-level configuration and state management.

5.1 Variables

Variables can be used to store data about the entire graph. The data is accessed and stored in the form of key-value pairs.

5.1.1 Creating or Updating a Key-Value Pair

Method & Url
1PUT http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/variables/name
Request Body
1{
2  "data": "tom"
3}
Response Status
1200
Response Body
1{
2    "name": "tom"
3}

5.1.2 Listing all key-value pairs

Method & Url
1GET http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/variables
Response Status
1200
Response Body
1{
2    "name": "tom"
3}

5.1.3 Listing a specific key-value pair

Method & Url
1GET http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/variables/name
Response Status
1200
Response Body
1{
2    "name": "tom"
3}

5.1.4 Deleting a specific key-value pair

Method & Url
1DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/variables/name
Response Status
1204