[lxc-devel] API wishlist

Stéphane Graber stgraber at ubuntu.com
Thu Nov 29 19:14:52 UTC 2012


So, I've been thinking a bit about what functions we're currently
missing in the API which would make the bindings and scripts much easier.

So far, I've been thinking of:
 - get_cgroup_item(cgroup, key)
 - set_cgroup_item(cgroup, key, value)
 - attach(namespaces, command)
   Attach to the provided list of namespaces and runs the command inside
the container.
 - clone(container)
   Used in a similar way to create() but instead of creating a new
rootfs, copies the one from an existing container. It gets a bit
trickier when we need to support weird storage backends.
 - console(tty)
   Similar to what lxc-console does, attach to the given tty number and
let the user exit with ctrl+a-q

 - get_version() (not container specific)
 - get_lxc_path() (not container specific)
   Returns the storage path for the containers.
   Defaults to LXCPATH.
 - set_lxc_path(path) (not container specific)


Looking at my todolist for this cycle, the highest priority ones for me
would be:
 1) get_lxc_path()
 2) set_lxc_path()
 3) get_cgroup_item()
 4) set_cgroup_item()

The rest I currently already have by wrapping around the lxc-* tools,
but it'd be nice to stop doing that and having those calls in the API so
we can rebase the tools on the API and make things a bit more consistent.

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20121129/1e1f8650/attachment.pgp>


More information about the lxc-devel mailing list