# $Id //depot/prod/test/nacldev/lib/NACL/C/VserverGroupMapping.pm#8 $ # # Copyright (c) 2001-2012 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VserverGroupMapping Component Module (auto-generated by CGT) ## @author Akshay Mohit(makshay@netapp.com), dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::VserverGroupMapping =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP VserverGroupMapping. A related class is L, which represents the past state of an ONTAP VserverGroupMapping. =head1 ATTRIBUTES =head2 command_interface See L =head2 direction =head2 vserver =head2 position =cut package NACL::C::VserverGroupMapping; use strict; use warnings; use NACL::CS::VserverGroupMapping; use NACL::ComponentUtils qw (_optional_scalars Dumper); use base 'NACL::C::Component::ONTAP'; use Params::Validate qw(validate validate_with SCALAR ARRAYREF); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 new my $VserverGroupMapping = NACL::C::VserverGroupMapping->new( command_interface => $ci, 'direction' => $direction, 'vserver' => $vserver, 'position' => $position, ); Return a new VserverGroupMapping component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'direction', scalar => 'vserver', scalar => 'position', ]; 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 find my $VserverGroupMapping_obj = NACL::C::VserverGroupMapping->find(command_interface => $ci, ...); my @VserverGroupMapping_objs = NACL::C::VserverGroupMapping->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 VserverGroupMapping_state = $VserverGroupMapping_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::VserverGroupMapping would return a NACL::CS::VserverGroupMapping 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 APISet or CMode ZAPI APISet. =cut =head2 swap NACL::C::VserverGroupMapping->swap( command_interface => $ci, 'direction' => $direction, 'vserver' => $vserver, 'position' => $position, ...); or $VserverGroupMapping_obj->swap(...); (Class or instance method) This method is used to swap existing group-mappings. Uses a CMode CLI APISet or CMode ZAPI APISet. Invokes 'group-mapping-swap' API for CMode ZAPI. =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<< 'direction' => $direction >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'vserver' => $vserver >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Applicable for CMode CLI. =item C<< 'position' => $position >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'with-position' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< 'position' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable only for CMode CLI =item C<< '*' >> This method takes all other options supported by "vserver group-mapping swap" command in ONTAP. Applicable for CMode CLI/ZAPI. =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 swap { $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 => { _optional_scalars( qw( with-position ) ), }, cli_cmd => 'vserver group-mapping swap', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_swap_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_swap_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], frontend => 'NACL::C::VserverGroupMapping::swap', ); if (defined($opts{position}) && (ref $pkg_or_obj)) { $pkg_or_obj->position($opts{position}); } $Log->exit() if $may_exit; } sub _swap_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'vserver_group_mapping_swap',); $Log->exit() if $may_exit; } sub _swap_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my $copy = [qw(with-position direction position)]; $pkg_or_obj->_base_backend_cmode_zapi( @opts, api => 'group-mapping-swap', copy => $copy, ); $Log->exit() if $may_exit; } =head2 modify NACL::C::VserverGroupMapping->modify( command_interface => $ci, 'direction' => $direction, 'vserver' => $vserver, 'position' => $position, ...); or $VserverGroupMapping_obj->modify(...); (Class or instance method) This method is used to modify an existing group-mapping. Uses a CMode CLI APISet or CMode ZAPI APISet. Invokes 'group-mapping-modify' API for CMode ZAPI. =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<< 'direction' => $direction >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'vserver' => $vserver >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Applicable for CMode CLI. =item C<< 'position' => $position >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value =item C<< 'pattern' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< 'replacement' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< 'position' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable only for CMode CLI =item C<< '*' >> This method takes all other options supported by "vserver group-mapping modify" command in ONTAP. Applicable for CMode CLI/ZAPI. =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 => { _optional_scalars( qw( pattern replacement ) ), }, cli_cmd => 'vserver group-mapping modify', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %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::VserverGroupMapping::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_group_mapping_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(direction pattern position replacement)]; $pkg_or_obj->_base_backend_cmode_zapi( @opts, api => 'group-mapping-modify', copy => $copy, ); $Log->exit() if $may_exit; } =head2 delete NACL::C::VserverGroupMapping->delete( command_interface => $ci, 'direction' => $direction, 'vserver' => $vserver, 'position' => $position, ...); or $VserverGroupMapping_obj->delete(...); (Class or instance method) This method is used to delete an existing group-mapping. Uses a CMode CLI APISet or CMode ZAPI APISet Invokes 'group-mapping-delete' API for CMode ZAPI. =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<< 'direction' => $direction >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'vserver' => $vserver >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Applicable for CMode CLI. =item C<< 'position' => $position >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< 'position' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable only for CMode CLI =item C<< '*' >> This method takes all other options supported by "vserver group-mapping delete" command in ONTAP. Applicable for CMode CLI/ZAPI. =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 group-mapping delete', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %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', }, ], frontend => 'NACL::C::VserverGroupMapping::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_group_mapping_delete',); $Log->exit() if $may_exit; } sub _delete_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my $copy = [qw(direction position)]; $pkg_or_obj->_base_backend_cmode_zapi( @opts, api => 'group-mapping-delete', copy => $copy, ); $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(direction vserver position)], _vs_context => 1 ); $Log->exit() if $may_exit; } =head2 insert NACL::C::VserverGroupMapping->insert( command_interface => $ci, 'direction' => $direction, 'vserver' => $vserver, 'position' => $position, ...); or $VserverGroupMapping_obj->insert(...); (Class or instance method) This method is used to create a group mapping at a specified position. Uses a CMode CLI APISet or CMode ZAPI APISet. Invokes 'group-mapping-insert' API for CMode ZAPI. =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<< 'direction' => $direction >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'vserver' => $vserver >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Applicable for CMode CLI. =item C<< 'position' => $position >> Applicable for CMode CLI, CMode ZAPI. (Required for class method, Not Applicable for instance method) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'pattern' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< 'replacement' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< 'position' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable only for CMode CLI =item C<< 'position' => $string >> =item C<< '*' >> This method takes all other options supported by "vserver group-mapping insert" command in ONTAP. Applicable for CMode CLI/ZAPI. =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 insert { $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 => { _optional_scalars( qw( pattern replacement ) ), }, cli_cmd => 'vserver group-mapping insert', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_insert_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_insert_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], frontend => 'NACL::C::VserverGroupMapping::insert', ); my $obj = $pkg_or_obj->new( command_interface => $opts{command_interface}, direction => $opts{'direction'}, vserver => $vserver, position => $opts{'position'}, ); $Log->exit() if $may_exit; return $obj; } sub _insert_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'vserver_group_mapping_insert',); $Log->exit() if $may_exit; } sub _insert_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my $copy = [qw(direction pattern position replacement)]; $pkg_or_obj->_base_backend_cmode_zapi( @opts, api => 'group-mapping-insert', copy => $copy, ); $Log->exit() if $may_exit; } =head2 create my $VserverGroupMapping_obj = NACL::C::VserverGroupMapping->create( command_interface => $ci, 'direction' => $direction, 'vserver' => $vserver, 'position' => $position, ...); (Class method) This method is used to define a new group-mapping. Uses a CMode CLI APISet or CMode ZAPI APISet. Invokes 'group-mapping-create' API for CMode ZAPI. =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<< 'direction' => $direction >> Applicable for CMode CLI, CMode ZAPI. (Required) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'vserver' => $vserver >> Applicable for CMode CLI, CMode ZAPI. (Required) Applicable for CMode CLI. =item C<< 'position' => $position >> Applicable for CMode CLI, CMode ZAPI. (Required) Maps to: CM ZAPI: $value Applicable for CMode CLI. =item C<< 'pattern' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< 'replacement' => $string >> Applicable for CMode CLI, CMode ZAPI. Maps to: CM ZAPI: $value =item C<< 'method-timeout' => $time_in_seconds >> (Optional) The default NATE timeout is 60 seconds. If the command might take more time to complete, this option can be used to specify a larger timeout value. The value should be provided in seconds. =item C<< 'position' => $string >> Applicable for CMode CLI. =item C<< "extended_query" => $string >> (Optional) Applicable only for CMode CLI =item C<< '*' >> This method takes all other options supported by "vserver group-mapping create" command in ONTAP. Applicable for CMode CLI/ZAPI. =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 => { _optional_scalars( qw( pattern replacement ) ), }, cli_cmd => 'vserver group-mapping create', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg->call_on_apiset( %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', }, ], frontend => 'NACL::C::VserverGroupMapping::create', ); my $obj = $pkg->new( command_interface => $opts{command_interface}, direction => $opts{'direction'}, vserver => $vserver, position => $opts{'position'}, ); $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_group_mapping_create',); $Log->exit() if $may_exit; } sub _create_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; my $copy = [qw(direction pattern position replacement)]; $pkg->_base_backend_cmode_zapi( @opts, api => 'group-mapping-create', copy => $copy, ); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'direction' => {type => SCALAR}, 'vserver' => {type => SCALAR}, 'position' => {type => SCALAR}, ); } 1;