$r{$disk}{count} = Yars::Tools->count_files($disk) if $count;
}
return $c->render_json(\%r) unless $c->param('all');
my %all = ( Yars::Tools->server_url => \%r );
for my $serve
$all{$server} = $res->json;
}
return $c->render_json(\%all);
};
=head2 POST /disk/status
Mark disks up or down. Send the disk root and state (up or down)
as JSON encoded in the body.
=c
);
}
$c->render_text($success ? "ok" : "failed" );
};
=head2 POST /check/manifest
Given JSON with 'manifest' which is a return-delimited string
of filenames and md5s (like the output of md5s
get($bucket_map_url);
if(my $res = $tx->success)
{
my %server_bucket_map = %{ $res->json };
my %my_bucket_map = %{ $yars->tools->bucket_map };
foreach my $key (keys %m
qw( tempdir );
use File::Glob qw( bsd_glob );
use YAML::XS;
use Carp qw( carp );
use JSON::MaybeXS qw( encode_json );
route_doc upload => "<filename> [md5]";
route_doc download => "<filename> <md5
>{message}";
last;
}
WARN "Error (may retry) : " . encode_json($error);
next;
};
DEBUG "Received asset with size ".$res->content->as
;
if (!$tx->success) {
my ($error) = $tx->error;
$error = encode_json $error if ref $error;
INFO "PUT to $host failed : $error";
}
}
$self-
ers + hosts to buckets for yars.
our $VERSION = '1.33'; # VERSION
use strict;
use warnings;
use JSON::MaybeXS ();
use Getopt::Long qw( GetOptions );
use Pod::Usage qw( pod2usage );
use feature 'say'
$_, buckets => $servers{$host}{$_} }, keys %{ $servers{$host} }
]};
}
my $out = JSON::MaybeXS->new->space_after->encode({ servers => \@conf });
$out =~ s/{/\n{/g;
$out =~ s/\
se Data::Dumper;
use Try::Tiny;
use File::Path qw/mkpath/;
use File::Temp;
use File::Compare;
use JSON::XS;
use File::stat qw/stat/;
use Mojo::ByteStream qw/b/;
use strict;
use warnings;
our %Bucket2
tateFile;
return $cached if $mod_time && $mod_time == stat($StateFile)->mtime;
our $j ||= JSON::XS->new;
-e $StateFile or LOGDIE "Missing state file $StateFile";
$cached = $j->decode(M
{
my $class = shift;
my $state = shift;
my $dir = dirname($StateFile);
our $j ||= JSON::XS->new;
mkpath $dir;
my $temp = File::Temp->new(DIR => $dir, UNLINK => 0);
print $t