Execute command (synchronous)
computers.exec.sync(strid, ExecSyncParams**kwargs) -> ExecSyncResponse
POST/computers/{id}/exec/sync
Execute a shell command and wait for completion, returning buffered stdout/stderr.
Parameters
id: str
command: Optional[str]
cwd: Optional[str]
env: Optional[Dict[str, str]]
timeout_seconds: Optional[int]
Returns
Execute command (synchronous)
import os
from tzafon import Lightcone
client = Lightcone(
api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
)
response = client.computers.exec.sync(
id="id",
)
print(response.exit_code){
"exit_code": 0,
"stderr": "stderr",
"stdout": "stdout"
}Returns Examples
{
"exit_code": 0,
"stderr": "stderr",
"stdout": "stdout"
}