# # Copyright (c) 2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # # ## @summary EcacheFind Component Module ## @author Paul Chen chenp@netapp.com,dl-metawafl-qa@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::AggregateEcacheFind =head1 DESCRIPTION C is a derived class of L. It represents the state of metawafl Eicach. A related class is L, which represents access to metawafl nodescope 'mw tec'. =head1 ATTRIBUTES =over =item C<< flags >> Flag info of ecache Filled in for 7Mode Nodescope. =item C<< value >> Value of ecache Filled in for 7Mode Nodescope =item C<< key >> Key of ecache =item C<< length >> Length of ecache Filled in for 7Mode Nodescope =item C<< queue >> Queue status of ecache Filled in for 7Mode Nodescope =item C<< cp_flags0 >> Queue status of ecache Filled in for 7Mode Nodescope =item C<< cp_flags1 >> Queue status of ecache Filled in for 7Mode Nodescope =cut package NACL::CS::AggregateEcacheFind; use strict; use warnings; use Tharn qw($Log); use Params::Validate qw(validate); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'ptr', array => 'flags', scalar => 'value', scalar => 'key', scalar => 'length', scalar => 'cp_flags0', ## Modified as cp_flag[0] is not a legal perl identifier scalar => 'cp_flags1', ## Modified as cp_flag[1] is not a legal perl identifier scalar => 'queue', scalar => 'aggregate', ]; =head1 METHODS =head2 fetch my $state = NACL::CS::AggregateEcacheFind->fetch( command_interface => $ci, filter => { 'aggregate' => aggr_name, 'key' => key_name, }, ); (Class method) Discovers which elements are present and returns their state in ComponentState objects. Supports 7Mode CLI =over =cut __PACKAGE__->_fetch_7mode_cli_method_builder( apiset_method => 'mw_tec_find', filter_keys_to_be_passed_to_apiset => [qw/aggregate key/], process_parsed_output => 1, ); sub _process_parsed_output { my ($pkg, $output) = @_; for my $key (keys %{$output->[0]}) { my $new_key = $key; # Remove any [ and ] since not allowed as legal perl identifier if ( $new_key =~ s/\[|\]//g ) { $output->[0]->{$new_key} = delete $output->[0]->{$key}; } } } 1;