IBM-SONAS
view release on metacpan or search on metacpan
NAME
IBM::SONAS - Perl API to IBM SONAS CLI
SYNOPSIS
IBM::SONAS is a Perl API to IBM SONAS CLI.
use IBM::SONAS;
# Create an IBM::SONAS object
my $ibm = IBM::SONAS->new(
user => 'admin',
host => 'my-sonas.company.com',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
METHODS
new ( %ARGS )
my $ibm = IBM::SONAS->new(
user => 'admin',
host => 'my-sonas.company.com',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
Constructor - creates a new IBM::SONAS object. This method accepts three
mandatory parameters and one optional parameter, the three mandatory
parameters are:
user
The username of the user with which to connect to the device.
host
The hostname or IP address of the device to which we are connecting.
key_path
Either a relative or fully qualified path to the private ssh key
valid for the user name and device to which we are connecting. Please
note that the executing user must have read permission to this key.
disk ( $id )
# Get the disk named "system_vol_00" as an
# IBM::StorageSystem::Disk object
my $disk = $ibm->disk(system_vol_00);
# Print the disk status
print $disk->status;
# Alternately
print $ibm->disk(system_vol_00)->status;
Returns a IBM::StorageSystem::Disk object representing the disk
specified by the value of the id parameter, which should be a valid disk
name in the target system.
Note that this is a caching method and that a previously retrieved
IBM::StorageSystem::Array object will be returned if one has been cached
from previous invocations.
get_disk( $id )
This is a functionally equivalent non-caching implementation of the disk
method.
get_disks
# Print a listing of all disks in the target system including their
# name, the assigned pool and status
printf( "%-20s%-20s%-20s\n",
"Name",
"Pool",
"Status"
);
printf( "%-20s%-20s%-20s\n",
"-----",
"------",
"-------"
);
foreach my $disk ( $ibm->get_disks ) {
printf( "%-20s%-20s%-20s\n",
( run in 0.739 second using v1.01-cache-2.11-cpan-0d23b851a93 )