NetApp...gregate(3pm)

๐Ÿ“ฆ
version 500.002 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

โœจ NetApp::Aggregate โ€” the perl manual page but make it cute โœจ

okay bestie, welcome to NetApp...gregate(3pm) from the User Contributed Perl Documentation โœจ it's giving very "I manage NetApp filer aggregates for a living and I'm also fun at parties". let's get into it ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

NetApp::Aggregate โ€” it's an OO class, and its whole job is creating and managing NetApp filer aggregates. that's it. that's the girl. ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

here's the vibe, literally copy-paste core:

use NetApp::Filer;
use NetApp::Aggregate;

my $filer = NetApp::Filer->new({ .... });

my @aggregate_names = $filer->get_aggregate_names;

my @aggregates      = $filer->get_aggregates;

my $aggregate       = $filer->get_aggregate( 'aggr01' );

look at that. gorgeous. no notes. ๐ŸŒˆ


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so this class wraps up a single NetApp filer aggregate (one. just one. main character energy only) and gives you methods to:

  • query info about the aggregate itself
  • query info about its sub-objects (eg. volumes, iykyk)
  • manage the aggregate itself

that's the whole thing bestie, it's honestly so tidy ๐ŸŽ€


๐Ÿซถ INSTANCE METHODS ๐Ÿซถ

โญ General Instance Methods โญ

  • get_filer โ€” hands you the NetApp::Filer object for the filer that this aggregate lives on. it's the aggregate's home address basically ๐Ÿ 
  • get_name โ€” returns the name of the aggregate, as a string. simple. iconic.
  • get_states, get_statuses, get_options โ€” each one of these gives you back a list of strings, and each string is a single state, status, or option for the aggregate. so like, one string per thing, in a list. ๐Ÿ’ซ
NOTE: to all you English grammar pluralization rules fanatics out there โ€” give up trying to convince the author to call that one method get_stati. it's get_statuses. periodt. ๐Ÿ˜Œ
  • get_state( $state ), get_status( $status ), get_option( $option ) โ€” each of these returns the value for the state / status / option you asked for. and here's the cute part: if that particular key wasn't present, it returns undef. which means you can tell the difference between a key that literally doesn't exist and a key that exists but has a false value. slay, honestly ๐Ÿ”ฅ
  • get_plex โ€” returns the NetApp::Aggregate::Plex object for the plex the aggregate lives on. yes, plex. no, we're not elaborating. ๐Ÿฆ‹

๐Ÿ“ Volume Specific Methods ๐Ÿ“

  • get_volume_names โ€” returns a list of the volume names that live inside this aggregate. just names. ๐Ÿ’–
  • get_volumes โ€” returns a list of NetApp::Volume objects, and each one represents one of the volumes in the aggregate. the full objects this time, not just names ๐Ÿ‘‘
  • get_volume( $name ) โ€” returns a single NetApp::Volume object for the volume you specified. but if that volume doesn't exist on the aggregate, a fatal exception is raised. so, like, know your volumes bestie ๐Ÿ˜ญ
  • create_volume( %args ) โ€” makes a flexible volume in the aggregate and returns the NetApp::Volume object for the brand new volume. the arguments go like this โ€” all values are simple strings unless noted otherwise:
$aggregate->create_volume(
    # Required arguments
    name            => $name,
    size            => $size,
    # Optional arguments
    space           => 'none' | 'file' | 'volume',
    language        => $language,
    source_filer    => $source_filer,
    source_volume   => $source_volume,
);
heads up: both source_filer and source_volume must be given when you're creating a flexcache volume. and the space and language arguments may not be specified alongside the source_filer/source_volume arguments. pick a lane, bestie ๐Ÿ’…
  • destroy_volume( %args ) โ€” destroys the volume you specify. and listen: since this API is not designed to be used interactively, the -f (force) argument is always used. be sure you really want to destroy the volume, programatically. like, sure sure. ๐Ÿซฃ
$aggregate->destroy_volume(
    # Required argument
    name            => $name,
);

the $name must be a string, and it must be one of the volumes in the $aggregate. no random names, no ghost volumes, we don't do that here โœจ

๐Ÿงš Qtree Specific Methods ๐Ÿงš

  • get_qtree_names โ€” returns a list of strings, and each string is the name of a qtree on the aggregate. ๐ŸŒธ
  • get_qtrees โ€” returns a list of NetApp::Qtree objects, each one representing a single qtree on the aggregate. ๐Ÿ’œ
  • get_qtree( $name ) โ€” returns a single NetApp::Qtree object for the qtree name you gave. the name has to be in the form of a pathname, for example:
/vol/volume_name/qtree_name

also: the qtree_name is optional if you're querying the object for a volume's qtree. and this method simply returns nothing if the specified qtree doesn't exist on the aggregate. no drama, just silence ๐Ÿ’€

๐ŸŽ€ Snapshot Specific Methods ๐ŸŽ€

  • get_snapshots โ€” returns a list of NetApp::Snapshot objects, one for each of the aggregate's snapshots. ๐Ÿ“ธ
  • get_snapshot( $name ) โ€” returns a single NetApp::Snapshot object matching the name you gave, if it exists for the aggregate. ๐Ÿฆ‹
  • create_snapshot( $name ) โ€” creates a snapshot of the aggregate with the name you specified. โœจ
  • delete_snapshot( $name ) โ€” deletes a snapshot of the aggregate with the name you specified. bye bestie ๐Ÿ‘‹
  • get_snapshot_deltas โ€” returns a list of NetApp::Snapshot::Delta objects, one for each snapshot delta for the aggregate. ๐ŸŒˆ
  • get_snapshot_reserved โ€” returns a string representing the amount of reserved space, as a percentage. and this string does NOT include the % sign. it's just the number, bestie, do not add the percent ๐Ÿšซ
  • set_snapshot_reserved( $percentage ) โ€” sets the snapshot reserved space to the percentage you specify, which should also NOT include the % sign. same energy, opposite direction ๐Ÿ’…
  • get_snapshot_schedule โ€” returns a NetApp::Snapshot::Schedule object representing the snapshot schedule for the aggregate. ๐Ÿ—“๏ธ
  • set_snapshot_schedule( %args ) โ€” sets the snapshot schedule for the aggregate based on the args you pass. the syntax is:
$aggregate->set_snapshot_schedule(
    weekly          => $weekly,
    daily           => $daily,
    hourly          => $hourly,
    hourlist        => [
        $hour1, $hour2, $hour3, ....
    ],
);

๐Ÿ”ฎ TO BE IMPLEMENTED ๐Ÿ”ฎ

NOTE: currently, all of the following methods have yet to be implemented, but they will be soon. this documentation is serving as a guideline for how to implement the perl API for each associated CLI function. so like, manifesting โœจ

๐Ÿ‘‘ NetApp::Aggregate->create( ... )

my $aggregate       = NetApp::Aggregate->create(
    # Required arguments
    filer           => $filer,      # NetApp::Filer object
    name            => $aggregate_name,
    # Required but mutually exclusive arguments
    # Either 'disks' OR 'diskcount and/or disksize'
    disks           => [
                         [ $disk1, $disk2, .... ],
                         [ $diskn, $diskn+1, .... ],
                       ],
    diskcount       => $diskcount,
    disksize        => $disksize,
    # Optional arguments
    raidtype        => 'raid0' | 'raid4' | 'raid-dp',
    raidsize        => $raidsize,
    disktype        => 'ATA' | 'FCAL' | 'LUN' | 'SAS' | 'SATA' | 'SCSI',
    rpm             => $rpm,
    mirrored        => $boolean,
);

note the mutual exclusivity bestie โ€” it's either disks OR diskcount and/or disksize. not both. we don't do both ๐Ÿšซ

๐ŸŒธ $aggregate->add( ... )

$aggregate->add(
    # Required arguments
    name            => $aggregate_name,
    # Required but mutually exclusive arguments
    # Either 'disks' OR 'diskcount and/or disksize'
    disks           => [
                         [ $disk1, $disk2, .... ],
                         [ $diskn, $diskn+1, .... ],
                       ],
    diskcount       => $diskcount,
    disksize        => $disksize,
    # Optional arguments
    raidgroup       => $raidgroup,
    force           => 1,
);

same mutually exclusive situation up top โ€” disks or diskcount and/or disksize, choose one โœจ

๐Ÿ’€ $aggregate->destroy()

NOTE: this always uses the -force option, since this API is not interactive. no take-backs, no confirmation prompt, just vibes and consequences ๐Ÿ˜ญ

๐ŸŒ™ $aggregate->offline()

$aggregate->offline(
    # Optional arguments
    cifsdelaytime   => $cifsdelaytime,
);

โญ $aggregate->online()

NOTE: it is unclear whether or not we should always imply -f (force => 1), or whether we should treat the prompted scenario as an error and raise an exception. and since forcing an aggregate online can result in data loss when -f is used, perhaps we should force that state to be cleaned up first. so likeโ€ฆ unresolved. thinking about it. ๐Ÿซ 

๐Ÿฆ‹ $aggregate->rename( $newname )

that's the whole signature. it renames. with a new name. $newname. cute ๐Ÿ’œ

๐ŸŽ€ $aggregate->restrict( ... )

$aggregate->restrict(
    # Optional arguments
    cifsdelaytime   => $cifsdelaytime,
);

and that's the whole page bestie!! ๐Ÿซถ this was NetApp...gregate(3pm) from the User Contributed Perl Documentation, perl v5.36.0, dated 2022-11-19. go forth and manage those aggregates responsibly, mwah ๐Ÿ’…โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from