SshHost

A host that runs the allowlisted read-only fact commands on a remote machine through the system ssh, started by base. It stores no credentials and never changes known_hosts. After a command fails because ssh did, problem holds why and every later command returns null at once.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var arch: String
Link copied to clipboard
open override val capabilities: Set<Capability>
Link copied to clipboard
open override var os: String
Link copied to clipboard
open override val platform: String
Link copied to clipboard

Functions

Link copied to clipboard

Null off Linux, without cgroup v2, or when none of the four counters can be read.

Link copied to clipboard
fun close()

Closes the shared connection and removes its private directory; safe to call twice.

Link copied to clipboard
open override fun env(): Map<String, String>
Link copied to clipboard
open fun facts(): List<Attribute>
Link copied to clipboard
open override fun readText(path: String): String?
Link copied to clipboard
open fun run(argv: List<String>, timeoutMillis: Long? = null, onOutput: (String) -> Unit): CommandResult?

Like run, but hands the merged output to onOutput while the process runs. The result carries the exit code and an empty output; the callback has seen all of it. Past timeoutMillis the child is killed and the result carries TIMED_OUT_EXIT_CODE. A host that can measure the child fills CommandResult.usage.

open override fun run(argv: List<String>): CommandResult?

Throws SshRefused for any command outside SshAllowlist.

Link copied to clipboard
open fun syncNanos(dir: String, rounds: Int): List<Long>?

Nanoseconds per write-and-fsync of a 4 KiB file in dir, or null when the host cannot.