App-Standby

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

Makefile.PL
README
README.md
bin/standby-mgm-cgi.pl
bin/standby-mgm.pl
bin/standby-mgm.psgi
conf/standby-mgm.conf
conf/standby-mgm.conf.dist
dist.ini
examples/complex/README
examples/complex/complex_endpoint.pl
examples/complex/lib/App/Standby/Cmd/Command/complex.pm
examples/complex/lib/App/Standby/Service/Complex.pm
examples/simple/README
examples/simple/lib/App/Standby/Service/Simple.pm
examples/simple/simple_endpoint.pl
lib/App/Standby.pm
lib/App/Standby/Cmd.pm
lib/App/Standby/Cmd/Command.pm
lib/App/Standby/Cmd/Command/bootstrap.pm
lib/App/Standby/DB.pm
lib/App/Standby/Frontend.pm
lib/App/Standby/Group.pm
lib/App/Standby/Service.pm
lib/App/Standby/Service/HTTP.pm
lib/App/Standby/Service/MS.pm

README  view on Meta::CPAN

NAME
    App::Standby - Managing on-call rotation and notification queues

DESCRIPTION
    This distribution provides a small Plack webapp which helps with
    managing on-call rotations and notification queues. It allows you to
    manage several different queues from on place. It is easily extendible
    by plugins which can talk to virtually API endpoint to update a queue or
    a contact.

    Most organizations have at least one big monitoring system (like Nagios
    or Zabbix) and at least one external service level monitoring and other
    means of notification, If you don't want to pass around a shared on-call
    mobile you have to remember to update all those services when the one on
    duty changes. This app will help you with that.

    It allows you to manage several groups with their own queues and update
    each groups external services with just one click.

examples/complex/lib/App/Standby/Cmd/Command/complex.pm  view on Meta::CPAN


__END__

=head1 NAME

App::Standby::Cmd::Command::complex - Example for a command to be run as a cronjob

=head1 DESCRIPTION

This class implements an example for a cronjob that is run once a day to keep some
complex endpoint up-to-date.

=cut

examples/complex/lib/App/Standby/Service/Complex.pm  view on Meta::CPAN

# use MooseX::Params::Validate;
# use Carp;
# use English qw( -no_match_vars );
# use Try::Tiny;

# extends ...
extends 'App::Standby::Service::HTTP';
# has ...
# with ...
# initializers ...
sub _init_endpoints {
    my $self = shift;

    return $self->_config_values($self->name().'_endpoint');
}


# your code here ...

no Moose;
__PACKAGE__->meta->make_immutable;

1;

examples/simple/README  view on Meta::CPAN

This example includes a very simple service example.

The service is just a subclass of App::Standby::Service::HTTP and
sends the whole queue while the endpoint is implemented as
a very simple CGI script that decodes the queue and inserts it
into a queue in a MySQL database.

examples/simple/lib/App/Standby/Service/Simple.pm  view on Meta::CPAN

# use MooseX::Params::Validate;
# use Carp;
# use English qw( -no_match_vars );
# use Try::Tiny;

# extends ...
extends 'App::Standby::Service::HTTP';
# has ...
# with ...
# initializers ...
sub _init_endpoints {
    my $self = shift;

    return $self->_config_values($self->name().'_endpoint');
}

# your code here ...

no Moose;
__PACKAGE__->meta->make_immutable;

1;

__END__

lib/App/Standby.pm  view on Meta::CPAN


=head1 NAME

App::Standby - Managing on-call rotation and notification queues

=head1 DESCRIPTION

This distribution provides a small Plack webapp which helps with managing on-call rotations
and notification queues. It allows you to manage several different queues from
on place. It is easily extendible by plugins which can talk to virtually API
endpoint to update a queue or a contact.

Most organizations have at least one big monitoring system (like Nagios or Zabbix) and
at least one external service level monitoring and other means of notification,
If you don't want to pass around a shared on-call mobile you have to remember to update all
those services when the one on duty changes. This app will help you with that.

It allows you to manage several groups with their own queues and update each
groups external services with just one click.

=head1 METHODS

lib/App/Standby/Service/HTTP.pm  view on Meta::CPAN

    'isa'   => 'Str',
    'required' => 0,
);

has 'password' => (
    'is'    => 'rw',
    'isa'   => 'Str',
    'required' => 0,
);

has 'endpoints' => (
    'is'    => 'rw',
    'isa'   => 'ArrayRef',
    'lazy'  => 1,
    'builder'   => '_init_endpoints',
);
# with ...
# initializers ...
sub _init_json {
    my $self = shift;

    my $JSON = JSON::->new->utf8();

    return $JSON;
}

t/frontend.t  view on Meta::CPAN

    unlike($res->header('Location'), qr/Invalid...Key/, 'No error due to invalid key');

    # contacts page for group 1 lists the new contact
    $res = $cb->(GET '/?rm=list_contacts&group_id=1',);
    like($res->content, qr/Testcontact/, 'User Testcontact exists in group 1');

    # adding config item succeeds w/ correct key
    $res = $cb->(POST '/', [
        rm          => 'insert_config',
        'group_id'  => 1,
        'key'      => 'ms_endpoint',
        'value' => 'http://localhost/ms/',
        'group_key' => 'test',
    ]);
    ok($res->is_redirect, 'Redirect after create');
    unlike($res->header('Location'), qr/Invalid...Key/, 'No error due to invalid key');

    # config page for group 1 lists the new item
    $res = $cb->(GET '/?rm=list_config&group_id=1',);
    like($res->content, qr/ms_endpoint/, 'Config item ms_endpoint exists in group 1');

    # adding service succeeds w/ correct key
    $res = $cb->(POST '/', [
        rm          => 'insert_service',
        'group_id'  => 1,
        'name'      => 'ms',
        'description' => 'Monitoring::Spooler',
        'class' => 'MS',
        'group_key' => 'test',
    ]);
    ok($res->is_redirect, 'Redirect after create');
    unlike($res->header('Location'), qr/Invalid...Key/, 'No error due to invalid key');

    # config page for group 1 lists the new item
    $res = $cb->(GET '/?rm=list_services&group_id=1',);
    like($res->content, qr/App::Standby::Service::MS/, 'Config item ms_endpoint exists in group 1');
};

done_testing();

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.139 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )