Module Ketrew_host (.ml)

module Ketrew_host: sig .. end
Definition of a host; a place to run commands or handle files.

module Ssh: sig .. end
Definitions specific to “SSH” hosts (see Ketrew_host.connection).
type default_shell 
val default_shell_to_yojson : default_shell -> Yojson.Safe.json
val default_shell_of_yojson : Yojson.Safe.json -> [ `Error of string | `Ok of default_shell ]
Specification of the default shell of a Host.
type t 
val to_yojson : t -> Yojson.Safe.json
val of_yojson : Yojson.Safe.json -> [ `Error of string | `Ok of t ]
Host container.

A host is the current machine, or an SSH-accessed distant host. It may have a plaground: a directory where Ketrew can create runtime-files. It keeps track of a default-shell to use (the “default” default_shell, is ("sh", "-c")).

val default_shell : ?binary:string ->
?options:string list ->
?command_option:string -> string -> default_shell
Use default_shell ~binary:"/bin/sh" ~options:["-l"; "--something"; "blah" ] ~command_option:"-c" "sh" to define a default-shell calling "sh -l --something blah -c <command>".
val localhost : ?execution_timeout:Ketrew_pervasives.Time.t ->
?default_shell:default_shell ->
?playground:Ketrew_path.t -> ?name:string -> unit -> t
The host "localhost" (i.e. not over SSH).
val tmp_on_localhost : t
The host "localhost", with "/tmp" as playground.
val ssh : ?execution_timeout:Ketrew_pervasives.Time.t ->
?add_ssh_options:string list ->
?default_shell:default_shell ->
?playground:Ketrew_path.t ->
?port:int -> ?user:string -> ?name:string -> string -> t
Create an SSH host.
val shell_of_default_shell : t -> string -> string list
val of_uri : Uri.t -> t
Get a Host.t from an URI (library ocaml-uri); the “path” part of the URI is the playground.

Optional arguments can be added to the URL:

For example of_string "//user@SomeHost:42/tmp/pg?shell=bash,-l,--init-file,bouh,-c&timeout=42" will be like using
      ssh ~default_shell:(default_shell  "bash"
                            ~command_name ~options:["-l""--init-file""bouh"]
                            ~command_option:"-c")
        ~execution_timeout:42.
        ~port:42 ~user:"user" "SomeHost"

val of_string : string -> t
Parse an RFC-3986-compliant string into a host, see Ketrew_host.of_uri.
val to_uri : t -> Uri.t
Convert a Host.t to an URI representing it.
val to_string_hum : t -> string
Get a display-friendly string for the host.
val log : t -> Ketrew_pervasives.Log.t
Get a Log.t document.
val execution_timeout : t -> Ketrew_pervasives.Time.t option
The execution timeout configured for the host.
val connection : t -> [ `Localhost | `Ssh of Ssh.t ]
val playground : t -> Ketrew_path.t option