# $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 StatisticsArchiveDatastore ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::StatisticsArchiveDatastore =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP StatisticsArchiveDatastore. A related class is L, which represents access to an ONTAP StatisticsArchiveDatastore. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the StatisticsArchiveDatastore element are the attributes of the StatisticsArchiveDatastore 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<< datafile_state >> State of Datafile Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_index >> Internal Index of Datafile Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< oldest_timestamp >> Oldest Datafile in Datastore Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< store >> Store Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_max_period >> Longest Sample Period in Datafile Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< path >> Path to Datastore on Root Volume Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_sort_id >> Sort Identifier of Datafile Filled in for CMode CLI/ZAPI iter =item C<< is_enabled >> Is Datastore Enabled? possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_size >> Size of Datafile Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_names >> Names of Individual Files in Datafile (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $datafile_names = $obj->datafile_names(); # $datafile_names contains a reference to the array of values my @datafile_names = $obj->datafile_names(); # @datafile_names 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 => { datafile_names = [ value1, value2...] } Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< node >> Node Name possible value(s) are, ,local Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< process >> Process Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< size >> Total Size of Datastore Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_duration >> Duration of Datafile (ms) Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< datafile_timestamp >> Timestamp of Datafile Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =back =cut package NACL::CS::StatisticsArchiveDatastore; 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 => 'datafile_state', array => 'datafile_index', scalar => 'oldest_timestamp', scalar => 'store', array => 'datafile_max_period', scalar => 'path', scalar => 'datafile_sort_id', scalar => 'is_enabled', array => 'datafile_size', array => 'datafile_names', scalar => 'node', scalar => 'process', scalar => 'size', array => 'datafile_duration', scalar => 'datafile_timestamp', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); sub _extra_filter_fields { $Log->enter() if $may_enter; $Log->exit() if $may_exit; return [qw( is-partial-shown age-filter )]; } =head1 METHODS =head2 fetch my $StatisticsArchiveDatastore_state = NACL::CS::StatisticsArchiveDatastore->fetch(command_interface => $ci, ...); my @StatisticsArchiveDatastore_states = NACL::CS::StatisticsArchiveDatastore->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 perf-archive-datastore-get-iter API for CMode ZAPI 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 => 'statistics archive datastore show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', zapi_type => 'iter' }, ], exception_text => 'No matching StatisticsArchiveDatastore(s) found', frontend => 'NACL::CS::StatisticsArchiveDatastore::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 => { timestamp_to_mmddyyyy => [qw(oldest-timestamp datafile-timestamp)], }, ); $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 => 'statistics_archive_datastore_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(is-enabled node size oldest-timestamp path age-filter process is-partial-shown ) ], map => { 'datafile-max-period' => [ 'perf-archive-datafile-infos', make_zapi_skip('perf-archive-datafile-info'), 'max-period', ], 'datafile-size' => [ 'perf-archive-datafile-infos', make_zapi_skip('perf-archive-datafile-info'), 'size', ], 'datafile-timestamp' => 'timestamp', 'datafile-index' => [ 'perf-archive-datafile-infos', make_zapi_skip('perf-archive-datafile-info'), 'index', ], 'datafile-state' => [ 'perf-archive-datafile-infos', make_zapi_skip('perf-archive-datafile-info'), 'state', ], 'store' => 'datastore', 'datafile-names' => [ make_zapi_array('perf-archive-datafile-infos'), make_zapi_skip('perf-archive-datafile-info'), 'filenames' ], 'datafile-duration' => [ 'perf-archive-datafile-infos', make_zapi_skip('perf-archive-datafile-info'), 'duration', ], }, api => "perf-archive-datastore-get-iter", ); $Log->exit() if $may_exit; return @state_objs; } 1;