# $Id$ # # Copyright (c) 2001-2010 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::VserverServicesNdmp->status() (auto-generated by CGT) ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::VserverServicesNdmpStatus =head1 DESCRIPTION C is a derived class of L. Object(s) of this type are returned when NACL::C::VserverServicesNdmp->status() is invoked. ((This module does not represent the state of any element, but is an object repesentation of the output obtained when NACL::C::VserverServicesNdmp->status() is invoked.) =head1 ATTRIBUTES The fields of the output are fields of the ComponentState object. =over =item C<< mover_mode >> Filled in for CMode CLI. =item C<< spt_device_id >> Filled in for CMode CLI. =item C<< mover_bytes_left_to_read >> Filled in for CMode CLI. =item C<< mover_setrecordsize_flag >> Filled in for CMode CLI. =item C<< mover_con_addr_type >> Filled in for CMode CLI. =item C<< mover_con_addr >> Filled in for CMode CLI. =item C<< mover_seek_position >> Filled in for CMode CLI. =item C<< mover_position >> Filled in for CMode CLI. =item C<< client_port >> Filled in for CMode CLI. =item C<< data_bytes_processed >> Filled in for CMode CLI. =item C<< spt_scsi_id >> Filled in for CMode CLI. =item C<< mover_pause_reason >> Filled in for CMode CLI. =item C<< mover_record_size >> Filled in for CMode CLI. =item C<< mover_con_port >> Filled in for CMode CLI. =item C<< data_con_port >> Filled in for CMode CLI. =item C<< mover_halt_reason >> Filled in for CMode CLI. =item C<< tape_mode >> Filled in for CMode CLI. =item C<< data_operation >> Filled in for CMode CLI. =item C<< client_addr >> Filled in for CMode CLI. =item C<< spt_ha >> Filled in for CMode CLI. =item C<< ndmp_version >> Filled in for CMode CLI. =item C<< session_id >> Filled in for CMode CLI. =item C<< node >> Filled in for CMode CLI. =item C<< spt_scsi_lun >> Filled in for CMode CLI. =item C<< data_con_addr >> Filled in for CMode CLI. =item C<< data_state >> Filled in for CMode CLI. =item C<< data_con_addr_type >> Filled in for CMode CLI. =item C<< mover_bytes_moved >> Filled in for CMode CLI. =item C<< tape_device >> Filled in for CMode CLI. =item C<< mover_setwindow_flag >> Filled in for CMode CLI. =item C<< mover_state >> Filled in for CMode CLI. =item C<< eff_host >> Filled in for CMode CLI. =item C<< mover_window_length >> Filled in for CMode CLI. =item C<< vserver >> Filled in for CMode CLI. =item C<< mover_record_num >> Filled in for CMode CLI. =item C<< mover_window_offset >> Filled in for CMode CLI. =item C<< data_halt_reason >> Filled in for CMode CLI. =item C<< session_authorized >> Filled in for CMode CLI. =back =cut package NACL::CS::VserverServicesNdmpStatus; 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 base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'mover_mode', scalar => 'spt_device_id', scalar => 'mover_bytes_left_to_read', scalar => 'mover_setrecordsize_flag', scalar => 'mover_con_addr_type', scalar => 'mover_con_addr', scalar => 'mover_seek_position', scalar => 'mover_position', scalar => 'client_port', scalar => 'data_bytes_processed', scalar => 'spt_scsi_id', scalar => 'mover_pause_reason', scalar => 'mover_record_size', scalar => 'mover_con_port', scalar => 'data_con_port', scalar => 'mover_halt_reason', scalar => 'tape_mode', scalar => 'data_operation', scalar => 'client_addr', scalar => 'spt_ha', scalar => 'ndmp_version', scalar => 'session_id', scalar => 'node', scalar => 'spt_scsi_lun', scalar => 'data_con_addr', scalar => 'data_state', scalar => 'data_con_addr_type', scalar => 'mover_bytes_moved', scalar => 'tape_device', scalar => 'mover_setwindow_flag', scalar => 'mover_state', scalar => 'eff_host', scalar => 'mover_window_length', scalar => 'vserver', scalar => 'mover_record_num', scalar => 'mover_window_offset', scalar => 'data_halt_reason', scalar => 'session_authorized', scalar => 'data_backup_mode', scalar => 'source_addr', scalar => 'data_path', scalar => 'is_secure_control_connection', scalar => 'preferred_interface_role', ]; =head1 METHODS =head2 fetch my $VserverServicesNdmpStatus_state = NACL::CS::VserverServicesNdmpStatus->fetch(command_interface => $ci, ...); my @VserverServicesNdmpStatus_states = NACL::CS::VserverServicesNdmpStatus->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 a CMode CLI APISet. =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 = shift; my @state_objs = $pkg->SUPER::fetch( @_, show_cmd => 'vserver services ndmp status', choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode', zapi_type => 'iter' }, ], exception_text => 'No matching vserver services ndmp(s) found' ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _update_state_objs_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; $pkg->SUPER::_update_state_objs_cmode_zapi( @args, zapi_field_translations => { uc => [qw(data-state data-operation data-halt-reason data-con-addr-type mover-state mover-mode mover-pause-reason mover-halt-reason mover-con-addr-type eff-host tape-mode data-backup-mode data-path) ], hyphenate_value => [qw(preferred-interface-role)], }, ); $Log->exit() if $may_exit; } sub _fetch_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_cli( @_, api => 'vserver_services_ndmp_status', ); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my ($pkg, @args) = @_; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @args, copy => [ qw(mover-mode spt-device-id mover-bytes-left-to-read mover-setrecordsize-flag mover-con-addr-type source-addr mover-con-addr mover-seek-position mover-position client-port data-bytes-processed spt-scsi-id mover-pause-reason mover-record-size mover-con-port data-con-port mover-halt-reason tape-mode data-path data-operation client-addr spt-ha ndmp-version spt-scsi-lun session-id data-con-addr data-state is-secure-control-connection data-con-addr-type mover-bytes-moved tape-device mover-setwindow-flag mover-state mover-window-length eff-host mover-record-num mover-window-offset data-halt-reason session-authorized data-backup-mode ) ], map => {'node' => 'node-name', 'vserver' => 'vserver-name',}, api => "ndmp-vserver-session-info-get-iter", ); $Log->exit() if $may_exit; return @state_objs; } 1;