Illumos::Zones - Zone administration class
use Illumos::Zones; ... my $zone = Illumos::Zones->new(debug => 0); ...
class to manage Zones
print debug information to STDERR
returns a schema for "Data::Processor" so that the zone config can be validated before written to the zone.
my $schema = $zone->schema();
returns a minimal template config for creating a zone
my $cfg = $zone->template();
returns a list of zone resources
my @res = @{$zone->resources()};
returns a list of zone resources which are arrays (i.e. can have multiple entries)
my @resArray = @{$zone->resourceArrays()};
static method. returns the name of the current zone
Illumos::Zones->zonename();
static method. returns true if we are on the global zone
Illumos::Zones->isGZ();
returns the list of zones. each element contains a hash with all the zone infos (cf. 'zoneamd list')
my @zones = @{$zone->listZones()};
returns a hash with all the zone infos (cf. 'zoneadm list')
my %zone = %{$zone->listZone($zonename)};
returns the state of the zone
$zone->zoneState($zonename);
boots the zone
$zone->boot($zonename);
gracefully shuts down the zone
$zone->shutdown($zonename);
reboots the zone
$zone->reboot($zonename);
creates a zone and applies the properties
$zone->createZone($zonename, { %props });
deletes a zone (zone must be uninstalled first)
$zone->deleteZone($zonename);
installs a zone
$zone->install($zonename);
uninstalls a zone
$zone->uninstall($zonename);
checks whether a zone exists or not
$zone->zoneExists($zonename);
returns a JSON data structure which contains all the zone properties
my %zonecfg = %{$zone->getZoneProperties($zonename)};
applies the properties provided in a JSON data structure to the zone if the zone does not exist it will be created
$zone->setZoneProperties($zonename, { %zonecfg });
checks whether a resource exists or not. $property and $value are optional parameters
$property
$value
$zone->resourceExists($zonename, $resource, $property, $value);
adds a resource
$zone->addResource($zonename, $resource, { %props });
deletes a resource. $property and $value are optional parameters for distinction if multiple resources of the same type exists.
$zone->delResource($zonename, $resource, $property, $value);
deletes all resrouces
$zone->clearResources($zonename);
sets a property
$zone->setProperty($zonename, $property, $value);
sets a property to the default value
$zone->clearProperty($zonename, $property);
Copyright (c) 2015 by OETIKER+PARTNER AG. All rights reserved.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Andy Fiddaman <omnios@citrus-it.co.uk>, Dominik Hassler <hadfl@cpan.org>, Tobias Oetiker <tobi@oetiker.ch>
2015-05-08 had Initial Version
To install Illumos::Zones, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Illumos::Zones
CPAN shell
perl -MCPAN -e shell install Illumos::Zones
For more information on module installation, please visit the detailed CPAN module installation guide.