# $Id$ # # Copyright (c) 2001-2010 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverCifsNbtstat ComponentState Module ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverCifsNbtstat =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP VserverCifsNbtstat. A related class is L, which represents access to an ONTAP VserverCifs. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the VserverCifsNbtstat element are the attributes of the VserverCifsNbtstat ComponentState. =over =item C<< "vserver" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "vserver" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "nbt_name" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "netbios-name" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "netbios_suffix" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "netbios-suffix" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "nbt_mode" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "nbt-mode" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "node" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "node" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "state" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "nbt-name-state" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "time_left" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "registration-time-left-minutes" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "nbt_scope" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "nbt-scope" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "type" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "registered-type" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "wins_servers" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "wins-entries" in the output of ZAPI "cifs-nbtstat-get-iter" =item C<< "server_state" >> =item C<< "interface" >> Filled in for CMode CLI, CMode ZAPI. CMode ZAPI: Accessible through the field "registered-addresses" in the output of ZAPI "cifs-nbtstat-get-iter" =back =cut package NACL::CS::VserverCifsNbtstat; use strict; use warnings; use Params::Validate qw(validate); use NACL::ComponentUtils qw(_dump_one Dumper); 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 => 'vserver', scalar => 'nbt_name', scalar => 'netbios_suffix', scalar => 'nbt_mode', scalar => 'node', scalar => 'state', scalar => 'time_left', scalar => 'nbt_scope', scalar => 'type', array => 'wins_servers', array => 'server_state', array => 'interface' ]; =head1 METHODS =head2 fetch my $node_state = NACL::CS::VserverCifsNbtstat->fetch(command_interface=>$ci,...); my @node_states = NACL::CS::VserverCifsNbtstat->fetch(command_interface=>$ci,...); see L =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', }, ], show_cmd => 'vserver cifs nbtstat', exception_text => 'No matching vserver cifs nbtstat(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 => "vserver_cifs_nbtstat"); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my $pkg = shift; my $copy = [qw(vserver node netbios-suffix nbt-mode nbt-scope)]; my $map = { "nbt_name" => ['netbios-name'], "state" => ['nbt-name-state'], "interface" => ['registered-addresses', 'ip-address'], "time_left" => ['registration-time-left-minutes'], "type" => ['registered-type'], "wins_servers" => ['wins-entries', 'wins-entry-info', 'wins-address'], "wins_servers" => ['wins-entries', 'wins-entry-info', 'wins-state'] }; $Log->exit() if $may_exit; return $pkg->SUPER::_fetch_cmode_zapi( @_, api => "cifs-nbtstat-get-iter", copy => $copy, map => $map, ); } ## end sub _fetch_cmode_zapi 1;