Try to improve robustness, make kerneldb additions atomic.
[virt-mem.git] / extract / fedora-koji / koji.mli
1 (* Memory info for virtual domains.
2    (C) Copyright 2008 Richard W.M. Jones, Red Hat Inc.
3    http://libvirt.org/
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *)
19
20 (** Wrappers around the XMLRPC calls. *)
21
22 type build = {
23   package_name : string;                (* eg. "kernel" *)
24   version : string;                     (* eg. "2.6.25" *)
25   release : string;                     (* eg. "1.fc8" *)
26   build_id : int;
27 }
28
29 type rpm = {
30   rpm_id : int;                         (* RPM ID (for downloading, etc.) *)
31   rpm_build : build;
32   rpm_name : string;                    (* eg. "kernel" *)
33   rpm_version : string;                 (* eg. "2.6.25" *)
34   rpm_release : string;                 (* eg. "1.fc8" *)
35   rpm_size : int;                       (* size in bytes of the RPM. *)
36   rpm_arch : string;                    (* architecture *)
37 }
38
39 val string_of_build : build -> string
40
41 val string_of_rpm : rpm -> string
42
43 (* Zzzaaargghh why doesn't xmlrpc-light define a name for the client object? *)
44 type rpc = < call : string -> XmlRpc.value list -> XmlRpc.value >
45
46 val list_builds : rpc -> prefix:string -> build list
47
48 val list_build_rpms : rpc -> build -> rpm list
49
50 (* This gets the RPM download URL for an RPM.  I can't see a way to
51  * get this using the Koji API, but the URLs are fairly predictable
52  * anyway.  The return value is (URI, filename).
53  *)
54 val rpm_download_url : rpm -> string * string