# Copyright (c) 2001-2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary MetroclusterCheckConfigReplication ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::MetroclusterCheckConfigReplication =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP MetroclusterCheckConfigReplication. A related class is L, which represents access to an ONTAP MetroclusterCheckConfigReplication. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the MetroclusterCheckConfigReplication element are the attributes of the MetroclusterCheckConfigReplication ComponentState. Additionally, the command_interface used to obtain the ComponentState object is also an attribute of the object. This makes it easier to obtain the component object corresponding to the CS object, using L. =over =item command_interface The command_interface with which the CS object was obtained. (Available in all CS objects regardless of requested_fields and the mode/interface) =item C<< vserver_recovery_steps >> Vserver Streams Recovery Steps Filled in for CMode CLI/ZAPI =item C<< last_heartbeat_sent >> Last Heartbeat Sent Time/ZAPI Filled in for CMode CLI =item C<< last_heartbeat_received >> Last Heartbeat Received Time Filled in for CMode CLI/ZAPI =item C<< cluster_recovery_steps >> Cluster Streams Recovery Steps Filled in for CMode CLI/ZAPI =item C<< running >> Config Replication Running possible value(s) are, true,false Filled in for CMode CLI/ZAPI =item C<< storage_status >> Storage Status Filled in for CMode CLI/ZAPI =item C<< storage_in_use >> Storage Currently In Use Filled in for CMode CLI/ZAPI =item C<< storage_remarks >> Storage Remarks Filled in for CMode CLI/ZAPI =item C<< vserver_streams >> Vserver Streams Status Filled in for CMode CLI/ZAPI =item C<< remote_heartbeat >> Remote Heartbeat Filled in for CMode CLI/ZAPI =item C<< heartbeat_recovery_steps >> Heartbeat Recovery Steps Filled in for CMode CLI/ZAPI =item C<< recovery_steps >> Config Replication Recovery Steps Filled in for CMode CLI/ZAPI =item C<< storage_recovery_steps >> Storage Recovery Steps Filled in for CMode CLI/ZAPI =item C<< cluster_streams >> Cluster Streams Status Filled in for CMode CLI/ZAPI =item C<< enabled >> Config Replication Enabled possible value(s) are, true,false Filled in for CMode CLI/ZAPI =back =cut package NACL::CS::MetroclusterCheckConfigReplication; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); use NACL::Exceptions::NoElementsFound qw(:try); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'vserver_recovery_steps', scalar => 'last_heartbeat_sent', scalar => 'last_heartbeat_received', scalar => 'cluster_recovery_steps', scalar => 'running', scalar => 'storage_status', scalar => 'storage_in_use', scalar => 'storage_remarks', scalar => 'vserver_streams', scalar => 'remote_heartbeat', scalar => 'heartbeat_recovery_steps', scalar => 'recovery_steps', scalar => 'storage_recovery_steps', scalar => 'cluster_streams', scalar => 'enabled', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 fetch my $MetroclusterCheckConfigReplication_state = NACL::CS::MetroclusterCheckConfigReplication->fetch(command_interface => $ci, ...); my @MetroclusterCheckConfigReplication_states = NACL::CS::MetroclusterCheckConfigReplication->fetch(command_interface => $ci, ...); (Class method) Discovers which elements are present and returns their state in ComponentState objects. Called in scalar context it returns only one state object, in list context it returns all state objects. See L for a more detailed description along with a complete explanation of the options it accepts. Uses CMode CLI/ZAPI. =over =item Exceptions =over =item C When there are no elements matching the query specified or elements of that type doesn't exist, then this exception will be thrown. =back =back =cut sub fetch { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::fetch( @args, show_cmd => 'metrocluster check config-replication show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' } ], exception_text => 'No matching metrocluster check config-replication(s) found', frontend => 'NACL::CS::MetroclusterCheckConfigReplication::fetch', ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@args, api => 'metrocluster_check_config_replication_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my $zapi_copy = [qw (vserver-streams remote-heartbeat last-heartbeat-sent last-heartbeat-received cluster-streams storage-status recovery-steps storage-in-use cluster-recovery-steps heartbeat-recovery-steps storage-recovery-steps vserver-recovery-steps)]; my $zapi_map = { 'running' => 'is-running', 'enabled' => 'is-enabled', }; my $obj = $pkg->SUPER::_fetch_cmode_zapi_non_iter( @args, api => 'metrocluster-check-config-replication-get', copy => $zapi_copy, map => $zapi_map, primary_keys => [qw()] #No primary keys ); $Log->exit() if $may_exit; return $obj; } ## end sub _fetch_cmode_zapi 1;