WWW::Giraffi::API::Axion - Giraffi API Axion Method Axion 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 axion data my $arrayref = $g->axion->all; foreach $ref(@{$arrayref}) { ## anything to do... }
WWW::Giraffi::API::Axion is Giraffi API Axion Method Access Module
Get All Axion Setting
Example:
$ create axion object my $axion = $g->axion; my $arrayref = $axion->all;
Return Array Reference:
[ { 'axion' => { 'options' => {}, 'name' => 'Aborted Alert', 'axiontype' => 'messaging', 'user_id' => 16, 'id' => 2 } } ]
Get Axion Setting
my $conditions = { 'name' => 'Aborted Alert' }; my $arrayref = $axion->search($conditions);
# only conditions match [ { 'axion' => { 'options' => {}, 'name' => 'Aborted Alert', 'axiontype' => 'messaging', 'user_id' => 16, 'id' => 2 } } ]
Get One Axion Setting
my $axion_id = 1; my $ref = $axion->find($axion_id);
Return Reference:
{ 'axion' => { 'options' => {}, 'name' => 'Aborted Alert', 'axiontype' => 'messaging', 'user_id' => 16, 'id' => 1 } }
my $axion_id = 1; my $arrayref = $axion->find_media($axion_id);
# media by add_media_by_id [ { medium => { options => { 'address' => 'me@domain' }, mediumtype => 'email', name => 'Alert Email', user_id => 16, id => 5 } } ]
Post Axion Setting
# axiontype is "messaging" my $conditions = { axiontype => "messaging", name => 'Aborted alert', }; # axiontype is "http_request" my $conditions = { axiontype => "http_request", name => 'Aborted alert post request', options => { header => { "content-type" => "application/x-www-form-urlencoded", Authorization => "Basic ****" }, uri => "https://convore.com/api/topics/19099/messages/create.json", method => "post", body => { message => "Aborted alert post message by API" } } }; $axion->create($conditions);
Execute Axion. add_media_by_id method is executed in advance
my $axion_id = 1; $axion->exec($axion_id);
Update Axion Setting
my $axion_id = 1; my $conditions = { name => 'Emergency Axion' }; $axion->update($axion_id, $conditions);
Delete Axion Setting
my $axion_id = 1; $axion->delete($axion_id);
Adds the specified media using the media id parameter to an axion, specified by an axion id parameter
my $media_id = 100; my $axion_id = 2; $axion->add_media($axion_id, $media_id);
Deletes the specified medium using the medium id parameter from an axion, specified by an axion id parameter
my $media_id = 100; my $axion_id = 2; $axion->remove_media($axion_id, $media_id);
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.