# $Id: //depot/prod/test/nacldev/lib/NACL/CS/VserverCifsSession.pm#2 # # Copyright (c) 2001-2012 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverCifsSession ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverCifsSession =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP VserverCifsSession. A related class is L, which represents access to an ONTAP VserverCifsSession. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the VserverCifsSession element are the attributes of the VserverCifsSession 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<< shares >> Open Shares Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< protocol_version >> Protocol Version Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< files >> Open Files Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< hostname >> Workstation Name Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< session_id >> Session ID Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< node >> Node Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< connected_time >> Connected Time Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< idle_time >> Idle Time Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< address >> Workstation IP Address Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI:
$value
=item C<< cifs_user >> CIFS User Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< auth_mechanism >> Authentication Mechanism Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< vserver >> Vserver Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< unix_user >> UNIX User Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< ca_protection >> CA Protection Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< connection_id >> Connection ID Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< other >> Open Other Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< lif_address >> Incoming Data LIF IP Address Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< continuously_available >> Continuously Available Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< windows_user >> Windows User Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< is_session_signed >> Is Session Signed possible value(s) are, true,false Filled in for CMode CLI/ZAPI. =item C<< session_index >> Session Index Filled in for CMode CLI. =item C<< user_type >> User Authenticated as possible value(s) are, local-user,domain-user,guest-user,anonymous-user Filled in for CMode CLI/ZAPI. =back =cut package NACL::CS::VserverCifsSession; 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 => 'shares', scalar => 'protocol_version', scalar => 'files', scalar => 'hostname', scalar => 'session_id', scalar => 'node', scalar => 'connected_time', scalar => 'idle_time', scalar => 'address', scalar => 'cifs_user', scalar => 'auth_mechanism', scalar => 'vserver', scalar => 'unix_user', scalar => 'ca_protection', scalar => 'connection_id', scalar => 'other', scalar => 'lif_address', scalar => 'continuously_available', scalar => 'windows_user', scalar => 'is_session_signed', scalar => 'session_index', scalar => 'user_type', scalar => 'connection_count', ]; =head1 METHODS =head2 fetch my $VserverCifsSession_state = NACL::CS::VserverCifsSession->fetch(command_interface => $ci, ...); my @VserverCifsSession_states = NACL::CS::VserverCifsSession->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. Supports CMode CLI/ZAPI. Invokes "cifs-session-get-iter" 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( @_, show_cmd => 'vserver cifs session show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' } ], exception_text => 'No matching $not_matching_element found', ); $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 => 'vserver_cifs_session_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my $copy = [ qw( address auth-mechanism ca-protection cifs-user connected-time connection-id continuously-available files hostname idle-time lif-address node other protocol-version session-id shares unix-user vserver windows-user user-type connection-count is-session-signed) ]; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, api => "cifs-session-get-iter", copy => $copy, ); $Log->exit() if $may_exit; return @state_objs; } 1;