IBM-StorageSystem

 view release on metacpan or  search on metacpan

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

				     type	=> $OBJ->{$obj}->{type}, 
				     id		=> $OBJ->{$obj}->{id} 
				);
			my @res = map { $_->device_name( $self->{device_name} ); $_ 
				      } $self->{__ibm}->__get_sl_objects( %args );

			return ( defined $id	? $self->{ $OBJ->{$obj}->{type} }->{$id} 
						: @res 
				)
		}
	}   
}

foreach my $attr ( map lc, @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{'Device_name'} 
		or croak __PACKAGE__ . ' constructor failed: mandatory Device_name argument not supplied';
	weaken( $self->{__ibm} = $ibm );

        foreach my $attr ( @ATTR ) { 
		$self->{lc $attr} = $args{$attr} 
	}

        return $self
}

1;

__END__

=pod

=head1 NAME

IBM::V7000::FileSystem - Class for operations with a IBM V7000 file system entities

=head1 VERSION

Version 0.01

=head1 SYNOPSIS

IBM::V7000::FileSystem - Class for operations with a IBM V7000 file system entities

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

	# Print the block size of file system 'fs1'
	print $ibm->fs(fs1)->block_size;
	
	# Get the file system 'fs2' as a IBM::V7000::FileSystem object
	my $fs = $ibm->fs(fs2);

	# Print the mount point of this file system
	print "fs2 mount point: " . $fs2->mount_point . "\n";

	# Call a function if inode usage on file system 'fs2' exceeds 90% of maximum allocation.
	monitoring_alert( 'Inode allocation > 90% on '.$fs->device_name ) 
		if ( ( ( $fs->inodes / $fs->max_inodes ) * 100 ) > 90 );

	# Do the same for all file systems
	map { monitoring_alert( 'Inode allocation > 90% on '.$_->device_name )
		if ( ( ( $fs->inodes / $fs->max_inodes ) * 100 ) > 90 ) } $ibm->get_fss;

=head1 METHODS

=head3 acltype

Returns the file system ACL type in use.

=head3 atime

Returns the value of the file system atime flag status.

=head3 block_allocation_type

Returns the value of the file system block allocation type.

=head3 block_size

Returns the file system block size.

=head3 cluster

Returns the cluster ID of the cluster on which the filesystem is mounted.

=head3 def_quota

Returns the value of the file system defined quota flag.

=head3 device_name

Returns the file system device name.

=head3 dmapi

Returns the file system DMAPI enabled status.

=head3 ind_block_size

Returns the file system indirect block size.

=head3 inode_size

Returns the file system inode size.



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