# $Id$ # # Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary MetroclusterCheckLif Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::MetroclusterCheckLif =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP MetroclusterCheckLif. A related class is L, which represents the past state of an ONTAP MetroclusterCheckLif. =head1 ATTRIBUTES =head2 command_interface See L =head2 vserver =head2 clusterID =head2 lif =cut package NACL::C::MetroclusterCheckLif; use strict; use warnings; use NACL::CS::MetroclusterCheckLif; 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 $MetroclusterCheckLif = NACL::C::MetroclusterCheckLif->new( command_interface => $ci, 'vserver' => $vserver, 'clusterID' => $clusterID, 'lif' => $lif, ); Return a new MetroclusterCheckLif component object with the given attributes. =cut use Class::MethodMaker [ scalar => 'vserver', scalar => 'clusterID', scalar => 'lif', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head2 find my $MetroclusterCheckLif_obj = NACL::C::MetroclusterCheckLif->find(command_interface => $ci, ...); my @MetroclusterCheckLif_objs = NACL::C::MetroclusterCheckLif->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 MetroclusterCheckLif_state = $MetroclusterCheckLif_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::MetroclusterCheckLif would return a NACL::CS::MetroclusterCheckLif 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 =head2 repair_placement NACL::C::MetroclusterCheckLif->repair_placement( command_interface => $ci, 'vserver' => $vserver, 'lif' => $lif, ...); (Class method) This method is used to repair LIF placement for the sync-source Vserver LIFs in the destination cluster. Uses CMode CLI/ZAPI . Invokes metrocluster-check-lif-repair-placement 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) sync-source Vserver Name Applicable for CMode CLI/ZAPI, non-iter. =item C<< 'lif' => $lif >> (Required) Logical Interface Name Applicable for CMode CLI/ZAPI, non-iter. =item C<< '*' >> This method takes all other options supported by "metrocluster check lif repair placement" 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 repair_placement { $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 lif ) ), }, cli_cmd => 'metrocluster check lif repair-placement', ); $pkg->call_on_apiset( %opts, choices => [ { method => '_repair_placement_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_repair_placement_cmode_zapi_non_iter', interface => 'ZAPI', set => 'CMode', zapi_type => 'non-iter', }, ], frontend => 'NACL::C::MetroclusterCheckLif::repair_placement', ); $Log->exit() if $may_exit; } sub _repair_placement_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'metrocluster_check_lif_repair_placement',); $Log->exit() if $may_exit; } sub _repair_placement_cmode_zapi_non_iter { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; my $copy = [qw(vserver lif)]; $pkg->_base_backend_cmode_zapi( @opts, api => 'metrocluster-check-lif-repair-placement', 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(vserver clusterID lif)],); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ( 'vserver' => {type => SCALAR}, 'clusterID' => {type => SCALAR, optional => 1}, 'lif' => {type => SCALAR}, ); } 1;