NAME

Janus::Ctrl - Controls maintenance via a SQLite database

SYNOPSIS

use Janus::Ctrl;

my $ctrl = Janus::Ctrl->new( $name => '/sqlite/file' );

$ctrl->clear();
$ctrl->pause( 'foo.alpha', 'blah' );
$ctrl->resume();
$ctrl->exclude( 'foobar', 'blah' );
sleep 3 if $ctrl->stuck();

DATABASE

A SQLITE db has a watcher table of four columns:

name : name of maintenance
ctrl : 'error', 'pause' or 'exclude'
node : stage name or node name
info : additional information, if any

METHODS

pause( $stage, $info, $ctrl = 'pause' )

Insert a record that cause stuck.

stuck( @stage )

Return records that cause @stage to be stuck. Return all records if @stage is not defined.

resume( @stage )

Clear records that cause @stage to be stuck. Clear all records if @stage is not defined.

exclude( $node, $info )

Exclude $node with a $info.

excluded()

Return ARRAY ref of excluded nodes.

dump()

Return ARRAY ref of *.

clear()

clear all records.

any()

A pseudo-stage that applies to all stages.