# This is a prototype. It needs documentation. # # Copyright (c) 2001-2013 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverCifs ComponentState Module ## @author Rupamjyoti.Baruah@netapp.com, dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverCifs =head1 DESCRIPTION C is a derived class of L. It represents the state of Vserver Cifs. A related class is L, which represents access to ONTAP Vserver Cifs. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the element are the attributes of the ComponentState. =over =item C<< vserver_cifs >> =item C<< vserver >> Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< cifs_server >> Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< domain_workgroup >> Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< domain >> Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< default_site >> Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< auth_style >> Filled in for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< ou >> Filled in for CMode CLI, CMode ZAPI. Maps to: CMode ZAPI: Accessible through the field "organizational-unit" in the output of ZAPI "cifs-server-get-iter" $value =item C<< admin_username >> Filled in for CMode CLI. =item C<< admin_password >> Filled in for CMode CLI. =item C<< status_admin >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: CMode ZAPI: Accessible through the field "administrative-status" in the output of ZAPI "cifs-server-get-iter" $value =item C<< comment >> CIFS Server Description Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: $value =item C<< netbios_aliases >> nbalias (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $netbios_aliases = $obj->netbios_aliases(); # $netbios_aliases contains a reference to the array of values my @netbios_aliases = $obj->netbios_aliases(); # @netbios_aliases 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 => { netbios_aliases = [ value1, value2...] } Filled in for CMode CLI. =item C<< workgroup >> Workgroup Name Filled in for CMode CLI/ZAPI. =item C<< nba_add >> add or delete Op for NBAliases possible value(s) are, true,false Filled in for CMode CLI. =item C<< nba >> List of newly added or deleted NBAliases (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $nba = $obj->nba(); # $nba contains a reference to the array of values my @nba = $obj->nba(); # @nba 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 => { nba = [ value1, value2...] } Filled in for CMode CLI. =back =cut package NACL::CS::VserverCifs; 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::ComponentUtils qw(_dump_one Dumper); use NACL::Exceptions::NoElementsFound qw(:try); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ # These fields are from the C Mode "vserver cifs show" scalar => 'vserver', scalar => 'cifs_server', scalar => 'domain_workgroup', scalar => 'domain', scalar => 'default_site', scalar => 'auth_style', scalar => 'ou', scalar => 'admin_username', scalar => 'admin_password', scalar => 'status_admin', scalar => 'comment', array => 'netbios_aliases', scalar => 'workgroup', scalar => 'nba_add', array => 'nba', ]; =head1 METHODS =head2 fetch my $node_state = NACL::CS::VserverCifs->fetch(command_interface=>$ci,...); my @node_states = NACL::CS::VserverCifs->fetch(command_interface=>$ci,...); see L =over =item Exceptions Supports CMode CLI/ZAPI. Invokes "cifs-server-get-iter" API for CMode ZAPI. =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 show', exception_text => 'No matching vserver cifs(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, @opts) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@opts, api => "vserver_cifs_show"); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; my $copy = [ qw(vserver cifs-server default-site domain domain-workgroup auth-style comment workgroup) ]; my $map = { 'ou' => 'organizational-unit', 'status-admin' => 'administrative-status', }; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @opts, api => "cifs-server-get-iter", copy => $copy, map => $map, ); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_zapi 1;