<<

NAME

pf::api::jsonrpcclient

SYNOPSIS

  use pf::api::jsonrpcclient;
  my $client = pf::api::jsonrpcclient->new;
  my @args = $client->call("echo","packet","fence");

  $client->notify("echo","packet","fence");

DESCRIPTION

  pf::api::jsonrpcclient is a jsonrpc client over http

Attributes

username

  the username of the rpc call

password

  the password of the rpc call

proto

  the protocol of the rpc call http or https
  default http

host

  the host of the rpc server
  default 127.0.0.1

port

  the port of the rpc server
  default 9090

id

  the id of the message it is incremented after each call
  default 0

METHODS

call

  Calls an rpc method

notify

  Send a notification message to the rpc server

curl

  Creates a curl object to connect to the rpc server

url

  The url to the rpc message to

build_jsonrpc_request

  builds the jsonrpc request

build_jsonrpc_notification

  builds the jsonrpc notification request

AUTHOR

Inverse inc. <info@inverse.ca>

COPYRIGHT

Copyright (C) 2005-2015 Inverse inc.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<<