API::PureStorage - Interacting with Pure Storage devices
my $pure = new API::PureStorage ($host, $api_token); my $info = $pure->array_info(); my $percent = sprintf('%0.2f', (100 * $info->{total} / $info->{capacity})); print "The array $host is currently $percent full\n";
This module is a wrapper around the Pure Storage API for their devices.
It currently supports API v1.4 and earlier. It supports a limited set of the available API commands: basic reading of volume and array information.
my %volume_info = $pure->volume_info() my $volume_info_ref = $pure->volume_info()
Returns a hash or hasref (depending on requested context) of general array information, including space usage.
* hostname - the configured hostname of the system
* total_reduction - The current overall data reduction multiple of the array. IE: A "2" here means "2:1" reduction.
* data_reduction - The reduction multiple of just data partitions.
Array-wide space usage info:
* volumes - bytes in use by active volume data
* shared_space - bytes recognized in use between multiple copies, volumes, snapshots, etc
* snapshots - bytes in use by snapshots
* system - bytes in use by system overhead. This can include recently allocated bytes that have yet to be accounted for in other categories. IE: a recently deleted volume that has yet to garbage collect.
* total - a byte count of all data on the system.
* capacity - the total capacity of the array in bytes
* thin_provisioning - ?
NB: To calculate the percentage usage of whole array, divide total by capacity.
my @volume_info = $pure->volume_info() my $volume_info_ref = $pure->volume_info()
Returns an array or arrayref of general information about volumes include space usage.
Each element of the array is a hash reference, representing a single volume.
* name - the name of this volume
* data_reduction - Reduction multiple of the data on this volume
* total_reduction - overall reduction multiple of this volume
Volume space usage info:
* shared_space - bytes recognized in use between multiple copies, snapshots, etc
* system - bytes in use by system overhead
* total - a byte count of all data used by the the volume
* size - the max size of the volume
NB: To calculate the percentage usage of the volume, divide total by size.
my @versions = $pure->version() my $versions_ref = $pure->version()
Returns an array/arrayref of API versions supported by the storage array.
http://www.purestorage.com/
Bug tracking for this module: https://rt.cpan.org/Dist/Display.html?Name=API-PureStorage Source hosting: http://www.github.com/bennie/perl-API-PureStorage
API::PureStorage v0.02 (2016/07/01)
(c) 2015-2016, Phillip Pollard <bennie@cpan.org> Published with permission of Pure Storage, Inc.
This source code is released under the "Perl Artistic License 2.0," the text of which is included in the LICENSE file of this distribution. It may also be reviewed here: http://opensource.org/licenses/artistic-license-2.0
Authored by Phillip Pollard.
To install API::PureStorage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm API::PureStorage
CPAN shell
perl -MCPAN -e shell install API::PureStorage
For more information on module installation, please visit the detailed CPAN module installation guide.