# # Copyright (c) 2001-2015 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverServicesNameServiceLdapClient Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::VserverServicesNameServiceLdapClient =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP VserverServicesNameServiceLdapClient. A related class is L, which represents the past state of an ONTAP VserverServicesNameServiceLdapClient. =head1 ATTRIBUTES =head2 command_interface See L =head2 vserver =head2 client_config =cut package NACL::C::VserverServicesNameServiceLdapClient; use strict; use warnings; use NACL::CS::VserverServicesNameServiceLdapClient; use NACL::ComponentUtils qw (_optional_scalars Dumper); use base 'NACL::C::Component::ONTAP'; use Params::Validate qw(validate_with SCALAR ARRAYREF SCALARREF); use NATE::Log qw(log_global); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use NACL::CS::ComponentState::ZapiArray qw(make_zapi_array); =head1 METHODS =head2 new my $VserverServicesNameServiceLdapClient = NACL::C::VserverServicesNameServiceLdapClient->new( command_interface => $ci, 'vserver' => $vserver, 'client-config' => $client_config, ); Return a new VserverServicesNameServiceLdapClient component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'vserver', scalar => 'client_config', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head2 find my $VserverServicesNameServiceLdapClient_obj = NACL::C::VserverServicesNameServiceLdapClient->find(command_interface => $ci, ...); my @VserverServicesNameServiceLdapClient_objs = NACL::C::VserverServicesNameServiceLdapClient->find(command_interface => $ci, ...); (Class method) A constructor of sorts, which discovers which elements are present (by interacting with the given command interface). In an array context it creates a component object for each present element and returns them. In a scalar context it creates a component object for just one element. This method is generally not implemented in individual components. The base class (L provides an implementation. See for a more detailed description along with explanation of all the options accepted. Uses a CMode CLI/ZAPI APISet. =head2 state my VserverServicesNameServiceLdapClient_state = $VserverServicesNameServiceLdapClient_obj->state(); (Instance method) Fetch the current state of the element associated with this component, and return a Component State object corresponding to this component (calling this on NACL::C::VserverServicesNameServiceLdapClient would return a NACL::CS::VserverServicesNameServiceLdapClient object) This method is generally not implemented in individual components. The base class (L provides an implementation. See for a more detailed description along with explanation of all the options accepted. Uses a CMode CLI/ZAPI APISet. =cut sub init { $Log->enter() if $may_enter; my ($self, @args) = @_; $self->SUPER::init(@args); $self->_vserver_context_init(@args); $Log->exit() if $may_exit; } =head2 create my $VserverServicesNameServiceLdapClient_obj = NACL::C::VserverServicesNameServiceLdapClient->create( command_interface => $ci, 'vserver' => $vserver, 'client-config' => $client_config, ...); (Class method) This method is used to create an LDAP client configuration. Uses CMode CLI/ZAPI . Invokes ldap-client-create for CMode Zapi non-iter =over =item Options =over =item C<< command_interface => $command_interface >> (Required) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'vserver' => $vserver >> (Required) Vserver Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'client-config' => $client_config >> (Required) Client Configuration Name Applicable for CMode CLI/ZAPI, non-iter. Mapping for non-iter: ldap-client-config =item C<< 'user-scope' => $string >> User Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-byhost-scope' => $string >> Netgroup-By-Host Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'base-dn' => $string >> Base DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'schema' => $string >> Schema Template Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'user-dn' => $string >> User DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'asymmetric-name-mapping' => $string >> Use different servers in each direction possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'bind-as-cifs-server' => $string >> Bind Using the Vserver's CIFS Credentials possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'base-scope' => $string >> Base Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'bind-dn' => $string >> Bind DN (User) Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'group-dn' => $string >> Group DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'allow-ssl' => $string >> Allow SSL for the TLS Handshake Protocol possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'bind-password' => $string >> Bind Password Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'session-security' => $string >> Client Session Security possible value(s) are, none,sign,seal Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'min-bind-level' => $string >> Minimum Bind Authentication Level possible value(s) are, anonymous,simple,sasl Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'ad-domain' => $string >> Active Directory Domain Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-dn' => $string >> Netgroup DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'port' => $string >> LDAP Server Port ranges from 1 to 65535 Applicable for CMode CLI/ZAPI, non-iter. Mapping for non-iter: tcp-port =item C<< 'obs-password' => $string >> Encrypted Password Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'group-scope' => $string >> Group Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-byhost-dn' => $string >> Netgroup-By-Host DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'use-start-tls' => $string >> Use start-tls Over LDAP Connections possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-scope' => $string >> Netgroup Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'query-timeout' => $string >> Query Timeout (sec) ranges from 0 to 10 Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'is-netgroup-byhost-enabled' => $string >> Enable Netgroup-By-Host Lookup possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'preferred-ad-servers' => [ $preferred-ad-server1, $preferred-ad-server2, ... ] >> (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'servers' => [ $server1, $server2, ... ] >> DEPRECATED (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'ldap-servers' => [ $server1, $server2, ... ] >> (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI/ZAPI, non-iter. =item C<< '*' >> This method takes all other options supported by "vserver services name service ldap client create" command in ONTAP =item C<< other_options >> This method takes other common options described in L =back =back =over =item Exceptions =over =item C In general, Component methods propagate the exceptions thrown from underlying API layer and the details of those exceptions are described in the L of user guide. =back =back =cut sub create { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, additional_spec => { 'preferred-ad-servers' => {type => ARRAYREF, optional => 1}, 'servers' => {type => ARRAYREF, optional => 1}, _optional_scalars( qw( user-scope netgroup-byhost-scope base-dn schema user-dn asymmetric-name-mapping bind-as-cifs-server base-scope bind-dn group-dn allow-ssl bind-password session-security min-bind-level ad-domain netgroup-dn port obs-password group-scope netgroup-byhost-dn use-start-tls netgroup-scope query-timeout is-netgroup-byhost-enabled ) ), }, cli_cmd => 'vserver services name-service ldap client create', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg->call_on_apiset_with_exceptions( %opts, choices => [ { method => '_create_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_create_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], nacl_exceptions => [qw(AlreadyExists)], frontend => 'NACL::C::VserverServicesNameServiceLdapClient::create', ); my %obj_opts = ( command_interface => $opts{command_interface}, vserver => $vserver, client_config => $opts{'client-config'}, ); my $obj = $pkg->new(%obj_opts); $Log->exit() if $may_exit; return $obj; } sub _create_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'vserver_services_name_service_ldap_client_create',); $Log->exit() if $may_exit; } sub _create_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; my $copy = [ qw(netgroup-byhost-scope user-scope base-dn user-dn schema preferred-ad-servers bind-as-cifs-server base-scope bind-dn group-dn allow-ssl bind-password session-security min-bind-level netgroup-dn ad-domain obs-password netgroup-byhost-dn group-scope use-start-tls netgroup-scope servers query-timeout is-netgroup-byhost-enabled) ]; my $map = { 'client-config' => 'ldap-client-config', 'port' => 'tcp-port', }; $pkg->_base_backend_cmode_zapi( @opts, api => 'ldap-client-create', copy => $copy, map => $map, ); $Log->exit() if $may_exit; } sub _check_non_iter { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_check_non_iter( @opts, _primary_keys => [qw(vserver client-config)], _vs_context => 1 ); $Log->exit() if $may_exit; } =head2 delete NACL::C::VserverServicesNameServiceLdapClient->delete( command_interface => $ci, 'vserver' => $vserver, 'client-config' => $client_config, ...); or $VserverServicesNameServiceLdapClient_obj->delete(...); (Class or instance method) This method is used to delete an LDAP client configuration. Uses CMode CLI/ZAPI . Invokes ldap-client-delete for CMode Zapi non-iter =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'vserver' => $vserver >> (Required for class method, Not Applicable for instance method) Vserver Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'client-config' => $client_config >> (Required for class method, Not Applicable for instance method) Client Configuration Name Applicable for CMode CLI/ZAPI, non-iter. Mapping for non-iter: ldap-client-config =item C<< '*' >> This method takes all other options supported by "vserver services name service ldap client delete" command in ONTAP =item C<< other_options >> This method takes other common options described in L =back =back =over =item Exceptions =over =item C In general, Component methods propagate the exceptions thrown from underlying API layer and the details of those exceptions are described in the L of user guide. =back =back =cut sub delete { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, cli_cmd => 'vserver services name-service ldap client delete', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset_with_exceptions( %opts, choices => [ { method => '_delete_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_delete_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], nacl_exceptions => [qw(DoesNotExist)], frontend => 'NACL::C::VserverServicesNameServiceLdapClient::delete', ); $Log->exit() if $may_exit; } sub _delete_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'vserver_services_name_service_ldap_client_delete',); $Log->exit() if $may_exit; } sub _delete_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my $map = {'client-config' => 'ldap-client-config',}; $pkg_or_obj->_base_backend_cmode_zapi( @opts, api => 'ldap-client-delete', map => $map, ); $Log->exit() if $may_exit; } =head2 modify_bind_password NACL::C::VserverServicesNameServiceLdapClient->modify_bind_password( command_interface => $ci, 'vserver' => $vserver, 'client-config' => $client_config, ...); or $VserverServicesNameServiceLdapClient_obj->modify_bind_password(...); (Class or instance method) This method is used to modify Bind Password of an LDAP client configuration. Uses CMode CLI. =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'vserver' => $vserver >> (Required for class method, Not Applicable for instance method) Vserver Applicable for CMode CLI =item C<< 'client-config' => $client_config >> (Required for class method, Not Applicable for instance method) Client Configuration Name Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "vserver services name service ldap client modify bind password" command in ONTAP =item C<< other_options >> This method takes other common options described in L =back =back =over =item Exceptions =over =item C In general, Component methods propagate the exceptions thrown from underlying API layer and the details of those exceptions are described in the L of user guide. =back =back =cut sub modify_bind_password { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, cli_cmd => 'vserver services name-service ldap client modify-bind-password', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset_with_exceptions( %opts, choices => [ { method => '_modify_bind_password_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, ], frontend => 'NACL::C::VserverServicesNameServiceLdapClient::modify_bind_password', ); $Log->exit() if $may_exit; } sub _modify_bind_password_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'vserver_services_name_service_ldap_client_modify_bind_password', ); $Log->exit() if $may_exit; } =head2 modify NACL::C::VserverServicesNameServiceLdapClient->modify( command_interface => $ci, 'vserver' => $vserver, 'client-config' => $client_config, ...); or $VserverServicesNameServiceLdapClient_obj->modify(...); (Class or instance method) This method is used to modify an LDAP client configuration. Uses CMode CLI/ZAPI . Invokes ldap-client-modify for CMode Zapi non-iter =over =item Options =over =item C<< command_interface => $command_interface >> (Required for class method, Not Applicable for instance method) See L =item C<< apiset_must => $ruleset >> (Optional) See L =item C<< apiset_should => $ruleset >> (Optional) See L =item C<< 'vserver' => $vserver >> (Required for class method, Not Applicable for instance method) Vserver Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'client-config' => $client_config >> (Required for class method, Not Applicable for instance method) Client Configuration Name Applicable for CMode CLI/ZAPI, non-iter. Mapping for non-iter: ldap-client-config =item C<< 'user-scope' => $string >> User Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-byhost-scope' => $string >> Netgroup-By-Host Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'base-dn' => $string >> Base DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'schema' => $string >> Schema Template Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'user-dn' => $string >> User DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'asymmetric-name-mapping' => $string >> Use different servers in each direction possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'bind-as-cifs-server' => $string >> Bind Using the Vserver's CIFS Credentials possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'base-scope' => $string >> Base Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'bind-dn' => $string >> Bind DN (User) Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'group-dn' => $string >> Group DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'allow-ssl' => $string >> Allow SSL for the TLS Handshake Protocol possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'session-security' => $string >> Client Session Security possible value(s) are, none,sign,seal Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'bind-password' => $string >> Bind Password Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'min-bind-level' => $string >> Minimum Bind Authentication Level possible value(s) are, anonymous,simple,sasl Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'ad-domain' => $string >> Active Directory Domain Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-dn' => $string >> Netgroup DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'port' => $string >> LDAP Server Port ranges from 1 to 65535 Applicable for CMode CLI/ZAPI, non-iter. Mapping for non-iter: tcp-port =item C<< 'obs-password' => $string >> Encrypted Password Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'group-scope' => $string >> Group Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-byhost-dn' => $string >> Netgroup-By-Host DN Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'use-start-tls' => $string >> Use start-tls Over LDAP Connections possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'netgroup-scope' => $string >> Netgroup Search Scope possible value(s) are, base,onelevel,subtree Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'query-timeout' => $string >> Query Timeout (sec) ranges from 0 to 10 Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'is-netgroup-byhost-enabled' => $string >> Enable Netgroup-By-Host Lookup possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'skip-config-validation' => $string >> Skip Configuration Validation,possible value(s) are, true,false Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'preferred-ad-servers' => [ $preferred-ad-server1, $preferred-ad-server2, ... ] >> (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'servers' => [ $server1, $server2, ... ] >> DEPRECATED (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'ldap-servers' => [ $server1, $server2, ... ] >> (Arrayref, even if only a single value is to be sent it should specified as an arrayref containing that single value) Applicable for CMode CLI/ZAPI, non-iter. =item C<< '*' >> This method takes all other options supported by "vserver services name service ldap client modify" command in ONTAP =item C<< other_options >> This method takes other common options described in L =back =back =over =item Exceptions =over =item C In general, Component methods propagate the exceptions thrown from underlying API layer and the details of those exceptions are described in the L of user guide. =back =back =cut sub modify { $Log->enter() if $may_enter; my ($pkg_or_obj, @args) = @_; $pkg_or_obj->_frontend_log_debug_opts(@args); my %opts = $pkg_or_obj->_common_validate_with( params => \@args, additional_spec => { 'preferred-ad-servers' => {type => ARRAYREF, optional => 1}, 'servers' => {type => ARRAYREF, optional => 1}, _optional_scalars( qw( user-scope netgroup-byhost-scope base-dn schema user-dn asymmetric-name-mapping bind-as-cifs-server base-scope bind-dn group-dn allow-ssl session-security bind-password min-bind-level ad-domain netgroup-dn port obs-password group-scope netgroup-byhost-dn use-start-tls netgroup-scope query-timeout is-netgroup-byhost-enabled skip-config-validation ) ), }, cli_cmd => 'vserver services name-service ldap client modify', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset_with_exceptions( %opts, choices => [ { method => '_modify_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_modify_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], frontend => 'NACL::C::VserverServicesNameServiceLdapClient::modify', ); $Log->exit() if $may_exit; } sub _modify_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'vserver_services_name_service_ldap_client_modify',); $Log->exit() if $may_exit; } sub _modify_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my $copy = [ qw(netgroup-byhost-scope user-scope base-dn user-dn schema preferred-ad-servers bind-as-cifs-server base-scope bind-dn group-dn allow-ssl bind-password session-security min-bind-level netgroup-dn ad-domain obs-password netgroup-byhost-dn group-scope use-start-tls netgroup-scope servers query-timeout is-netgroup-byhost-enabled skip-config-validation) ]; my $map = { 'client-config' => 'ldap-client-config', 'port' => 'tcp-port', }; $pkg_or_obj->_base_backend_cmode_zapi( @opts, api => 'ldap-client-modify', copy => $copy, map => $map, ); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'vserver' => {type => SCALAR}, 'client-config' => {type => SCALAR}, ); } 1;