module Job:Module dealing with asynchronous jobs.sig
..end
type('a, 'b)
t =('a, 'b) Libvirt.job_t
Jobs represent a pending operation such as domain creation. The possible types for a job are:
(`Domain, `W) Job.t Job creating a new domain (`Domain_nocreate, `W) Job.t Job acting on an existing domain (`Network, `W) Job.t Job creating a new network (`Network_nocreate, `W) Job.t Job acting on an existing network
type
job_type =
| |
Bounded |
|||
| |
Unbounded |
(* | A Bounded job is one where we can estimate time to completion. | *) |
type
job_state =
| |
Running |
|||
| |
Complete |
|||
| |
Failed |
|||
| |
Cancelled |
(* | State of the job. | *) |
type
job_info = {
|
typ : |
(* | Job type (Bounded, Unbounded) | *) |
|
state : |
(* | Job state (Running, etc.) | *) |
|
running_time : |
(* | Actual running time (seconds) | *) |
|
remaining_time : |
(* | Estimated time left (seconds) | *) |
|
percent_complete : |
(* | Estimated percent complete | *) |
val get_info : ('a, 'b) t -> job_info
val get_domain : ([ `Domain ], 'a) t -> 'a Libvirt.Domain.t
You should only call it on a job in state Complete.
val get_network : ([ `Network ], 'a) t -> 'a Libvirt.Network.t
You should only call it on a job in state Complete.
val cancel : ('a, 'b) t -> unit
val free : ('a, [> `R ]) t -> unit
The job object is automatically freed if it is garbage
collected. This function just forces it to be freed right
away.
val const : ('a, [> `R ]) t -> ('a, Libvirt.ro) t
const conn
turns a read/write job into a read-only
job. Note that the opposite operation is impossible.