# $Id$ # # Copyright (c) 2014 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary LunMove ComponentState Module (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::LunMove =head1 DESCRIPTION C is a derived class of L. It represents the state of an ONTAP LunMove. A related class is L, which represents access to an ONTAP LunMove. =head1 ATTRIBUTES The individual pieces of data that are part of the state of the LunMove element are the attributes of the LunMove 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<< scanner_total >> LUN Move Total Filled in for CMode CLI =item C<< job_status >> LUN Move Status Filled in for CMode CLI =item C<< lun_index >> LUN Index Filled in for CMode CLI =item C<< last_failure_reason >> Last Failure Reason Filled in for CMode CLI =item C<< destination_path >> Destination Path Filled in for CMode CLI =item C<< job_uuid >> LUN Move Job UUID Filled in for CMode CLI =item C<< is_snapshot_fenced >> Is Snapshot Fenced possible value(s) are, true,false Filled in for CMode CLI =item C<< cutover_time >> Cutover Time (secs) Filled in for CMode CLI/ZAPI =item C<< max_throughput >> Maximum Transfer Rate (per sec) Filled in for CMode CLI =item C<< progress_percent >> LUN Move Progress (%) Filled in for CMode CLI =item C<< vserver >> Vserver Name Filled in for CMode CLI/ZAPI =item C<< elapsed_time >> Elapsed Time Filled in for CMode CLI/ZAPI =item C<< is_destination_ready >> Is Destination Ready possible value(s) are, true,false Filled in for CMode CLI/ZAPI =item C<< is_promoted_late >> Is Destination Promoted Late possible value(s) are, true,false Filled in for CMode CLI/ZAPI =item C<< scanner_progress >> LUN Move Progress Filled in for CMode CLI/ZAPI =item C<< source_path >> Source Path Filled in for CMode CLI/ZAPI =item C<< source_vserver >> Source Vserver Filled in for CMode CLI/ZAPI =item C<< source_snapshot_instance_uuid >> Source Snapshot Instance UUID Filled in for CMode CLI. =item C<< source_snapshot >> Source Snapshot Name Filled in for CMode CLI. =item C<< source_snapshot_id >> Source Snapshot ID Filled in for CMode CLI. =back =cut package NACL::CS::LunMove; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); use NACL::Exceptions::NoElementsFound qw(:try); use NACL::C::_Mixins::LunCopyRelocation qw(:all); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'scanner_total', scalar => 'job_status', scalar => 'lun_index', scalar => 'last_failure_reason', scalar => 'destination_path', scalar => 'job_uuid', scalar => 'is_snapshot_fenced', scalar => 'cutover_time', scalar => 'max_throughput', scalar => 'progress_percent', scalar => 'vserver', scalar => 'elapsed_time', scalar => 'is_destination_ready', scalar => 'is_promoted_late', scalar => 'scanner_progress', scalar => 'source_path', scalar => 'source_vserver', scalar => 'source_snapshot_instance_uuid', scalar => 'source_snapshot', scalar => 'source_snapshot_id', ]; =head1 METHODS =head2 fetch my $LunMove_state = NACL::CS::LunMove->fetch(command_interface => $ci, ...); my @LunMove_states = NACL::CS::LunMove->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. =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 => 'lun move show', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' }, ], exception_text => 'No matching lun move(s) found', frontend => 'NACL::CS::LunMove::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 => 'lun_move_show',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @opts) = @_; my $common_copy = $pkg->_common_fetch_zapi_copy(); push @$common_copy, ('is-promoted-late','vserver'); my $map = {'source-vserver' => 'vserver'}; my @states = $pkg->SUPER::_fetch_cmode_zapi( @opts, copy => $common_copy, map => $map, api => 'lun-move-get-iter', ); $Log->exit() if $may_exit; return @states; } 1;