Linux-LXC
view release on metacpan or search on metacpan
lib/Linux/LXC.pod view on Meta::CPAN
=item return (if want scalar)
True if shell command return 0 (it usually means that the command was a success), false otherwise.
=back
=head3 get_config($paramater, $filter, $flag)
Get an array of values corresponding to all data that match the LXC container configuration.
=over 15
=item $parameter
The parameter to match.
=item $filter
An regex, or undef.
Values corresponding of the parameter to keep. If undef, we will keep all of them.
=item $flags
ALLOW_EMPTY: don't croak if the parameter asked was not found.
=item return
An array with all matched results.
=back
=head3 get_lxc_path()
Return the path to the LXC instance of the container. By default it's /var/lib/lxc/<utsname>/.
The path is the folder that contains rootfs and config file.
=head3 get_template()
Get the template of the LXC instance.
=head3 get_utsname()
Will return the utsname of the container.
=head3 is_existing()
Retrun true if the container with the given utsname exists. False otherwise.
=head3 is_running()
Retrun true if the container with the given utsname is running. False otherwise.
=head3 is_stopped()
Return true if the container with the given utsname is stopped. False otherwise.
=head3 put($input, $destination)
Will copy the $input file or folder on the $destination path in the container instance.
This method also takes care of ownership and will chown $destination to the container root uid.
The ownership will also be set for all intermediate folders we have to create.
=over 15
=item $input
String corresponding to a relative or absolute path of a folder or a file we want to copy on the container root fs.
This path should be readable by the user executing this script.
=item $output
Location on the container to put the file or folder. This path has to be absolute.
=back
=head3 set_config($attribute, $value, $flag)
Will set a LXC attribute in container configuration.
The update can occurs in two modes: addition or erasing.
In the first one, a new attribute with the given value will always be created.
In the second case, the first previous value already existing of $attribute will be updated with the new $value. If none is found, the atribute will also be created.
=over 15
=item $attribute
Attribute to set.
=item $value
Value to give to the attribute.
=item $flag
Can be ADDITION_MODE, ERASING_MODE or undef. If undef, ERASING_MODE will occur.
=back
=head3 set_template($template)
Will set the $template name to the given container.
Note that this action should be done before the deployment.
=head3 start()
Start the container.
=head3 stop()
Stop the container.
=head1 AUTHOR
Spydemon <jsaipakoimetr@spyzone.fr>
=head1 BUGS AND INFO
A bug tracker is available for this module at the address: https://dev.spyzone.fr/Perl/Linux-LXC but inscriptions are
closed because of spamming issue.
If you want an account for contributing, report any enhancement suggestion or bug report, please send me an email.
( run in 0.445 second using v1.01-cache-2.11-cpan-5511b514fd6 )