# $Id$ # # Copyright (c) 2001-2011 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary VolumeRecoveryQueue Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::VolumeRecoveryQueue =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP VolumeRecoveryQueue. A related class is L, which represents the past state of an ONTAP VolumeRecoveryQueue. =head1 ATTRIBUTES =head2 command_interface See L =head2 vserver =head2 volume =cut package NACL::C::VolumeRecoveryQueue; use strict; use warnings; use NACL::CS::VolumeRecoveryQueue; 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); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 new my $VolumeRecoveryQueue = NACL::C::VolumeRecoveryQueue->new( command_interface => $ci, 'vserver' => $vserver, 'volume' => $volume, ); Return a new VolumeRecoveryQueue component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'vserver', scalar => 'volume', ]; =head2 find my $VolumeRecoveryQueue_obj = NACL::C::VolumeRecoveryQueue->find(command_interface => $ci, ...); my @VolumeRecoveryQueue_objs = NACL::C::VolumeRecoveryQueue->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 APISet. =head2 state my VolumeRecoveryQueue_state = $VolumeRecoveryQueue_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::VolumeRecoveryQueue would return a NACL::CS::VolumeRecoveryQueue 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. =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 modify NACL::C::VolumeRecoveryQueue->modify( command_interface => $ci, 'vserver' => $vserver, 'volume' => $volume, ...); or $VolumeRecoveryQueue_obj->modify(...); (Class or instance method) This method is used to modify attributes of volumes in the recovery queue. Uses CMode CLI/ZAPI. Invokes "volume-recovery-queue-modify-retention" 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<< 'vserver' => $vserver >> (Required for class method, Not Applicable for instance method) Vserver Name Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< 'volume' => $volume >> (Required for class method, Not Applicable for instance method) Volume Name Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< 'retention-hours' => $string >> Volume Delete Retention Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< '*' >> This method takes all other options supported by "volume recovery queue 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 => { _optional_scalars( qw( retention-hours ) ), }, api => 'volume_recovery_queue_modify', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_modify_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_modify_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], frontend => 'NACL::C::VolumeRecoveryQueue::modify', ); } sub _modify_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'volume_recovery_queue_modify',); $Log->exit() if $may_exit; } sub _modify_cmode_zapi { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my %opts = $pkg_or_obj->_validate_backend_opts(@opts); $pkg_or_obj->_base_backend_cmode_zapi( %opts, copy => [qw(retention-hours)], map => { 'vserver' => 'vserver-name', 'volume' => 'volume-name', }, api => 'volume-recovery-queue-modify-retention', ); $Log->exit() if $may_exit; } =head2 purge_all NACL::C::VolumeRecoveryQueue->purge_all( command_interface => $ci, 'vserver' => $vserver, ...); (Class method) This method is used to purge all volumes from the recovery queue belonging to a Vserver. Uses CMode CLI . =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 name Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "volume recovery queue purge all" 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 purge_all { $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( vserver ) ), }, ignore_primary_keys => 1, api => 'volume_recovery_queue_purge_all', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg->call_on_apiset( %opts, choices => [ { method => '_purge_all_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::VolumeRecoveryQueue::purge_all', ); } sub _purge_all_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'volume_recovery_queue_purge_all',); $Log->exit() if $may_exit; } =head2 purge NACL::C::VolumeRecoveryQueue->purge( command_interface => $ci, 'vserver' => $vserver, 'volume' => $volume, ...); or $VolumeRecoveryQueue_obj->purge(...); (Class or instance method) This method is used to purge volumes from the recovery queue belonging to a Vserver. Uses CMode CLI/ZAPI. Invokes "volume-recovery-queue-purge" 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<< 'vserver' => $vserver >> (Required for class method, Not Applicable for instance method) Vserver Name Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< 'volume' => $volume >> (Required for class method, Not Applicable for instance method) Volume Name Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< '*' >> This method takes all other options supported by "volume recovery queue purge" 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 purge { $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, api => 'volume_recovery_queue_purge', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_purge_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_purge_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], frontend => 'NACL::C::VolumeRecoveryQueue::purge', ); } sub _purge_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'volume_recovery_queue_purge',); $Log->exit() if $may_exit; } sub _purge_cmode_zapi { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my %opts = $pkg_or_obj->_validate_backend_opts(@opts); $pkg_or_obj->_base_backend_cmode_zapi( %opts, map => { 'vserver' => 'vserver-name', 'volume' => 'volume-name', }, api => 'volume-recovery-queue-purge', ); $Log->exit() if $may_exit; } =head2 recover_all NACL::C::VolumeRecoveryQueue->recover_all( command_interface => $ci, 'vserver' => $vserver, ...); (Class method) This method is used to recover all volumes from the recovery queue belonging to a Vserver. Uses CMode CLI . =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 name Applicable for CMode CLI =item C<< '*' >> This method takes all other options supported by "volume recovery queue recover all" 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 recover_all { $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( vserver ) ), }, ignore_primary_keys => 1, api => 'volume_recovery_queue_recover_all', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg->call_on_apiset( %opts, choices => [ { method => '_recover_all_cmode_cli', interface => 'CLI', set => 'CMode', }, ], frontend => 'NACL::C::VolumeRecoveryQueue::recover_all', ); } sub _recover_all_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'volume_recovery_queue_recover_all',); $Log->exit() if $may_exit; } =head2 recover NACL::C::VolumeRecoveryQueue->recover( command_interface => $ci, 'vserver' => $vserver, 'volume' => $volume, ...); or $VolumeRecoveryQueue_obj->recover(...); (Class or instance method) This method is used to recover volumes from the recovery queue belonging to a Vserver. Uses CMode CLI/ZAPI. Invokes "volume-recovery-queue-recovery" 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<< 'vserver' => $vserver >> (Required for class method, Not Applicable for instance method) Vserver Name Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< 'volume' => $volume >> (Required for class method, Not Applicable for instance method) Volume Name Applicable for CMode CLI/ZAPI Maps to: CM ZAPI: For "requested_fields", "filter" and Output mapping: <$value> =item C<< '*' >> This method takes all other options supported by "volume recovery queue recover" 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 recover { $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, api => 'volume_recovery_queue_recover', ); my $vserver; $opts{vserver_operated_on} = \$vserver; $pkg_or_obj->call_on_apiset( %opts, choices => [ { method => '_recover_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_recover_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], frontend => 'NACL::C::VolumeRecoveryQueue::recover', ); } sub _recover_cmode_cli { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; $pkg_or_obj->_base_backend_cmode_cli(@opts, api => 'volume_recovery_queue_recover',); $Log->exit() if $may_exit; } sub _recover_cmode_zapi { $Log->enter() if $may_enter; my ($pkg_or_obj, @opts) = @_; my %opts = $pkg_or_obj->_validate_backend_opts(@opts); $pkg_or_obj->_base_backend_cmode_zapi( %opts, map => { 'vserver' => 'vserver-name', 'volume' => 'volume-name', }, api => 'volume-recovery-queue-recover', ); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'vserver' => {type => SCALAR}, 'volume' => {type => SCALAR}, ); } 1;