Считываю функционал триггера через API:
$VAR1 = {
'functions' => [
{
'parameter' => '',
'function' => 'last',
'itemid' => '30184',
'triggerid' => '16180',
'functionid' => '15783'
}
],
'expression' => '{15783}>0.07',
'triggerid' => '16180'
};
Пытаюсь поменять last() на avg(#12)
Код в perl:
$json =
{
jsonrpc=> '2.0',
method => 'trigger.update',
params =>
{
triggerid => '16180',
parameter => '#12',
function => 'avg',
# itemid => '30184',
# functionid => '15783'
},
id => 1,
auth => "$authID"
};
$response = $client->call($url, $json);
print Dumper($response);
Dumper показывает:
$VAR1 = bless( {
'version' => 0,
'content' => {
'jsonrpc' => '2.0',
'id' => 1,
'result' => {
'triggerids' => [
'16180'
]
}
},
'jsontext' => '{"jsonrpc":"2.0","result":{"triggerids":["16180"]},"id":1}',
'is_success' => 1
}, 'JSON::RPC::ReturnObject' );
Вроде бы как 'is_success' => 1, но в реальности функция триггера не меняется. Где я накосячил?
$VAR1 = {
'functions' => [
{
'parameter' => '',
'function' => 'last',
'itemid' => '30184',
'triggerid' => '16180',
'functionid' => '15783'
}
],
'expression' => '{15783}>0.07',
'triggerid' => '16180'
};
Пытаюсь поменять last() на avg(#12)
Код в perl:
$json =
{
jsonrpc=> '2.0',
method => 'trigger.update',
params =>
{
triggerid => '16180',
parameter => '#12',
function => 'avg',
# itemid => '30184',
# functionid => '15783'
},
id => 1,
auth => "$authID"
};
$response = $client->call($url, $json);
print Dumper($response);
Dumper показывает:
$VAR1 = bless( {
'version' => 0,
'content' => {
'jsonrpc' => '2.0',
'id' => 1,
'result' => {
'triggerids' => [
'16180'
]
}
},
'jsontext' => '{"jsonrpc":"2.0","result":{"triggerids":["16180"]},"id":1}',
'is_success' => 1
}, 'JSON::RPC::ReturnObject' );
Вроде бы как 'is_success' => 1, но в реальности функция триггера не меняется. Где я накосячил?