# $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 MetroclusterInterconnectAdapter ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::MetroclusterInterconnectAdapter =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP MetroclusterInterconnectAdapter. A related class is L, which represents access to an ONTAP MetroclusterInterconnectAdapter. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the MetroclusterInterconnectAdapter element are the attributes of the MetroclusterInterconnectAdapter 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<< ripaddr >> Remote Adapter IPAddr (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $ripaddr = $obj->ripaddr(); # $ripaddr contains a reference to the array of values my @ripaddr = $obj->ripaddr(); # @ripaddr 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 => { ripaddr = [ value1, value2...] } Filled in for CMode CLI. =item C<< next_adapter >> Next Adapter Filled in for CMode CLI. =item C<< smodel >> Switch Model Filled in for CMode CLI. =item C<< rareaid >> Remote Adapter AreaId (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $rareaid = $obj->rareaid(); # $rareaid contains a reference to the array of values my @rareaid = $obj->rareaid(); # @rareaid 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 => { rareaid = [ value1, value2...] } Filled in for CMode CLI. =item C<< wwname >> WWName Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< link_speed_neg_type >> Link Speed Negotiation Type Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< is_ood >> Is OOD Supported Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< ipaddr >> IP Address Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< fwversion >> Firmware Version Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< rwwname >> Remote Adapter WWName (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $rwwname = $obj->rwwname(); # $rwwname contains a reference to the array of values my @rwwname = $obj->rwwname(); # @rwwname 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 => { rwwname = [ value1, value2...] } Filled in for CMode CLI. =item C<< rpartner >> Node name possible value(s) are, ,local (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $rpartner = $obj->rpartner(); # $rpartner contains a reference to the array of values my @rpartner = $obj->rpartner(); # @rpartner 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 => { rpartner = [ value1, value2...] } Filled in for CMode CLI. =item C<< dr_systemid >> DR System ID Filled in for CMode CLI. =item C<< swwname >> Switch WWName Filled in for CMode CLI. =item C<< node_systemid >> Local System ID Filled in for CMode CLI. =item C<< partner_type >> Partner Type possible value(s) are, HA,DR,AUX Filled in for CMode CLI. =item C<< domainid >> Domain Id Filled in for CMode CLI. =item C<< rdomainid >> Remote Adapter DomainId (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $rdomainid = $obj->rdomainid(); # $rdomainid contains a reference to the array of values my @rdomainid = $obj->rdomainid(); # @rdomainid 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 => { rdomainid = [ value1, value2...] } Filled in for CMode CLI. =item C<< ha_systemid >> HA System ID Filled in for CMode CLI. =item C<< adapter >> Adapter Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< path_no >> Path Number Filled in for CMode CLI. =item C<< type >> Type Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< svendor >> Switch Vendor Filled in for CMode CLI. =item C<< sportno >> Switch PortNo Filled in for CMode CLI. =item C<< node >> Node name possible value(s) are, ,local Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< portno >> Port No Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< swwpn >> Switch Port WWPN Filled in for CMode CLI. =item C<< conn_index >> Connection Index Filled in for CMode CLI. =item C<< sname >> Switch Name Filled in for CMode CLI. =item C<< areaid >> Area Id Filled in for CMode CLI. =item C<< link_speed >> Link Speed Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =item C<< rportid >> Remote Adapter PortId (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $rportid = $obj->rportid(); # $rportid contains a reference to the array of values my @rportid = $obj->rportid(); # @rportid 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 => { rportid = [ value1, value2...] } Filled in for CMode CLI. =item C<< rsysid >> Remote Adapter PartnerSysid (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $rsysid = $obj->rsysid(); # $rsysid contains a reference to the array of values my @rsysid = $obj->rsysid(); # @rsysid 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 => { rsysid = [ value1, value2...] } Filled in for CMode CLI. =item C<< aux_systemid >> Auxiliary System ID Filled in for CMode CLI. =item C<< partner_sysid >> Partner System ID Filled in for CMode CLI. =item C<< adapter_index >> Adapter Index Filled in for CMode CLI. =item C<< next_partner >> Next Partner Filled in for CMode CLI. =item C<< index >> Partner SysId Index Filled in for CMode CLI. =item C<< sstatus >> Switch Status Filled in for CMode CLI. =item C<< radapter >> Remote Adapter Name (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $radapter = $obj->radapter(); # $radapter contains a reference to the array of values my @radapter = $obj->radapter(); # @radapter 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 => { radapter = [ value1, value2...] } Filled in for CMode CLI. =item C<< physical_status >> Physical Status Filled in for CMode CLI/ZAPI. Maps to: CMode ZAPI: For "requested_fields", "filter" and Output mapping: =back =cut package NACL::CS::MetroclusterInterconnectAdapter; 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 => 'ripaddr', scalar => 'next_adapter', scalar => 'smodel', array => 'rareaid', scalar => 'wwname', scalar => 'link_speed_neg_type', scalar => 'is_ood', scalar => 'ipaddr', scalar => 'fwversion', array => 'rwwname', array => 'rpartner', scalar => 'dr_systemid', scalar => 'swwname', scalar => 'node_systemid', scalar => 'partner_type', scalar => 'domainid', array => 'rdomainid', scalar => 'ha_systemid', scalar => 'adapter', scalar => 'path_no', scalar => 'type', scalar => 'svendor', scalar => 'sportno', scalar => 'node', scalar => 'portno', scalar => 'swwpn', scalar => 'conn_index', scalar => 'sname', scalar => 'areaid', scalar => 'link_speed', array => 'rportid', array => 'rsysid', scalar => 'aux_systemid', scalar => 'partner_sysid', scalar => 'adapter_index', scalar => 'next_partner', scalar => 'index', scalar => 'sstatus', array => 'radapter', scalar => 'physical_status', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 fetch my $MetroclusterInterconnectAdapter_state = NACL::CS::MetroclusterInterconnectAdapter->fetch(command_interface => $ci, ...); my @MetroclusterInterconnectAdapter_states = NACL::CS::MetroclusterInterconnectAdapter->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 metrocluster-interconnect-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, @args) = @_; my @state_objs = $pkg->SUPER::fetch( @args, choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' }, ], show_cmd => 'metrocluster interconnect adapter show', exception_text => 'No matching metrocluster interconnect adapter(s) found', frontend => 'NACL::CS::MetroclusterInterconnectAdapter::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 => 'metrocluster_interconnect_adapter_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, copy => [ qw(wwname link-speed-neg-type ipaddr is-ood fwversion adapter type portno link-speed physical-status ) ], map => {'node' => 'node-name',}, api => "metrocluster-interconnect-adapter-get-iter", ); $Log->exit() if $may_exit; return @state_objs; } 1;