WWW::Giraffi::API::Trigger - Giraffi API Trigger Method Trigger Module
0.2_04
use strict; use warnings; use WWW::Giraffi::API; my $apikey = "ilovenirvana_ilovekurtcobain"; my $g = WWW::Giraffi::API->new(apikey => $apikey); # get all trigger data my $arrayref = $g->trigger->all; foreach $ref(@{$arrayref}) { ## anything to do... }
WWW::Giraffi::API::Trigger is Giraffi API Trigger Method Access Module
Get All Trigger Setting
Example:
$ create trigger object my $trigger = $g->trigger; my $arrayref = $trigger->all;
Return Array Reference:
[ { trigger => { axioninterval => 180, level => 0, options => { time' => 3 }, triggertype => 'timeout', service_id => 9, id => 5 } } ]
Get Trigger Setting
my $conditions = { 'triggertype' => 'timeout' }; my $arrayref = $trigger->search($conditions);
# only conditions match [ { trigger => { axioninterval => 180, level => 0, options => { time' => 3 }, triggertype => 'timeout', service_id => 9, id => 5 } } ]
Get One Trigger Setting
my $trigger_id = 1; my $ref = $trigger->find($trigger_id);
Return Reference:
{ trigger => { axioninterval => 180, level => 0, options => { time' => 3 }, triggertype => 'timeout', service_id => 9, id => 5 } }
Get all axions related to an trigger, specified by an trigger id parameter.
my $trigger_id = 5; my $arrayref = $service->find_axion($trigger_id);
[ { axion => { options => {}, name => 'Aborted Alert', axiontype => 'messaging', user_id => 16, id => 4 } } ]
Execute axion related to an trigger, specified by an trigger id parameter.
$trigger_id = 5; $trigger->exec_axion($trigger_id);
Update Trigger Setting
my $trigger_id = 5; my $conditions = { options => { timeout => 10 } }; $trigger->update($trigger_id, $conditions);
Update the specified axion using the axion id/axion kind parameter from an trigger, specified by an trigger id parameter.
my $trigger_id = 5; my $axion_id = 1; my $axion_kind = "problem"; # problem or recovery $service->update_axion($trigger_id, $axion_id, $axion_kind);
Delete Trigger Setting
my $trigger_id = 5; $trigger->delete($trigger_id);
Deletes the specified axion using the axion id/axion kind parameter from an trigger, specified by an trigger id parameter.
my $trigger_id = 5; my $axion_id = 1; my $axion_kind = "problem"; # problem or recovery $service->remove_trigger($trigger_id, $axion_id, $axion_kind);
Akira Horimoto <emperor@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Giraffi::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Giraffi::API
CPAN shell
perl -MCPAN -e shell install WWW::Giraffi::API
For more information on module installation, please visit the detailed CPAN module installation guide.