IBM-StorageSystem

 view release on metacpan or  search on metacpan

lib/IBM/StorageSystem/VDisk/Copy.pm  view on Meta::CPAN

package IBM::StorageSystem::VDisk::Copy;

use strict;
use warnings;

use Carp qw(croak);

our $VERSION = '0.01';
our @ATTR = qw(autoexpand capacity copy_id easy_tier easy_tier_status fast_write_state 
free_capacity grainsize mdisk_grp_id mdisk_grp_name mdisk_id mdisk_name overallocation 
primary real_capacity se_copy status sync tier tier_capacity type used_capacity 
vdisk_id vdisk_name warning);

foreach my $attr ( @ATTR ) { 
        {   
                no strict 'refs';
                *{ __PACKAGE__ .'::'. $attr } = sub {
                        my( $self, $val ) = @_; 
                        $self->{$attr} = $val if $val;
                        return $self->{$attr}
                }   
        }   
}

sub new {
        my( $class, $ibm, %args ) = @_; 
        my $self = bless {}, $class;
        defined $args{copy_id} or croak 'Constructor failed: mandatory copy_id argument not supplied';
        foreach my $attr ( @ATTR ) { $self->{$attr} = $args{$attr} }

        return $self
}

1;

__END__

=pod

=head1 NAME

IBM::StorageSystem::VDisk::Copy - Class for operations with IBM StorageSystem VDisk Copies

=head1 VERSION

Version 0.01

=head1 SYNOPSIS

IBM::StorageSystem::VDisk::Copy - Class for operations with IBM StorageSystem VDisk Copies

	use IBM::StorageSystem;
        
	my $ibm = IBM::StorageSystem->new( user            => 'admin',
			 	   host            => 'my-v7000',
				   key_path        => '/path/to/my/.ssh/private_key'
			) or die "Couldn't create object! $!\n";

	# Print the status of copy 0 of VDisk 0
	print "Status: " . $ibm->vdisk(0)->copy(0)->status . "\n";

	# Print each VDisk by name and each of the VDisk copies status
	foreach my $vdisk ( $ibm->get_vdisks ) { 
        	print "VDisk : " . $vdisk->name . "\n";

        	foreach my $copy ( $vdisk->get_copys ) { 
        	        printf( "\tCopy: %-2s - Status : %-20s\n", $copy->copy_id, $copy->status )
        	}   
	}


=head1 METHODS

=head3 autoexpand

Specifies whether autoexpand is enabled on a space-efficient volume. The value can be on or off.

=head3 capacity

Returns the volume copy capacity in bytes.

=head3 copy_id

Specifies a system-assigned identifier for the volume copy. The value can be 0 or 1.

=head3 easy_tier

This value is set by the user and determines whether Easy Tier(R) is permitted to manage the pool.

B<Note:>

=over 3

=item 1. 

If easy_tier is on, then easy_tier_status can take on any value.

=item 2. 

if easy_tier is off, then easy_tier_status is measured or inactive.

=back

=head3 easy_tier_status

Which Easy Tier functions are active for the volume copy:

=over 3

=item Active 

May move extents of this volume copy for performance (automatic data placement).

=item Measured

Statistics are being gathered for this volume copy, but no extents will be moved.



( run in 0.475 second using v1.01-cache-2.11-cpan-39bf76dae61 )