Device-PaloAlto-Firewall

 view release on metacpan or  search on metacpan

lib/Device/PaloAlto/Firewall.pm  view on Meta::CPAN

 package Device::PaloAlto::Firewall;

use 5.006;
use strict;
use warnings;

our $VERSION = '0.091'; # VERSION - generated by DZP::OurPkgVersion

use Device::PaloAlto::Firewall::Test;

use Moose;
use Modern::Perl;
use LWP::UserAgent;
use HTTP::Request;
use Carp;
use Params::Validate qw{:all};
use URI;
use XML::Twig;
use Memoize qw{memoize unmemoize};
use POSIX qw{strftime};
use Devel::StackTrace;

use Data::Dumper;

=head1 NAME

Device::PaloAlto::Firewall - Interact with the Palo Alto firewall API

=head1 VERSION

version 0.091

=cut

=head1 SYNOPSIS

Device::PaloAlto::Firewall provides interfaces to B<retrieve> information from a Palo Alto firewall. 

    my $firewall = Device::PaloAlto::Firewall->new(uri => 'http://localhost.localdomain', username => 'admin', password => 'complex_password')

    my $environ = $firewall->environmentals();
    my $interfaces = $firewall->interfaces();

A key point is that that methods only retrieve information. There are no methods within this module to modify or commit configuration.


=head1 RETURN VALUES

If the methods succeed they generally return either an ARRAYREF or a HASHREF. This includes an empty ARRAYREF or HASHREF if something is not configured or there are no entries (e.g. no OSPF neighbours). 

If the method fails  - either because the device is unreachable, there's an authentication issue, or the device has thrown an error - it will croak a message and return undef.

What type (ARRAYREF, HASHREF, etc) a method returns will be in each method's section, however the full data structures is not documented. They don't adhere to a strict schema, but examples for each method are provided on the L<Device::PaloAlto:Firewa...

=head1 CONSTRUCTOR

The C<new()> constructor takes the following arguments:

=over 4

=item * C<uri> - A HTTP or HTTPS URI to the firewall.

=item * C<username> - a username to authenticate to the device.

=item * C<password> - a password for the username.

=back

=cut

has 'user_agent'            => ( is => 'ro', isa => 'LWP::UserAgent', init_arg => undef, default => sub { LWP::UserAgent->new } );
has 'uri'                   => ( is => 'ro', writer => '_uri', required => 1 );

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.494 second using v1.00-cache-2.02-grep-82fe00e-cpan-f5108d614456 )