@results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/nodemultiips.tt', { results => $json }, { layout => 'noop' };
}
else {
h
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(:all);
use JSON::MaybeXS;
use File::Glob ':glob';
use File::Slurp;
use File::stat;
use POSIX qw(strftime);
use Readonly;
Readonly my %co
r_db => 'cover_db/cover.json',
output => 'cover_html/index.html'
);
# Read and decode coverage data
my $json_text = read_file($config{cover_db});
my $data = decode_json($json_text);
my $coverage_pc
ob("coverage_history/*.json");
# Cache historical data instead of reading for each file
my %historical_cache;
for my $hist_file (@history_files) {
my $json = eval { decode_json(read_file($hist_file)
results;
if ( request->is_ajax ) {
my $json = to_json (\@results);
template 'ajax/report/portmultinodes.tt', { results => $json }, { layout => 'noop' };
}
else {
h
results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/apchanneldist.tt', { results => $json }, { layout => 'noop' };
}
else {
h
results;
if ( request->is_ajax ) {
my $json = to_json (\@results);
template 'ajax/report/deviceaddrnodns.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/moduleinventory.tt',
{ results => $json, opt => $has_opt },
{ layout =>
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i
) } @results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/search/port.tt', { results => $json }, { layout => 'noop' };
}
else {
heade
ication. It is
responsible for publishing the deduplicated entries to a specified format
(Atom or JSON).
=head1 SYNOPSIS
use App::FeedDeduplicator::Publisher;
my $publisher = App::FeedDedup
App::FeedDeduplicator::Publisher. The constructor
accepts an arrau of entries, a format (Atom or JSON), and a maximum number of
entries as parameters.
The entries should be an array reference contai
hould contain a hash reference with the feed information.
The format should be either 'Atom' or 'JSON', and the maximum number of
entries specifies how many entries to include in the output.
=head2
tered = $rs->get_datatables_filtered_count($exp_params);
content_type 'application/json';
return to_json(
{ draw => int( param('draw') ),
recordsTotal => i
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'
_spaces = 2; # Number of spaces to use for each level of indent
our $promote_bool = 1; # Convert JSON::PP::Boolean to raw true/false
# Global var to track how many levels we're indented
my $current_
. "\" :: ";
my $reftype = Scalar::Util::reftype($x);
my $y;
if ($promote_bool && $class eq 'JSON::PP::Boolean') {
my $val = $$x;
return __dump_bool(!!$val);
}
my $len = length($class) + 6
ur code, and disable them at runtime as needed.
=item C<$Dump::Krumo::promote_bool = 1>
Convert JSON::PP::Booleans to true/false instead of treating them as objects.
=item C<$Dump::Krumo::COLORS>
,
},
"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
MARC::Validator::Report;
use strict;
use warnings;
use Class::Utils qw(set_params);
use Cpanel::JSON::XS;
use Getopt::Std;
use Perl6::Slurp qw(slurp);
our $VERSION = 0.03;
# Constructor.
sub new {
s_report {
my ($self, $report_file) = @_;
my $report = slurp($report_file);
# JSON output.
my $j = Cpanel::JSON::XS->new;
$self->{'_report'} = $j->decode($report);
$self->{'_list'} = {};
for
sage {
my $self = shift;
print STDERR "Usage: $0 [-h] [-l] [-p plugin] [-v] [--version] report.json\n";
print STDERR "\t-h\t\tPrint help.\n";
print STDERR "\t-l\t\tList unique errors.\n";
print
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
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)
nterprise
members: 8
=head1 TOON FORMAT FEATURES
=head2 Data Types
TOON supports JSON data types:
=over 4
=item B<Object> - Unordered collection of key-value pairs
user:
scape sequences are supported:
text: "Line 1\nLine 2"
path: "C:\\Program Files\\App"
json: "Use \" to escape quotes"
=head2 Root Forms
Documents can start with different root types:
* L<TOON Specification|https://github.com/toon-format/spec/blob/main/SPEC.md>
=item * L<JSON|https://www.json.org/> - Data model foundation
=item * L<YAML|https://yaml.org/> - Similar indentation-b
use 5.006;
use strict;
use warnings;
use Cache::LRU;
use LWP::UserAgent;
use HTTP::Headers;
use JSON;
use Geo::DetailsLite;
use Net::CIDR;
use Net::CIDR::Set;
our $VERSION = '3.2.0';
use constant D
elf->{ua}->default_headers(
HTTP::Headers->new(
Accept => 'application/json',
Authorization => 'Bearer ' . $token
)
);
$self->{ua}->agent("IPinfo
_type =~ m{application/json}i ) {
eval { $info = from_json( $response->decoded_content ); };
if ($@) {
return ( undef, 'Error parsing JSON response.' );
;
bless $self, $class;
return $self;
}
sub TO_JSON {
my ($self) = @_;
# Return a copy of the object as a hash reference for JSON encoding
return {%$self};
}
sub ip {
return
lain string. It defaults to an empty string if not provided.
=head2 TO_JSON
This method is used to convert the object to a JSON representation.
=head2 ip
my $ip_address = $geo_details->ip();
d_parts => [], # intentional, is inflated via make_snmpwalk_browsable()
value => to_json([encode_base64($val, '')]),
};
}
debug sprintf 'walked %d rows', scalar keys %sto