Run a snippet on a host over SSH
POST/plugin-api/snippets/execute
Needs no snippets.* permission beyond an accessible snippet and host - running one has never required a separate grant.
Request
Responses
- 200
- 400
- 404
- 409
- 422
- 500
- 502
- 504
Snippet ran. A nonzero exit is not an error here: success is false, exitCode holds the code (null if the host sent none) and output/error carry what the command printed.
Snippet ID and host ID are required, or the snippet is a note.
Snippet or host not found.
The host key was rejected (code SSH_HOST_KEY_REJECTED), usually because it changed. Open a Terminal connection to the host to verify and accept the new key.
Authentication to the host failed (code SSH_AUTH_FAILED), e.g. "Authentication failed for root@10.0.0.5".
Internal error.
The host could not be reached (code SSH_HOST_UNREACHABLE): connection refused or reset, host or network unreachable, or the hostname could not be resolved.
Timed out connecting to the host (code SSH_TIMEOUT), or the command ran past SNIPPET_EXECUTION_TIMEOUT_SECONDS (code COMMAND_TIMEOUT, with the output printed so far in output and errorOutput).