Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Abraham committed Sep 10, 2012
1 parent 8fbae3f commit c4d1453
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 66 deletions.
22 changes: 11 additions & 11 deletions MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"roa"
],
"dynamic_config" : 0,
"generated_by" : "Module::Build version 0.4, CPAN::Meta::Converter version 2.120921",
"generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.112621",
"license" : [
"perl_5"
],
Expand All @@ -21,7 +21,7 @@
"prereqs" : {
"build" : {
"requires" : {
"Test::More" : "0"
"Test::More" : 0
}
},
"configure" : {
Expand All @@ -31,12 +31,12 @@
},
"runtime" : {
"requires" : {
"Array::Diff" : "0",
"Data::Dumper" : "0",
"JSON::XS" : "0",
"LWP::UserAgent" : "0",
"Moo" : "0",
"perl" : "0"
"Array::Diff" : 0,
"Data::Dumper" : 0,
"JSON::XS" : 0,
"LWP::UserAgent" : 0,
"Moo" : 0,
"perl" : 0
}
}
},
Expand All @@ -47,15 +47,15 @@
},
"Pabbix::Auth" : {
"file" : "lib/Pabbix/Auth.pm",
"version" : "0"
"version" : 0
},
"Pabbix::Request" : {
"file" : "lib/Pabbix/Request.pm",
"version" : "0"
"version" : 0
},
"Pabbix::Trigger" : {
"file" : "lib/Pabbix/Trigger.pm",
"version" : "0"
"version" : 0
}
},
"release_status" : "stable",
Expand Down
32 changes: 1 addition & 31 deletions lib/Pabbix/Trigger/Exist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;
use Moo;
use Pabbix::Request;
use Data::Dumper;

#use Pabbix::Trigger::Trigger;
sub exist
{
my $self = shift;
Expand Down Expand Up @@ -47,34 +47,4 @@ sub _createJson
return $json;
}

has url => (
is => 'ro',
);

has authToken => (
is => 'ro',
);

has host => (
is => 'ro',
);

has hostid => (
is => 'ro',
);

has description => (
is => 'ro',
required => 1,
);

has expression => (
is => 'ro',
required => 1,
);

has nodeids => (
is => 'ro',
);

1;
54 changes: 30 additions & 24 deletions lib/Pabbix/Trigger/Get.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,14 @@ use strict;
use warnings;
use Moo;
use Pabbix::Request;
use Pabbix::Trigger::Trigger;

sub get
{
my $self = shift;
my $json = {
jsonrpc => "2.0",
method => "trigger.get",
params => {
output => "extend",
expandData => "host",
filter => {
value => $self->_translateStatus,
}
},
auth => $self->authToken,
id => 0
};

my $response = Pabbix::Request->new(
url => $self->url,
json => $json,
json => $self->_createJson,
);
return $response->get();
}
Expand All @@ -50,16 +37,35 @@ sub _translateStatus
}
}

has url => (
is => 'ro',
);
sub _createJson
{
my $self = shift;
my $json = {
jsonrpc => "2.0",
method => "trigger.get",
params => {
output => "extend",
expandData => "host",
filter => {
value => $self->_translateStatus,
}
},
auth => $self->authToken,
id => 0
};
return $json;
}

#has url => (
# is => 'ro',
# required => 1,
#);

#has authToken => (
# is => 'ro',
# required => 1,
#);

has authToken => (
is => 'ro',
);

has statusValue => (
is => 'ro',
);

1;

0 comments on commit c4d1453

Please sign in to comment.