# $Id$ # # Copyright (c) 2001-2010 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary ComponentState Module for the method NACL::C::Volume->status() (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VolumeStatus =head1 DESCRIPTION C is a derived class of L. Object(s) of this type are returned when NACL::C::Volume->status() is invoked. ((This module does not represent the state of any element, but is an object repesentation of the output obtained when NACL::C::Volume->status() is invoked.) =head1 ATTRIBUTES The fields of the output are fields of the ComponentState object. =over =item C<< volume_options >> Volume Options possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $volume_options = $obj->volume_options(); # $volume_options contains a reference to the array of values my @volume_options = $obj->volume_options(); # @volume_options contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { volume_options = [ value1, value2...] } Filled in for CMode CLI =item C<< volume_snap_autodelete_destroy_list >> destroy-list possible value(s) are, text Filled in for CMode CLI =item C<< disk_primaryport >> Disk primary port possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_primaryport = $obj->disk_primaryport(); # $disk_primaryport contains a reference to the array of values my @disk_primaryport = $obj->disk_primaryport(); # @disk_primaryport contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_primaryport = [ value1, value2...] } Filled in for CMode CLI =item C<< volume_snap_autodelete_prefix >> prefix possible value(s) are, text Filled in for CMode CLI =item C<< disk_serialnumber >> Disk serial num possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_serialnumber = $obj->disk_serialnumber(); # $disk_serialnumber contains a reference to the array of values my @disk_serialnumber = $obj->disk_serialnumber(); # @disk_serialnumber contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_serialnumber = [ value1, value2...] } Filled in for CMode CLI =item C<< volume_state >> volume state possible value(s) are, online,restricted,offline,force-online,force-offline,mixed Filled in for CMode CLI =item C<< aggr_raidgroup_info >> raidgroup info possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $aggr_raidgroup_info = $obj->aggr_raidgroup_info(); # $aggr_raidgroup_info contains a reference to the array of values my @aggr_raidgroup_info = $obj->aggr_raidgroup_info(); # @aggr_raidgroup_info contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { aggr_raidgroup_info = [ value1, value2...] } Filled in for CMode CLI =item C<< volume_snap_autodelete_enabled >> enabled possible value(s) are, text Filled in for CMode CLI =item C<< disk_shelf >> Disk shelf possible value(s) are, integer (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_shelf = $obj->disk_shelf(); # $disk_shelf contains a reference to the array of values my @disk_shelf = $obj->disk_shelf(); # @disk_shelf contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_shelf = [ value1, value2...] } Filled in for CMode CLI =item C<< aggr_plex_info >> plex info possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $aggr_plex_info = $obj->aggr_plex_info(); # $aggr_plex_info contains a reference to the array of values my @aggr_plex_info = $obj->aggr_plex_info(); # @aggr_plex_info contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { aggr_plex_info = [ value1, value2...] } Filled in for CMode CLI =item C<< volume_style >> Volume Style possible value(s) are, flex,striped,infinitevol Filled in for CMode CLI =item C<< volume_snap_autodelete_delete_order >> delete order possible value(s) are, newest_first,oldest_first Filled in for CMode CLI =item C<< disk_bay >> Disk bay possible value(s) are, integer (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_bay = $obj->disk_bay(); # $disk_bay contains a reference to the array of values my @disk_bay = $obj->disk_bay(); # @disk_bay contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_bay = [ value1, value2...] } Filled in for CMode CLI =item C<< aggr_checksum_style >> checksum style possible value(s) are, checksum style Filled in for CMode CLI =item C<< volume_options_subset >> Volume options subset possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $volume_options_subset = $obj->volume_options_subset(); # $volume_options_subset contains a reference to the array of values my @volume_options_subset = $obj->volume_options_subset(); # @volume_options_subset contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { volume_options_subset = [ value1, value2...] } Filled in for CMode CLI =item C<< aggr_raidstatus >> raidstatus possible value(s) are, text Filled in for CMode CLI =item C<< disk_hostadapter >> Disk host adapter possible value(s) are, text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disk_hostadapter = $obj->disk_hostadapter(); # $disk_hostadapter contains a reference to the array of values my @disk_hostadapter = $obj->disk_hostadapter(); # @disk_hostadapter contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disk_hostadapter = [ value1, value2...] } Filled in for CMode CLI =item C<< volume_snap_autodelete_commitment >> commitment possible value(s) are, try,disrupt,destroy Filled in for CMode CLI =item C<< disklist >> disk possible value(s) are, disk path name (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $disklist = $obj->disklist(); # $disklist contains a reference to the array of values my @disklist = $obj->disklist(); # @disklist contains the array of values If this field needs to be passed to the filter hash, the value for this field should be passed in as an arrayref # filter => { disklist = [ value1, value2...] } Filled in for CMode CLI =item C<< aggr_raidtype >> raidtype possible value(s) are, raid_tec,raid_dp,raid4 Filled in for CMode CLI =item C<< volume_snap_autodelete_defer_delete >> defer delete possible value(s) are, scheduled,user_created,prefix,none Filled in for CMode CLI =item C<< volume_size >> Volume Size possible value(s) are, [KB,MB,GB,TB,PB] Filled in for CMode CLI =item C<< volume_uuid >> Volume UUID possible value(s) are, text Filled in for CMode CLI =item C<< volume_filesystem_size >> Filesystem Size possible value(s) are, [KB,MB,GB,TB,PB] Filled in for CMode CLI =item C<< aggregate >> aggregate possible value(s) are, aggregate name Filled in for CMode CLI =item C<< volume_autosize_enabled >> Volume autosize? possible value(s) are, text Filled in for CMode CLI =item C<< aggr_checksum_status >> checksum status possible value(s) are, text Filled in for CMode CLI =item C<< volume >> volume possible value(s) are, volume name Filled in for CMode CLI =item C<< vserver >> Vserver possible value(s) are, vserver name Filled in for CMode CLI =item C<< volume_snap_autodelete_target_free_space >> target free space possible value(s) are, percent Filled in for CMode CLI =item C<< volume_autosize_mode >> Volume autosize mode possible value(s) are, off,grow,grow_shrink Filled in for CMode CLI =item C<< volume_location >> Is it a cluster vol? possible value(s) are, text Filled in for CMode CLI =item C<< volume_snap_autodelete_trigger >> trigger possible value(s) are, volume,snap_reserve,space_reserve Filled in for CMode CLI =item C<< volume_language >> Volume language possible value(s) are, Language code Filled in for CMode CLI =back =cut package NACL::CS::VolumeStatus; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use NACL::Exceptions::NoElementsFound qw(:try); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ array => 'volume_options', scalar => 'volume_snap_autodelete_destroy_list', array => 'disk_primaryport', scalar => 'volume_snap_autodelete_prefix', array => 'disk_serialnumber', scalar => 'volume_state', array => 'aggr_raidgroup_info', scalar => 'volume_snap_autodelete_enabled', array => 'disk_shelf', array => 'aggr_plex_info', scalar => 'volume_style', scalar => 'volume_snap_autodelete_delete_order', array => 'disk_bay', scalar => 'aggr_checksum_style', array => 'volume_options_subset', scalar => 'aggr_raidstatus', array => 'disk_hostadapter', scalar => 'volume_snap_autodelete_commitment', array => 'disklist', scalar => 'aggr_raidtype', scalar => 'volume_snap_autodelete_defer_delete', scalar => 'volume_size', scalar => 'volume_uuid', scalar => 'volume_filesystem_size', scalar => 'aggregate', scalar => 'volume_autosize_enabled', scalar => 'aggr_checksum_status', scalar => 'volume', scalar => 'vserver', scalar => 'volume_snap_autodelete_target_free_space', scalar => 'volume_autosize_mode', scalar => 'volume_location', scalar => 'volume_snap_autodelete_trigger', scalar => 'volume_language', ]; =head1 METHODS =head2 fetch my $VolumeStatus_state = NACL::CS::VolumeStatus->fetch(command_interface => $ci, ...); my @VolumeStatus_states = NACL::CS::VolumeStatus->fetch(command_interface => $ci, ...); (Class method) Discovers which elements are present and returns their state in ComponentState objects. Called in scalar context it returns only one state object, in list context it returns all state objects. See L for a more detailed description along with a complete explanation of the options it accepts. Uses a CMode CLI APISet. =over =item Exceptions =over =item C When there are no elements matching the query specified or elements of that type doesn't exist, then this exception will be thrown. =back =back =cut sub fetch { $Log->enter() if $may_enter; my ( $pkg, @args ) = @_; my @state_objs = $pkg->SUPER::fetch( @args, show_cmd => 'volume status', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' } ], exception_text => 'No matching volume(s) found', frontend => 'NACL::CS::VolumeStatus::fetch', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my ( $pkg, @args ) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli( @args, api => 'volume_status', ); $Log->exit() if $may_exit; return @state_objs; } 1;