---
name: "NetApp::Aggregate"
section: "3pm"
platform: "linux"
package: "libnetapp-perl"
version: "500.002-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/NetApp::Aggregate"
---

# NetApp::Aggregate(3pm)

## NAME

NetApp::Aggregate -- OO class for creating and managing NetApp filer aggregates

## SYNOPSIS

```
    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' );
```

## DESCRIPTION

This class encapsulates a single NetApp filer aggregate, and provides methods for querying information about the aggregate and it's sub-objects (eg. volumes), as well as methods for managing the aggregate itself.

## INSTANCE METHODS

### General Instance Methods

*get\_filer*

Returns the NetApp::Filer object representing the filer on which the aggregate exists.

*get\_name*

Returns the name of the aggregate as a string.

*get\_states, get\_statuses, get\_options*

Each of these methods returns a list of strings, each of which represents a single state, status, or option for the aggregate.

```
    NOTE: All you English grammar pluralization rules fanatics can
    give up trying to convince the author to call that one method
    get_stati.
```

*get\_state( $state ), get\_status( $status ), get\_option( $option )*

Each of these methods returns the value for the specified state, status or option.  If that particular key wasn't present, then this method will return undef.  This makes it easy to tell the difference between a key that doesn't exist, and one that has a false value.

*get\_plex*

Returns the NetApp::Aggregate::Plex object representing the plex on which the aggregate lives.

### Volume Specific Methods

*get\_volume\_names*

Returns a list of the volume names which are contained within this aggregate.

*get\_volumes*

Returns a list of NetApp::Volume objects, each of which represents one of the volumes in the aggregate.

*get\_volume( $name )*

Returns a single NetApp::Volume object representing the specified volume.  If that volume doesn't exist on the aggregate, then a fatal exception is raised.

*create\_volume( %args )*

This method creates a flexible volume in the aggregate, and returns the NetApp::Volume object representing the new volume.  The arguments are as follows.  All values are simple strings, unless otherwise noted.

```
    $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,
    );
```

Both the source\_filer and source\_volume arguments must be given when creating a flexcache volume.

The space and language arguments may not be specified with the source\_filer/source\_volume arguments.

*destroy\_volume( %args )*

Destroys the specified volume.  Note that 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.

```
    $aggregate->destroy_volume(
        # Required argument
        name            => $name,
    );
```

The `$name` must be a string, and it must be one of the volumes in the `$aggregate`.

### Qtree Specific Methods

*get\_qtree\_names*

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

*get\_qtrees*

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

*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.  This method simply returns nothing if the specified qtree doesn't exist on the aggregate.

### Snapshot Specific Methods

*get\_snapshots*

Returns a list of NetApp::Snapshot objects for each of the snapshots of the aggregate.

*get\_snapshot( $name )*

Returns a single NetApp::Snapshot object matching the specified name, if it exists for the aggregate.

*create\_snapshot( $name )*

Creates a snapshot of the aggregate with the specified name.

*delete\_snapshot( $name )*

Deletes a snapshot of the aggregate with the specified name.

*get\_snapshot\_deltas*

Returns a list of NetApp::Snapshot::Delta objects for each snapshot delta for the aggregate.

*get\_snapshot\_reserved*

Returns a string representing the amount of reserved space, as a percentage.  This string does NOT include the % sign.

*set\_snapshot\_reserved( $percentage )*

Sets the snapshot reserved space to the specified percentage, which should also NOT include the % sign.

*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 arguments passed.  The argument 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 will be soon.  This documentation serves as a guideline for how to implement the perl API for each associates CLI function.

### 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,
    );
```

### $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,
    );
```

### $aggregate-\>destroy()

NOTE: This always uses the -force option, since this API is not interactive.

### $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.  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.

### $aggregate-\>rename( $newname )

### $aggregate-\>restrict( ... )

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