This is the solution:

The Web Service API wrapper does not expect an array argname1 => value1,
argname2 => value2, ... as function argument, but a simple list
argname1, value1, agname2, value2.

I.e.
    execute('unreg_node_for_pid', ['pid'=>'peter']);
is wrong
    execute('unreg_node_for_pid', ['pid', 'peter']);
is right.

Till

On 04/13/2016 04:49 PM, [email protected] wrote:
> Hi all
>
> I try to get and set information from PF using its JasonRPC interface.
>
> I am using JasonRPC for PHP (https://github.com/fguillot/JsonRPC).
>
> When I call methods over RPC, i always get an empty answer and an error
> message about a missing parameter in packetfence.log.
>
> For example:
>
> $result = $client->execute('node_information',
> ['mac'=>'a8:5b:78:a7:1f:0f']);
>
> leads to:
> Apr 13 16:44:39 httpd.webservices(4925) WARN: [mac:a8:5b:78:a7:1f:0f]
> Odd number of elements in hash assignment at /usr/local/pf/lib/pf/api.pm
> line 537.
>  (pf::api::node_information)
> Apr 13 16:44:39 httpd.webservices(4925) ERROR: [mac:a8:5b:78:a7:1f:0f]
> Missing argument mac for the function pf::api::node_information
> (pf::util::validate_argv)
>
> or
>
> $result = $client->execute('unreg_node_for_pid', ['pid'=>'peter']);
>
> leads to:
> Apr 13 16:44:39 httpd.webservices(4928) WARN: [mac:unknown] Odd number
> of elements in hash assignment at /usr/local/pf/lib/pf/api.pm line 195.
>  (pf::api::unreg_node_for_pid)
> Apr 13 16:44:39 httpd.webservices(4928) ERROR: [mac:unknown] Missing
> argument pid for the function pf::api::unreg_node_for_pid
> (pf::util::validate_argv)
>
> Is this a known issue or I am doing something wrong? Why is there a
> complaint about missing arguments even when they are submitted?
>
> Thanks,
> Till
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> PacketFence-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/packetfence-users


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to