Skip to main content
Version: 2.7

SSH Client Commands

The SSH calls are specified as CommandInfo-nodes. Each command specifies:

  • Command id
  • Command name
  • Address
  • List arguments (input, inout and output)

Four types of commands are currently supported. These are documented below.

Command type SSH.Command

Address SSH.Command

Description This command executes a command on the SSH shell. Each command opens a separate connection to the shell and executes the command via this connection. This implementation is optimized for single commands.

Following arguments are necessary for this command:

NameDescriptionTypeData Type
CommandThe command as text which the plugin executes on the remote shell. As example: "ls -la"InputSystem.String
ResultThe content of the return value from the shellOutputSystem.String

Example

{
"Id": "0012A45C-E9FD-471E-8AD3-8BB85A33B186",
"Name": "Command",
"Type": "CommandNode",
"Address": "SSH.Command",
"Arguments": [
{
"Name": "Command",
"Type": "Input",
"DataType": "System.String"
},
{
"Name": "Result",
"Type": "Output",
"DataType": "System.String"
}
]
}

Command type SSH.OpenShell

Address SSH.OpenShell

Description This command opens a connection to a SSH shell. It is not possible to write any data to the shell with this command. This can be done with the associated command SSH.WriteToShell. Do not forget to close the shell with the command SSH.CloseShell. The implementation is optimized for sending several commands one after the other.

Following arguments are necessary for this command:

NameDescriptionTypeData Type
NameThe name of the shell connection.InputSystem.String
ExpectedEndExprThe expected end of the shell stream return value triggered by the commandInputSystem.String
SessionIdThe new id of the open sessionOutputSystem.Guid

Example

{
"Id": "A407B4F8-944E-4F81-8C6D-3F57CDA6C593",
"Name": "OpenShell",
"Type": "CommandNode",
"Address": "SSH.OpenShell",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String"
},
{
"Name": "ExpectedEndExpr",
"Type": "Input",
"DataType": "System.String"
},
{
"Name": "SessionId",
"Type": "Output",
"DataType": "System.Guid"
}
]
}

Command type SSH.WriteToShell

Address SSH.WriteToShell

Description This command writes commands to an open SSH shell. Before it can be called, it is necessary to open a shell with the command type SSH.OpenShell. The implementation is optimized for sending several commands one after the other.

Following arguments are necessary for this command:

NameDescriptionTypeData Type
SessionIdThe session id of the open shellInputSystem.Guid
CommandsArray of single commands. Each command element of the array is executed separately one after the other on the shell and a for each command a return value is awaitedInputSystem.String[]
TimeoutResponse timeout for all shell commands in millisecondsInputSystem.Int32
ExpectedEndExprThe expected end of the shell stream return value triggered by the commandInputSystem.String
ResultsContains for each command the content of the return value from the shellOutputSystem.String[]

Example

{
"Id": "8ED11001-6D7E-45A7-B24D-ED511A5FA6E8",
"Name": "WriteToShell",
"Type": "CommandNode",
"Address": "SSH.WriteToShell",
"Arguments": [
{
"Name": "SessionId",
"Type": "Input",
"DataType": "System.Guid"
},
{
"Name": "Commands",
"Type": "Input",
"DataType": "System.String[]"
},
{
"Name": "Timeout",
"Type": "Input",
"DataType": "System.Int32"
},
{
"Name": "ExpectedEndExpr",
"Type": "Input",
"DataType": "System.String"
},
{
"Name": "Results",
"Type": "Output",
"DataType": "System.String[]"
}
]
}

Command type SSH.CloseShell

Address SSH.CloseShell

Description This command closes a connection to a SSH shell. It is not possible to write any data to the shell with this command.

Following arguments are necessary for this command:

NameDescriptionTypeData Type
SessionIdThe session id of the open shellInputSystem.Guid

Example

{
"Id": "0AA0CD4A-EC8F-4CBD-8921-D0DFD7366B2F",
"Name": "CloseShell",
"Type": "CommandNode",
"Address": "SSH.CloseShell",
"Arguments": [
{
"Name": "SessionId",
"Type": "Input",
"DataType": "System.Guid"
}
]
}