# $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 StatisticsArchiveConfig ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com, pkj@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::StatisticsArchiveConfig =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP StatisticsArchiveConfig. A related class is L, which represents access to an ONTAP StatisticsArchiveConfig. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the StatisticsArchiveConfig element are the attributes of the StatisticsArchiveConfig 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<< datastore_file_rotation >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< datastore_max_size >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< max_counter_bw >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< opm_file_rotation >> Minutes Between OPM Data File Rotations ranges from 1 to 120 Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< cleaner_period >> Filled in for CMode CLI. =item C<< is_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< min_buffer_size >> Filled in for CMode CLI. =item C<< max_buffer_size >> Filled in for CMode CLI. =item C<< buffer_size >> Filled in for CMode CLI. =item C<< max_cleaner_period >> Filled in for CMode CLI. =item C<< min_cleaner_period >> Filled in for CMode CLI. =item C<< datastore_max_retention >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< collector_period >> Filled in for CMode CLI. =item C<< datastore_max_percent >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< version >> Data ONTAP Version of Installed Configuration Filled in for CMode CLI. =item C<< perfstat_sampling_period >> Minutes Between Perfstat Collection ranges from 0 to 60 Filled in for CMode CLI. =item C<< enabled_preset_name >> Enabled Performance Preset Names (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $enabled_preset_name = $obj->enabled_preset_name(); # $enabled_preset_name contains a reference to the array of values my @enabled_preset_name = $obj->enabled_preset_name(); # @enabled_preset_name 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 => { enabled_preset_name = [ value1, value2...] } Filled in for CMode CLI. =item C<< enabled_preset_vserver >> Enabled Performance Preset owning Vservers (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $enabled_preset_vserver = $obj->enabled_preset_vserver(); # $enabled_preset_vserver contains a reference to the array of values my @enabled_preset_vserver = $obj->enabled_preset_vserver(); # @enabled_preset_vserver 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 => { enabled_preset_vserver = [ value1, value2...] } Filled in for CMode CLI. =item C<< datastore_path >> Base Path of Performance Archive Datastore Filled in for CMode CLI. =back =cut package NACL::CS::StatisticsArchiveConfig; 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 => 'datastore_file_rotation', scalar => 'datastore_max_size', scalar => 'max_counter_bw', scalar => 'cleaner_period', scalar => 'is_enabled', scalar => 'min_buffer_size', scalar => 'max_buffer_size', scalar => 'buffer_size', scalar => 'max_cleaner_period', scalar => 'min_cleaner_period', scalar => 'datastore_max_retention', scalar => 'collector_period', scalar => 'datastore_max_percent', scalar => 'version', scalar => 'perfstat_sampling_period', array => 'enabled_preset_name', array => 'enabled_preset_vserver', scalar => 'datastore_path', scalar => 'opm_file_rotation' ]; =head1 METHODS =head2 fetch my $StatisticsArchiveConfig_state = NACL::CS::StatisticsArchiveConfig->fetch(command_interface => $ci, ...); (Class method) Discovers which elements are present and returns their state in ComponentState objects. This being a "singleton" table (i.e. one which can only have one row) is callable only in scalar context. See L for a more detailed description along with a complete explanation of the options it accepts. Supports CMode CLI/ZAPI APISet. Invokes "perf-archive-config-get" 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( @_, choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' }, ], exception_text => 'No matching statistics archive config(s) found', is_singleton => 1, show_cmd => 'statistics archive config show', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_cli( @_, api => 'statistics_archive_config_show', is_singleton => 1, ); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my %opts = validate @args, $pkg->_fetch_backend_validate_spec(); my $zapi_copy = [ qw( datastore-file-rotation datastore-max-retention datastore-max-size is-enabled max-counter-bw datastore-max-percent opm-file-rotation) ]; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi_non_iter( %opts, api => 'perf-archive-config-get', copy => $zapi_copy, primary_keys => [qw()] #No primary keys ); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_zapi 1;