Module Ketrew_client (.ml)

module Ketrew_client: sig .. end
The “client” is the frontend to either a standalone engine or an HTTP client talking to a server/engine.

module Error: sig .. end
Error.t is the type of the error kinds that this module introduces.
type t 
The handle of the client.
val as_client : configuration:Ketrew_configuration.t ->
f:(client:t ->
(unit,
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_target.id
| `Dyn_plugin of [> `Dynlink_error of Dynlink.error | `Findlib of exn ]
| `Failure of string
| `Wrong_configuration of [> `Found of string ] * [> `Exn of exn ] ]
as 'a)
Ketrew_unix_io.Deferred_result.t) ->
(unit, 'a) Ketrew_unix_io.Deferred_result.t
Run the function f with a fresh-client created with the configuration.

If the configuration can be for an HTTP client, for a standalone engine, or for a server (the client behaves like a local standalone engine, using Ketrew_configuration.standalone_of_server).

val configuration : t -> Ketrew_configuration.t
Retrieve the configuration used to create the client.
val get_local_engine : t -> Ketrew_engine.t option
Get the handle to the engine (returns None if the client is an HTTP one).
val all_targets : t ->
(Ketrew_target.t list,
[> `Client of Error.t
| `Database of Trakeva.Error.t
| `IO of
[> `Read_file_exn of string * exn | `Write_file_exn of string * exn ]
| `Missing_data of Ketrew_target.id
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Ketrew_unix_io.Deferred_result.t
Get all the current targets.
val get_list_of_target_ids : t ->
query:Ketrew_protocol.Up_message.target_query ->
(Ketrew_target.id list,
[> `Client of Error.t
| `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Ketrew_unix_io.Deferred_result.t
Get a list of target IDs given the query.
val get_target : t ->
id:Ketrew_target.id ->
(Ketrew_target.t,
[> `Client of Error.t
| `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Ketrew_unix_io.Deferred_result.t
The latest contents of a given target.
val get_targets : t ->
id_list:Ketrew_target.id list ->
(Ketrew_target.t list,
[> `Client of Error.t
| `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Ketrew_unix_io.Deferred_result.t
Same as Ketrew_client.get_target but “in bulk.”
val call_query : t ->
target:Ketrew_target.t ->
string -> (string, Ketrew_pervasives.Log.t) Ketrew_unix_io.Deferred_result.t
Call a target's plugin query by name.
val kill : t ->
Ketrew_target.id list ->
(unit,
[> `Client of Error.t
| `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_target.id
| `Missing_data of Ketrew_target.id
| `Target of [> `Deserilization of string ] ])
Ketrew_unix_io.Deferred_result.t
Kill a set of targets.
val restart : t ->
Ketrew_target.id list ->
(unit,
[> `Client of Error.t
| `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_target.id
| `Missing_data of Ketrew_target.id
| `Target of [> `Deserilization of string ] ])
Ketrew_unix_io.Deferred_result.t
Restart a set of targets.
val submit : ?override_configuration:Ketrew_configuration.t ->
Ketrew_edsl.user_target -> unit
Submit a high-level workflow description to the engine; this function calls Lwt_main.run.