NetApp::Volume(3pm)
๐ NetApp::Volume โ the manual page, but make it slay ๐
okay bestie, this is NetApp::Volume, a page from the User Contributed Perl Documentation. it's a whole class, and it's here to run your NetApp filer volumes. let's get into it ๐ซถ
โจ NAME โจ
NetApp::Volume โ it's an OO class for creating and managing NetApp filer volumes. that's the whole vibe. object-oriented, volume-managing, iconic. ๐
๐ธ SYNOPSIS ๐ธ
here's how you'd actually get your hands on one:
use NetApp::Filer;
use NetApp::Aggregate;
my $filer = NetApp::Filer->new({ .... });
my @volume_names = $filer->get_volume_names;
my @volumes = $filer->get_volumes;
my $volume = $filer->get_volume( 'volname' );
look at you, already slaying โจ
๐ฆ DESCRIPTION ๐ฆ
so this class wraps up a single NetApp filer volume โ like, one volume, that's its whole personality. it gives you methods to query stuff about the volume and its sub-objects (qtrees, hi besties ๐), plus methods to manage the volume itself. query and manage. the duality. the range. ๐
๐ INSTANCE METHODS ๐
get_filer
hands you back the NetApp::Filer object โ the filer where this aggregate lives. ๐ซถ
get_name
returns the name of the volume, as a string. simple. elegant. iconic.
get_states, get_statuses, get_options
each one of these gives you a list of strings, and each string is a single state, status, or option for the volume.
NOTE: all you English-grammar pluralization fanatics out there? you can genuinely give up trying to convince the author to call that one method get_stati. it's not happening. let it go. ๐
get_state( $state ), get_status( $status ), get_option( $option )
each of these gives you the value for the state, status, or option you asked for. and if that particular key wasn't present? you get undef back. which is actually so useful, because it means you can tell the difference between a key that straight-up doesn't exist and a key that exists but has a false value. big brain energy ngl ๐ง โจ
set_option( $option => $value )
sets one single option to the value you specify. it always returns true, and it raises a fatal exception if it can't set the option. no cap, it will just die on you. ๐ญ
get_aggregate_name
returns the name of the aggregate that the volume lives on. but heads up โ for a "traditonal" volume, this comes back as a false value. ๐
get_aggregate
returns the NetApp::Aggregate object representing the aggregate the volume lives on. and again โ for a "traditonal" volume, this is a false value.
get_qtree_names
returns a list of strings, each one being the name of a qtree on the volume. ๐
get_qtrees
returns a list of NetApp::Qtree objects, each representing a single qtree on the volume.
get_qtree( $name )
returns one single NetApp::Qtree object for the qtree name you specify. and the name has to be in the form of a pathname, like this:
/vol/volume_name/qtree_name
the qtree_name is optional if you're querying the object for a volume's qtree. and if the qtree you asked for doesn't exist on the volume? this method just returns nothing. no drama. ๐
get_language
returns a string that represents the language code for the volume. ๐
set_language( $language )
sets the language code to whatever value you pass in. always returns a true value โ or raises a fatal exception if the language code can't be set. periodt.
get_size
returns the size of the volume, as a string.
set_size( $size )
sets the size of the volume to the value you give it. in all cases, that $size value is the same form that the create() method accepts, and also the same form the underlying ONTAP CLI command accepts:
[+|-] <number> k|m|g|t
get_maxfiles
returns the maxfiles value for the volume.
set_maxfiles( $maxfiles )
sets the maxfiles value for the volume.
is_clone
returns true if the volume is a clone, false if it isn't. vibe check: are you a clone or not ๐ช
get_parent_name
returns a string with the name of the parent volume โ but only if this volume is a clone.
get_parent
returns a NetApp::Volume object for the parent volume โ again, only if this volume is a clone.
get_snapshot_name
returns a string with the snapshot name, if the volume is a clone.
get_snapshot
NOT YET IMPLEMENTED. once the API gets extended to support snapshots, this will return a NetApp::Snapshot object (RSN, I'm sure...). ๐ญ manifesting it fr fr
get_snapmirrors
returns a list of NetApp::Snapmirror objects, each one representing a snapmirror relationship for this volume. ๐ฅ
offline( %args )
takes the volume offline. the arguments are as follows:
$volume->offline(
# Optional arguments
cifsdelaytime => $cifsdelaytime,
);
online( %args )
brings the volume online. the arguments are as follows:
$volume->online(
# Optional arguments
force => 1,
);
rename( %args )
renames the volume to whatever newname you specify. always returns a true value, and raises a fatal exception if the name can't be changed. the arguments are as follows:
$volume->rename(
# Required arguments
newname => $newname,
);
restrict( %args )
puts the volume into the restricted state. the arguments are as follows:
$volume->restrict(
# Optional arguments
cifsdelaytime => $cifsdelaytime,
);
๐ธ Snapshot Specific Methods ๐ธ
get_snapshots
returns a list of NetApp::Snapshot objects, one for each of the volume's snapshots.
get_snapshot( $name )
returns a single NetApp::Snapshot object matching the name you specify โ if it exists for the volume.
create_snapshot( $name )
creates a snapshot of the volume with the name you specify. โจ
delete_snapshot( $name )
deletes a snapshot of the volume with the name you specify. bye bestie ๐
get_snapshot_deltas
returns a list of NetApp::Snapshot::Delta objects, one for each snapshot delta for the volume.
get_snapshot_reserved
returns a string representing the amount of reserved space, as a percentage. and listen โ this string does NOT include the % sign. do not come for me, it's just how it is.
set_snapshot_reserved( $percentage )
sets the snapshot reserved space to the percentage you specify, which should also NOT include the % sign. matching energy, love that for us.
get_snapshot_schedule
returns a NetApp::Snapshot::Schedule object representing the snapshot schedule for the volume. ๐๏ธ
set_snapshot_schedule( %args )
sets the snapshot schedule for the volume based on the arguments you pass. the argument syntax is:
$volume->set_snapshot_schedule(
weekly => $weekly,
daily => $daily,
hourly => $hourly,
hourlist => [
$hour1, $hour2, $hour3, ....
],
);
enable_shapshot_autodelete
this method turns on snapshot autodelete for the volume.
(yes the method name in the source says shapshot. we don't fix it. we respect it. it's part of the lore now. ๐)
disable_snapshot_autodelete
this method turns off snapshot autodelete for the volume.
reset_snapshot_autodelete
this method resets snapshot autodelete for the volume back to the filer defaults. ๐ง
set_snapshot_autodelete_option( $name => $value )
sets the snapshot autodelete option you name ($name) to the value you specify ($value).
get_snapshot_autodelete_option( $name )
returns the value of the autodelete option you name ($name). and note this: if the prefix is "(not specified)", then the value returned is the empty string. so watch out for that one, bestie.
๐ซ UNIMPLEMENTED COMMANDS ๐ซ
these ONTAP vol commands are not implemented, because the same functionality and info is already available through this API by some other means. so like, we didn't forget. we chose. ๐
container
the aggregate containing the volume can be grabbed using:
$volume->get_aggregate;
which will return the NetApp::Aggregate object for it. slay.
๐ฎ TO BE IMPLEMENTED ๐ฎ
all the other commands will be implemented in a future release of this API. and commands for flexible volumes will most likely get preference over traditional volumes. flexible volumes stay winning ๐
autosize
it's genuinely not yet clear how this one should be implemented, since the command does several things. it enables and disables the autosize feature, or resets it to defaults, and it also sets the maximum and incremental sizes to autosize to.
this could be implemented a few different ways, for example:
$volume->autosize(
# Optional arguments
maximum => $maximum,
incremental => $incremental,
# Optional, but mutually exclusive:
on => 1,
off => 1,
reset => 1,
);
that seems a little clumsy though, ngl. perhaps a better interface would be to have methods controlling the state of the feature:
$volume->enable_autosize;
$volume->disable_autosize;
$volume->reset_autosize;
and then methods to set/get the autosize values:
$volume_set_autosize(
# Required but mutually exclusive options
maximum => $maximum,
incremental => $incremental,
);
$volume->get_autosize;
like, the range?? the design discourse?? we love to see it ๐ซถ
and that's the whole page, bestie. this one came out of perl v5.36.0, dated 2022-11-19 โ so yeah, shoutout to that version and that date, they're doing great. mwah ๐ bye!! โจ๐๐ฆ๐ธ
๐ฆ where this page comes from
- debian bookworm: libnetapp-perl 500.002-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnetapp-perl 500.002-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnetapp-perl 500.002-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnetapp-perl 500.002-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnetapp-perl 500.002-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms