NAME

NetBox::Client - perl5 interface to NetBox API

DESCRIPTION

This module implements all operations (object(-s) retrievement, creation, modification and deletion) as described in NetBox API Overview.

CAVEATS

LIMITATIONS

Unlike REST, GraphQL mode has a bunch of limitations, which (in my opinion) makes it less convinient then REST. However, I have to admit, it works faster, noticeably faster, then REST. So, about the limitations:

SYNOPSIS

use NetBox::Client;

my $netbox = NetBox::Client->new(
    'baseurl' => 'https://localhost:8001',
    'token'   => 'authorization+token',
    'method'  => 'rest'
);

my @cables = $netbox->retrieve('dcim/cables', {
    'type'    => 'smf',
    'status'  => 'connected',
    'fields'  => [ qw(label created) ]
});
unless ($netbox->error) {
    foreach my $cable (@cables) {
        printf "Cable %s installed %s\n",
            $cable->{'label'},
            $cable->{'created'};
    }
}

$netbox->delete('dcim/cables', [
    { 'id' => 10 },
    { 'id' => 11 }
]);
die $netbox->errmsg if $netbox->error;

METHODS

ERROR HANDLING

AUTHORS

CHANGELOG

v0.1.5 - 2025-10-08

v0.1.4

v0.1.3

v0.1.1

v0.1.0

TODO

LINKS