# $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 ComponentState Module for the method NACL::C::LunCopy->show_by_job_info() (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::LunCopyShowByJobInfo =head1 DESCRIPTION C is a derived class of L. Object(s) of this type are returned when NACL::C::LunCopy->show_by_job_info() is invoked. ((This module does not represent the state of any element, but is an object repesentation of the output obtained when NACL::C::LunCopy->show_by_job_info() is invoked.) =head1 ATTRIBUTES The fields of the output are fields of the ComponentState object. =over =item C<< scanner_total >> LUN Copy Total Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< job_status >> LUN Copy Status possible value(s) are, Preparing,Allocation-Map,Data,Destroying,Paused-Admin,Paused-Error,Complete,Destroyed Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< source_vserver >> Source Vserver Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< source_snapshot_instance_uuid >> Source Snapshot Instance UUID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< lun_index >> LUN Index Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_promoted_early >> Is Destination Promoted Early possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< source_snapshot >> Source Snapshot Name Filled in for CMode CLI/ZAPI iter =item C<< last_failure_reason >> Last Failure Reason Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< destination_path >> Destination Path Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< job_uuid >> LUN Copy Job UUID Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< is_snapshot_fenced >> Is Snapshot Fenced possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< cutover_time >> Cutover Time Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< max_throughput >> Maximum Transfer Rate (per sec) Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< progress_percent >> LUN Copy Progress (%) Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< vserver >> Destination Vserver Name Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< source_snapshot_id >> Source Snapshot ID Filled in for CMode CLI/ZAPI iter =item C<< is_destination_ready >> Is Destination Ready possible value(s) are, true,false Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< elapsed_time >> Elapsed Time Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< dest_node >> Destination Node Filled in for CMode CLI/ZAPI iter =item C<< scanner_progress >> LUN Copy Progress Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =item C<< source_path >> Source Path Filled in for CMode CLI/ZAPI iter Mapping for CMode ZAPI iter: =back =cut package NACL::CS::LunCopyShowByJobInfo; use strict; use warnings; use Params::Validate qw(validate); use NATE::Log qw(log_global); use NACL::Exceptions::NoElementsFound qw(:try); use NACL::CS::ComponentState::ZapiSkip qw(make_zapi_skip); use NACL::CS::ComponentState::ZapiArray qw(make_zapi_array); use base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'scanner_total', scalar => 'job_status', scalar => 'source_vserver', scalar => 'source_snapshot_instance_uuid', scalar => 'lun_index', scalar => 'is_promoted_early', scalar => 'source_snapshot', 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 => 'source_snapshot_id', scalar => 'is_destination_ready', scalar => 'elapsed_time', scalar => 'dest_node', scalar => 'scanner_progress', scalar => 'source_path', ]; my $Log = log_global(); my $may_enter = $Log->may_enter(); my $may_exit = $Log->may_exit(); =head1 METHODS =head2 fetch my $LunCopyShowByJobInfo_state = NACL::CS::LunCopyShowByJobInfo->fetch(command_interface => $ci, ...); my @LunCopyShowByJobInfo_states = NACL::CS::LunCopyShowByJobInfo->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. Invokes lun-copy-get-iter API for CMode ZAPI iter. =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 copy show-by-job-info', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode', zapi_type => 'none', }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', zapi_type => 'iter' }, ], exception_text => 'No matching LunCopyShowByJobInfo(s) found', frontend => 'NACL::CS::LunCopyShowByJobInfo::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_copy_show_by_job_info',); $Log->exit() if $may_exit; return @state_objs; } sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, copy => [ qw(scanner-total source-vserver job-uuid scanner-progress lun-index is-snapshot-fenced max-throughput is-destination-ready source-path source-snapshot-instance-uuid last-failure-reason destination-path cutover-time progress-percent job-status is-promoted-early elapsed-time ) ], map => {'vserver' => 'destination-vserver',}, api => "lun-copy-get-iter", ); $Log->exit() if $may_exit; return @state_objs; } 1;