# $Id$ # # Copyright (c) 2001-2012 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary NetworkFcpAdapter ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com, veerap@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::NetworkFcpAdapter =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP NetworkFcpAdapter. A related class is L, which represents access to an ONTAP NetworkFcpAdapter. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the NetworkFcpAdapter element are the attributes of the NetworkFcpAdapter 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<< substatus >> Filled in for CMode CLI. =item C<< conn_established >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< pslot >> Filled in for CMode CLI. =item C<< fabric_established >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< cache_line_size >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< external_gbic_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< fc_wwpn >> Filled in for CMode CLI. =item C<< portname >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< orig_wwnn >> Filled in for CMode CLI. =item C<< max_speed >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< state >> Filled in for CMode CLI. =item C<< zapi_speed >> Filled in for CMode CLI. =item C<< pci_bus_width >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< firmware_rev >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< nodename >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< lif_capable >> Filled in for CMode CLI. =item C<< description >> Filled in for CMode CLI. =item C<< standby_snmp >> Filled in for CMode CLI. =item C<< adapter >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< handle >> Filled in for CMode CLI. =item C<< portaddr >> Filled in for CMode CLI. =item C<< media_type_snmp >> Filled in for CMode CLI. =item C<< status >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< tha_index >> Filled in for CMode CLI. =item C<< node >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< packet_size >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< sram_parity_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< speed >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< data_link_rate >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< queue_depth >> Filled in for CMode CLI. =item C<< fc_wwnn >> Filled in for CMode CLI. =item C<< standby >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< physical_protocol >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< partner_adapter >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< hardware_rev >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< pci_clock_speed >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< media_type >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< adapter_type >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< port_address >> Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: $value =item C<< fabric_name >> Fabric Name Filled in for CMode CLI. =item C<< switch_port >> Switch Port Filled in for CMode CLI. =item C<< sfp_formfactor >> *Form Factor Of Transceiver Filled in for CMode CLI. =item C<< sfp_wavelength >> *Wavelength In Nanometers Filled in for CMode CLI. =item C<< sfp_connector >> *Connector Used Filled in for CMode CLI. =item C<< sfp_date_code >> *Date Code Of Transceiver Filled in for CMode CLI. =item C<< sfp_rev >> *Revision Of Transceiver Filled in for CMode CLI. =item C<< sfp_part_number >> *Part Number Of Transceiver Filled in for CMode CLI. =item C<< is_sfp_rx_power_in_range >> *Is Received Power In Range, possible value(s) are true,false Filled in for CMode CLI. =item C<< sfp_serial_number >> *Serial Number Of Transceiver Filled in for CMode CLI. =item C<< is_sfp_optical_transceiver_valid >> *Validity Of Transceiver, possible value(s) are true,false Filled in for CMode CLI. =item C<< sfp_fc_speed_capabilities >> *FC Capabilities Of Transceiver Filled in for CMode CLI. =item C<< is_sfp_tx_power_in_range >> *Is Xmit Power In Range, possible value(s) are true,false Filled in for CMode CLI. =item C<< sfp_vendor_oui >> *Vendor OUI Of Transceiver Filled in for CMode CLI. =item C<< sfp_encoding >> *Encoding Used Filled in for CMode CLI. =item C<< sfp_tx_power >> *SPF Transmitted Optical Power Filled in for CMode CLI. =item C<< sfp_vendor_name >> *Vendor Name Of Transceiver Filled in for CMode CLI. =item C<< sfp_rx_power >> *Received Optical Power Filled in for CMode CLI. =item C<< is_sfp_diagnostics_internally_calibrated >> *Is Internally Calibrated, possible value(s) are true,false Filled in for CMode CLI. =back =cut package NACL::CS::NetworkFcpAdapter; 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 => 'substatus', scalar => 'conn_established', scalar => 'pslot', scalar => 'fabric_established', scalar => 'cache_line_size', scalar => 'external_gbic_enabled', scalar => 'fc_wwpn', scalar => 'portname', scalar => 'orig_wwnn', scalar => 'max_speed', scalar => 'state', scalar => 'zapi_speed', scalar => 'pci_bus_width', scalar => 'firmware_rev', scalar => 'nodename', scalar => 'lif_capable', scalar => 'description', scalar => 'standby_snmp', scalar => 'adapter', scalar => 'handle', scalar => 'portaddr', scalar => 'media_type_snmp', scalar => 'status', scalar => 'tha_index', scalar => 'node', scalar => 'packet_size', scalar => 'sram_parity_enabled', scalar => 'speed', scalar => 'data_link_rate', scalar => 'queue_depth', scalar => 'fc_wwnn', scalar => 'standby', scalar => 'physical_protocol', scalar => 'partner_adapter', scalar => 'hardware_rev', scalar => 'pci_clock_speed', scalar => 'media_type', scalar => 'adapter_type', scalar => 'port_address', scalar => 'fabric_name', scalar => 'switch_port', scalar => 'sfp_formfactor', scalar => 'sfp_wavelength', scalar => 'sfp_connector', scalar => 'sfp_date_code', scalar => 'sfp_rev', scalar => 'sfp_part_number', scalar => 'is_sfp_rx_power_in_range', scalar => 'sfp_serial_number', scalar => 'is_sfp_optical_transceiver_valid', scalar => 'sfp_fc_speed_capabilities', scalar => 'is_sfp_tx_power_in_range', scalar => 'sfp_vendor_oui', scalar => 'sfp_encoding', scalar => 'sfp_tx_power', scalar => 'sfp_vendor_name', scalar => 'sfp_rx_power', scalar => 'is_sfp_diagnostics_internally_calibrated', ]; sub isa { $Log->enter() if $may_enter; my ($pkg_or_obj, $kind) = @_; my $isa = $pkg_or_obj->_build_isa( kind => $kind, alias => 'NACL::CS::FcpAdapter' ); $Log->exit() if $may_exit; return $isa; } =head1 METHODS =head2 fetch my $NetworkFcpAdapter_state = NACL::CS::NetworkFcpAdapter->fetch(command_interface => $ci, ...); my @NetworkFcpAdapter_states = NACL::CS::NetworkFcpAdapter->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. Supports CMode CLI/ZAPI. Invokes "fcp-adapter-get-iter" API for CMode ZAPI. =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 = shift; my @state_objs = $pkg->SUPER::fetch( @_, show_cmd => 'network fcp adapter show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' } ], exception_text => 'No matching network fcp adapter(s) found', show_cmd => 'network fcp adapter show', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _fetch_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@_, api => 'network_fcp_adapter_show',); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, api => 'fcp_adapter_get_iter', copy => [ qw ( adapter-type cache-line-size data-link-rate external-gbic-enabled fabric-established firmware-rev hardware-rev max-speed media-type node packet-size partner-adapter pci-bus-width pci-clock-speed physical-protocol speed sram-parity-enabled standby adapter ) ], map => { 'nodename' => 'node-name', 'conn-established' => 'connection-established', 'portname' => 'port-name', 'status' => 'state', 'fc-wwpn' => 'port-name', 'portaddr' => 'port-address', } ); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_zapi 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(physical-protocol)], decimal_to_hex => ['portaddr'], }, ); $Log->exit() if $may_exit; } 1;