# Copyright (c) 2001-2012 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::ClusterPeer->ping() ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::ClusterPeerPing =head1 DESCRIPTION C is a derived class of L. Object(s) of this type are returned when NACL::C::ClusterPeer->ping() is invoked. (This module does not represent the state of any element, but is an object repesentation of the output obtained when intercluster connectivity test is initiated) =head1 ATTRIBUTES The fields of the output are fields of the ComponentState object. (Note that it's likely that not all fields will get filled in. Some fields are specific to particular modes/interfaces/versions) =over =item C<< originating_node >> Node that Initiates Ping. Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< destination_cluster >> Cluster to Ping Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< destination_node >> Node to Ping in Destination Cluster Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< ip_address >> Active IP Address Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< count >> Ping Count. (can be between 1 to 255) Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< status >> Status of Ping Operation (Possible values are unknown_node | internal_error | unreachable | session_reachable | interface_reachable) Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< timeout >> Ping timeout in seconds. Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< packet_size >> Size of packet. Filled in for CMode CLI. =item C<< ttl >> Time to Live/ Number of Hops Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< response_time >> Response time in milliseconds. Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< destination_cluster_UUID >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< ipAddress >> Filled in for CMode CLI. =item C<< current_count >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< response_time_us >> Filled in for CMode CLI. =item C<< type >> Filled in for CMode CLI/ZAPI. Maps to: CM ZAPI: For 'requested_fields', 'filter' and Output mapping: $value =item C<< ping_error >> Filled in for CMode CLI. =back =cut package NACL::CS::ClusterPeerPing; 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 base 'NACL::CS::ComponentState::ONTAP'; use Class::MethodMaker [ scalar => 'originating_node', scalar => 'destination_cluster', scalar => 'destination_node', scalar => 'ip_address', scalar => 'count', scalar => 'status', scalar => 'timeout', scalar => 'packet_size', scalar => 'ttl', scalar => 'response_time', scalar => 'destination_cluster_UUID', scalar => 'ipAddress', scalar => 'current_count', scalar => 'response_time_us', scalar => 'type', scalar => 'ping_error', ]; =head1 METHODS =head2 fetch my $ClusterPeerPing_state = NACL::CS::ClusterPeerPing->fetch(command_interface => $ci, ...); my @ClusterPeerPing_states = NACL::CS::ClusterPeerPing->fetch(command_interface => $ci, ...); (Class method) Returns the details of intercluster connectivity test in the form of a ComponentState object. 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. Supports CMode CLI/ZAPI. Invokes "cluster-peer-ping-iter" API for CMode 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 = shift; my @state_objs = $pkg->SUPER::fetch( @_, choices => [ { method => '_fetch_cmode_cli', interface => 'CLI', set => 'CMode' }, { method => '_fetch_cmode_zapi', interface => 'ZAPI', set => 'CMode' } ], show_cmd => 'cluster peer ping', exception_text => 'No matching cluster peer ping(s) found' ); $Log->exit() if $may_exit; return wantarray ? @state_objs : $state_objs[0]; } ## end sub fetch sub _fetch_cmode_cli { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_cli(@_, api => 'cluster_peer_ping'); $Log->exit() if $may_exit; return @state_objs; } ## end sub _fetch_cmode_cli sub _fetch_cmode_zapi { $Log->enter() if $may_enter; my $pkg = shift; my @state_objs = $pkg->SUPER::_fetch_cmode_zapi( @_, api => 'cluster_peer_ping_iter', copy => [ qw(count destination-cluster destination-node originating-node timeout type destination-cluster-UUID current-count) ], map => { "ip-address" => ['destination-address'], "status" => ['ping-status'], "ttl" => ['time-to-live'], "response-time" => ['round-trip'], } ); return @state_objs; } ## end sub _fetch_cmode_zapi 1;