# $Id: //depot/prod/test/nacldev/lib/NACL/CS/VserverCifsUsersAndGroupsLocalUser.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 VserverCifsUsersAndGroupsLocalUser ComponentState Module (auto-generated by CGT) ## @author pbala@netapp, dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverCifsUsersAndGroupsLocalUser =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP VserverCifsUsersAndGroupsLocalUser. A related class is L, which represents access to an ONTAP VserverCifsUsersAndGroupsLocalUser. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the VserverCifsUsersAndGroupsLocalUser element are the attributes of the VserverCifsUsersAndGroupsLocalUser 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<< user_cannot_change_password >> Filled in for CMode CLI. =item C<< sid_aliases >> Note that for array fields, the accessor method can be invoked in either scalar or list context. my $sid_aliases = $obj->sid_aliases(); # $sid_aliases contains a reference to the array of values my @sid_aliases = $obj->sid_aliases(); # @sid_aliases contains the array of values Filled in for CMode CLI. =item C<< password_must_change_time >> Filled in for CMode CLI. =item C<< primary_group_id >> Filled in for CMode CLI. =item C<< user_name >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $values =item C<< password >> Filled in for CMode CLI. =item C<< must_change_password >> Filled in for CMode CLI. =item C<< is_account_disabled >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $values =item C<< password_can_change_time >> Filled in for CMode CLI. =item C<< full_name >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $values =item C<< vserver >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $values =item C<< description >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $values =item C<< account_expiry_time >> Filled in for CMode CLI. =item C<< is_account_locked >> Filled in for CMode CLI. =item C<< password_never_expires >> Filled in for CMode CLI. =item C<< password_last_set >> Filled in for CMode CLI. =item C<< password_prevent_tc124 >> Filled in for CMode CLI. =item C<< domain_id >> Domain ID Filled in for CMode CLI. =item C<< user_rid >> User RID Filled in for CMode CLI. =item C<< encMilkAndCookies >> Account Password Filled in for CMode CLI. =item C<< domain_name >> Domain Name Filled in for CMode CLI. =back =cut package NACL::CS::VserverCifsUsersAndGroupsLocalUser; 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 => 'user_cannot_change_password', array => 'sid_aliases', scalar => 'password_must_change_time', scalar => 'primary_group_id', scalar => 'user_name', scalar => 'password', scalar => 'must_change_password', scalar => 'is_account_disabled', scalar => 'password_can_change_time', scalar => 'full_name', scalar => 'vserver', scalar => 'description', scalar => 'account_expiry_time', scalar => 'is_account_locked', scalar => 'password_never_expires', scalar => 'password_last_set', scalar => 'password_prevent_tc124', scalar => 'domain_id', scalar => 'user_rid', scalar => 'encMilkAndCookies', scalar => 'domain_name', ]; =head1 METHODS =head2 fetch my $VserverCifsUsersAndGroupsLocalUser_state = NACL::CS::VserverCifsUsersAndGroupsLocalUser->fetch(command_interface => $ci, ...); my @VserverCifsUsersAndGroupsLocalUser_states = NACL::CS::VserverCifsUsersAndGroupsLocalUser->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-local-user-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 users-and-groups local-user show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' }, ], exception_text => 'No matching vserver cifs users-and-groups local-user(s) 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_users_and_groups_local_user_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my $pkg = shift; my %opts = validate @_, $pkg->_fetch_backend_validate_spec(); my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( %opts, api => 'cifs_local_user_get_iter', copy => [ qw ( vserver is-account-disabled user-name description full-name ) ], ); $Log->exit() if $may_exit; return @state_objs; } 1;