.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "NetApp::Filer::Export 3pm" .TH NetApp::Filer::Export 3pm "2008-11-26" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" NetApp::Filer::Export \-\- OO Class for representing NFS exports .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use NetApp::Filer; \& \& my $filer = NetApp::Filer\->new({ ... }); \& \& # Filer methods for querying exports: \& my @exports = $filer\->get_exports; \& my @temporary_exports = $filer\->get_temporary_exports; \& my @permanent_exports = $filer\->get_permanent_exports; \& my @active_exports = $filer\->get_active_exports; \& my @inactive_exports = $filer\->get_inactive_exports; \& \& # Methods for accessing export attributes \& foreach my $export ( @exports ) { \& \& } \& \& # Methods for changing export attributes .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class encapsulates a single \s-1NFS\s0 export on a NetApp filer, and provides methods for managing them. There are related methods in the NetApp::Filer class for manging exports as a whole, but the methods in this class are specific to a single \s-1NFS\s0 export. .SS "\s-1API\s0 specific attributes" .IX Subsection "API specific attributes" This \s-1API\s0 also attempts to bring some sanity to how exports are managed, and some consistency to the interface. Most of the attributes of an export are fairly obvious, and they map directly to the options supported by \*(L"exportfs\*(R" and the /etc/exports file. This \&\s-1API\s0 introduces two new attributes: 'type' and 'active'; .PP \fIThe type attribute\fR .IX Subsection "The type attribute" .PP In order to distinguish between exports which are temporary (i.e. \s-1NOT\s0 saved to /etc/exports) and those which are permanent (i.e. \s-1ARE\s0 saved to /etc/exports), this \s-1API\s0 support a \*(L"type\*(R", which be either of: .PP .Vb 2 \& permanent \& temporary .Ve .PP A temporary export is one which was created using \*(L"exportfs \-io\*(R", and which was not saved to /etc/exports. These exports will not survive a reboot of the filer. .PP A permanent export is one which is found in /etc/exports. .PP \fIThe active attribute\fR .IX Subsection "The active attribute" .PP Since you can change the export options for a filesystem temporarily (for example, by using the \*(L"fencing\*(R" option \-b, or just manually specifying different options and re-exporting using \-io), some permanent exports may not be in effect on the system. .PP The active attribute is used to track these. If the active attribute is true, then the export is currently in effect. Almost by definition, all temporary exports are always active. However, if a permanent export is not in effect because a temporary export for the same pathname has been created, then such an export is considerd inactive. .SS "Global vs. Limited ro/rw Attributes" .IX Subsection "Global vs. Limited ro/rw Attributes" The \*(L"ro\*(R" and \*(L"rw\*(R" export options really have two different modes of use. If either option is specified with no \*(L"=a[:b[:c...]]\*(R" list, then it means \s-1ALL\s0 hosts. Since this \s-1API\s0 provides methods for adding and removing entries from those lists, it treats the \*(L"all\*(R" cases special, by managing thenm as separate attributes. .PP To specify global readonly or readwrite access, use the following options: .PP .Vb 2 \& ro_all \& rw_all .Ve .PP These have boolean values. The \*(L"rw\*(R" and \*(L"ro\*(R" attributes/options are \&\s-1ARRAY\s0 references, each containing the list of entries for an \*(L"rw=\*(R" or \&\*(L"ro=\*(R" list for managing limited access. .SS "Change and Update Semantics" .IX Subsection "Change and Update Semantics" There are several methods for changing the attributes of an export object, but in \s-1ALL\s0 cases, these merely change the object in memory. In order for the attribute change to take effect, the update method must be called, which will generate and execute the appropriate \&\*(L"exportfs\*(R" command. .PP For example, suppose you wanted to remove root access for a specific hostname from all exports on a filer: .PP .Vb 1 \& my $untrusted = \*(Aqunsafe.foo.com\*(Aq; \& \& my @exports = $filer\->get_exports; \& \& foreach my $export ( @exports ) { \& if ( $export\->has_root( $untrusted ) ) { \& $export\->remove_root( $untrusted ); \& $export\->update; \& } \& } .Ve .PP The \*(L"remove_root\*(R" method simply removes the entry from the object in memory. The \*(L"update\*(R" method re-exports that filesystem to make the change take effect on the filer. .SH "METHODS" .IX Header "METHODS" .SS "get_filer" .IX Subsection "get_filer" Returns the NetApp::Filer object for the filer on which this export exists. .SS "get_type" .IX Subsection "get_type" Returns a string with one of the following values: .PP .Vb 2 \& temporary \& permanent .Ve .PP indicating whether or not this particular export has been written to /etc/exports. .SS "get_active" .IX Subsection "get_active" Returns a boolean value, false only if the type is \*(L"permanent\*(R", and the same export was not found in the list of currently active exports (i.e. not found in the output of \*(L"exportfs\*(R"). A temporary export is always active, by definition. .SS "get_path" .IX Subsection "get_path" Returns a string representing the path for the export. Note that this may not necessarily be the same as the actual pathname of the underlying volume or qtree. .SS "get_actual" .IX Subsection "get_actual" Returns a string representing the \*(L"actual\*(R" path of the underlying volume or qtree for the export. If a volume or qtree as been exported using a different name, this is the actual path of the underlying object. If this export option was not used, this method will return an empty string. .SS "get_nosuid" .IX Subsection "get_nosuid" Returns a boolean value, indicating whether or not the \*(L"nosuid\*(R" option is used by the export. .ie n .SS "set_nosuid( $boolean )" .el .SS "set_nosuid( \f(CW$boolean\fP )" .IX Subsection "set_nosuid( $boolean )" This method takes a single argument, interpreted in boolean context, an sets the \*(L"nosuid\*(R" option for the export. .SS "get_anon" .IX Subsection "get_anon" Returns the value of the \*(L"anon\*(R" option, if set. Since this option can have the value of \*(L"0\*(R", it returns undef when this option has not been set. .PP \&\s-1WARNING:\s0 be careful interpreting this in a simple boolean context. To test whether or not this option has been set use \*(L"defined\*(R". .ie n .SS "set_anon( $anon )" .el .SS "set_anon( \f(CW$anon\fP )" .IX Subsection "set_anon( $anon )" Takes a single argument, and sest the \*(L"anon\*(R" opton to that value. To unset this option, pass an undefined value: .PP .Vb 1 \& $export\->set_anon( undef ); .Ve .SS "get_sec" .IX Subsection "get_sec" Returns a list of the \*(L"sec\*(R" option values. .ie n .SS "set_sec( $arrayref )" .el .SS "set_sec( \f(CW$arrayref\fP )" .IX Subsection "set_sec( $arrayref )" Takes a single argument, an array reference of \*(L"sec\*(R" values, which can be any of: none, sec, krb5, krb5i, or krb5p. This \s-1API\s0 does no validation of these values, so if an invalid value is given, this will result in a fatal exception when the \*(L"update\*(R" method is called. .ie n .SS "has_sec( $sec )" .el .SS "has_sec( \f(CW$sec\fP )" .IX Subsection "has_sec( $sec )" Takes a single string argument, and returns true if that value is found in the list of \*(L"sec\*(R" options, false otherwise. .ie n .SS "add_sec( $sec )" .el .SS "add_sec( \f(CW$sec\fP )" .IX Subsection "add_sec( $sec )" Takes a single string argument, and adds that value to the list of \&\*(L"sec\*(R" options, if not already present. .ie n .SS "remove_sec( $sec )" .el .SS "remove_sec( \f(CW$sec\fP )" .IX Subsection "remove_sec( $sec )" Takes a single string argument, and removes that value from the list of \*(L"sec\*(R" options, if present. .SS "get_root" .IX Subsection "get_root" Returns a list of the \*(L"root\*(R" option values. .ie n .SS "set_root( $arrayref )" .el .SS "set_root( \f(CW$arrayref\fP )" .IX Subsection "set_root( $arrayref )" Takes a single argument, an array reference of \*(L"root\*(R" values, which can be any combination of hostnames, \s-1IP\s0 addresses, or networks. Again, no data validation is performed, so bogus values will not be detected until the export is updated on the filer, using the \*(L"update\*(R" method. .PP To clear the root option entirely, simply pass an empty array reference. .ie n .SS "has_root( $root )" .el .SS "has_root( \f(CW$root\fP )" .IX Subsection "has_root( $root )" Takes a single string argument, and returns true if that value is found in the list of \*(L"root\*(R" options, false otherwise. .ie n .SS "add_root( $root )" .el .SS "add_root( \f(CW$root\fP )" .IX Subsection "add_root( $root )" Takes a single string argument, and adds that value to the list of \&\*(L"root\*(R" options, if not already present. .ie n .SS "remove_root( $root )" .el .SS "remove_root( \f(CW$root\fP )" .IX Subsection "remove_root( $root )" Takes a single string argument, and removes that value from the list of \*(L"root\*(R" options, if present. .SS "get_ro_all" .IX Subsection "get_ro_all" Returns a boolean value, indicating whether or not the \*(L"ro_all\*(R" option has been set. .ie n .SS "set_ro_all( $boolean )" .el .SS "set_ro_all( \f(CW$boolean\fP )" .IX Subsection "set_ro_all( $boolean )" Takes a single boolean argument, and sets the \*(L"ro_all\*(R" option to it's value. Setting \*(L"ro_all\*(R" to a true value will clear the \*(L"ro\*(R" list, if it exists. .PP Also, if \*(L"ro_all\*(R" is true, then the following methods will quietly do nothing: .PP .Vb 3 \& has_ro \& add_ro \& remove_ro .Ve .PP The \*(L"ro_all\*(R" option must be cleared (set to a false value) first. .SS "get_ro" .IX Subsection "get_ro" Returns a list of the \*(L"ro\*(R" entries, if any. Returns nothing if \&\*(L"ro_all\*(R" has been set. .ie n .SS "set_ro( $arrayref )" .el .SS "set_ro( \f(CW$arrayref\fP )" .IX Subsection "set_ro( $arrayref )" Takes a single argument, an array reference of \*(L"ro\*(R" values. Setting the \*(L"ro\*(R" list explicitly will set clear \*(L"ro_all\*(R" (set it to a false value). .ie n .SS "has_ro( $ro )" .el .SS "has_ro( \f(CW$ro\fP )" .IX Subsection "has_ro( $ro )" Takes a single argument, and returns true if that value is found in the list of \*(L"ro\*(R" options, false otherwise. If \*(L"ro_all\*(R" is true, then it always returns false. .ie n .SS "add_ro( $ro )" .el .SS "add_ro( \f(CW$ro\fP )" .IX Subsection "add_ro( $ro )" Takes a single string argument, and adds that value to the list of \&\*(L"ro\*(R" options, if not already present. If \*(L"ro_all\*(R" is true, then this method will do nothing. .ie n .SS "remove_ro( $ro )" .el .SS "remove_ro( \f(CW$ro\fP )" .IX Subsection "remove_ro( $ro )" Takes a single string argument, and removes that value from the list of \*(L"ro\*(R" options, if present. If \*(L"ro_all\*(R" is true, then this method does nothing. .SS "get_rw_all, set_rw_all, get_rw, set_rw, has_rw, add_rw, remove_rw" .IX Subsection "get_rw_all, set_rw_all, get_rw, set_rw, has_rw, add_rw, remove_rw" All of these methods behave exactly the same as their \*(L"ro\*(R" counterparts described immediately above. They apply to the \*(L"rw\*(R" option, instead of \*(L"ro\*(R", but if that isn't obvious... .SS "update" .IX Subsection "update" This method re-exports the export, using \*(L"exportfs\*(R". If \s-1ANY\s0 of the object attributes have been changed programmatically, those changes will not take effect on the filer until this method has been called. .PP Note that updating an export will not necessarily change it's \*(L"type\*(R" from temporary to permanent, unless the \*(L"type\*(R" is explicitly changed. .ie n .SS "compare( $export )" .el .SS "compare( \f(CW$export\fP )" .IX Subsection "compare( $export )" This method takes a single NetApp::Filer::Export object, and compares the current object (that is, the one on which the method was called) to it. If they have the same basic export options, it returns true, otherwise, it returns false. Only the following options are compared: .PP .Vb 7 \& actual \& nosuid \& anon \& sec \& root \& rw/rw_all \& ro/ro_all .Ve