Group
Extension

Matches 63

App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Configuration.pm ( view source; MetaCPAN )
       push @new_dcf, $field;
        next;
    }

    # snmp_object implies JSON content in the field
    $field->{'json_list'} = true;
    # snmp_object implies user should not edit in the web
   
type => 'exec',
        event => 'discover',
        with => {
                            # get JSON format of the snmp_object
            cmd => (sprintf q![%% ndo %%] show -d '[%% ip %%]' -e %s --
 if type=="string" then [.] else . end | [ .[] ] | sort'!
                            # send the JSON output into device custom_field (action inline)
                            .q! | [%% ndo %%] %s 
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/SSHCollector/Platform/EOS.pm ( view source; MetaCPAN )
trict;
use warnings;

use Dancer ':script';
use Moo;
use NetAddr::MAC qw/mac_as_ieee/;
use JSON qw(decode_json);

=head1 PUBLIC METHODS

=over 4

=item B<arpnip($host, $ssh)>

Retrieve ARP entries fro
md_v4 = "show ip arp vrf all | json | no-more\n";
    my @out_v4 = $ssh->capture({ stdin_data => $cmd_v4 });
    if (!$ssh->error) {
        my $data = eval { decode_json(join '', @out_v4) };
        
 "show ipv6 neighbor vrf all | json | no-more\n";
    my @out_v6 = $ssh->capture({ stdin_data => $cmd_v6 });
    if (!$ssh->error) {
        my $data = eval { decode_json(join '', @out_v6) };
        
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Worker/Plugin/Show.pm ( view source; MetaCPAN )
r ':syntax';
use App::Netdisco::Worker::Plugin;
use aliased 'App::Netdisco::Worker::Status';

use JSON::PP ();
use Data::Printer ();
use App::Netdisco::Transport::SNMP;

register_worker({ phase => 'ch

  my $result = sub { eval { $snmp->$object() } };

  if ($ENV{ND2_DO_QUIET}) {
      my $coder = JSON::PP->new->utf8(1)
                               ->allow_nonref(1)
                              
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Worker/Plugin/LoadMIBs.pm ( view source; MetaCPAN )
_rs = schema('netdisco')
          ->resultset('DeviceBrowser')
          ->search({ -bool => \q{ jsonb_typeof(value) != 'array' } });

    if ($legacy_rs->count) {
        my @rows = $legacy_rs->hri-
data] ) )
        foreach my $row (@rows) {
            my $value = (@{ thaw( decode_base64( from_json($row->{value}) ) ) })[0];
            $value = (ref {} eq ref $value)
              ? { map {($_ 
           : (defined $value ? encode_base64($value, '') : undef);
            $row->{value} = to_json([$value]);
        }

        schema('netdisco')->resultset('DeviceBrowser')->populate(\@rows);
 
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/API/Objects.pm ( view source; MetaCPAN )
tset('Device')
    ->find( params->{ip} ) } or send_error('Bad Device', 404);
  return to_json $device->TO_JSON;
};

foreach my $rel (qw/device_ips vlans ports modules port_vlans wireless_ports ssids 
        ->find( params->{ip} )->$rel } or send_error('Bad Device', 404);
      return to_json [ map {$_->TO_JSON} $rows->all ];
    };
}

swagger_path {
  tags => ['Objects'],
  path => setting('api_b
 ),
    ( param('backend') ? ( backend   => param('backend') ) : () ),
  })->delete;

  return to_json { deleted => ($gone || 0)};
};

foreach my $rel (qw/nodes active_nodes nodes_with_age active_node
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Worker/Plugin/Scheduler.pm ( view source; MetaCPAN )
orker::Status';

use App::Netdisco::JobQueue 'jq_insert';
use Dancer::Plugin::DBIC 'schema';

use JSON::PP ();

register_worker({ phase => 'check' }, sub {
  my ($job, $workerconf) = @_;

  return Sta
');
});

register_worker({ phase => 'main' }, sub {
  my ($job, $workerconf) = @_;

  my $coder = JSON::PP->new->utf8(0)->allow_nonref(1)->allow_unknown(1);
  my $sched = $coder->decode( $job->extra |
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/API/Queue.pm ( view source; MetaCPAN )
schema(vars->{'tenant'})->resultset('DeviceSkip')
    ->get_distinct_col('backend');

  return to_json \@names;
};

swagger_path {
  tags => ['Queue'],
  path => (setting('api_base') || '').'/queue/jo
    => (param('limit') || setting('jobs_qdepth') || 50),
  })->with_times->hri->all;

  return to_json \@set;
};

swagger_path {
  tags => ['Queue'],
  path => (setting('api_base') || '').'/queue/jobs
 ),
    ( param('backend') ? ( backend   => param('backend') ) : () ),
  })->delete;

  return to_json { deleted => ($gone || 0)};
};

swagger_path {
  tags => ['Queue'],
  path => (setting('api_base'
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Worker/Plugin/Snapshot.pm ( view source; MetaCPAN )
d_parts => [], # intentional, is inflated via make_snmpwalk_browsable()
          value     => to_json([encode_base64($val, '')]),
        };
    }
    debug sprintf 'walked %d rows', scalar keys %sto
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Backend/Role/Scheduler.pm ( view source; MetaCPAN )
Netdisco::Backend::Role::Scheduler;

use Dancer qw/:moose :syntax :script/;

use NetAddr::IP;
use JSON::PP ();
use Algorithm::Cron;

use App::Netdisco::Util::MCE;
use App::Netdisco::JobQueue qw/jq_ins
ive', $wid;
      return debug "sch ($wid): no need for scheduler... quitting"
  }

  my $coder = JSON::PP->new->utf8(0)->allow_nonref(1)->allow_unknown(1);

  while (1) {
      # sleep until some poi
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/DB/ResultSet/NodeIp.pm ( view source; MetaCPAN )
_rs({}, {
        '+columns' => [
          { router_ip =>  \q{(SELECT key FROM json_each_text(seen_on_router_last::json) ORDER BY value::timestamp DESC LIMIT 1)} },
          { router_name => \q{COAL
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/Search/Device.pm ( view source; MetaCPAN )
]} @results;

    if ( request->is_ajax ) {
        my $json = to_json( \@results );
        template 'ajax/search/device.tt', { results => $json }, { layout => 'noop' };;
    }
    else {
        hea
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/Report/VlanInventory.pm ( view source; MetaCPAN )
@results;

    if ( request->is_ajax ) {
        my $json = to_json (\@results);
        template 'ajax/report/vlaninventory.tt', { results => $json }, { layout => 'noop' };
    }
    else {
        h
esults;

    if ( request->is_ajax ) {
        my $json = to_json (\@results);
        template 'ajax/report/vlanmultiplenames.tt', { results => $json }, { layout => 'noop' };
    }
    else {
       
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/Search/Port.pm ( view source; MetaCPAN )
) } @results;

    if ( request->is_ajax ) {
        my $json = to_json( \@results );
        template 'ajax/search/port.tt', { results => $json }, { layout => 'noop' };
    }
    else {
        heade
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/AdminTask/UserLog.pm ( view source; MetaCPAN )
tered = $rs->get_datatables_filtered_count($exp_params);

    content_type 'application/json';
    return to_json(
        {   draw            => int( param('draw') ),
            recordsTotal    => i
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/Search/VLAN.pm ( view source; MetaCPAN )
calar @results;

    if (request->is_ajax) {
        my $json = to_json( \@results );
        template 'ajax/search/vlan.tt', { results => $json }, { layout => 'noop' };
    }
    else {
        heade
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/DB/Result/NodeIp.pm ( view source; MetaCPAN )
,
  },
  "seen_on_router_first",
  { data_type => "jsonb", is_nullable => 0, default_value => \"{}" },
  "seen_on_router_last",
  { data_type => "jsonb", is_nullable => 0, default_value => \"{}" },
  
    "host($args->{foreign_alias}.ip)" => { '=' =>
          \q{(SELECT key FROM json_each_text(seen_on_router_last::json) ORDER BY value::timestamp DESC LIMIT 1)} },
      };
  },
  { join_type => 'LE
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Worker/Plugin.pm ( view source; MetaCPAN )
with application protocols such as SNMP, NETCONF
(OpenConfig with XML), RESTCONF (OpenConfig with JSON), eAPI, or even CLI
scraping. The combination of transport and protocol is known as a I<driver>.
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/Report/SsidInventory.pm ( view source; MetaCPAN )
r @results;

    if ( request->is_ajax ) {
        my $json = to_json( \@results );
        template 'ajax/report/portssid.tt', { results => $json }, { layout => 'noop' };
    }
    else {
        hea
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/Permission.pm ( view source; MetaCPAN )
      $cf = from_json ($item->custom_fields || '{}');
              }
              elsif (ref {} eq ref $item and exists $item->{'custom_fields'}) {
                  $cf = from_json ($item->{'custom
$cf = from_json ($item->custom_fields || '{}');
                  }
                  elsif (ref {} eq ref $item and exists $item->{'custom_fields'}) {
                      $cf = from_json ($item->{'
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/Worker.pm ( view source; MetaCPAN )
      event_data  => dclone (vars->{'hook_data'} || {}) };

  # remove scalar references which to_json cannot handle
  visit( $extra->{'event_data'}, sub {
    my ($key, $valueref) = @_;
    $$valuere
' if ref $$valueref eq 'SCALAR';
  });

  jq_insert({
    action => ('hook::'. lc($conf->{'type'})),
    extra  => encode_base64( encode('UTF-8', to_json( $extra )), '' ),
  });

  return 1;
}

true;

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.