IBM-StorageSystem

 view release on metacpan or  search on metacpan

lib/IBM/StorageSystem/Quota.pm  view on Meta::CPAN


our $VERSION = '0.02';
our @ATTR = qw(cluster device fileset type ID name SL_usage HL_usage used_usage 
SL_inode HL_inode used_inode gracetime_usage gracetime_inode in_doubt_kB last_update);

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{'Cluster:Device:Type:ID'} 
		or croak 'Constructor failed: mandatory Cluster:Device:Type:ID argument not supplied';

	foreach my $attr ( keys %args ) {
		my $mattr = lc $attr;
		$mattr =~ s/(\(|\))//g;

		foreach my $s ( qw(id hl sl) ) {
			my $u = uc $s;
			$mattr =~ s/(^|_)($s)/$1$u/g
		}

		$self->{$mattr} = $args{$attr} 
	}

	return $self;
}

1;

__END__

=pod

=head1 NAME

IBM::StorageSystem::Quota - Class for operations with IBM StorageSystem quota object

=head1 VERSION

Version 0.01

=head1 SYNOPSIS

IBM::StorageSystem::Quota - Class for operations with IBM StorageSystem quota objects

        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";
	



=head1 METHODS

=head3 HL_inode

Returns the quota inode hard limit.

=head3 HL_usage

Returns the quota hard limit usage in kilobytes.

=head3 ID

Returns the ID of the user, group or file set, if any.

=head3 SL_inode

Returns the quota inode soft limit.

=head3 SL_usage

Returns the quota soft limit usage in kilobytes.

=head3 cluster

Returns the cluster name on which the quota is imposed.

=head3 device

Returns the device to which the quota is applied.

=head3 fileset

Returns the fileset to which the quota is applied.

=head3 gracetime_inode

Returns the usage time frame within which the user must bring inode usage below the quota.

=head3 gracetime_usage

Returns the usage time frame within which the user must bring disk space usage below the quota.

=head3 in_doubt_kB

Returns the amount of data free space or allocated space on the disk, where the system 
has not updated the quota system yet.

=head3 last_update

Specifies the time when the quota information was updated.

=head3 name

Specifies the user, group or file set name. If the user or group does not exist in the 
configured authentication server (AD or LDAP), this column displays user/group id instead 



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