# # Copyright (c) 2001-2017 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverCifsOptions ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com, benjaram@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverCifsOptions =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP VserverCifsOptions. A related class is L, which represents access to an ONTAP VserverCifsOptions. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the VserverCifsOptions element are the attributes of the VserverCifsOptions ComponentState. =over =item C<< "smb2_enabled" >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< "smb1_enabled" >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< "default_unix_user" >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< "read_grants_exec" >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< "vserver" >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< "wins_servers" >> (Array) Note that for array fields, the accessor method can be invoked in either scalar or list context. my $wins_servers = $obj->wins_servers(); # $wins_servers contains a reference to the array of values my @wins_servers = $obj->wins_servers(); # @wins_servers contains the array of values Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: @values =item C<< max_mpx >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< smb2_2_enabled >> Filled in for CMode CLI. =item C<< shadowcopy_dir_depth >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< copy_offload_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< default_unix_group >> Filled in for CMode CLI/ZAPI. CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< shadowcopy_enabled >> Filled in for CMode CLI/ZAPI. CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< node_referrals_enabled >> Filled in for CMode CLI. =item C<< local_auth_enabled >> Enable/Disable Local User Authentication, possible value(s) are true,false Filled in for CMode CLI. =item C<< local_users_and_groups_enabled >> *Enable/Disable Local Users and Groups, possible value(s) are true,false Filled in for CMode CLI. =item C<< is_referral_enabled >> *Refer Clients to More Optimal LIFs, possible value(s) are true,false Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< is_local_auth_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< is_local_users_and_groups_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< smb3_enabled >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< is_exportpolicy_enabled >> *Enable/Disable Export Policies for CIFS, possible value(s) are true,false Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< is_use_junctions_as_reparse_points_enabled >> Enable/Disable Reparse Point Support possible value(s) are, true,false Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< is_unix_nt_acl_enabled >> Enable/Disable NT ACLs on UNIX security-style volumes possible value(s) are, true,false Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< is_trusted_domain_enum_search_enabled >> Enable/Disable enumeration of trusted domain and search capability possible value(s) are, true,false Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For "filter", "requested_fields" and Output mapping: $value =item C<< client_session_timeout >> Idle Timeout Before CIFS Session Disconnect (secs) Filled in for CMode CLI. =item C<< dac_enabled >> Enable/Disable Dynamic Access Control (DAC) possible value(s) are, true,false Filled in for CMode CLI. =item C<< restrict_anonymous >> Restrictions for Anonymous User possible value(s) are, none,no-enumeration,no-access Filled in for CMode CLI. =item C<< is_read_only_delete_enabled >> Enable/Disable Deletion of Read-Only Files possible value(s) are, enabled,disabled Filled in for CMode CLI. =item C<< is_copy_offload_direct_copy_enabled >> Enable/Disable the Direct-copy Copy Offload Mechanism possible value(s) are, true,false Filled in for CMode CLI. =item C<< file_system_sector_size >> Size of File System Sector Reported to SMB Clients (bytes) possible value(s) are, 512,4096 (in bytes) Filled in for CMode CLI. =item C<< is_dac_enabled >> Enable/Disable Dynamic Access Control (DAC) possible value(s) are, true,false Filled in for CMode CLI. =item C<< 'is-advanced-sparse-file-support-enabled' => $string >> Enable/Disable Advance Sparse File Support, possible value(s) are, true,false Filled in for CMode CLI. =item C<< 'max-file-write-zero-length' => $integer >> Maximum Length of Data in a File Zeroed by One Operation, possible value(s) are 4K to 2GB. Filled in for CMode CLI. =item C<< guest_unix_user >> Map the Guest User to Valid UNIX User Filled in for CMode CLI/ZAPI. =item C<< 'is-large-mtu-enabled' => $string >> Enable/Disable SMB 2.1 "large MTU" feature, possible value(s) are, true,false default value for this parameter is false. Filled in for CMode CLI/ZAPI. =back =cut package NACL::CS::VserverCifsOptions; use strict; use warnings; use Params::Validate qw(validate); use NACL::ComponentUtils qw(_dump_one); 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(Dumper); use NACL::Exceptions::NoElementsFound qw(:try); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'smb2_enabled', scalar => 'smb1_enabled', scalar => 'default_unix_user', scalar => 'read_grants_exec', scalar => 'vserver', array => 'wins_servers', scalar => 'max_mpx', scalar => 'smb2_2_enabled', scalar => 'shadowcopy_dir_depth', scalar => 'copy_offload_enabled', scalar => 'default_unix_group', scalar => 'shadowcopy_enabled', scalar => 'node_referrals_enabled', scalar => 'local_auth_enabled', scalar => 'local_users_and_groups_enabled', scalar => 'is_referral_enabled', scalar => 'is_local_auth_enabled', scalar => 'is_local_users_and_groups_enabled', scalar => 'smb3_enabled', scalar => 'is_exportpolicy_enabled', scalar => 'is_use_junctions_as_reparse_points_enabled', scalar => 'is_unix_nt_acl_enabled', scalar => 'is_trusted_domain_enum_search_enabled', scalar => 'client_session_timeout', scalar => 'dac_enabled', scalar => 'restrict_anonymous', scalar => 'is_read_only_delete_enabled', scalar => 'is_copy_offload_direct_copy_enabled', scalar => 'file_system_sector_size', scalar => 'is_dac_enabled', scalar => 'is_advanced_sparse_file_support_enabled', scalar => 'max_file_write_zero_length', scalar => 'guest_unix_user', scalar => 'is_admin_users_mapped_to_root_enabled', scalar => 'is_large_mtu_enabled', ]; =head1 METHODS =head2 fetch my $VserverCifsOptions_state = NACL::CS::VserverCifsOptions->fetch(command_interface => $ci, ...); my @VserverCifsOptions_states = NACL::CS::VserverCifsOptions->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-options-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 options show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, { method => '_fetch_7mode_cli', interface => 'CLI', set => '7Mode', }, ], exception_text => 'No matching vserver cifs options(s) found' ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _fetch_7mode_cli { $Log->enter() if $may_enter; my @state_objs; my $pkg = shift; my %opts = validate @_, $pkg->_fetch_backend_validate_spec(); my $apiset = delete $opts{apiset}; my $filter = delete $opts{filter}; my (%temp_attributes, %final_attributes); $opts{'option-name'} = "cifs.grant_implicit_exe_perms "; my $response = $apiset->options($opts{'option-name'}); my $output = $response->get_parsed_output(); $temp_attributes{'grant_implicit_exe_perms'} = $output->[0]->{'cifs.grant_implicit_exe_perms'}; $pkg->_hash_copy( source => \%temp_attributes, map => {'grant_implicit_exe_perms' => "read_grants_exec",}, target => \%final_attributes ); my $obj = $pkg->new(command_interface => $opts{command_interface}); $obj->_set_fields(row => \%final_attributes); push @state_objs, $obj; return @state_objs; } ## end sub _fetch_7mode_cli sub _fetch_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@_, api => 'vserver_cifs_options_show'); $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 @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @_, api => 'cifs_options_get_iter', copy => [ qw( default-unix-user max-mpx shadowcopy-dir-depth default-unix-group is-exportpolicy-enabled is-local-auth-enabled is-local-users-and-groups-enabled is-referral-enabled is-trusted-domain-enum-search-enabled is-unix-nt-acl-enabled is-use-junctions-as-reparse-points-enabled vserver is-advanced-sparse-file-support-enabled max-file-write-zero-length guest-unix-user is-admin-users-mapped-to-root-enabled is-large-mtu-enabled is-copy-offload-direct-copy-enabled ) ], map => { 'wins-servers' => ['wins-servers', make_zapi_skip('inet-address')], 'copy-offload-enabled' => 'is-copy-offload-enabled', 'smb2-enabled' => 'is-smb2-enabled', 'smb1-enabled' => 'is-smb1-enabled', 'smb2-2-enabled' => 'is-smb2-2-enabled', 'smb3-enabled' => 'is-smb3-enabled', 'read-grants-exec' => 'read-grants-execute', 'shadowcopy-enabled' => 'is-shadowcopy-enabled', }, ); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_zapi 1;