my $p = param('positions') or send_error('Missing positions', 400);
my $positions = from_json($p) or send_error('Bad positions', 400);
send_error('Bad positions', 400) unless ref [] eq re
,
vlan => ($vlan || 0),
});
if ($posrow) {
$posrow->update({ positions => to_json(\%clean) });
}
else {
schema(vars->{'tenant'})->resultset('NetmapPositions')->creat
],
locations => [sort @lgrplist],
vlan => ($vlan || 0),
positions => to_json(\%clean),
});
}
};
sub make_node_infostring {
my $node = shift or return '';
my $f
ults;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/portssid.tt',
{ results => $json, opt => $ssid }, { layout => 'noop' };
}
Guard 'guard';
use NetAddr::IP::Lite ':lower';
use Storable 'dclone';
use List::MoreUtils ();
use JSON::PP ();
use Encode;
register_worker({ phase => 'early', driver => 'snmp',
title => 'basic de
}
# for existing device, filter custom_fields
if ($device->in_storage) {
my $coder = JSON::PP->new->utf8(0)->allow_nonref(1)->allow_unknown(1);
# get the custom_fields
my $f
chema('netdisco')->resultset('DevicePort')->txn_do_locked(ACCESS_EXCLUSIVE, sub {
my $coder = JSON::PP->new->utf8(0)->allow_nonref(1)->allow_unknown(1);
# backup the custom_fields
my %fi
rom file or copy from job param
my $data = $job->extra;
my @fwtable = (length $data ? @{ from_json($data) } : ());
return $job->cancel('data provided but 0 fwd entries found')
unless scalar
e from file or copy from job param
my $data = $job->extra;
my @arps = (length $data ? @{ from_json($data) } : ());
return $job->cancel('data provided but 0 arp entries found')
unless scalar
te;
register_worker({ phase => 'main' }, sub {
my ($job, $workerconf) = @_;
my $extra = from_json( decode_base64( $job->extra || '' ) );
my $event_data = { ('ndo' => $ENV{NETDISCO_DO}), %{ $e
VICE_IP => $event_data->{'ip'},
},
)->run();
$result->{cmd} = $cmd;
$job->subaction(to_json($result));
if ($action_conf->{'ignore_failure'} or not $result->{'result'}) {
return Statu
rom_json( decode_base64( $job->extra || '' ) );
$job->subaction('');
my $event_data = $extra->{'event_data'};
my $action_conf = $extra->{'action_conf'};
$action_conf->{'body'} ||= to_json($e
ustom_headers'} ||= {};
$action_conf->{'custom_headers'}->{'Content-Type'}
||= 'application/json; charset=UTF-8';
$action_conf->{'custom_headers'}->{'Authorization'}
= ('Bearer '. $action_
@results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/halfduplex.tt', { results => $json }, { layout => 'noop' };
}
else {
he
esults;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/nodesdiscovered.tt', { results => $json }, { layout => 'noop' };
}
else {
esults;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/devicebylocation.tt', { results => $json }, { layout => 'noop' };
}
else {
sults;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/devicednsmismatch.tt', { results => $json }, { layout => 'noop' };
}
else {
@results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/nodemultiips.tt', { results => $json }, { layout => 'noop' };
}
else {
h
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i
}
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/nodevendor.tt',
{ results => $json, opt => $vendor },
{ layout => 'no
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i
>hri->all;
if (request->is_ajax) {
my $json = to_json (\@results);
template 'ajax/report/portutilization.tt', { results => $json }, { layout => 'noop' };
}
else {
results;
if ( request->is_ajax ) {
my $json = to_json (\@results);
template 'ajax/report/portmultinodes.tt', { results => $json }, { layout => 'noop' };
}
else {
h
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i
}
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/moduleinventory.tt',
{ results => $json, opt => $has_opt },
{ layout =>
results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/duplexmismatch.tt', { results => $json, }, { layout => 'noop' };
}
else {
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i
}
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/netbios.tt',
{ results => $json, opt => $domain },
{ layout => 'noop
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i