'\" t .\" Title: zonemgr .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 06/09/2016 .\" Manual: RAD Module Definitions .\" Source: SunOS 5.11 .\" Language: English .\" .TH "ZONEMGR" "3rad" "06/09/2016" "SunOS 5.11" "RAD Module Definitions" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zonemgr .SH "SYNOPSIS" .SS "interface ZoneManager" .sp .nf .fi .sp .nf Result\ \&create(string\ \&name, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&string\ \&path, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&string\ \&template); .fi .sp .nf Result\ \&delete(string\ \&name); .fi .sp .nf Result\ \&importConfig(boolean\ \&noexecute, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&string\ \&name, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&string[]\ \&configuration); .fi .SS "interface ZoneInfo" .sp .nf string\ \&brand\ \&; . integer\ \&id\ \&; . string\ \&uuid\ \&; . string\ \&name\ \&; . boolean\ \&isGlobal\ \&; .fi .SS "interface Zone" .sp .nf string[]\ \&auxstate\ \&; . string\ \&brand\ \&; . integer\ \&id\ \&; . string\ \&uuid\ \&; . string\ \&name\ \&; . string\ \&state\ \&; .fi .sp .nf cancelConfig(); .fi .sp .nf string\ \&exportConfig(boolean\ \&includeEdits, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&boolean\ \&liveMode); .fi .sp .nf update(boolean\ \&noexecute, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&string[]\ \&commands); .fi .sp .nf editConfig(boolean\ \&liveMode); .fi .sp .nf commitConfig(); .fi .sp .nf boolean\ \&configIsLive(); .fi .sp .nf boolean\ \&configIsStale(); .fi .sp .nf addResource(Resource\ \&resource, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&Resource\ \&scope); .fi .sp .nf reloadConfig(boolean\ \&liveMode); .fi .sp .nf removeResources(Resource\ \&filter, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&Resource\ \&scope); .fi .sp .nf Resource[]\ \&getResources(Resource\ \&filter, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&Resource\ \&scope); .fi .sp .nf Property[]\ \&getResourceProperties(Resource\ \&filter, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&string[]\ \&properties); .fi .sp .nf setResourceProperties(Resource\ \&filter, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&Property[]\ \&properties); .fi .sp .nf clearResourceProperties(Resource\ \&filter, . \ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&\ \&string[]\ \&properties); .fi .sp .nf Result\ \&apply(string[]\ \&options); .fi .sp .nf Result\ \&attach(string[]\ \&options); .fi .sp .nf Result\ \&boot(string[]\ \&options); .fi .sp .nf Result\ \&clone(string[]\ \&options); .fi .sp .nf Result\ \&detach(string[]\ \&options); .fi .sp .nf Result\ \&halt(string[]\ \&options); .fi .sp .nf Result\ \&install(string[]\ \&options); .fi .sp .nf Result\ \&mark(string[]\ \&options); .fi .sp .nf Result\ \&migrate(string[]\ \&options); .fi .sp .nf Result\ \&move(string[]\ \&options); .fi .sp .nf Result\ \&rename(string[]\ \&options); .fi .sp .nf Result\ \&ready(string[]\ \&options); .fi .sp .nf Result\ \&reboot(string[]\ \&options); .fi .sp .nf Result\ \&savecore(string[]\ \&options); .fi .sp .nf Result\ \&shutdown(string[]\ \&options); .fi .sp .nf Result\ \&suspend(string[]\ \&options); .fi .sp .nf Result\ \&uninstall(string[]\ \&options); .fi .sp .nf Result\ \&verify(string[]\ \&options); .fi .SH "DESCRIPTION" .PP \fBapi com\&.oracle\&.solaris\&.rad\&.zonemgr\fR .PP This API provides functionality for the configuration and administration of Zones subsystem\&. .PP The API provides a snapshot of the state of zones\&. The snapshot can be updated externally, either in another RAD session or by some other mechanism\&. This means that operations like commitConfig() may fail due to the changes introduced by other agents\&. .PP The API detects and reports the creation and deletion of zones as well as configuration changes for individual zones\&. .PP Some zones properties are accessed more frequently than others, for example, name\&. These properties are specifically exported as properties of the RAD interface as well as included in the list of zone properties\&. .PP Three properties, id, state and auxstate, are not part of the configuration snapshot\&. These properties can vary without invalidating the integrity of the snapshot\&. These properties are documented as dynamic\&. .PP The following sample Python clients illustrate some simple interactions with the module\&. .PP \fBExample\ \&1.\ \&Retrieve a zones list, print 'pool' of first zone\fR .sp .if n \{\ .RS 4 .\} .nf import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind with radcon\&.connect_unix() as rc: zones = rc\&.list_objects(zbind\&.Zone()) zone0 = rc\&.get_object(zones[0]) for prop in zone0\&.getResourceProperties(zbind\&.Resource(\'global\')): if prop\&.name == "pool": print "Zone: %s, pool: %s" % (zone0\&.name, prop\&.value) break .fi .if n \{\ .RE .\} .PP \fBExample\ \&2.\ \&Listen to stateChange events\fR .sp .if n \{\ .RS 4 .\} .nf import signal import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind def handler(event, payload, user): print "event: %s" % str(event) print "payload: %s" % str(payload) print "zone: %s" % str(payload\&.zone) print "old: %s" % str(payload\&.oldstate) print "new: %s" % str(payload\&.newstate) with radcon\&.connect_unix() as rc: mgr = rc\&.get_object(zbind\&.ZoneManager()) rc\&.subscribe(mgr, "stateChange", handler) signal\&.pause() .fi .if n \{\ .RE .\} .PP \fBExample\ \&3.\ \&Listen to configChange event of first zone\fR .sp .if n \{\ .RS 4 .\} .nf import signal import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind def handler(event, payload, user): print "event: %s" % str(event) print "payload: %s" % str(payload) print "zone: %s" % str(payload\&.zone) with radcon\&.connect_unix() as rc: zones = rc\&.list_objects(zbind\&.Zone()) zone0 = rc\&.get_object(zones[0]) print "Waiting for configuration change event on %s" % zone0\&.name rc\&.subscribe(zone0, "configChange", handler) signal\&.pause() .fi .if n \{\ .RE .\} .PP \fBExample\ \&4.\ \&Find zone test0 and print out its brand\fR .sp .if n \{\ .RS 4 .\} .nf import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind with radcon\&.connect_unix() as rc: pat = radcli\&.ADRGlobPattern({"name" : "test0"}) test0 = rc\&.get_object(zbind\&.Zone(), pat) for prop in test0\&.getResourceProperties(zbind\&.Resource(\'global\')): if prop\&.name == "brand": print "Zone: %s, brand: %s" % (test0\&.name, prop\&.value) break .fi .if n \{\ .RE .\} .PP \fBExample\ \&5.\ \&Find zone with id 2 and print out its name\fR .sp .if n \{\ .RS 4 .\} .nf import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind import sys with radcon\&.connect_unix() as rc: zones = rc\&.list_objects(zbind\&.Zone(), radcli\&.ADRGlobPattern({"id" : "2"})) try: test0 = rc\&.get_object(zones[0]) except: print "Can\'t find a zone with that id" sys\&.exit(1) print "Zone: %s, id: %d" % (test0\&.name, test0\&.id) .fi .if n \{\ .RE .\} .PP \fBExample\ \&6.\ \&Boot zone test0\fR .sp .if n \{\ .RS 4 .\} .nf import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind with radcon\&.connect_unix() as rc: pat = radcli\&.ADRGlobPattern({"name" : "test0"}) test0 = rc\&.get_object(zbind\&.Zone(), pat) test0\&.boot(None) .fi .if n \{\ .RE .\} .SH "INTERFACES" .SS "interface ZoneManager" .PP Manage the zone in which this instance is executing\&. .PP Create and delete zones\&. Changes in the state of zones can be monitored through the StateChange event\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZoneManager Methods\fR .RS 4 .PP \fBResult\fR \fBcreate\fR(\fBstring\fR\ \&\fIname\fR, \fBstring\fR\ \&\fIpath\fR, \fBstring\fR\ \&\fItemplate\fR) .RS 4 .PP Create a zone based on the default template or the specified template\&. .PP Create a zone with the supplied name and path\&. If a template is supplied, it should be the name of a template, such as SYSblank\&. .PP \fBArguments:\fR .PP \fIname\fR .PP \fIpath\fR (\fInullable\fR) .PP \fItemplate\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBdelete\fR(\fBstring\fR\ \&\fIname\fR) .RS 4 .PP Delete a zone\&. .PP \fBArguments:\fR .PP \fIname\fR .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBimportConfig\fR(\fBboolean\fR\ \&\fInoexecute\fR, \fBstring\fR\ \&\fIname\fR, \fBstring[]\fR\ \&\fIconfiguration\fR) .RS 4 .PP Create a zone using the exported definition of another zone\&. .PP The supplied configuration must be in a format that could be used in a zonecfg command file \- e\&.g\&. output of zonecfg export\&. .PP \fBArguments:\fR .PP \fInoexecute\fR \(em If true, do not execute the commands, but verify that they would result in a legal zone configuration\&. .PP \fIname\fR .PP \fIconfiguration\fR \(em Command details .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZoneManager Events\fR .RS 4 .PP \fBStateChange\fR\ \&\fBstateChange\fR .RE .SS "interface ZoneInfo" .PP Report on the zone in which this instance is executing\&. .PP Information about the current zone can be accessed\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZoneInfo Properties\fR .RS 4 .PP \fBstring\fR\ \&\fBbrand\fR (\fIread\-only\fR) .RS 4 .PP The brand of the zone in which this interface is executing\&. .RE .PP \fBinteger\fR\ \&\fBid\fR (\fIread\-only\fR) .RS 4 .PP The ID of the zone in which this interface is executing\&. .RE .PP \fBstring\fR\ \&\fBuuid\fR (\fIread\-only\fR, \fInullable\fR) .RS 4 .PP The UUID of the zone in which this interface is executing\&. .RE .RS 4 .PP \fBRead Error:\fR \fBResult\fR .RE .PP \fBstring\fR\ \&\fBname\fR (\fIread\-only\fR) .RS 4 .PP The name of the zone in which this instance is executing\&. .RE .PP \fBboolean\fR\ \&\fBisGlobal\fR (\fIread\-only\fR) .RS 4 .PP Is this instance executing in a global zone? .RE .RE .SS "interface Zone" .PP Operations that affect a single zone\&. .PP Represents an individual zone\&. All zone configuration and administrative actions are represented in this interface\&. Changes of the zone configuration can be monitored through the configChange event\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZone Properties\fR .RS 4 .PP \fBstring[]\fR\ \&\fBauxstate\fR (\fIread\-only\fR, \fInullable\fR) .RS 4 .PP The list of zone auxiliary states\&. This property is dynamic, can be modified externally, and can be empty\&. .RE .RS 4 .PP \fBRead Error:\fR \fBResult\fR .RE .PP \fBstring\fR\ \&\fBbrand\fR (\fIread\-only\fR) .RS 4 .PP The brand of the zone\&. This is equivalent to the "brand" property in the global resource\&. .RE .PP \fBinteger\fR\ \&\fBid\fR (\fIread\-only\fR) .RS 4 .PP The ID of the zone\&. This property is dynamic and can be modified externally\&. If a zone reboots, the zone ID will change\&. .RE .PP \fBstring\fR\ \&\fBuuid\fR (\fIread\-only\fR, \fInullable\fR) .RS 4 .PP The UUID of the zone\&. .RE .RS 4 .PP \fBRead Error:\fR \fBResult\fR .RE .PP \fBstring\fR\ \&\fBname\fR (\fIread\-only\fR) .RS 4 .PP The name of the zone\&. This is equivalent to the "name" property in the global resource\&. .RE .PP \fBstring\fR\ \&\fBstate\fR (\fIread\-only\fR) .RS 4 .PP The state of the zone\&. This property is dynamic and can be modified externally\&. If a zone is booted, the zone state will change\&. See zones(5) for zone states reference\&. .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZone Methods\fR .RS 4 .PP \fBcancelConfig\fR() .RS 4 .PP Resets any configuration changes done after editConfig()\&. .PP After the changes are reset, call editConfig() again to begin a new set of modifications\&. Note that this method will also reread the configuration by using reloadConfig()\&. Can return NOT_EDITING error if editConfig() has not already been called successfully\&. This method resets the session liveMode to false\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBstring\fR \fBexportConfig\fR(\fBboolean\fR\ \&\fIincludeEdits\fR, \fBboolean\fR\ \&\fIliveMode\fR) .RS 4 .PP Return the exported output for this zone\&. .PP Return a string containing the exported form of the configuration\&. The output matches the configuration snapshot\&. .PP \fBArguments:\fR .PP \fIincludeEdits\fR (\fInullable\fR) \(em If true (default if omitted), then the exported configuration will contain the in\-flight modifications (if any were made) in the current session, otherwise only the committed on\-disk configuration is exported\&. .PP \fIliveMode\fR (\fInullable\fR) \(em If set to true, live (running) zone configuration is exported as seen at the time of this method call\&. If not specified, this method honors the session\'s liveMode\&. If the zone is not running yet live mode was requested, INVALID_ZONE_STATE error will be raised\&. .PP \fBResult:\fR .PP \fBstring\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBupdate\fR(\fBboolean\fR\ \&\fInoexecute\fR, \fBstring[]\fR\ \&\fIcommands\fR) .RS 4 .PP Process the supplied commands to update the zone\&. .PP Process the list of commands\&. .PP A SNAPSHOT_ERROR may result, in which case the configuration is unchanged\&. If the client still wishes to update the configuration after a SNAPSHOT_ERROR is returned they must refresh their snapshot of zone configuration using reloadConfig() method\&. (Before calling update() on the refreshed Zone object they should verify that their planned changes are still applicable to the zone configuration\&.) .PP \fBArguments:\fR .PP \fInoexecute\fR \(em If true, do not execute the commands, but verify that they would result in a legal zone configuration\&. .PP \fIcommands\fR \(em Each element is a command, recognizable by zonecfg(1M)\&. Failure of any command results in no changes to the zone\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBeditConfig\fR(\fBboolean\fR\ \&\fIliveMode\fR) .RS 4 .PP Initiate zone configuration editing\&. .PP Calling this method will initiate a configuration modification transaction\&. It will also update the configuration snapshot if a new on\-disk configuration is found\&. Each configuration editing transaction must either be canceled by a call to cancelConfig(), or changes must be committed using commitConfig()\&. There can be only one configuration editing transaction open at one time, so a subsequent call to editConfig() without calling cancelConfig() or succesfully calling commitConfig() first will result in an ALREADY_EDITING error\&. .PP \fBArguments:\fR .PP \fIliveMode\fR (\fInullable\fR) \(em If set to true, Live Zone Reconfiguration mode is enabled (session liveMode is set to true) and all changes made to the configuration will be applied live to the running zone at the time commitConfig() is called\&. Can return INVALID_ZONE_STATE if the zone is not running\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBcommitConfig\fR() .RS 4 .PP Tries to save the configuration changes made by addResource(), removeResources() and setResourceProperties(), clearResourceProperties() since the last call to editConfig()\&. .PP If external changes were made subsequent to editConfig(), no changes are saved and SNAPSHOT_ERROR is returned, indicating that the user should either abandon the changed configuration or call editConfig() to reread the current zone configuration, redo the changes, and try to save again\&. See the SNAPSHOT_ERROR description for more information\&. A NOT_EDITING error can be returned if editConfig() has not already been called successfully\&. The configuration is applied to running zone if the session\'s liveMode was set to true\&. However if the zone was not running any more, the INVALID_ZONE_STATE error will be raised\&. The session liveMode is not reset\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBboolean\fR \fBconfigIsLive\fR() .RS 4 .PP Returns session\'s liveMode setting as set by preceding editConfig() or reloadConfig() method calls\&. .PP \fBResult:\fR .PP \fBboolean\fR .RE .PP \fBboolean\fR \fBconfigIsStale\fR() .RS 4 .PP Checks whether a configuration snapshot captured by the instance is stale, meaning that changes to the zone configuration were done by an external process in the interim\&. .PP \fBResult:\fR .PP \fBboolean\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBaddResource\fR(\fBResource\fR\ \&\fIresource\fR, \fBResource\fR\ \&\fIscope\fR) .RS 4 .PP Queue a resource for addition to the zone configuration\&. .PP While the change to the configuration is not saved until a successful call is made to commitConfig(), this resource is accessible by getResources(), getResourceProperties(), and setResourceProperties(), as well as by removeResources() methods\&. Returns RESOURCE_ALREADY_EXISTS if the resource being added is not unique\&. The NOT_EDITING error can be returned if editConfig() has not yet been called successfully\&. .PP \fBExample\ \&7.\ \&Adding dedicated-cpu resource using addResource()\fR .sp .if n \{\ .RS 4 .\} .nf \&.\&.\&. zone0\&.addResource(zbind\&.Resource(\'dedicated\-cpu\', [zbind\&.Property(\'ncpus\', \'3\-4\'), zbind\&.Property(\'importance\', \'1\')])) .fi .if n \{\ .RE .\} .PP \fBExample\ \&8.\ \&Adding mac resource to particular anet\fR .sp .if n \{\ .RS 4 .\} .nf \&.\&.\&. zone0\&.addResource(zbind\&.Resource(\'mac\'), zbind\&.Resource(\'anet\', [Property(\'id\', \'3\')])) .fi .if n \{\ .RE .\} .PP \fBArguments:\fR .PP \fIresource\fR .PP \fIscope\fR (\fInullable\fR) \(em Specify where to add the new resource to\&. See mac in anet resource example above\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBreloadConfig\fR(\fBboolean\fR\ \&\fIliveMode\fR) .RS 4 .PP Reload zone configuration snapshot\&. .PP This method should be used to reload the configuration snapshot from the on\-disk zone configuration, which could have been changed by an external process\&. All uncommitted edits will be discarded\&. .PP \fBArguments:\fR .PP \fIliveMode\fR (\fInullable\fR) \(em If specified, the session liveMode will be set\&. If not specified, this method honors the session\'s liveMode as set previously by editConfig() or reloadConfig()\&. INVALID_ZONE_STATE error can be raise if live reconfiguration was requested but the zone was not running\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBremoveResources\fR(\fBResource\fR\ \&\fIfilter\fR, \fBResource\fR\ \&\fIscope\fR) .RS 4 .PP Delete resource(s) matching filter from the zone configuration\&. .PP This method can fail with RESOURCE_NOT_FOUND if the filter does not match any resource\&. A NOT_EDITING error can be returned if editConfig() has not yet been called successfully\&. .PP \fBArguments:\fR .PP \fIfilter\fR .PP \fIscope\fR (\fInullable\fR) \(em Specify where to remove the resource(s) from\&. Used for example to remove non\-primary mac address(es) from a particular anet resource\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResource\fR\fB[]\fR \fBgetResources\fR(\fBResource\fR\ \&\fIfilter\fR, \fBResource\fR\ \&\fIscope\fR) .RS 4 .PP Return a list of zero or more resources matching given filter\&. .PP .PP \fBArguments:\fR .PP \fIfilter\fR (\fInullable\fR) \(em If NULL, all resources are returned\&. The INVALID_ARGUMENT error is returned if filter type is empty\&. The RESOURCE_UNKNOWN error is returned if filter type is an unknown resource type\&. Refer to zonecfg(1M) for a list of valid resource types\&. .PP \fIscope\fR (\fInullable\fR) \(em Specify where to get the resource(s) from\&. Used for example to get a list of non\-primary mac addresses for a particular anet resource\&. .PP \fBResult:\fR .PP \fBResource\fR\fB[]\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBProperty\fR\fB[]\fR \fBgetResourceProperties\fR(\fBResource\fR\ \&\fIfilter\fR, \fBstring[]\fR\ \&\fIproperties\fR) .RS 4 .PP Returns a list of zero or more properties of a given resource\&. .PP This method can fail with RESOURCE_NOT_FOUND if filter does not match any resource, with RESOURCE_TOO_MANY if more than one resource matches, or with RESOURCE_UNKNOWN if filter type is not a known resource type\&. .PP \fBArguments:\fR .PP \fIfilter\fR .PP \fIproperties\fR (\fInullable\fR) \(em Names of the properties the caller is interested in\&. If NULL, all properties are returned\&. .PP \fBResult:\fR .PP \fBProperty\fR\fB[]\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBsetResourceProperties\fR(\fBResource\fR\ \&\fIfilter\fR, \fBProperty\fR\fB[]\fR\ \&\fIproperties\fR) .RS 4 .PP Set property values of given resource\&. .PP This method can fail with RESOURCE_NOT_FOUND if the filter does not match any resource, RESOURCE_UNKNOWN in the case of an invalid filter type, or RESOURCE_TOO_MANY if more than one resource matches\&. If an error occurs when setting the properties, the SYSTEM_ERROR is returned and Result\&.str should be inspected to obtain detailed information about the failure\&. The PROPERTY_UNKNOWN error can be returned if a property of the given name did not exist in that particular resource and the INVALID_ARGUMENT error can be returned if properties argument is an empty list\&. The NOT_EDITING error can be returned if editConfig() has not yet been called successfully\&. .PP \fBExample\ \&9.\ \&Setting simple global variable\fR .sp .if n \{\ .RS 4 .\} .nf import rad\&.client as radcli import rad\&.connect as radcon import rad\&.bindings\&.com\&.oracle\&.solaris\&.rad\&.zonemgr_1 as zbind with radcon\&.connect_unix() as rc: zones = rc\&.list_objects(zbind\&.Zone()) zone0 = rc\&.get_object(zones[0]) zone0\&.editConfig() zone0\&.setResourceProperties(zbind\&.Resource(\'global\'), [zbind\&.Property(\'autoboot\', \'false\')]) .fi .if n \{\ .RE .\} .PP \fBExample\ \&10.\ \&Setting multiple simple variables in particular anet resource\fR .sp .if n \{\ .RS 4 .\} .nf \&.\&.\&. zone0\&.setResourceProperties( zbind\&.Resource(\'anet\', [zbind\&.Property(\'linkname\', \'net1\')]), [zbind\&.Property(\'mac\-address\', \'auto\'), zbind\&.Property(\'mtu\', \'1400\')]) .fi .if n \{\ .RE .\} .PP In the following example please notice the listvalue named argument that needs to be used when constructing Property with list of simple value\&. See zonecfg(1m) manual page for detailed information about individual resources and properties\&. .PP \fBExample\ \&11.\ \&Setting list of options to dir=/storage filesystem\fR .sp .if n \{\ .RS 4 .\} .nf \&.\&.\&. zone0\&.setResourceProperties( zbind\&.Resource(\'fs\', [zbind\&.Property(\'dir\', \'/storage\')]), [zbind\&.Property(\'options\', listvalue=[\'ro\', \'nodevices\'])]) .fi .if n \{\ .RE .\} .PP Next example shows how to find particular non\-primary mac address in an anet resource and set its properties\&. Please note this example is supposed to work on solaris\-kz branded zones only\&. .PP \fBExample\ \&12.\ \&Setting mac-address property of a non-primary mac in anet\fR .sp .if n \{\ .RS 4 .\} .nf \&.\&.\&. anet = zone0\&.getResources(zbind\&.Resource(\'anet\', [zbind\&.Property(\'id\', \'0\')])) macs = zone0\&.getResources(zbind\&.Resource(\'mac\', [zbind\&.Property(\'id\', \'1\')]), anet[0]) zone0\&.setResourceProperties(macs[0], [zbind\&.Property(\'mac\-address\', \'0:8:20:9e:eb:8c\')]) .fi .if n \{\ .RE .\} .PP \fBArguments:\fR .PP \fIfilter\fR .PP \fIproperties\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBclearResourceProperties\fR(\fBResource\fR\ \&\fIfilter\fR, \fBstring[]\fR\ \&\fIproperties\fR) .RS 4 .PP Clear property values of given resource\&. .PP This method can fail with RESOURCE_NOT_FOUND if the filter does not match any resource or RESOURCE_TOO_MANY if more than one resource matches\&. The PROPERTY_UNKNOWN error can be returned if a property of the given name did not exist in that particular resource and the INVALID_ARGUMENT error can be returned if the properties argument is an empty list\&. A NOT_EDITING error can be returned if editConfig() has not yet been called successfully\&. .PP \fBArguments:\fR .PP \fIfilter\fR .PP \fIproperties\fR \(em Names of the properties to clear\&. .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBapply\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Apply configuration to the running zone\&. .PP Can fail with INVALID_ZONE_STATE if the zone is not running\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options as described in zoneadm(1m)\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBattach\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Attach a zone .PP This method is equivalent to using zoneadm(1M) attach on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBboot\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Boot a zone .PP This method is equivalent to using zoneadm(1M) boot on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBclone\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Clone a zone .PP This method is equivalent to using zoneadm(1M) clone on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBdetach\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Detach a zone .PP This method is equivalent to using zoneadm(1M) detach on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBhalt\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Halt a zone .PP This method is equivalent to using zoneadm(1M) halt on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBinstall\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Install a zone .PP This method is equivalent to using zoneadm(1M) install on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBmark\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Mark a zone incomplete .PP This method is equivalent to using zoneadm(1M) mark on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBmigrate\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Migrate a zone to a different system\&. .PP This method is equivalent to using zoneadm(1M) migrate on a zone\&. Note that the RAD URI specified must not require interactive authentication (e\&.g\&. a password prompt)\&. Available since version 1\&.1\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBmove\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Move a zone .PP This method is equivalent to using zoneadm(1M) move on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBrename\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Rename a zone .PP This method is equivalent to using zoneadm(1M) rename on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options\&. .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBready\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Ready a zone .PP This method is equivalent to using zoneadm(1M) ready on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBreboot\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Reboot a zone .PP This method is equivalent to using zoneadm(1M) reboot on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBsavecore\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Save crash dump of a zone .PP This method is equivalent to using zoneadm(1M) savecore on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBshutdown\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Shutdown a zone .PP This method is equivalent to using zoneadm(1M) shutdown on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBsuspend\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Suspend a zone .PP This method is equivalent to using zoneadm(1M) suspend on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBuninstall\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Uninstall a zone .PP This method is equivalent to using zoneadm(1M) uninstall on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .PP \fBResult\fR \fBverify\fR(\fBstring[]\fR\ \&\fIoptions\fR) .RS 4 .PP Verify a zone .PP This method is equivalent to using zoneadm(1M) verify on a zone\&. .PP \fBArguments:\fR .PP \fIoptions\fR (\fInullable\fR) \(em Command options .PP \fBResult:\fR .PP \fBResult\fR .PP \fBError:\fR .PP \fBResult\fR .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZone Events\fR .RS 4 .PP \fBConfigChange\fR\ \&\fBconfigChange\fR .RE .SH "ENUMERATED TYPES" .PP \fBenum ErrorCode\fR .RS 4 .PP Errors .RE .RS 4 .PP NONE (0) .RS 4 .PP No error .RE .PP FRAMEWORK_ERROR (1) .RS 4 .PP An error occurred within the RAD framework .RE .PP SNAPSHOT_ERROR (2) .RS 4 .PP The user accesses the zone configuration details through a snapshot\&. This snapshot is captured when the user references a Zone instance\&. If the framework detects that the user intends to perform an operation that would be inconsistent with external changes made after the creation of the snapshot, the operation fails and this error is returned\&. .RE .PP COMMAND_ERROR (3) .RS 4 .PP An error occurred in the requested operation .RE .PP RESOURCE_ALREADY_EXISTS (4) .RS 4 .PP Resource cannot be added because the resource already exists\&. .RE .PP RESOURCE_NOT_FOUND (5) .RS 4 .PP Unable to find a resource matching given filter\&. .RE .PP RESOURCE_TOO_MANY (6) .RS 4 .PP If the filter provided matches more than one resource, this error can be returned by methods that operate on one particular resource\&. .RE .PP RESOURCE_UNKNOWN (7) .RS 4 .PP The resource of the particular type is not known\&. .RE .PP ALREADY_EDITING (8) .RS 4 .PP This error is returned by editConfig() when there was a prior call to editConfig(), and an active zone configuration editing session still exists\&. The session has not been cancelled by cancelConfig(), or committed by a successful commitConfig() call\&. .RE .PP PROPERTY_UNKNOWN (9) .RS 4 .PP The property does not exist in the particular resource\&. .RE .PP NOT_EDITING (10) .RS 4 .PP Calling configuration modification methods is not allowed outside of transaction\&. .RE .PP SYSTEM_ERROR (11) \(em System error\&. .RS 4 .PP This error code is a result of an error in a low\-level system component or library where it\'s impractical to expose that particular error code through the Zone interface\&. Detailed information about the error, if available, will be made available through str field of the Result structure\&. .RE .PP INVALID_ARGUMENT (12) .RS 4 .PP Invalid method argument(s)\&. .RE .PP INVALID_ZONE_STATE (13) .RS 4 .PP This error is raised in case Live Zone Reconfiguration mode was requested, but the zone in question wasn\'t running\&. .RE .RE .PP \fBenum PropertyValueType\fR .RS 4 .PP The type of property\&. PROP_COMPLEX is obsolete and is never used\&. .RE .RS 4 .PP PROP_SIMPLE (0) .PP PROP_LIST (1) .PP PROP_COMPLEX (2) .RE .SH "STRUCTURE TYPES" .PP \fBstruct Result\fR \(em An error occurred for the given operation\&. .RS 4 .PP \fBExample\ \&13.\ \&Retrieve an error information from the structure.\fR .sp .if n \{\ .RS 4 .\} .nf import rad\&.client as rad \&.\&.\&. try: test0\&.cancelConfig() except rad\&.ObjectError as e: result = e\&.get_payload() print("Result\&.code = %s" % result\&.code) .fi .if n \{\ .RE .\} .RE .RS 4 .PP \fBFields:\fR .PP \fBErrorCode\fR\ \&\fIcode\fR (\fInullable\fR) \(em See ErrorCode structure help for description of individual error codes\&. .PP \fBstring\fR\ \&\fIstr\fR (\fInullable\fR) \(em String representation of the actual error possibly including the information gathered from the low\-level error\&. .PP \fBstring\fR\ \&\fIstdout\fR (\fInullable\fR) \(em Contents of the standard output of a subprocess\&. See help for a given method for more information about whether stdout contents is set\&. .PP \fBstring\fR\ \&\fIstderr\fR (\fInullable\fR) \(em Contents of the standard error of a subprocess\&. See help for a given method for more information about whether stderr contents is set\&. .RE .PP \fBstruct ConfigChange\fR .RS 4 .PP The payload of a configChange event\&. .RE .RS 4 .PP \fBFields:\fR .PP \fBstring\fR\ \&\fIzone\fR .RE .PP \fBstruct StateChange\fR .RS 4 .PP The payload of a stateChange event\&. .RE .RS 4 .PP \fBFields:\fR .PP \fBstring\fR\ \&\fIzone\fR .PP \fBstring\fR\ \&\fIoldstate\fR .PP \fBstring\fR\ \&\fInewstate\fR .RE .PP \fBstruct Property\fR .RS 4 .PP A Resource property\&. complexvalue is obsolete and never used\&. .RE .RS 4 .PP \fBFields:\fR .PP \fBstring\fR\ \&\fIname\fR .PP \fBstring\fR\ \&\fIvalue\fR (\fInullable\fR) .PP \fBPropertyValueType\fR\ \&\fItype\fR (\fInullable\fR) .PP \fBstring[]\fR\ \&\fIlistvalue\fR (\fInullable\fR) .PP \fBstring[]\fR\ \&\fIcomplexvalue\fR (\fInullable\fR) .RE .PP \fBstruct Resource\fR \(em A zone resource\&. .RS 4 .PP This structure is used for storing information about an individual zone configuration resource\&. The structure can also be used for filtering resources in methods such as getResources(), removeResources(), getResourceProperties() and setResourceProperties\&. .PP The rules for matching individual configuration resources are as follows: .PP 1\&. Resources are matched based on the filter\'s type attribute first\&. .PP 2\&. If the properties attribute of the filter is NULL (or is an empty array), then no additional filtering is done\&. .PP 3\&. If the properties attribute is a non\-empty array of property elements, the resource is first checked to determine if it contains a property of this name\&. Then a check is performed to confirm that the property simple value matches (that is, the value attribute of the property in the filter object is not NULL) .PP 4\&. Step 3 is evaluated for each Property in the filter object\&. If all checks evaluate to true (that is, property is present and possibly has the requested value if specified in the filter object), then the Resource is added to the list of matches\&. .PP See examples and specific documentation for individual methods which accept Resource as filter argument\&. .RE .RS 4 .PP \fBFields:\fR .PP \fBstring\fR\ \&\fItype\fR .PP \fBProperty\fR\fB[]\fR\ \&\fIproperties\fR (\fInullable\fR) .PP \fBstring\fR\ \&\fIparent\fR (\fInullable\fR) \(em Private implementation detail to supported hierarchically nested resources\&. .RE .PP \fBVersion:\fR (1\&.2)