heaptree-logo
Heaptree

Run Command

Execute a shell command on a remote node

Signature

def run_command(node_id: str, command: str) -> ExecutionResponseWrapper

Parameters

  • node_id (str) – target node
  • command (str) – command to execute

Returns

ExecutionResponseWrapper with:

  • output – stdout text
  • error – stderr text (if any)
  • exit_code – process exit code
  • success – boolean convenience (exit_code == 0 and no error)
  • execution_time_seconds – time taken

Example

result = client.run_command(node_id, "ls -la")
print(result.output)

Exceptions

  • MissingCredentialsException
  • InternalServerErrorException