parent
6b5677b4ce
commit
00852d1a66
|
@ -22,7 +22,7 @@ for ( my $i = 0 ; $i < @ARGV ; $i++ ) {
|
||||||
|
|
||||||
$action ||= "help";
|
$action ||= "help";
|
||||||
|
|
||||||
if ( $action =~ /^(?:[gs]et|(?:add|del)Key)$/ ) {
|
if ( $action =~ /^(?:[gs]et|(?:add|del)Key|dump)$/ ) {
|
||||||
eval { require Lemonldap::NG::Manager::Cli; };
|
eval { require Lemonldap::NG::Manager::Cli; };
|
||||||
die "Manager libraries not available, aborting ($@)" if ($@);
|
die "Manager libraries not available, aborting ($@)" if ($@);
|
||||||
Lemonldap::NG::Manager::Cli->run(@ARGV);
|
Lemonldap::NG::Manager::Cli->run(@ARGV);
|
||||||
|
|
|
@ -194,6 +194,13 @@ sub lastCfg {
|
||||||
return $self->jsonResponse('/confs/latest')->{cfgNum};
|
return $self->jsonResponse('/confs/latest')->{cfgNum};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub dump {
|
||||||
|
my ($self) = @_;
|
||||||
|
my $conf = $self->jsonResponse( '/confs/latest', 'full=1' );
|
||||||
|
my $json = JSON->new->indent->canonical;
|
||||||
|
print $json->encode($conf);
|
||||||
|
}
|
||||||
|
|
||||||
sub _getKey {
|
sub _getKey {
|
||||||
my ( $self, $key ) = @_;
|
my ( $self, $key ) = @_;
|
||||||
my $sep = $self->sep;
|
my $sep = $self->sep;
|
||||||
|
@ -304,7 +311,7 @@ sub run {
|
||||||
}
|
}
|
||||||
$self->cfgNum( $self->lastCfg ) unless ( $self->cfgNum );
|
$self->cfgNum( $self->lastCfg ) unless ( $self->cfgNum );
|
||||||
my $action = shift;
|
my $action = shift;
|
||||||
unless ( $action =~ /^(?:get|set|addKey|delKey)$/ ) {
|
unless ( $action =~ /^(?:get|set|addKey|delKey|dump)$/ ) {
|
||||||
die
|
die
|
||||||
"unknown action $action. Only get, set, addKey or delKey are accepted";
|
"unknown action $action. Only get, set, addKey or delKey are accepted";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user