# # Copyright (c) 2001-2013 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary MetroclusterCheck Component Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::C::MetroclusterCheck =head1 DESCRIPTION C is a derived class of L. It represents access to an ONTAP MetroclusterCheck. A related class is L, which represents the past state of an ONTAP MetroclusterCheck. =head1 ATTRIBUTES =head2 command_interface See L =head2 component =cut package NACL::C::MetroclusterCheck; use strict; use warnings; use NACL::CS::MetroclusterCheck; 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 $MetroclusterCheck = NACL::C::MetroclusterCheck->new( command_interface => $ci, 'component' => $component, ); Return a new MetroclusterCheck component object with the given attributes. =cut use Class::MethodMaker [scalar => 'component',]; =head2 find my $MetroclusterCheck_obj = NACL::C::MetroclusterCheck->find(command_interface => $ci, ...); my @MetroclusterCheck_objs = NACL::C::MetroclusterCheck->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 MetroclusterCheck_state = $MetroclusterCheck_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::MetroclusterCheck would return a NACL::CS::MetroclusterCheck 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 =head2 run NACL::C::MetroclusterCheck->run( command_interface => $ci, ...); (Class method) This method is used to check the Metrocluster setup. Uses CMode CLI/ZAPI . Invokes 'metrocluster-check-run' 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<< '*' >> This method takes all other options supported by "metrocluster check run" command in ONTAP Applicable for CMode CLI/ZAPI =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 run { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->_frontend_log_debug_opts(@args); my %opts = $pkg->_common_validate_with( params => \@args, ignore_primary_keys => 1, cli_cmd => 'metrocluster check run', ); $pkg->call_on_apiset( %opts, choices => [ { method => '_run_cmode_cli', interface => 'CLI', set => 'CMode', }, { method => '_run_cmode_zapi', interface => 'ZAPI', set => 'CMode', }, ], frontend => 'NACL::C::MetroclusterCheck::run', ); } sub _run_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_cli(@opts, api => 'metrocluster_check_run',); $Log->exit() if $may_exit; } sub _run_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; $pkg->_base_backend_cmode_zapi(@opts, api => 'metrocluster-check-run',); $Log->exit() if $may_exit; } __PACKAGE__->_load_event_class(); sub _primary_keys_validate_spec { return ('component' => {type => SCALAR},); } 1;