-
Notifications
You must be signed in to change notification settings - Fork 0
RexConnect Commands
Written for version 0.5.0. Notes:
- All RexConnect commands and arguments are case-sensitive.
- For simplicity, command examples below are shown without the required request wrapper.
RexConnect supports the following commands:
The query command executes a Gremlin script (with optional parameters).
The query command supports three arguments:
- String script (required): The Gremlin script.
- String params (optional): A parameter map in JSON format. Despite the
paramsJSON formatting, this argument should be written as a string within the overall request/command JSON data. - String cacheScript (optional): Use a value of "1" to make RexConnect cache this query's script. A numeric cache key will be provided with the command's response.
{
"cmd": "query",
"argList": [
{
"g.addVertex([TestId:x]);",
"{\\"x\\": 123}",
"1"
}
]
}# RexConnect> query
# ...script (0; string): g.addVertex([TestId:x]);
# ...params (1; string; opt): {"x":123}
# ...cacheScript (2; string; opt): 1
{"t":11,"k":99,"r":[{"_properties":{"TestId":123},"_id":"194844","_type":"vertex"}]}
The queryc command executes a cached script (with optional parameters).
The queryc command supports two arguments:
- String cacheKey (required): The numeric key that identifies the cached script.
- String params (optional): A parameter map in JSON format. Despite the
paramsJSON formatting, this argument should be written as a string within the overall request/command JSON data.
{
"cmd": "queryc",
"argList": [
{
"99",
"{\\"x\\": 123}"
}
]
}# RexConnect> queryc
# ...cacheKey (0; string): 99
# ...params (1; string; opt): {"x":123}
{"t":11,"r":[{"_properties":{"TestId":123},"_id":"194844","_type":"vertex"}]}
The session command performs actions related to RexPro sessions and session state. While a session is started/active, RexPro remembers that session's variables across independent requests/commands. Opened sessions should always closed.
A session also represents an open-ended transaction. Thus, all changes made will be lost upon close unless commit is called.
The session command supports one argument, "action".
- String action (required): The session-related action to perform. Accepted actions:
-
startopens a new session. -
closekills the current session. -
commitsaves the changes made during the session. -
rollbackreverts the changes made during the session.
-
{
"cmd": "session",
"argList": [
{
"start"
}
]
}# RexConnect> session
# ...action (0; string): start
{"timer":4,"results":["41f2336a-3f22-4de2-bd25-0378b84ab6ab"]}
The config command alters the default RexConnect configuration state for a particular request. Note that these configuration changes are not persisted across requests.
The config command supports two arguments, "setting" and "mode".
- String setting (required): The configuration setting to change. Accepted settings:
-
prettyspecifies whether the returned JSON uses "pretty" formatting. Accepted modes:-
0(default) disabled -
1enabled
-
-
debugspecifies whether to debugging information should be outputted. Accepted modes:-
0(default) disabled -
1enabled
-
-
- int mode (required): The mode value for the specified setting. Accepted modes are displayed above with their corresponding settings.
{
"cmd": "config",
"argList": [
{
"pretty",
"1"
}
]
}# RexConnect> config
# ...setting (0; string): pretty
# ...mode (1; int): 1
{
"timer": 0
}