Net-ILO
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Net::ILO',
AUTHOR => 'Nicholas Lewis <nick.lewis@gmail.com>',
VERSION_FROM => 'lib/Net/ILO.pm',
ABSTRACT_FROM => 'lib/Net/ILO.pm',
PL_FILES => {},
PREREQ_PM => {
'IO::Socket::SSL' => 0,
'Test::More' => 0,
'XML::Simple' => 0
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Net-ILO-*' },
);
Either your machine / iLO firmware version is too old, or the method you called
requires a more advanced license than you have.
=item C<State %s is not valid>
An invalid UID state was passed to uid(). Valid states are 'on' and 'off'.
=item C<Unable to establish SSL connection with %s:%d [%s]>
An error occurred while connecting to iLO. The message in brackets is
propagated from IO::Socket::SSL, and is rarely useful.
=item C<Error transmitting command to server>
A connection was established, but something went wrong while sending the
command to the remote iLO. Try reconnecting, and ensure that your
network settings are correct.
=item C<No response received from remote machine>
A connection was established and a command successfully sent to the iLO, but
=item C<Error parsing response: %s>
An error occurred while parsing the XML response from the iLO. The error
message is propagated from XML::Simple, and could mean HP changed the iLO
API.
=back
=head1 DEPENDENCIES
IO::Socket::SSL
XML::Simple
=head1 AUTHOR
Nicholas Lewis, C<< <nick.lewis at gmail.com> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-net-ilo at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-ILO>. I will be notified, and then you'll
lib/Net/ILO.pm view on Meta::CPAN
package Net::ILO;
use strict;
use warnings;
use Carp;
use Data::Dumper;
use English qw(-no_match_vars);
use IO::Socket::SSL;
use XML::Simple;
our $VERSION = '0.54';
my $METHOD_UNSUPPORTED = 'Method not supported by this iLO version';
sub address {
lib/Net/ILO.pm view on Meta::CPAN
my $self = shift;
if ($self->{_client}) {
return $self->{_client};
}
my $address = $self->address or croak "Can't connect: address not set";
my $port = $self->port or croak "Can't connect: port not set";
$self->{_client} = IO::Socket::SSL->new(
PeerAddr => "$address:$port",
);
if (!$self->{_client}) {
$self->error( "Unable to establish SSL connection with $address:$port [" . IO::Socket::SSL::errstr() . "]" );
return;
}
return $self->{_client};
}
sub _debug {
lib/Net/ILO.pm view on Meta::CPAN
Either your machine / iLO firmware version is too old, or the method you called
requires a more advanced license than you have.
=item C<State %s is not valid>
An invalid UID state was passed to uid(). Valid states are 'on' and 'off'.
=item C<Unable to establish SSL connection with %s:%d [%s]>
An error occurred while connecting to iLO. The message in brackets is
propagated from IO::Socket::SSL, and is rarely useful.
=item C<Error transmitting command to server>
A connection was established, but something went wrong while sending the
command to the remote iLO. Try reconnecting, and ensure that your
network settings are correct.
=item C<No response received from remote machine>
A connection was established and a command successfully sent to the iLO, but
lib/Net/ILO.pm view on Meta::CPAN
=item C<Error parsing response: %s>
An error occurred while parsing the XML response from the iLO. The error
message is propagated from XML::Simple, and could mean HP changed the iLO
API.
=back
=head1 DEPENDENCIES
IO::Socket::SSL
XML::Simple
=head1 AUTHOR
Nicholas Lewis, C<< <nick.lewis at gmail.com> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-net-ilo at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-ILO>. I will be notified, and then you'll
t/05-connect.t view on Meta::CPAN
#!perl
use strict;
use Net::ILO;
use Test::More tests => 2;
# TODO: mock IO::Socket::SSL object for better testing
my $ilo = Net::ILO->new();
my $connection;
eval { $connection = $ilo->_connect; };
ok( $@ =~ "Can't connect: address not set", 'Connecting without address throws exception' );
$ilo->{_client} = 'Fake connection';
( run in 0.733 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )