# $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 System ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::System =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP System. A related class is L, which represents access to an ONTAP System. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the System element are the attributes of the System ComponentState. Additionally, the command_interface used to obtain the ComponentState object is also an attribute of the object. This makes it easier to obtain the component object corresponding to the CS object, using L. =over =item command_interface The command_interface with which the CS object was obtained. (Available in all CS objects regardless of requested_fields and the mode/interface) =item C<< model >> Model Filled in for CMode CLI =item C<< assettag >> Asset Tag Filled in for CMode CLI =item C<< node >> Node possible value(s) are, ,local Filled in for CMode CLI =item C<< uuid >> UUID Filled in for CMode CLI =item C<< product_version >> Product Version Filled in for CMode CLI =item C<< max_aggr_size >> Maximum Aggregate Size (in bytes) Filled in for CMode CLI =item C<< env_failed_power_supply_message >> Failed PSU message Filled in for CMode CLI =item C<< eligibility >> Eligibility possible value(s) are, true,false Filled in for CMode CLI =item C<< env_failed_fan_count >> Failed fan count Filled in for CMode CLI =item C<< message_list >> System Messages (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $message_list = $obj->message_list(); # $message_list contains a reference to the array of values my @message_list = $obj->message_list(); # @message_list 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 => { message_list = [ value1, value2...] } Filled in for CMode CLI =item C<< uptime >> Uptime Filled in for CMode CLI =item C<< cpu_up_time >> CPU up time Filled in for CMode CLI =item C<< env_over_temperature >> Over temperature possible value(s) are, true,false Filled in for CMode CLI =item C<< systemid >> System ID Filled in for CMode CLI =item C<< nvram_battery_status >> NVRAM Battery possible value(s) are, ok,partially discharged,fully discharged,not present,near eol,eol,unknown,over charged,fully charged Filled in for CMode CLI =item C<< owner >> Owner Filled in for CMode CLI =item C<< nvramid >> NVRAM System ID Filled in for CMode CLI =item C<< env_failed_fan_message >> Failed fan message Filled in for CMode CLI =item C<< env_failed_power_supply_count >> Failed PSUs Filled in for CMode CLI =item C<< location >> Location Filled in for CMode CLI =item C<< cpu_busy_time >> CPU busy time Filled in for CMode CLI =item C<< health >> Health possible value(s) are, true,false Filled in for CMode CLI =item C<< max_vol_size >> Maximum Volume Size (in bytes) Filled in for CMode CLI =item C<< epsilon >> Epsilon possible value(s) are, true,false Filled in for CMode CLI =item C<< serialnumber >> Serial Number Filled in for CMode CLI =item C<< cpu_fw_rel >> FW Release Filled in for CMode CLI =item C<< max_node_vvols >> Maximum Number of Volumes Filled in for CMode CLI =item C<< uuid_str >> UUID in string Filled in for CMode CLI =item C<< vendor >> Vendor Filled in for CMode CLI =back =cut package NACL::CS::System; 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 [ scalar => 'model', scalar => 'assettag', scalar => 'node', scalar => 'uuid', scalar => 'product_version', scalar => 'max_aggr_size', scalar => 'env_failed_power_supply_message', scalar => 'eligibility', scalar => 'env_failed_fan_count', array => 'message_list', scalar => 'uptime', scalar => 'cpu_up_time', scalar => 'env_over_temperature', scalar => 'systemid', scalar => 'nvram_battery_status', scalar => 'owner', scalar => 'nvramid', scalar => 'env_failed_fan_message', scalar => 'env_failed_power_supply_count', scalar => 'location', scalar => 'cpu_busy_time', scalar => 'health', scalar => 'max_vol_size', scalar => 'epsilon', scalar => 'serialnumber', scalar => 'cpu_fw_rel', scalar => 'max_node_vvols', scalar => 'uuid_str', scalar => 'vendor', ]; =head1 METHODS =head2 fetch my $System_state = NACL::CS::System->fetch(command_interface => $ci, ...); my @System_states = NACL::CS::System->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 => 'system node show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' } ], exception_text => 'No matching system(s) found', frontend => 'NACL::CS::System::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 => 'system_node_show',); $Log->exit() if $may_exit; return @state_objs; } 1;