available


Description:

[ Version ( since = "1.0.80" ) ]
public bool available (string[] groups) throws Error

test availability of some parts of the API

This command is used to check the availability of some groups of functionality in the appliance, which not all builds of the libguestfs appliance will be able to provide.

The libguestfs groups, and the functions that those groups correspond to, are listed in "AVAILABILITY" in guestfs(3). You can also fetch this list at runtime by calling available_all_groups.

The argument groups is a list of group names, eg: "["inotify", "augeas"]" would check for the availability of the Linux inotify functions and Augeas (configuration file editing) functions.

The command returns no error if *all* requested groups are available.

It fails with an error if one or more of the requested groups is unavailable in the appliance.

If an unknown group name is included in the list of groups then an error is always returned.

*Notes:*

* feature_available is the same as this call, but with a slightly simpler to use API: that call returns a boolean true/false instead of throwing an error.

* You must call launch before calling this function.

The reason is because we don't know what groups are supported by the appliance/daemon until it is running and can be queried.

* If a group of functions is available, this does not necessarily mean that they will work. You still have to check for errors when calling individual API functions even if they are available.

* It is usually the job of distro packagers to build complete functionality into the libguestfs appliance. Upstream libguestfs, if built from source with all requirements satisfied, will support everything.

* This call was added in version 1.0.80. In previous versions of libguestfs all you could do would be to speculatively execute a command to find out if the daemon implemented it. See also version.

See also filesystem_available.

Parameters:

this

A GuestfsSession object

groups

an array of strings

Returns:

true on success, false on error