Session management commands
get connections
This command returns the list of connections to the current runtime instance, including local connections.
get connections
localhost:42200 > get connections
User Client Host Start Date Last Access Id
127.0.0.1 Fri Feb 02 11:25:40 CET 2024 Fri Feb 02 11:25:00 CET 2024
admin 127.0.0.1 Fri Feb 02 11:00:00 CET 2024 Fri Feb 02 11:00:00 CET 2024 460887c2-c633-4a54-b603-bb2fae3c6f20
admin 127.0.0.1 Fri Feb 02 11:00:00 CET 2024 Fri Feb 02 11:00:00 CET 2024 79a46934-1a30-40fe-b1aa-2b1ab56dd019
admin 127.0.0.1 Fri Feb 02 11:00:00 CET 2024 Fri Feb 02 11:25:00 CET 2024 17c1c546-b38c-445f-bce9-aa213dc3e599
get sessions
This command returns the list of sessions for the current runtime instance. The list includes sessions both from the runtime log database; as well as sessions actively running in-memory.
get sessions [name <name>]
[id <id1,id2,idn>]
[status <running,error,done,stopped>]
[duration <min>]
[to <max>]
[limit <limit>]
[format <format>]
Option | Mandatory | Description |
---|---|---|
|
No |
Session Name. |
|
No |
Comma-separated list of session IDs. |
|
No |
Filter sessions with this status: |
|
No |
Filter sessions with this minimum duration in milliseconds. |
|
No |
Filter sessions with this maximum duration in milliseconds. |
|
No |
Number of sessions to retrieve. |
|
No |
Defines the comma-separated list of columns to return in the output. The available columns are |
markInactiveSessionsAsDead
This command reviews the content of the sessions log database, and marks inactive sessions as dead.
Inactive sessions ar sessions with an inconsistent state. They can occur if the runtime stops abruptly while sessions are still active. You can purge these sessions using the purge keep
or schedule purge keep
commands, specifying the dead
status.
markInactiveSessionsAsDead
purge keep
This command purges the session logs.
You can also do this command on a schedule using the schedule purge keep
command.
purge keep <number> <minute|hour|day|session>
[sessionid <id1,id2,...>]
[sessionname <name,name2,...>]
[status <done,error,killed,dead>]
Option | Mandatory | Description |
---|---|---|
|
Yes |
Number of sessions, and length of session history, to keep in the log. |
|
No |
Comma-separated list of session IDs to purge. |
|
No |
Comma-separated list of session names to purge. |
|
No |
Comma-separated list of statuses that are okay to purge. |
purge keep 100 session
purge keep 0 session sessionid mySessionid
purge keep 5 session sessionname mySession status done
purge keep 3 day
restart session
This command restarts a given session.
restart session <id> [synch] [format <format>]
Option | Mandatory | Description |
---|---|---|
|
Yes |
ID of the session to restart. |
|
No |
Waits for the session to restart, then continues. By default, the command does not wait until the session restarts to proceed. |
|
No |
Defines the comma-separated list of columns to return in the output. This option only works in synch mode. The following columns are available:
'%name`, |
restart session c0a84b0b016716c58c17de7b2e8a75c9
Session: c0a84b0b016716c58c17de7b2e8a75c9 is restarted
restart session c0a84b0b016716c58c17de7b2e8a75c9 synch format %id,%status,%returncode
Session: c0a84b0b016716cadadf88fc29a8c399 is restarted...
c0a84b0b016716cadadf88fc29a8c399,ERROR,-1
schedule purge keep
This command schedules a purge of the session logs.
schedule purge keep <number> <minute|hour|day|session>
cron <cron_expression>
[sessionname <name,name2,...>]
[sessionid <id1,id2,...>]
[status <done,error,killed,dead>]
[on host <host_name>]
[port <host_port>]
Option | Mandatory | Description |
---|---|---|
|
Yes |
Number of sessions, and length of session history, to keep in the log. |
|
Yes |
Cron expression to run the schedule. |
|
No |
Comma-separated list of session IDs to purge. |
|
No |
Comma-separated list of session names to purge. |
|
No |
Comma-separated list of statuses that are okay to purge. |
|
No |
Hostname or address of the runtime host. If this option is not set, uses the connected runtime. |
|
No |
Runtime port. |
schedule purge keep 10 session cron "0 15 10 * * ? *"
stop session
This command sends a stop signal to a running session.
stop session <id> [synch] [format <format>]
Option | Mandatory | Description |
---|---|---|
|
Yes |
ID of the session to stop. |
|
No |
Waits for the session to stop before going back to the command line. |
|
No |
Defines the comma-separated list of columns to return in the output. This option only works in synch mode. The following columns are available:
|
stop session c0a84b0b016716c58c17de7b2e8a75c9
Sending a stop request to session c0a84b0b016716c58c17de7b2e8a75c9...
Stop request has been successfully sent to session c0a84b0b016716c58c17de7b2e8a75c9
stop session c0a84b0b016716c6b50bd39807324430 synch format %id,%status,%returncode
Sending a stop request to session c0a84b0b016716c6b50bd39807324430...
Session: c0a84b0b016716c6b50bd39807324430 is stopping...
c0a84b0b016716c6b50bd39807324430,STOPPED,-2
wait session
This command waits for a session to complete, and issue the session return code as the output.
wait session <id> [format <format>]
Option | Mandatory | Description |
---|---|---|
|
Yes |
Id of the session to wait for. |
|
No |
Defines the comma-separated list of status information to return in the output when the session ends. The following columns are available:
|
wait session c0a84b0b016716cdb01b379e2eddf9a3
1
wait session c0a84b0b016716c58c17de7b2e8a75c9 format %id,%status,%returncode
c0a84b0b016716c58c17de7b2e8a75c9,EXECUTED,1