Files
i2p.www/www.i2p2/pages/i2pcontrol.html

131 lines
8.6 KiB
HTML
Raw Normal View History

{% extends "_layout.html" %}
{% block title %}Licenses{% endblock %}
{% block content %}
<h1>I2PControl - Remote Control Service</h1>
<p>I2P enables a <a href="http://en.wikipedia.org/wiki/JSON-RPC">JSONRPC2</a> interface via the plugin I2PControl.
The aim of the interface is to provide simple way to interface with a running I2P node. A client, itoopie, has been developed in parallel.
The JSONRPC2 implementation for the client as well as the plugin is provided by the java libraries <a href="http://software.dzhuvinov.com/json-rpc-2.0.html">JSON-RPC 2.0</a>.
A list of implementations of JSON-RPC for various languages can be found at <a href="http://json-rpc.org/wiki/implementations">the JSON-RPC wiki</a>.
</p>
<h2>API</h2>
<p>
Parameters are only provided in a named way (maps).
<h4>JSON-RPC 2 format</h4>
<div class="box" style="clear: none;"><pre>
Request:
{"id":"id", "method":"method-name","params":{"param-key-1":"param-value-1", "param-key-2":"param-value-2", "token":"**actual token**"}, "jsonrpc":"2.0"}
Response:
{"id":"id","result":{"result-key-1":"result-value-1","result-key-2":"result-value-2"},"jsonrpc":"2.0"}
</pre></div>
</p>
<ul>method-name &ndash; Description
<ul>Request
<li>param-key-1 &ndash; Description</li>
<li>param-key-2 &ndash; Description</li>
<li>token &ndash; Token used for authenticating every request (excluding the 'authenticate' request)</li>
</ul>
<ul>Response
<li>result-key-1 &ndash; Description</li>
<li>result-key-2 &ndash; Description</li>
</ul>
</ul>
<h4>Implemented methods</h4>
<ul>authenticate &ndash; Creates and returns an authentication token used for further communication.
<ul>Request
<li>password &ndash; [String] The password used for authenticating against the remote server.</li>
</ul>
<ul>Response
<li>token &ndash; [String] The token used for further communication.</li>
</ul>
</ul>
<ul>echo &ndash; Echoes the value of the echo key, used for debugging and testing.
<ul>Request
<li>echo &ndash; [String] Value will be returned in response.</li>
<li>token &ndash; [String]Token used for authenticating the client. Is provided by the server via the 'authenticate' request.</li>
</ul>
<ul>Response
<li>result &ndash; [String] Value of the key 'echo' in the request.</li>
</ul>
</ul>
<ul>getRate &ndash; Fetches rateStat from router statManager. Creates stat if not already created.
<ul>Request
<li>rateStat &ndash; [String] Determines which rateStat to fetch, see <a href="ratestats.html">ratestats</a>.</li>
<li>period &ndash; [double] Determines which period a stat is fetched for.</li>
<li>token &ndash; [String] Token used for authenticating the client. Is provided by the server via the 'authenticate' request.</li>
</ul>
<ul>Response
<li>result &ndash; [double] Returns the average value for the reuested rateStat and period.</li>
</ul>
</ul>
<ul>getNetworkInfo &ndash; Fetches various network related information. Ports, addresses etc.
<ul>Request
<li>*all &ndash; [value-ignored] Returns all of the below values fetched by the options below.</li>
<li>*i2p.router.net.ntcp.port &ndash; [value-ignored] What port is used for the TCP transport.</li>
<li>*i2p.router.net.ntcp.hostname &ndash; [value-ignored] What hostname is used for the TCP transport.</li>
<li>*i2p.router.net.ntcp.autoip &ndash; [value-ignored] Use automatically detected ip for TCP transport.</li>
<li>*i2p.router.net.ssu.port &ndash; [value-ignored] What port is used for the UDP transport.</li>
<li>*i2p.router.net.ssu.hostname &ndash; [value-ignored] What hostname is used for the UDP transport.</li>
<li>*i2p.router.net.ssu.detectedip &ndash; [value-ignored] What IP address has the UDP transport detected.</li>
<li>*i2p.router.net.ssu.autoip &ndash; [value-ignored] Which methods should be used for detecting the ip address of the UDP transport.</li>
<li>*i2p.router.net.upnp &ndash; [value-ignored] Is UPNP enabled.</li>
<li>*i2p.router.net.bw.share &ndash; [value-ignored] How many percent of bandwidth is usable for participating tunnels.</li>
<li>*i2p.router.net.bw.in &ndash; [value-ignored] How many KB/s of inboud bandwidth is allowed.</li>
<li>*i2p.router.net.bw.out &ndash; [value-ignored] How many KB/s of outbound bandwidth is allowed.</li>
<li>*i2p.router.net.laptopmode &ndash; [value-ignored] Is laptop mode enabled (cChange router identity and UDP port when IP changes ).</li>
<li>token &ndash; [String] Token used for authenticating the client. Is provided by the server via the 'authenticate' request.</li>
</ul>
<ul>Response
<li>i2p.router.net.ntcp.port &ndash; [String] What port is used for the TCP transport.</li>
<li>i2p.router.net.ntcp.hostname &ndash; [String] What hostname is used for the TCP transport.</li>
<li>i2p.router.net.ntcp.autoip &ndash; [String] Use automatically detected ip for TCP transport.</li>
<li>i2p.router.net.ssu.port &ndash; [String] What port is used for the UDP transport.</li>
<li>i2p.router.net.ssu.hostname &ndash; [String] What hostname is used for the UDP transport.</li>
<li>i2p.router.net.ssu.detectedip &ndash; [String] What IP address has the UDP transport detected.</li>
<li>i2p.router.net.ssu.autoip &ndash; [String] Which methods should be used for detecting the ip address of the UDP transport.</li>
<li>i2p.router.net.upnp &ndash; [String] Is UPNP enabled.</li>
<li>i2p.router.net.bw.share &ndash; [String] How many percent of bandwidth is usable for participating tunnels.</li>
<li>i2p.router.net.bw.in &ndash; [String] How many KB/s of inboud bandwidth is allowed.</li>
<li>i2p.router.net.bw.out &ndash; [String] How many KB/s of outbound bandwidth is allowed.</li>
<li>i2p.router.net.laptopmode &ndash; [String] Is laptop mode enabled (cChange router identity and UDP port when IP changes ).</li>
</ul>
</ul>
<ul>setNetworkInfo &ndash; Fetches various network related information. Ports, addresses etc.
<ul>Request
<li>*i2p.router.net.ntcp.port &ndash; [value-ignored] What port is used for the TCP transport.</li>
<li>*i2p.router.net.ntcp.hostname &ndash; [value-ignored] What hostname is used for the TCP transport.</li>
<li>*i2p.router.net.ntcp.autoip &ndash; [value-ignored] Use automatically detected ip for TCP transport.</li>
<li>*i2p.router.net.ssu.port &ndash; [value-ignored] What port is used for the UDP transport.</li>
<li>*i2p.router.net.ssu.hostname &ndash; [value-ignored] What hostname is used for the UDP transport.</li>
<li>*i2p.router.net.ssu.autoip &ndash; [value-ignored] Which methods should be used for detecting the ip address of the UDP transport.</li>
<li>*i2p.router.net.upnp &ndash; [value-ignored] Is UPNP enabled.</li>
<li>*i2p.router.net.bw.share &ndash; [value-ignored] How many percent of bandwidth is usable for participating tunnels.</li>
<li>*i2p.router.net.bw.in &ndash; [value-ignored] How many KB/s of inboud bandwidth is allowed.</li>
<li>*i2p.router.net.bw.out &ndash; [value-ignored] How many KB/s of outbound bandwidth is allowed.</li>
<li>*i2p.router.net.laptopmode &ndash; [value-ignored] Is laptop mode enabled (change router identity and UDP port when IP changes ).</li>
<li>token &ndash; [String] Token used for authenticating the client. Is provided by the server via the 'authenticate' request.</li>
</ul>
<ul>Response
<li>i2p.router.net.ntcp.port &ndash; [boolean] If the port used for the TCP transport was changed.</li>
<li>i2p.router.net.ntcp.hostname &ndash; [boolean] If the hostname is used for the TCP transport was changed.</li>
<li>i2p.router.net.ntcp.autoip &ndash; [boolean] If the method for automatically detecting ip for TCP transport was changed.</li>
<li>i2p.router.net.ssu.port &ndash; [boolean] If the port is used for the UDP transport was changed.</li>
<li>i2p.router.net.ssu.hostname &ndash; [boolean] If the hostname is used for the UDP transport was changed.</li>
<li>i2p.router.net.ssu.autoip &ndash; [boolean] If the methods used for detecting the ip address of the UDP transport were changed.</li>
<li>i2p.router.net.upnp &ndash; [boolean] If the UPNP setting was changed.</li>
<li>i2p.router.net.bw.share &ndash; [boolean] If how many percent of bandwidth is usable for participating tunnels was changed.</li>
<li>i2p.router.net.bw.in &ndash; [boolean] If how many KB/s of inboud bandwidth is allowed was changed.</li>
<li>i2p.router.net.bw.out &ndash; [boolean] If how many KB/s of outbound bandwidth is allowed was changed.</li>
<li>i2p.router.net.laptopmode &ndash; [boolean] If the laptop mode (change router identity and UDP port when IP changes ) was changed.</li>
<li>restart.needed &ndash; [boolean] Is a restart needed for the new settings to be used.</li>
</ul>
</ul>
<p>* denotes an optional value.</p>
{% endblock %}