Begin to add the upload and download commands.
[libguestfs.git] / ocaml / guestfs.mli
index ba75036..2257fc0 100644 (file)
@@ -36,21 +36,6 @@ val close : t -> unit
     unreferenced, but callers can also call this in order to
     provide predictable cleanup. *)
 
-val launch : t -> unit
-val wait_ready : t -> unit
-val kill_subprocess : t -> unit
-
-val add_drive : t -> string -> unit
-val add_cdrom : t -> string -> unit
-val config : t -> string -> string option -> unit
-
-val set_path : t -> string option -> unit
-val get_path : t -> string
-val set_autosync : t -> bool -> unit
-val get_autosync : t -> bool
-val set_verbose : t -> bool -> unit
-val get_verbose : t -> bool
-
 type lvm_pv = {
   pv_name : string;
   pv_uuid : string;
@@ -109,35 +94,89 @@ type lvm_lv = {
   modules : string;
 }
 
-val cat : t -> string -> string
-(** list the contents of a file *)
+type stat = {
+  dev : int64;
+  ino : int64;
+  mode : int64;
+  nlink : int64;
+  uid : int64;
+  gid : int64;
+  rdev : int64;
+  size : int64;
+  blksize : int64;
+  blocks : int64;
+  atime : int64;
+  mtime : int64;
+  ctime : int64;
+}
 
-val list_devices : t -> string list
-(** list the block devices *)
+type statvfs = {
+  bsize : int64;
+  frsize : int64;
+  blocks : int64;
+  bfree : int64;
+  bavail : int64;
+  files : int64;
+  ffree : int64;
+  favail : int64;
+  fsid : int64;
+  flag : int64;
+  namemax : int64;
+}
 
-val list_partitions : t -> string list
-(** list the partitions *)
+val launch : t -> unit
+(** launch the qemu subprocess *)
 
-val ll : t -> string -> string
-(** list the files in a directory (long format) *)
+val wait_ready : t -> unit
+(** wait until the qemu subprocess launches *)
 
-val ls : t -> string -> string list
-(** list the files in a directory *)
+val kill_subprocess : t -> unit
+(** kill the qemu subprocess *)
 
-val lvs : t -> string list
-(** list the LVM logical volumes (LVs) *)
+val add_drive : t -> string -> unit
+(** add an image to examine or modify *)
 
-val lvs_full : t -> lvm_lv list
-(** list the LVM logical volumes (LVs) *)
+val add_cdrom : t -> string -> unit
+(** add a CD-ROM disk image to examine *)
 
-val mount : t -> string -> string -> unit
-(** mount a guest disk at a position in the filesystem *)
+val config : t -> string -> string option -> unit
+(** add qemu parameters *)
 
-val pvs : t -> string list
-(** list the LVM physical volumes (PVs) *)
+val set_path : t -> string -> unit
+(** set the search path *)
 
-val pvs_full : t -> lvm_pv list
-(** list the LVM physical volumes (PVs) *)
+val get_path : t -> string
+(** get the search path *)
+
+val set_autosync : t -> bool -> unit
+(** set autosync mode *)
+
+val get_autosync : t -> bool
+(** get autosync mode *)
+
+val set_verbose : t -> bool -> unit
+(** set verbose mode *)
+
+val get_verbose : t -> bool
+(** get verbose mode *)
+
+val is_ready : t -> bool
+(** is ready to accept commands *)
+
+val is_config : t -> bool
+(** is in configuration state *)
+
+val is_launching : t -> bool
+(** is launching subprocess *)
+
+val is_busy : t -> bool
+(** is busy processing a command *)
+
+val get_state : t -> int
+(** get the current state *)
+
+val mount : t -> string -> string -> unit
+(** mount a guest disk at a position in the filesystem *)
 
 val sync : t -> unit
 (** sync disks, writes are flushed through to the disk image *)
@@ -145,9 +184,195 @@ val sync : t -> unit
 val touch : t -> string -> unit
 (** update file timestamps or create a new file *)
 
-val vgs : t -> string list
+val cat : t -> string -> string
+(** list the contents of a file *)
+
+val ll : t -> string -> string
+(** list the files in a directory (long format) *)
+
+val ls : t -> string -> string array
+(** list the files in a directory *)
+
+val list_devices : t -> string array
+(** list the block devices *)
+
+val list_partitions : t -> string array
+(** list the partitions *)
+
+val pvs : t -> string array
+(** list the LVM physical volumes (PVs) *)
+
+val vgs : t -> string array
 (** list the LVM volume groups (VGs) *)
 
-val vgs_full : t -> lvm_vg list
+val lvs : t -> string array
+(** list the LVM logical volumes (LVs) *)
+
+val pvs_full : t -> lvm_pv array
+(** list the LVM physical volumes (PVs) *)
+
+val vgs_full : t -> lvm_vg array
 (** list the LVM volume groups (VGs) *)
 
+val lvs_full : t -> lvm_lv array
+(** list the LVM logical volumes (LVs) *)
+
+val read_lines : t -> string -> string array
+(** read file as lines *)
+
+val aug_init : t -> string -> int -> unit
+(** create a new Augeas handle *)
+
+val aug_close : t -> unit
+(** close the current Augeas handle *)
+
+val aug_defvar : t -> string -> string option -> int
+(** define an Augeas variable *)
+
+val aug_defnode : t -> string -> string -> string -> int * bool
+(** define an Augeas node *)
+
+val aug_get : t -> string -> string
+(** look up the value of an Augeas path *)
+
+val aug_set : t -> string -> string -> unit
+(** set Augeas path to value *)
+
+val aug_insert : t -> string -> string -> bool -> unit
+(** insert a sibling Augeas node *)
+
+val aug_rm : t -> string -> int
+(** remove an Augeas path *)
+
+val aug_mv : t -> string -> string -> unit
+(** move Augeas node *)
+
+val aug_match : t -> string -> string array
+(** return Augeas nodes which match path *)
+
+val aug_save : t -> unit
+(** write all pending Augeas changes to disk *)
+
+val aug_load : t -> unit
+(** load files into the tree *)
+
+val aug_ls : t -> string -> string array
+(** list Augeas nodes under a path *)
+
+val rm : t -> string -> unit
+(** remove a file *)
+
+val rmdir : t -> string -> unit
+(** remove a directory *)
+
+val rm_rf : t -> string -> unit
+(** remove a file or directory recursively *)
+
+val mkdir : t -> string -> unit
+(** create a directory *)
+
+val mkdir_p : t -> string -> unit
+(** create a directory and parents *)
+
+val chmod : t -> int -> string -> unit
+(** change file mode *)
+
+val chown : t -> int -> int -> string -> unit
+(** change file owner and group *)
+
+val exists : t -> string -> bool
+(** test if file or directory exists *)
+
+val is_file : t -> string -> bool
+(** test if file exists *)
+
+val is_dir : t -> string -> bool
+(** test if file exists *)
+
+val pvcreate : t -> string -> unit
+(** create an LVM physical volume *)
+
+val vgcreate : t -> string -> string array -> unit
+(** create an LVM volume group *)
+
+val lvcreate : t -> string -> string -> int -> unit
+(** create an LVM volume group *)
+
+val mkfs : t -> string -> string -> unit
+(** make a filesystem *)
+
+val sfdisk : t -> string -> int -> int -> int -> string array -> unit
+(** create partitions on a block device *)
+
+val write_file : t -> string -> string -> int -> unit
+(** create a file *)
+
+val umount : t -> string -> unit
+(** unmount a filesystem *)
+
+val mounts : t -> string array
+(** show mounted filesystems *)
+
+val umount_all : t -> unit
+(** unmount all filesystems *)
+
+val lvm_remove_all : t -> unit
+(** remove all LVM LVs, VGs and PVs *)
+
+val file : t -> string -> string
+(** determine file type *)
+
+val command : t -> string array -> string
+(** run a command from the guest filesystem *)
+
+val command_lines : t -> string array -> string array
+(** run a command, returning lines *)
+
+val stat : t -> string -> stat
+(** get file information *)
+
+val lstat : t -> string -> stat
+(** get file information for a symbolic link *)
+
+val statvfs : t -> string -> statvfs
+(** get file system statistics *)
+
+val tune2fs_l : t -> string -> (string * string) list
+(** get ext2/ext3 superblock details *)
+
+val blockdev_setro : t -> string -> unit
+(** set block device to read-only *)
+
+val blockdev_setrw : t -> string -> unit
+(** set block device to read-write *)
+
+val blockdev_getro : t -> string -> bool
+(** is block device set to read-only *)
+
+val blockdev_getss : t -> string -> int
+(** get sectorsize of block device *)
+
+val blockdev_getbsz : t -> string -> int
+(** get blocksize of block device *)
+
+val blockdev_setbsz : t -> string -> int -> unit
+(** set blocksize of block device *)
+
+val blockdev_getsz : t -> string -> int64
+(** get total size of device in 512-byte sectors *)
+
+val blockdev_getsize64 : t -> string -> int64
+(** get total size of device in bytes *)
+
+val blockdev_flushbufs : t -> string -> unit
+(** flush device buffers *)
+
+val blockdev_rereadpt : t -> string -> unit
+(** reread partition table *)
+
+val upload : t -> string -> string -> unit
+(** upload a file from the local machine *)
+
+val download : t -> string -> string -> unit
+(** download a file to the local machine *)
+