# # Copyright (c) 2001-2011 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary StorageArrayPort ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::StorageArrayPort =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP StorageArrayPort. A related class is L, which represents access to an ONTAP StorageArrayPort. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the StorageArrayPort element are the attributes of the StorageArrayPort ComponentState. =over =item C<< "wwnn" >> =item C<< "wwpn" >> =item C<< "name" >> =item C<< "id" >> =item C<< max_queue_depth >> Filled in for CMode CLI. =item C<< average_pending >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $average_pending = $obj->average_pending(); # $average_pending contains a reference to the array of values my @average_pending = $obj->average_pending(); # @average_pending contains the array of values Filled in for CMode CLI. =item C<< target_io_kbps >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_io_kbps = $obj->target_io_kbps(); # $target_io_kbps contains a reference to the array of values my @target_io_kbps = $obj->target_io_kbps(); # @target_io_kbps contains the array of values Filled in for CMode CLI. =item C<< target_iops >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_iops = $obj->target_iops(); # $target_iops contains a reference to the array of values my @target_iops = $obj->target_iops(); # @target_iops contains the array of values Filled in for CMode CLI. =item C<< switch_port >> Filled in for CMode CLI. =item C<< average_waiting >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $average_waiting = $obj->average_waiting(); # $average_waiting contains a reference to the array of values my @average_waiting = $obj->average_waiting(); # @average_waiting contains the array of values Filled in for CMode CLI. =item C<< max_pending >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $max_pending = $obj->max_pending(); # $max_pending contains a reference to the array of values my @max_pending = $obj->max_pending(); # @max_pending contains the array of values Filled in for CMode CLI. =item C<< percent_waiting >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $percent_waiting = $obj->percent_waiting(); # $percent_waiting contains a reference to the array of values my @percent_waiting = $obj->percent_waiting(); # @percent_waiting contains the array of values Filled in for CMode CLI. =item C<< max_waiting >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $max_waiting = $obj->max_waiting(); # $max_waiting contains a reference to the array of values my @max_waiting = $obj->max_waiting(); # @max_waiting contains the array of values Filled in for CMode CLI. =item C<< path_link_errors >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $path_link_errors = $obj->path_link_errors(); # $path_link_errors contains a reference to the array of values my @path_link_errors = $obj->path_link_errors(); # @path_link_errors contains the array of values Filled in for CMode CLI. =item C<< max_consumed_queue_depth >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $max_consumed_queue_depth = $obj->max_consumed_queue_depth(); # $max_consumed_queue_depth contains a reference to the array of values my @max_consumed_queue_depth = $obj->max_consumed_queue_depth(); # @max_consumed_queue_depth contains the array of values Filled in for CMode CLI. =item C<< percent_busy >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $percent_busy = $obj->percent_busy(); # $percent_busy contains a reference to the array of values my @percent_busy = $obj->percent_busy(); # @percent_busy contains the array of values Filled in for CMode CLI. =item C<< lun_queue_depth >> Filled in for CMode CLI. =item C<< average_queue_depth >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $average_queue_depth = $obj->average_queue_depth(); # $average_queue_depth contains a reference to the array of values my @average_queue_depth = $obj->average_queue_depth(); # @average_queue_depth contains the array of values Filled in for CMode CLI. =item C<< target_port_speed >> Filled in for CMode CLI. =item C<< target_lun_in_use_count >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $target_lun_in_use_count = $obj->target_lun_in_use_count(); # $target_lun_in_use_count contains a reference to the array of values my @target_lun_in_use_count = $obj->target_lun_in_use_count(); # @target_lun_in_use_count contains the array of values Filled in for CMode CLI. =item C<< connection_type >> Filled in for CMode CLI. =item C<< average_latency_per_iop >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $average_latency_per_iop = $obj->average_latency_per_iop(); # $average_latency_per_iop contains a reference to the array of values my @average_latency_per_iop = $obj->average_latency_per_iop(); # @average_latency_per_iop contains the array of values Filled in for CMode CLI. =item C<< utilization_policy >> Filled in for CMode CLI. =item C<< initiator >> Filled in for CMode CLI. Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator = $obj->initiator(); # $initiator contains a reference to the array of values my @initiator = $obj->initiator(); # @initiator contains the array of values Filled in for CMode CLI. =item C<< initiator_port >> Filled in for CMode CLI. (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $initiator_port = $obj->initiator_port(); # $initiator_port contains a reference to the array of values my @initiator_port = $obj->initiator_port(); # @initiator_port contains the array of values Filled in for CMode CLI. =item C<< storage_device_type >> Storage Device Type possible value(s) are, default , array_lun , fcsas_bridge , sts_bridge , tape_mc , virtual_disk , unknown Filled in for CMode CLI. =item C<< average_dynamic_queue_depth >> Average Dynamic Queue Depth ranges from 0 to 2048 (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $average_dynamic_queue_depth = $obj->average_dynamic_queue_depth(); # $average_dynamic_queue_depth contains a reference to the array of values my @average_dynamic_queue_depth = $obj->average_dynamic_queue_depth(); # @average_dynamic_queue_depth 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 => { average_dynamic_queue_depth = [ value1, value2...] } Filled in for CMode CLI. =item C<< dynamic_queue_depth >> Dynamic Queue Depth ranges from 0 to 2048 (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $dynamic_queue_depth = $obj->dynamic_queue_depth(); # $dynamic_queue_depth contains a reference to the array of values my @dynamic_queue_depth = $obj->dynamic_queue_depth(); # @dynamic_queue_depth 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 => { dynamic_queue_depth = [ value1, value2...] } Filled in for CMode CLI. =back =cut package NACL::CS::StorageArrayPort; use strict; use warnings; use Params::Validate qw(validate); use NACL::ComponentUtils qw(_dump_one); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use Data::Dumper; use NACL::Exceptions::NoElementsFound qw(:try); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'wwnn', scalar => 'wwpn', scalar => 'name', array => 'node', scalar => 'id', scalar => 'max_queue_depth', array => 'average_pending', array => 'target_io_kbps', array => 'target_iops', scalar => 'switch_port', array => 'average_waiting', array => 'max_pending', array => 'percent_waiting', array => 'max_waiting', array => 'path_link_errors', array => 'max_consumed_queue_depth', array => 'percent_busy', scalar => 'lun_queue_depth', array => 'average_queue_depth', scalar => 'target_port_speed', array => 'target_lun_in_use_count', scalar => 'connection_type', array => 'average_latency_per_iop', scalar => 'utilization_policy', array => 'initiator', array => 'initiator_port', scalar => 'storage_device_type', array => 'average_dynamic_queue_depth', array => 'dynamic_queue_depth', ]; =head1 METHODS =head2 fetch my $StorageArrayPort_state = NACL::CS::StorageArrayPort->fetch(command_interface => $ci, ...); my @StorageArrayPort_states = NACL::CS::StorageArrayPort->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. =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 => 'storage array port show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_fetch_7mode_cli', interface => 'CLI', set => '7Mode', }, ], exception_text => 'No matching storage array port(s) found' ); $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 => 'storage_array_port_show'); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_7mode_cli { $Log->enter() if $may_enter; my $pkg = shift; my %opts = validate @_, $pkg->_fetch_backend_validate_spec(); my $apiset = delete $opts{apiset}; my @state_objs; my %copy_filter = %{$opts{filter}}; my @copy_requested_fields = @{$opts{requested_fields}}; my $deleted_filter = $pkg->_remove_relational_regex_filters( filter => \%copy_filter, requested_fields => \@copy_requested_fields ); my $filter = \%copy_filter; my $requested_fields = \@copy_requested_fields; my $response = $apiset->storage_array_show_ports(); my $output = $response->get_parsed_output(); my $row_modified; foreach my $row (@$output) { my $obj = $pkg->new(); $row_modified = $pkg->_hash_copy( source => $row, copy => [qw( wwpn wwnn)], map => {'array_name' => 'name'}, ); $row_modified->{'node'} = $opts{'command_interface'}->name(); $row_modified->{'command_interface'} = $opts{'command_interface'}; $obj->_set_fields(row => $row_modified); push @state_objs, $obj; } ## end foreach my $row (@$output) $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_7mode_cli 1;