NetApp::Filer(3pm)

πŸ“¦
version 500.002 Β· 2 versions
  • 500.002 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 500.002 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NetApp::Filer(3pm) πŸ’–

okay bestie, this is the user-contributed Perl documentation for NetApp::Filer(3pm) πŸ’… welcome to the part where we learn how to talk to a NetApp Filer like a main character. no cap. πŸ¦‹


✨ NAME ✨

NetApp::Filer β€” OO Class for managing NetApp Filer devices πŸŽ€


✨ SYNOPSIS ✨

so the whole vibe is: you use NetApp::Filer; and then you spin up a filer object. two main flavors, depending on whether you're doing the ssh thing or the telnet thing. 🫢

           use NetApp::Filer;

           my $filer           = NetApp::Filer->new({
               hostname        => $hostname_of_nasfiler,
               ssh_identity    => "/path/to/ssh/identify/file",
           });

           my $filer           = NetApp::Filer->new({
               hostname        => $hostname_of_nasfiler,
               protocol        => 'telnet',
               telnet_password => $telnet_password,
           });

periodt. that's the shape of it. ✨


✨ DESCRIPTION ✨

okay so NetApp::Filer is literally the class that implements methods for communication with a NetApp Filer device. Both ssh and telnet are supported, but bestie, only ssh is really recommended. why? because NetApp doesn't support concurrent access via telnet, and the error checking using ssh is far more robust. plus, you can configure secure access via ssh without using passwords, but telnet access will always require a password. always. πŸ”₯


✨ METHODS ✨


πŸŽ€ Filer Specific Methods πŸŽ€

new( $args_ref )

Okay bestie, this is the whole entry point, listen up. This method takes a hash reference of arguments, and it hands you back a NetApp::Filer object that you're gonna use to talk to the filer you specified. πŸ’–

The arguments go a little something like this:

NetApp::Filer->new({
    # Required arguments
    hostname        => $hostname,
    # Optional arguments
    username        => $username,
    ssh_identify    => $ssh_identity,
    ssh_command     => [ @ssh_command ],
    protocol        => 'ssh' | 'telnet',
    telnet_password => $telnet_password,
    telnet_timeout  => $telnet_timeout,
    cache_enabled   => 0 || 1,
    cache_expiration => $cache_expiration,
});

Now let's break each one down, no skips, no skimming, we go through all of them. πŸ’…

  • hostname (required) β€” a string, and it's literally the hostname of the filer you wanna connect to. Non-negotiable, it's the whole point. 🌸
  • username (optional) β€” the username to use for communication. Defaults to 'root'. Lowkey classic.
  • ssh_identify (optional) β€” the ssh identify file to use for ssh communication. If you don't specify it, then ssh gets invoked without the -i argument, and it'll just use whatever default identify file is set up for the current user. πŸ™ˆ

In practice this argument will almost always be required, but the code allows it to be optional. The code is being chill like that.

Heads up: if the specified file doesn't exist, then a fatal exception is raised. No vibes, no mercy. πŸ’€
  • ssh_command (optional) β€” an array reference representing the ssh command to be used to communicate. Defaults to just ['ssh'].

Do not use this argument to specify the identity via -i. Instead, use the ssh_identify argument. If you need to specify certain ssh options, for example StrictHostKeyChecking, then use this argument. For example:

my $filer           = NetApp::Filer->new({
    hostname        => $somenasfiler,
    ssh_command     => [qw( ssh -o StrictHostKeyChecking=no )],
});
  • protocol (optional) β€” this option is a string, either 'ssh' or 'telnet'. The default, and recommended, protocol is ssh. While telnet is supported, only one concurrent root telnet session per filer is allowed, and the error checking over telnet is far less robust than ssh. So like... ssh, bestie. Please. 🫢
  • telnet_password (optional) β€” this option is a string, and it specifies the root password to use when connecting via telnet. Note that password based ssh connectivity is not supported, and telnet access, while supported, is not recommended. The author uses the telnet support for only one thing: installing the ssh keys, and configuring ssh access. That's it. That's the whole telnet career. πŸŽ€
  • cache_enabled (optional) β€”
NOTE: The caching mechanism is considered experimental. For one thing, it depends on using a patched version of Memoize::Expire, which is still not yet available on CPAN. Use with caution. ⚠️

This option has a boolean value, and is used to disable the internal caching of the results of several API calls. By default, the cache is disabled. If enabled, then the result of any of the following NetApp::Filer methods will be cached, using Memoize:

  • get_aggregate
  • get_volume
  • get_qtree

To enable caching of these API calls, set cache_enabled to a true value. The cached values will expire (see the next option), unless the expiration value is set to 0.

  • cache_expiration (optional) β€” this option is an integer, and it's the number of seconds to cache results of the above API calls. The default value is 10 seconds. Setting this value to 0 will prevent the cached values from expiring at all. Forever cache, iconic behaviour, slightly unhinged. ✨

get_version

Returns a NetApp::Filer::Version object. Simple. Clean. Slay.

get_licenses

Returns a list of NetApp::Filer::License objects, each of which represents a single licensed service on the filer. Note that if the service is "not licensed", it is ignored. Only services with active or expired license are returned. We don't do unlicensed over here. 🚫

get_license( $service )

Returns a single NetApp::Filer::License object for the specified service. One service, one object, no drama. πŸ’…

add_license( $code )

Adds a license using the specified code. Returns a boolean value only. That's the whole vibe.

delete_license( $service )

Deleted the license for the specified service. Returns a boolean value only. (Yes, "deleted", that's what the page says, I'm just the messenger. 😭)


🌈 Aggregate Specific Methods 🌈

get_aggregate_names

Returns a list of strings, each of which is the name of an aggregate on the filer. Just names, no objects, minimal effort, we respect it.

get_aggregates

Returns a list of NetApp::Aggregate objects, each of which represents an aggregate on the filer. Now we're getting the full glow-up. ✨

get_aggregate( $name )

Returns a single NetApp::Aggregate object for the specified aggregate name.

create_aggregate( %args )

Create an aggregate using the specified arguments, and it returns the NetApp::Aggregate object that represents it. The arguments are as follows:

my $aggregate = $filer->create_aggregate(
    # Required arguments
    name            => $name,
    # Optional arguments
    raidtype        => 'raid0' | 'raid4' | 'raid_dp',
    raidsize        => $raidsize,
    disktype        => 'ATA' | 'FCAL' | 'LUN' | 'SAS' | 'SATA' | 'SCSI',
    diskcount       => $diskcount,
    disksize        => $disksize,
    rpm             => $rpm,
    language        => $language,
    snaplock        => 'Compliance' | 'Enterprise',
    mirrored        => 1,           # -m
    traditional     => 1,           # -v
    force           => 1,           # -f
    disks           => [
        # To specify a single set of disks:
        'disk1', 'disk2', ....
        # To specify two sets of disks:
        [ 'disk1', 'disk2', .... ],
        [ 'diskn', 'disktn+1', .... ],
    ],
);

destroy_aggregate( %args )

Destroy an aggregate using the specified arguments. The arguments are as follows:

$filer->destroy_aggregate(
    # Required arguments
    name            => $name,
);

Gone. Poof. Bye bestie. πŸ‘‹


πŸ’œ Volume Specific Methods πŸ’œ

get_volume_names

Returns a list of strings, each of which is the name of a volume on the filer.

get_volumes

Returns a list of NetApp::Volume objects, each of which represents a volume on the filer.

get_volume( $name )

Returns a single NetApp::Volume object for the specified volume name.


πŸ¦‹ Qtree Specific Methods πŸ¦‹

get_qtree_names

Returns a list of strings, each of which is the name of a qtree on the filer.

get_qtrees

Returns a list of NetApp::Qtree objects, each of which represents a single qtree on the filer.

get_qtree( $name )

Returns a single NetApp::Qtree object for the specified qtree name. The name must in the form of a pathname, for example:

/vol/volume_name/qtree_name

The qtree_name is optional if querying the object for a volume's qtree. Flexible queen. πŸ‘‘

create_qtree( %args )

Creates a qtree on the filer. The arguments are as follows:

$filer->create_qtree(
    # Required arguments
    name            => $name,
    # Optional arguments
    mode            => $mode,
    security        => 'unix' | 'ntfs' | 'mixed',
    oplocks         => 0 | 1,
);
  • name (required) β€” the name of the qtree to create. Obviously. πŸŽ€
  • mode (optional) β€” the UNIX mode bits to use when creating the qtree.
  • security (optional) β€” the security of the qtree. This must be one of: unix, ntfs, or mixed. Pick one, there's no fourth option, don't try it. πŸ’…
  • oplocks (optional) β€” this option specifies whether or not oplocks are to be enabled on the qtree. The value is interpreted in a boolean context, true meaning "enabled" and false meaning "disabled".

⭐ Snapmirror Specific Methods ⭐

set_snapmirror_state( $state )

Sets the snapmirror state on the filer to the specified value, which must be either of the strings "off" or "on". Two options, that's the menu. πŸ“

get_snapmirror_state

Returns a string, either "off" or "on", indicating whether or not snapmirror is turned off or on for this filer.

get_snapmirrors

Returns a list of NetApp::Snapmirror objects, each of which represents a single snapmirror relationship on the filer.


🧚 Export Specific Methods 🧚

Okay so this one's a lil family. There is one general purpose method to retrieve all of the NFS exports on a filer, and 4 special purpose ones that make it easy to see the difference between the contents of /etc/exports, and the live exports reported by "exportfs". It's giving ✨ detective energy ✨.

get_exports

Returns a list of NetApp::Filer::Export objects, each of which represents an NFS export on the filer.

get_permanent_exports

Returns a list of NetApp::Filer::Export objects, each of which represents a permanent export, which is one found in the /etc/exports file. These are the ones that actually survive a reboot, iykyk. 🫢

get_temporary_exports

Returns a list of NetApp::Filer::Export objects, each of which represents a temporary export, which is one NOT found in the /etc/exports file. Temporary exports are ones created manually, using "exportfs -io", or by using the "exportfs -b" option to fence clients, or any other command which creates a live NFS export that has not yet been written to /etc/exports, and which will not survive a reboot of the filer. Live fast, die on reboot. πŸ’€

get_active_exports

Returns a list of NetApp::Filer::Export objects, each of which represents a active export. Active exports are those reported by the "exportfs" command. They can be permanent, if they are found in /etc/exports, or temporary, if created by hand. Both flavours, valid.

get_inactive_exports

Returns a list of NetApp::Filer::Export objects, each of which represents a inactive export. An inactive export is a permanent export found in /etc/exports, but which is NOT found in the list of active exports reported by "exportfs". If the options of a permanent export are changed, but not saved to /etc/exports (eg. re-export something with "exportfs -io"), then the active, temporary export for that same path, and the inactive, permanent export in /etc/exports can both exist concurrently. Two exports, same path, coexisting. Chaotic but valid. πŸ™ˆ


And that's the whole page, bestie!! πŸŽ‰ This one's from perl v5.36.0, dated 2022-11-19, and it's page NetApp::Filer(3pm). Go forth and talk to your filer. πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from