package App::Glacier::DB;
use strict;
use warnings;
use JSON;
use Carp;
use App::Glacier::Timestamp;
use parent 'Exporter';
use constant {
ENCODE => 0,
DECODE => 1
};
my %transcode = (
'
ecoder
\&Storable::thaw
],
'json' => [
# Encoder
sub { JSON->new->convert_blessed(1)->encode(shift) },
# Decoder
sub { JSON->
new->
filter_json_object(sub { timestamp_deserialize
p::Glacier::DateTime;
use App::Glacier::Timestamp;
use App::Glacier::Job::InventoryRetrieval;
use JSON;
=head1 NAME
glacier sync - synchronize vault inventory cache
=head1 SYNOPSIS
B<glacier sync>
list vault $vault_name: ",
$self->glacier->last_error_message);
}
}
$res = decode_json($res);
$self->_sync($dir, [map { timestamp_deserialize($_) }
@{$res->{ArchiveList}}],
cier::HttpCatch;
use App::Glacier::Signature;
use Carp;
use version 0.77;
use LWP::UserAgent;
use JSON;
sub new {
my ($class, %opts) = @_;
my $region = (delete $opts{region} || _get_instore_r
. $istore_document_path);
unless ($response->is_success) {
return undef;
}
my $doc = JSON->new->decode($response->decoded_content);
return $doc->{region};
}
sub _get_instore_creds {
esponse = $ua->get($url);
unless ($response->is_success) {
return undef;
}
my $doc = JSON->new->decode($response->decoded_content);
return ($doc->{AccessKeyId}, $doc->{SecretAccessKey
=> { default => 72000, check => \&App::Glacier::Command::ck_number },
encoding => { default => 'json' }
);
sub configtest {
my ($class, $cfg, @path) = @_;
$cfg->lint(\%lexicon, @path);
}
#
my $jid = $self->glacier->Initiate_inventory_retrieval(
$self->vault,
'JSON',
"Inventory retrieval for vault ".$self->vault
);
if ($self->glaci
lf) if ref($fmt) eq 'CODE';
return $self->strftime($fmt);
} else {
croak "unknown canned format $fmt"
}
}
sub TO_JSON {
my $self = shift;
return $self->canned_format('standard');
}