# $Id$ # # Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary StorageShelfAcpModule ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::StorageShelfAcpModule =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP StorageShelfAcpModule. A related class is L, which represents access to an ONTAP StorageShelfAcpModule. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the StorageShelfAcpModule element are the attributes of the StorageShelfAcpModule 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<< error_type >> Error Type possible value(s) are, No-Error,Connection-Issue,Connection-Activity,Module-Error,Shelf-Error (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $error_type = $obj->error_type(); # $error_type contains a reference to the array of values my @error_type = $obj->error_type(); # @error_type 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 => { error_type = [ value1, value2...] } Filled in for CMode CLI/ZAPI, non-iter. Mapping for CMode ZAPI non-iter: =item C<< protocol_version >> Protocol Version Filled in for CMode CLI/ZAPI, non-iter. =item C<< module_name >> Module name Filled in for CMode CLI/ZAPI, non-iter. =item C<< node >> Node possible value(s) are, ,local Filled in for CMode CLI/ZAPI, non-iter. Mapping for CMode ZAPI non-iter: node-name =item C<< state >> Local Node State possible value(s) are, unknown,initializing,discovery-complete,awaiting-inband,no-inband,active,awaiting-bootp,updating-firmware,connection-error,firmware-update-required,rebooting,limited-activity Filled in for CMode CLI/ZAPI, non-iter. =item C<< error_text >> Error Text (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $error_text = $obj->error_text(); # $error_text contains a reference to the array of values my @error_text = $obj->error_text(); # @error_text 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 => { error_text = [ value1, value2...] } Filled in for CMode CLI/ZAPI, non-iter. Mapping for CMode ZAPI non-iter: =item C<< mac_enaddr >> MAC HW address Filled in for CMode CLI/ZAPI, non-iter. =item C<< module_address >> IP Address Filled in for CMode CLI/ZAPI, non-iter. =item C<< corrective_action >> Corrective Action (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $corrective_action = $obj->corrective_action(); # $corrective_action contains a reference to the array of values my @corrective_action = $obj->corrective_action(); # @corrective_action 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 => { corrective_action = [ value1, value2...] } Filled in for CMode CLI/ZAPI, non-iter. Mapping for CMode ZAPI non-iter: =item C<< error_severity >> Error Severity possible value(s) are, unknown,notice,warning,error,critical (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $error_severity = $obj->error_severity(); # $error_severity contains a reference to the array of values my @error_severity = $obj->error_severity(); # @error_severity 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 => { error_severity = [ value1, value2...] } Filled in for CMode CLI/ZAPI, non-iter. Mapping for CMode ZAPI non-iter: =item C<< firmware_version >> Firmware Version Filled in for CMode CLI/ZAPI, non-iter. =item C<< shelf_serial_number >> Shelf Serial Number Filled in for CMode CLI/ZAPI, non-iter. =item C<< mac_address >> MAC Address Filled in for CMode CLI/ZAPI, non-iter. =item C<< last_contact >> Last Contact (secs) Filled in for CMode CLI/ZAPI, non-iter. =item C<< iom_type >> IOM Type possible value(s) are, Unknown,iom3,iom6,iom6e Filled in for CMode CLI/ZAPI, non-iter. =item C<< stack_id >> Stack ID possible value(s) are, ,- Filled in for CMode CLI/ZAPI, non-iter. =item C<< error_id >> Error ID (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $error_id = $obj->error_id(); # $error_id contains a reference to the array of values my @error_id = $obj->error_id(); # @error_id 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 => { error_id = [ value1, value2...] } Filled in for CMode CLI/ZAPI, non-iter. Mapping for CMode ZAPI non-iter: =item C<< acpa_id >> ACPA assigner ID Filled in for CMode CLI/ZAPI, non-iter. =item C<< adapter_name >> Adapter Name Filled in for CMode CLI/ZAPI, non-iter. =item C<< shelf_id >> Shelf ID Filled in for CMode CLI/ZAPI, non-iter. =back =cut package NACL::CS::StorageShelfAcpModule; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); use NACL::Exceptions::NoElementsFound qw(:try); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use NACL::CS::ComponentState::ZapiArray qw(make_zapi_array); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ array => 'error_type', scalar => 'protocol_version', scalar => 'module_name', scalar => 'node', scalar => 'state', array => 'error_text', scalar => 'mac_enaddr', scalar => 'module_address', array => 'corrective_action', array => 'error_severity', scalar => 'firmware_version', scalar => 'shelf_serial_number', scalar => 'mac_address', scalar => 'last_contact', scalar => 'iom_type', scalar => 'stack_id', array => 'error_id', scalar => 'acpa_id', scalar => 'adapter_name', scalar => 'shelf_id', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); sub _check_non_iter { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_check_non_iter(@opts, _primary_keys => [qw(node mac-enaddr)],); $Log->exit() if $may_exit; } =head1 METHODS =head2 fetch my $StorageShelfAcpModule_state = NACL::CS::StorageShelfAcpModule->fetch(command_interface => $ci, ...); my @StorageShelfAcpModule_states = NACL::CS::StorageShelfAcpModule->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 CMode CLI/ZAPI. Invokes storage-shelf-acp-module-get API for CMode ZAPI non-iter. =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 => 'storage shelf acp module show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_fetch_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], exception_text => 'No matching StorageShelfAcpModule(s) found', frontend => 'NACL::CS::StorageShelfAcpModule::fetch', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _update_state_objs_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->SUPER::_update_state_objs_cmode_zapi(@args, zapi_field_translations => {hyphenate_value => [qw(error-severity state)],},); $Log->exit() if $may_exit; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@args, api => 'storage_shelf_acp_module_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi_non_iter( @args, copy => [ qw(module-name iom-type last-contact acpa-id stack-id shelf-id protocol-version state module-address firmware-version mac-address adapter-name shelf-serial-number ) ], map => { 'error-severity' => [ make_zapi_array('error-severity'), make_zapi_skip('storage-shelf-error-severity'), ], 'node' => 'node-name', 'corrective-action' => [ make_zapi_array('corrective-action'), make_zapi_skip('string'), ], 'error-type' => [ make_zapi_array('error-type'), make_zapi_skip('acp-error-type-enum'), ], 'error-text' => [make_zapi_array('error-text'), make_zapi_skip('string'),], 'error-id' => [make_zapi_array('error-id'), make_zapi_skip('integer'),], }, api => "storage-shelf-acp-module-get", primary_keys => [qw( mac-enaddr node )], ); $Log->exit() if $may_exit; return @state_objs; } 1;