# # Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverOptions ComponentState Module ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverOptions =head1 DESCRIPTION C is a derived class of L. It represents the values of cluster-wide options. If node-scope options need to be queried, then use L. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the VserverOptions element are the attributes of the VserverOptions ComponentState. =over =item C<< option_name >> Applicable for CMode-CLI/ZAPI. =item C<< option_value >> Applicable for CMode-CLI/ZAPI. =item C<< vserver >> Applicable for CMode-CLI/ZAPI. =item C<< option_constraint_string >> Applicable for CMode-CLI. =back =cut package NACL::CS::VserverOptions; use strict; use warnings; use base qw(NACL::CS::ComponentState::ONTAP); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use Class::MethodMaker [ scalar => 'option_name', scalar => 'option_value', scalar => 'vserver', scalar => 'option_constraint_string', ]; =head1 METHODS =head2 fetch my $option_state = NACL::CS::VserverOptions->fetch(command_interface=>$ci,...); my @option_states = NACL::CS::VserverOptions->fetch(command_interface=>$ci,...); see L Uses a CMode-CLI or a CMode-ZAPI APISet. =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(); 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 => 'vserver options', exception_text => 'No matching cluster-wide options(s) found' ); $Log->exit(); return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _fetch_cmode_cli { $Log->enter(); my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@args, api => 'vserver_options'); $Log->exit(); return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter(); my ($pkg_or_obj, @args) = @_; my @state_objs = $pkg_or_obj->SUPER::_fetch_cmode_zapi( @args, api => 'options-get-iter', copy => [qw(vserver)], map => { 'option-name' => 'name', 'option-value' => 'value', }, ); $Log->exit(); return @state_objs; } ## end sub _fetch_cmode_zapi 1;