2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-28 04:27:46 +00:00
kea/doc/guide/api.xml

3013 lines
112 KiB
XML
Raw Normal View History

2018-10-05 18:33:30 +02:00
<!--
- Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<!-- autogenerated using cmd_docgen. Do not edit by hand! -->
<appendix xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="api">
<title>API Reference</title>
<para>Kea currently supports 66 commands:
<command><link linkend="ref-build-report">build-report</link></command>
, <command><link linkend="ref-cache-clear">cache-clear</link></command>
, <command><link linkend="ref-cache-get">cache-get</link></command>
, <command><link linkend="ref-cache-insert">cache-insert</link></command>
, <command><link linkend="ref-cache-load">cache-load</link></command>
, <command><link linkend="ref-cache-remove">cache-remove</link></command>
, <command><link linkend="ref-cache-write">cache-write</link></command>
, <command><link linkend="ref-config-get">config-get</link></command>
, <command><link linkend="ref-config-reload">config-reload</link></command>
, <command><link linkend="ref-config-set">config-set</link></command>
, <command><link linkend="ref-config-test">config-test</link></command>
, <command><link linkend="ref-config-write">config-write</link></command>
, <command><link linkend="ref-dhcp-disable">dhcp-disable</link></command>
, <command><link linkend="ref-dhcp-enable">dhcp-enable</link></command>
, <command><link linkend="ref-ha-continue">ha-continue</link></command>
, <command><link linkend="ref-ha-heartbeat">ha-heartbeat</link></command>
, <command><link linkend="ref-ha-scopes">ha-scopes</link></command>
, <command><link linkend="ref-ha-sync">ha-sync</link></command>
, <command><link linkend="ref-lease4-add">lease4-add</link></command>
, <command><link linkend="ref-lease4-del">lease4-del</link></command>
, <command><link linkend="ref-lease4-get">lease4-get</link></command>
, <command><link linkend="ref-lease4-get-all">lease4-get-all</link></command>
, <command><link linkend="ref-lease4-update">lease4-update</link></command>
, <command><link linkend="ref-lease4-wipe">lease4-wipe</link></command>
, <command><link linkend="ref-lease6-add">lease6-add</link></command>
, <command><link linkend="ref-lease6-del">lease6-del</link></command>
, <command><link linkend="ref-lease6-get">lease6-get</link></command>
, <command><link linkend="ref-lease6-get-all">lease6-get-all</link></command>
, <command><link linkend="ref-lease6-update">lease6-update</link></command>
, <command><link linkend="ref-lease6-wipe">lease6-wipe</link></command>
, <command><link linkend="ref-leases-reclaim">leases-reclaim</link></command>
, <command><link linkend="ref-libreload">libreload</link></command>
, <command><link linkend="ref-list-commands">list-commands</link></command>
, <command><link linkend="ref-network4-add">network4-add</link></command>
, <command><link linkend="ref-network4-del">network4-del</link></command>
, <command><link linkend="ref-network4-get">network4-get</link></command>
, <command><link linkend="ref-network4-list">network4-list</link></command>
, <command><link linkend="ref-network4-subnet-add">network4-subnet-add</link></command>
, <command><link linkend="ref-network4-subnet-del">network4-subnet-del</link></command>
, <command><link linkend="ref-network6-add">network6-add</link></command>
, <command><link linkend="ref-network6-del">network6-del</link></command>
, <command><link linkend="ref-network6-get">network6-get</link></command>
, <command><link linkend="ref-network6-list">network6-list</link></command>
, <command><link linkend="ref-network6-subnet-add">network6-subnet-add</link></command>
, <command><link linkend="ref-network6-subnet-del">network6-subnet-del</link></command>
, <command><link linkend="ref-reservation-add">reservation-add</link></command>
, <command><link linkend="ref-reservation-del">reservation-del</link></command>
, <command><link linkend="ref-reservation-get">reservation-get</link></command>
, <command><link linkend="ref-shutdown">shutdown</link></command>
, <command><link linkend="ref-stat-lease4-get">stat-lease4-get</link></command>
, <command><link linkend="ref-stat-lease6-get">stat-lease6-get</link></command>
, <command><link linkend="ref-statistic-get">statistic-get</link></command>
, <command><link linkend="ref-statistic-get-all">statistic-get-all</link></command>
, <command><link linkend="ref-statistic-remove">statistic-remove</link></command>
, <command><link linkend="ref-statistic-remove-all">statistic-remove-all</link></command>
, <command><link linkend="ref-statistic-reset">statistic-reset</link></command>
, <command><link linkend="ref-statistic-reset-all">statistic-reset-all</link></command>
, <command><link linkend="ref-subnet4-add">subnet4-add</link></command>
, <command><link linkend="ref-subnet4-del">subnet4-del</link></command>
, <command><link linkend="ref-subnet4-get">subnet4-get</link></command>
, <command><link linkend="ref-subnet4-list">subnet4-list</link></command>
, <command><link linkend="ref-subnet6-add">subnet6-add</link></command>
, <command><link linkend="ref-subnet6-del">subnet6-del</link></command>
, <command><link linkend="ref-subnet6-get">subnet6-get</link></command>
, <command><link linkend="ref-subnet6-list">subnet6-list</link></command>
, <command><link linkend="ref-version-get">version-get</link></command>
.</para>
<para xml:id="commands-kea-ctrl-agent">Commands supported by kea-ctrl-agent daemon: <command><link linkend="ref-build-report">build-report</link></command>
, <command><link linkend="ref-config-get">config-get</link></command>
, <command><link linkend="ref-config-test">config-test</link></command>
, <command><link linkend="ref-config-write">config-write</link></command>
, <command><link linkend="ref-list-commands">list-commands</link></command>
, <command><link linkend="ref-shutdown">shutdown</link></command>
, <command><link linkend="ref-version-get">version-get</link></command>
.</para>
<para xml:id="commands-kea-dhcp4">Commands supported by kea-dhcp4 daemon: <command><link linkend="ref-build-report">build-report</link></command>
, <command><link linkend="ref-cache-clear">cache-clear</link></command>
, <command><link linkend="ref-cache-get">cache-get</link></command>
, <command><link linkend="ref-cache-insert">cache-insert</link></command>
, <command><link linkend="ref-cache-load">cache-load</link></command>
, <command><link linkend="ref-cache-remove">cache-remove</link></command>
, <command><link linkend="ref-cache-write">cache-write</link></command>
, <command><link linkend="ref-config-get">config-get</link></command>
, <command><link linkend="ref-config-reload">config-reload</link></command>
, <command><link linkend="ref-config-set">config-set</link></command>
, <command><link linkend="ref-config-test">config-test</link></command>
, <command><link linkend="ref-config-write">config-write</link></command>
, <command><link linkend="ref-dhcp-disable">dhcp-disable</link></command>
, <command><link linkend="ref-dhcp-enable">dhcp-enable</link></command>
, <command><link linkend="ref-ha-continue">ha-continue</link></command>
, <command><link linkend="ref-ha-heartbeat">ha-heartbeat</link></command>
, <command><link linkend="ref-ha-scopes">ha-scopes</link></command>
, <command><link linkend="ref-ha-sync">ha-sync</link></command>
, <command><link linkend="ref-lease4-add">lease4-add</link></command>
, <command><link linkend="ref-lease4-del">lease4-del</link></command>
, <command><link linkend="ref-lease4-get">lease4-get</link></command>
, <command><link linkend="ref-lease4-get-all">lease4-get-all</link></command>
, <command><link linkend="ref-lease4-update">lease4-update</link></command>
, <command><link linkend="ref-lease4-wipe">lease4-wipe</link></command>
2019-10-29 18:35:31 +01:00
, <command><link linkend="ref-leases-reclaim">leases-reclaim</link></command>
2018-10-05 18:33:30 +02:00
, <command><link linkend="ref-libreload">libreload</link></command>
, <command><link linkend="ref-list-commands">list-commands</link></command>
, <command><link linkend="ref-network4-add">network4-add</link></command>
, <command><link linkend="ref-network4-del">network4-del</link></command>
, <command><link linkend="ref-network4-get">network4-get</link></command>
, <command><link linkend="ref-network4-list">network4-list</link></command>
, <command><link linkend="ref-network4-subnet-add">network4-subnet-add</link></command>
, <command><link linkend="ref-network4-subnet-del">network4-subnet-del</link></command>
, <command><link linkend="ref-reservation-add">reservation-add</link></command>
, <command><link linkend="ref-reservation-del">reservation-del</link></command>
, <command><link linkend="ref-reservation-get">reservation-get</link></command>
, <command><link linkend="ref-shutdown">shutdown</link></command>
, <command><link linkend="ref-stat-lease4-get">stat-lease4-get</link></command>
, <command><link linkend="ref-statistic-get">statistic-get</link></command>
, <command><link linkend="ref-statistic-get-all">statistic-get-all</link></command>
, <command><link linkend="ref-statistic-remove">statistic-remove</link></command>
, <command><link linkend="ref-statistic-remove-all">statistic-remove-all</link></command>
, <command><link linkend="ref-statistic-reset">statistic-reset</link></command>
, <command><link linkend="ref-statistic-reset-all">statistic-reset-all</link></command>
, <command><link linkend="ref-subnet4-add">subnet4-add</link></command>
, <command><link linkend="ref-subnet4-del">subnet4-del</link></command>
, <command><link linkend="ref-subnet4-get">subnet4-get</link></command>
, <command><link linkend="ref-subnet4-list">subnet4-list</link></command>
, <command><link linkend="ref-version-get">version-get</link></command>
.</para>
<para xml:id="commands-kea-dhcp6">Commands supported by kea-dhcp6 daemon: <command><link linkend="ref-build-report">build-report</link></command>
, <command><link linkend="ref-cache-clear">cache-clear</link></command>
, <command><link linkend="ref-cache-get">cache-get</link></command>
, <command><link linkend="ref-cache-insert">cache-insert</link></command>
, <command><link linkend="ref-cache-load">cache-load</link></command>
, <command><link linkend="ref-cache-remove">cache-remove</link></command>
, <command><link linkend="ref-cache-write">cache-write</link></command>
, <command><link linkend="ref-config-get">config-get</link></command>
, <command><link linkend="ref-config-reload">config-reload</link></command>
, <command><link linkend="ref-config-set">config-set</link></command>
, <command><link linkend="ref-config-test">config-test</link></command>
, <command><link linkend="ref-config-write">config-write</link></command>
, <command><link linkend="ref-dhcp-disable">dhcp-disable</link></command>
, <command><link linkend="ref-dhcp-enable">dhcp-enable</link></command>
, <command><link linkend="ref-ha-continue">ha-continue</link></command>
, <command><link linkend="ref-ha-heartbeat">ha-heartbeat</link></command>
, <command><link linkend="ref-ha-scopes">ha-scopes</link></command>
, <command><link linkend="ref-ha-sync">ha-sync</link></command>
, <command><link linkend="ref-lease6-add">lease6-add</link></command>
, <command><link linkend="ref-lease6-del">lease6-del</link></command>
, <command><link linkend="ref-lease6-get">lease6-get</link></command>
, <command><link linkend="ref-lease6-get-all">lease6-get-all</link></command>
, <command><link linkend="ref-lease6-update">lease6-update</link></command>
, <command><link linkend="ref-lease6-wipe">lease6-wipe</link></command>
, <command><link linkend="ref-leases-reclaim">leases-reclaim</link></command>
, <command><link linkend="ref-libreload">libreload</link></command>
, <command><link linkend="ref-list-commands">list-commands</link></command>
, <command><link linkend="ref-network6-add">network6-add</link></command>
, <command><link linkend="ref-network6-del">network6-del</link></command>
, <command><link linkend="ref-network6-get">network6-get</link></command>
, <command><link linkend="ref-network6-list">network6-list</link></command>
, <command><link linkend="ref-network6-subnet-add">network6-subnet-add</link></command>
, <command><link linkend="ref-network6-subnet-del">network6-subnet-del</link></command>
, <command><link linkend="ref-reservation-add">reservation-add</link></command>
, <command><link linkend="ref-reservation-del">reservation-del</link></command>
, <command><link linkend="ref-reservation-get">reservation-get</link></command>
, <command><link linkend="ref-shutdown">shutdown</link></command>
, <command><link linkend="ref-stat-lease6-get">stat-lease6-get</link></command>
, <command><link linkend="ref-statistic-get">statistic-get</link></command>
, <command><link linkend="ref-statistic-get-all">statistic-get-all</link></command>
, <command><link linkend="ref-statistic-remove">statistic-remove</link></command>
, <command><link linkend="ref-statistic-remove-all">statistic-remove-all</link></command>
, <command><link linkend="ref-statistic-reset">statistic-reset</link></command>
, <command><link linkend="ref-statistic-reset-all">statistic-reset-all</link></command>
, <command><link linkend="ref-subnet6-add">subnet6-add</link></command>
, <command><link linkend="ref-subnet6-del">subnet6-del</link></command>
, <command><link linkend="ref-subnet6-get">subnet6-get</link></command>
, <command><link linkend="ref-subnet6-list">subnet6-list</link></command>
, <command><link linkend="ref-version-get">version-get</link></command>
.</para>
<para xml:id="commands-high_availability-lib">Commands supported by high_availability hook library: <command><link linkend="ref-ha-continue">ha-continue</link></command>
, <command><link linkend="ref-ha-heartbeat">ha-heartbeat</link></command>
, <command><link linkend="ref-ha-scopes">ha-scopes</link></command>
, <command><link linkend="ref-ha-sync">ha-sync</link></command>
.</para>
<para xml:id="commands-host_cache-lib">Commands supported by host_cache hook library: <command><link linkend="ref-cache-clear">cache-clear</link></command>
, <command><link linkend="ref-cache-get">cache-get</link></command>
, <command><link linkend="ref-cache-insert">cache-insert</link></command>
, <command><link linkend="ref-cache-load">cache-load</link></command>
, <command><link linkend="ref-cache-remove">cache-remove</link></command>
, <command><link linkend="ref-cache-write">cache-write</link></command>
.</para>
<para xml:id="commands-host_cmds-lib">Commands supported by host_cmds hook library: <command><link linkend="ref-reservation-add">reservation-add</link></command>
, <command><link linkend="ref-reservation-del">reservation-del</link></command>
, <command><link linkend="ref-reservation-get">reservation-get</link></command>
.</para>
<para xml:id="commands-lease_cmds-lib">Commands supported by lease_cmds hook library: <command><link linkend="ref-lease4-add">lease4-add</link></command>
, <command><link linkend="ref-lease4-del">lease4-del</link></command>
, <command><link linkend="ref-lease4-get">lease4-get</link></command>
, <command><link linkend="ref-lease4-get-all">lease4-get-all</link></command>
, <command><link linkend="ref-lease4-update">lease4-update</link></command>
, <command><link linkend="ref-lease4-wipe">lease4-wipe</link></command>
, <command><link linkend="ref-lease6-add">lease6-add</link></command>
, <command><link linkend="ref-lease6-del">lease6-del</link></command>
, <command><link linkend="ref-lease6-get">lease6-get</link></command>
, <command><link linkend="ref-lease6-get-all">lease6-get-all</link></command>
, <command><link linkend="ref-lease6-update">lease6-update</link></command>
, <command><link linkend="ref-lease6-wipe">lease6-wipe</link></command>
.</para>
<para xml:id="commands-stat_cmds-lib">Commands supported by stat_cmds hook library: <command><link linkend="ref-stat-lease4-get">stat-lease4-get</link></command>
, <command><link linkend="ref-stat-lease6-get">stat-lease6-get</link></command>
.</para>
<para xml:id="commands-subnet_cmds-lib">Commands supported by subnet_cmds hook library: <command><link linkend="ref-network4-add">network4-add</link></command>
, <command><link linkend="ref-network4-del">network4-del</link></command>
, <command><link linkend="ref-network4-get">network4-get</link></command>
, <command><link linkend="ref-network4-list">network4-list</link></command>
, <command><link linkend="ref-network4-subnet-add">network4-subnet-add</link></command>
, <command><link linkend="ref-network4-subnet-del">network4-subnet-del</link></command>
, <command><link linkend="ref-network6-add">network6-add</link></command>
, <command><link linkend="ref-network6-del">network6-del</link></command>
, <command><link linkend="ref-network6-get">network6-get</link></command>
, <command><link linkend="ref-network6-list">network6-list</link></command>
, <command><link linkend="ref-network6-subnet-add">network6-subnet-add</link></command>
, <command><link linkend="ref-network6-subnet-del">network6-subnet-del</link></command>
, <command><link linkend="ref-subnet4-add">subnet4-add</link></command>
, <command><link linkend="ref-subnet4-del">subnet4-del</link></command>
, <command><link linkend="ref-subnet4-get">subnet4-get</link></command>
, <command><link linkend="ref-subnet4-list">subnet4-list</link></command>
, <command><link linkend="ref-subnet6-add">subnet6-add</link></command>
, <command><link linkend="ref-subnet6-del">subnet6-del</link></command>
, <command><link linkend="ref-subnet6-get">subnet6-get</link></command>
, <command><link linkend="ref-subnet6-list">subnet6-list</link></command>
.</para>
<!-- start of build-report -->
<section xml:id="reference-build-report">
<title>build-report reference</title>
2019-10-29 18:35:31 +01:00
<para xml:id="ref-build-report"><command>build-report</command> - Returns a list of compilation options that this particular binary was built with</para>
2018-10-05 18:33:30 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-build-report"/></para>
<para>Command syntax:
<screen>{
"command": "build-report"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": &lt;string with build details&gt;
}</screen>
</para>
</section>
<!-- end of build-report -->
<!-- start of cache-clear -->
<section xml:id="reference-cache-clear">
<title>cache-clear reference</title>
<para xml:id="ref-cache-clear"><command>cache-clear</command> - This command removes all cached host reservations.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-host_cache-lib">host_cache</link> hook)</para>
<para>Description and examples: See <xref linkend="command-cache-clear"/></para>
<para>Command syntax:
<screen>{
"command": "cache-clear"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of cache-clear -->
<!-- start of cache-get -->
<section xml:id="reference-cache-get">
<title>cache-get reference</title>
<para xml:id="ref-cache-get"><command>cache-get</command> - Returns full content of the host cache.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-host_cache-lib">host_cache</link> hook)</para>
<para>Description and examples: See <xref linkend="command-cache-get"/></para>
<para>Command syntax:
<screen>{
"command": "cache-get"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0
"text": "123 entries returned."
"arguments": &lt;list of host reservations&gt;
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of cache-get -->
<!-- start of cache-insert -->
<section xml:id="reference-cache-insert">
<title>cache-insert reference</title>
<para xml:id="ref-cache-insert"><command>cache-insert</command> - This command may be used to manually insert a host into the cache.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-host_cache-lib">host_cache</link> hook)</para>
<para>Description and examples: See <xref linkend="command-cache-insert"/></para>
<para>Command syntax:
<screen>{
"command": "cache-insert",
"arguments": {
"hw-address": "01:02:03:04:05:06",
"subnet-id4": 4,
"subnet-id6": 0,
"ip-address": "192.0.2.100",
"hostname": "somehost.example.org",
"client-classes4": [ ],
"client-classes6": [ ],
"option-data4": [ ],
"option-data6": [ ],
"next-server": "192.0.0.2",
"server-hostname": "server-hostname.example.org",
"boot-file-name": "bootfile.efi",
"host-id": 0
}
},
{
"command": "cache-insert",
"arguments": {
"hw-address": "01:02:03:04:05:06",
"subnet-id4": 0,
"subnet-id6": 6,
"ip-addresses": [ "2001:db8::cafe:babe" ],
"prefixes": [ "2001:db8:dead:beef::/64" ],
"hostname": "",
"client-classes4": [ ],
"client-classes6": [ ],
"option-data4": [ ],
"option-data6": [ ],
"next-server": "0.0.0.0",
"server-hostname": "",
"boot-file-name": "",
"host-id": 0
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of cache-insert -->
<!-- start of cache-load -->
<section xml:id="reference-cache-load">
<title>cache-load reference</title>
<para xml:id="ref-cache-load"><command>cache-load</command> - This command allows load the contents of a file on disk into an in-memory cache.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-host_cache-lib">host_cache</link> hook)</para>
<para>Description and examples: See <xref linkend="command-cache-load"/></para>
<para>Command syntax:
<screen>{
"command": "cache-load",
"arguments": "/tmp/kea-host-cache.json"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of cache-load -->
<!-- start of cache-remove -->
<section xml:id="reference-cache-remove">
<title>cache-remove reference</title>
<para xml:id="ref-cache-remove"><command>cache-remove</command> - The cache-remove command works similarly to reservation-get command.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-host_cache-lib">host_cache</link> hook)</para>
<para>Description and examples: See <xref linkend="command-cache-remove"/></para>
<para>Command syntax:
<screen>{
"command": "cache-remove",
"arguments": {
"ip-address": "192.0.2.1",
"subnet-id": 123
}
}
2018-10-16 17:49:50 +02:00
Another example that removes IPv6 host identifier by DUID and specific subnet-id is:
2018-10-05 18:33:30 +02:00
{
"command": "cache-remove",
"arguments": {
"duid": "00:01:ab:cd:f0:a1:c2:d3:e4",
"subnet-id": 123
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of cache-remove -->
<!-- start of cache-write -->
<section xml:id="reference-cache-write">
<title>cache-write reference</title>
<para xml:id="ref-cache-write"><command>cache-write</command> - Instructs Kea to write its host cache content to disk.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-host_cache-lib">host_cache</link> hook)</para>
<para>Description and examples: See <xref linkend="command-cache-write"/></para>
<para>Command syntax:
<screen>{
"command": "cache-write",
"arguments": "/path/to/the/file.json"
}</screen>
The command takes one mandatory argument that specifies a filename path of a file to be written.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of cache-write -->
<!-- start of config-get -->
<section xml:id="reference-config-get">
<title>config-get reference</title>
2019-10-29 18:35:31 +01:00
<para xml:id="ref-config-get"><command>config-get</command> - Retrieves the current configuration used by the server. The configuration
2018-10-05 18:33:30 +02:00
is roughtly equal to the configuration file, but includes additional
changes made by other commands and due to parameters inheritance.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-config-get"/></para>
<para>Command syntax:
<screen>{
"command": "config-get"
}</screen>
2018-10-16 17:49:50 +02:00
This command takes no parameters.</para>
2018-10-05 18:33:30 +02:00
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"arguments": {
&lt;JSON configuration here, starting with Dhcp4, Dhcp6, or Control-agent object&gt;
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of config-get -->
<!-- start of config-reload -->
<section xml:id="reference-config-reload">
<title>config-reload reference</title>
<para xml:id="ref-config-reload"><command>config-reload</command> - The config-reload command instructs Kea to load again the configuration file that was used previously.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-config-reload"/></para>
<para>Command syntax:
<screen>{
"command": "config-reload"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of config-reload -->
<!-- start of config-set -->
<section xml:id="reference-config-set">
<title>config-set reference</title>
<para xml:id="ref-config-set"><command>config-set</command> - The config-set command instructs the server to replace its current configuration with the new configuration supplied in the command's arguments.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-config-set"/></para>
<para>Command syntax:
<screen>{
"command": "config-set",
"arguments": {
"&lt;server&gt;": {
},
"Logging": {
}
}
}</screen>
where &lt;server&gt; is the configuration element name for a given server such as "Dhcp4" or "Dhcp6"</para>
<para>Response syntax:
<screen> {"result": 0, "text": "Configuration successful." }
or
{"result": 1, "text": "unsupported parameter: BOGUS (&lt;string&gt;:16:26)" }</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of config-set -->
<!-- start of config-test -->
<section xml:id="reference-config-test">
<title>config-test reference</title>
<para xml:id="ref-config-test"><command>config-test</command> - The config-test command instructs the server to check whether the new configuration supplied in the command's arguments can be loaded.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-config-test"/></para>
<para>Command syntax:
<screen>{
"command": "config-test",
"arguments": {
"&lt;server&gt;": {
},
"Logging": {
}
}
}</screen>
where &gt;server&lt; is the configuration element name for a given server such as "Dhcp4" or "Dhcp6"</para>
2018-10-05 18:33:30 +02:00
<para>Response syntax:
<screen>{"result": 0, "text": "Configuration seems sane..." }
or
{"result": 1, "text": "unsupported parameter: BOGUS (&lt;string&gt;:16:26)" }</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of config-test -->
<!-- start of config-write -->
<section xml:id="reference-config-write">
<title>config-write reference</title>
<para xml:id="ref-config-write"><command>config-write</command> - The config-write command instructs the Kea server to write its
current configuration to a file on disk.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-config-write"/></para>
<para>Command syntax:
<screen>{
"command": "config-write",
"arguments": {
"filename": "config-modified-2017-03-15.json"
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of config-write -->
<!-- start of dhcp-disable -->
<section xml:id="reference-dhcp-disable">
<title>dhcp-disable reference</title>
<para xml:id="ref-dhcp-disable"><command>dhcp-disable</command> - The dhcp-disable command globally disables the DHCP service.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-dhcp-disable"/></para>
<para>Command syntax:
<screen>{
"command": "dhcp-disable",
"arguments": {
"max-period": 20
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of dhcp-disable -->
<!-- start of dhcp-enable -->
<section xml:id="reference-dhcp-enable">
<title>dhcp-enable reference</title>
<para xml:id="ref-dhcp-enable"><command>dhcp-enable</command> - The dhcp-enable command globally enables the DHCP service.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-dhcp-enable"/></para>
<para>Command syntax:
<screen>{
"command": "dhcp-enable"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of dhcp-enable -->
<!-- start of ha-continue -->
<section xml:id="reference-ha-continue">
<title>ha-continue reference</title>
<para xml:id="ref-ha-continue"><command>ha-continue</command> - This command is used to resume the operation of the paused HA state machine.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-high_availability-lib">high_availability</link> hook)</para>
<para>Description and examples: See <xref linkend="command-ha-continue"/></para>
<para>Command syntax:
<screen>{
"command": "ha-continue"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of ha-continue -->
<!-- start of ha-heartbeat -->
<section xml:id="reference-ha-heartbeat">
<title>ha-heartbeat reference</title>
<para xml:id="ref-ha-heartbeat"><command>ha-heartbeat</command> - This command is sent internally by Kea partner when operating
2018-10-16 17:49:50 +02:00
in High Availability (HA) mode. It will retrieve the server HA state and clock value.</para>
2018-10-05 18:33:30 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-high_availability-lib">high_availability</link> hook)</para>
<para>Description and examples: See <xref linkend="command-ha-heartbeat"/></para>
<para>Command syntax:
2018-10-16 17:49:50 +02:00
<screen>{
"command": "ha-heartbeat",
}</screen>
2018-10-05 18:33:30 +02:00
</para>
<para>Response syntax:
2018-10-16 17:49:50 +02:00
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
The response to this command is different from the typical command response. The response will include server state (see <xref linkend="ha-server-states"/> plus the current clock value.</para>
2018-10-05 18:33:30 +02:00
</section>
<!-- end of ha-heartbeat -->
<!-- start of ha-scopes -->
<section xml:id="reference-ha-scopes">
<title>ha-scopes reference</title>
2018-10-16 17:49:50 +02:00
<para xml:id="ref-ha-scopes"><command>ha-scopes</command> - This command modifies the scope that the server is responsible for serving when operating in High Availability (HA) mode.</para>
2018-10-05 18:33:30 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-high_availability-lib">high_availability</link> hook)</para>
<para>Description and examples: See <xref linkend="command-ha-scopes"/></para>
<para>Command syntax:
<screen>{
"command": "ha-scopes",
"service": [ &lt;service, typically "dhcp4" or "dhcp6"&gt; ],
"arguments": {
"scopes": [ "HA_server1", "HA_server2" ]
2018-10-16 17:49:50 +02:00
}</screen>
In the example given, the arguments configure the server to handle traffic from both HA_server1 and HA_server2 scopes.</para>
2018-10-05 18:33:30 +02:00
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of ha-scopes -->
<!-- start of ha-sync -->
<section xml:id="reference-ha-sync">
<title>ha-sync reference</title>
<para xml:id="ref-ha-sync"><command>ha-sync</command> - The command is issued to instruct the server running in HA mode to
synchronize its local lease database with the selected peer.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.4.0 (<link linkend="commands-high_availability-lib">high_availability</link> hook)</para>
<para>Description and examples: See <xref linkend="command-ha-sync"/></para>
<para>Command syntax:
<screen>{
"command": "ha-sync",
"service": [ &lt;service affected: "dhcp4" or "dhcp6" ],
"arguments": {
"server-name": &lt;name of the partner server&gt;,
"max-period": &lt;integer, in seconds&gt;
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of ha-sync -->
<!-- start of lease4-add -->
<section xml:id="reference-lease4-add">
<title>lease4-add reference</title>
2018-10-16 17:49:50 +02:00
<para xml:id="ref-lease4-add"><command>lease4-add</command> - The lease4-add command adds a new IPv4 lease administratively.</para>
2018-10-05 18:33:30 +02:00
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease4-add"/></para>
<para>Command syntax:
<screen>{
"command": "lease4-add",
"arguments": {
"ip-address": "192.0.2.202",
"hw-address": "1a:1b:1c:1d:1e:1f"
}
}</screen>
2018-10-16 17:49:50 +02:00
Note that Kea 1.4 requires an additional argument, subnet-ID, which is optional as of Kea 1.5. A number of other more detailed optional arguments are also supported.</para>
2018-10-05 18:33:30 +02:00
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease4-add -->
<!-- start of lease4-del -->
<section xml:id="reference-lease4-del">
<title>lease4-del reference</title>
<para xml:id="ref-lease4-del"><command>lease4-del</command> - lease4-del can be used to delete a lease from the lease database.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease4-del"/></para>
<para>Command syntax:
<screen>{
"command": "lease4-del",
"arguments": {
"ip-address": "192.0.2.202"
}
}</screen>
2018-10-16 17:49:50 +02:00
Specify the lease to be deleted either by IP address, or by identifier-type and identifier value. Currently supported identifiers are "hw-address" and "client-id".</para>
2018-10-05 18:33:30 +02:00
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease4-del -->
<!-- start of lease4-get -->
<section xml:id="reference-lease4-get">
<title>lease4-get reference</title>
<para xml:id="ref-lease4-get"><command>lease4-get</command> - lease4-get can be used to query the lease database and retrieve existing leases.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease4-get"/></para>
<para>Command syntax:
<screen>{
"command": "lease4-get",
"arguments": {
"ip-address": "192.0.2.1"
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"arguments": {
"client-id": "42:42:42:42:42:42:42:42",
"cltt": 12345678,
"fqdn-fwd": false,
"fqdn-rev": true,
"hostname": "myhost.example.com.",
"hw-address": "08:08:08:08:08:08",
"ip-address": "192.0.2.1",
"state": 0,
"subnet-id": 44,
"valid-lft": 3600
},
"result": 0,
"text": "IPv4 lease found."
}</screen>
lease4-get returns a result that indicates a result of the operation and lease details, if found. It has one of the following values: 0 (success), 1 (error) or 2 (empty).</para>
</section>
<!-- end of lease4-get -->
<!-- start of lease4-get-all -->
<section xml:id="reference-lease4-get-all">
<title>lease4-get-all reference</title>
<para xml:id="ref-lease4-get-all"><command>lease4-get-all</command> - lease4-get-all is used to retrieve all IPv4 leases or all leases for the specified set of subnets.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.4.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease4-get-all"/></para>
<para>Command syntax:
<screen>{
"command": "lease4-get-all"
2018-10-16 17:49:50 +02:00
"arguments": "subnets"
2018-10-05 18:33:30 +02:00
}</screen>
The lease4-get-all command may result in very large responses.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease4-get-all -->
<!-- start of lease4-update -->
<section xml:id="reference-lease4-update">
<title>lease4-update reference</title>
<para xml:id="ref-lease4-update"><command>lease4-update</command> - The lease4-update command can be used to update existing leases.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease4-update"/></para>
<para>Command syntax:
<screen>{
"command": "lease4-update",
"arguments": {
"ip-address": "192.0.2.1",
"hostname": "newhostname.example.org",
"hw-address": "1a:1b:1c:1d:1e:1f",
"subnet-id": 44,
"force-create": true
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease4-update -->
<!-- start of lease4-wipe -->
<section xml:id="reference-lease4-wipe">
<title>lease4-wipe reference</title>
<para xml:id="ref-lease4-wipe"><command>lease4-wipe</command> - lease4-wipe is designed to remove all leases associated with a given subnet.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease4-wipe"/></para>
<para>Command syntax:
<screen>{
"command": "lease4-wipe",
"arguments": {
"subnet-id": 44
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease4-wipe -->
<!-- start of lease6-add -->
<section xml:id="reference-lease6-add">
<title>lease6-add reference</title>
2018-10-16 17:49:50 +02:00
<para xml:id="ref-lease6-add"><command>lease6-add</command> - The lease6-add command creates a new lease administratively.</para>
2018-10-05 18:33:30 +02:00
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease6-add"/></para>
<para>Command syntax:
<screen>{
"command": "lease6-add",
"arguments": {
"subnet-id": 66,
"ip-address": "2001:db8::3",
"duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24",
"iaid": 1234
}
}</screen>
lease6-add can be also used to add leases for IPv6 prefixes..</para>
<para>Response syntax:
<screen>{ "result": 0, "text": "Lease added." }
{ "result": 1, "text": "missing parameter 'ip-address' (&lt;string&gt;:3:19)" }</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease6-add -->
<!-- start of lease6-del -->
<section xml:id="reference-lease6-del">
<title>lease6-del reference</title>
<para xml:id="ref-lease6-del"><command>lease6-del</command> - lease6-del can be used to delete a lease from the lease database.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease6-del"/></para>
<para>Command syntax:
<screen>{
2018-10-16 17:49:50 +02:00
"command": "lease6-del",
2018-10-05 18:33:30 +02:00
"arguments": {
"ip-address": "192.0.2.202"
}
}</screen>
lease6-del returns a result that indicates a outcome of the operation. It has one of the following values: 0 (success), 1 (error) or 3 (empty).</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease6-del -->
<!-- start of lease6-get -->
<section xml:id="reference-lease6-get">
<title>lease6-get reference</title>
<para xml:id="ref-lease6-get"><command>lease6-get</command> - lease6-get can be used to query the lease database and retrieve existing leases.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease6-get"/></para>
<para>Command syntax:
<screen>{
"command": "lease6-get",
"arguments": {
"ip-address": "2001:db8:1234:ab::",
"type": "IA_PD"
}
}</screen>
lease6-get returns a result that indicates a result of the operation and lease details, if found. It has one of the following values: 0 (success), 1 (error) or 2 (empty).</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease6-get -->
<!-- start of lease6-get-all -->
<section xml:id="reference-lease6-get-all">
<title>lease6-get-all reference</title>
<para xml:id="ref-lease6-get-all"><command>lease6-get-all</command> - lease6-get-all is used to retrieve all IPv6 leases or all leases for the specified set of subnets.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease6-get-all"/></para>
<para>Command syntax:
<screen>{
"command": "lease6-get-all",
"arguments": {
"subnets": [ 1, 2, 3, 4 ]
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"arguments": {
"leases": [
{
"cltt": 12345678,
"duid": "42:42:42:42:42:42:42:42",
"fqdn-fwd": false,
"fqdn-rev": true,
"hostname": "myhost.example.com.",
"hw-address": "08:08:08:08:08:08",
"iaid": 1,
"ip-address": "2001:db8:2::1",
"preferred-lft": 500,
"state": 0,
"subnet-id": 44,
"type": "IA_NA",
"valid-lft": 3600
},
{
"cltt": 12345678,
"duid": "21:21:21:21:21:21:21:21",
"fqdn-fwd": false,
"fqdn-rev": true,
"hostname": "",
"iaid": 1,
"ip-address": "2001:db8:0:0:2::",
"preferred-lft": 500,
"prefix-len": 80,
"state": 0,
"subnet-id": 44,
"type": "IA_PD",
"valid-lft": 3600
}
]
},
"result": 0,
"text": "2 IPv6 lease(s) found."
}</screen>
The lease6-get-all command may result in very large responses.</para>
</section>
<!-- end of lease6-get-all -->
<!-- start of lease6-update -->
<section xml:id="reference-lease6-update">
<title>lease6-update reference</title>
<para xml:id="ref-lease6-update"><command>lease6-update</command> - The lease6-update command can be used to update existing leases.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease6-update"/></para>
<para>Command syntax:
<screen>{
"command": "lease6-update",
"arguments": {
"ip-address": "2001:db8::1",
"duid": "88:88:88:88:88:88:88:88",
"iaid": 7654321,
"hostname": "newhostname.example.org",
"subnet-id": 66,
"force-create": false
}
}
</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease6-update -->
<!-- start of lease6-wipe -->
<section xml:id="reference-lease6-wipe">
<title>lease6-wipe reference</title>
<para xml:id="ref-lease6-wipe"><command>lease6-wipe</command> - lease6-wipe is designed to remove all leases associated with a given subnet.</para>
2019-10-29 18:35:31 +01:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-lease_cmds-lib">lease_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-lease6-wipe"/></para>
<para>Command syntax:
<screen>{
"command": "lease6-wipe",
"arguments": {
"subnet-id": 66
}
}</screen>
Note: not all backends support this command.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of lease6-wipe -->
<!-- start of leases-reclaim -->
<section xml:id="reference-leases-reclaim">
<title>leases-reclaim reference</title>
<para xml:id="ref-leases-reclaim"><command>leases-reclaim</command> - The leases-reclaim command instructs the server to reclaim all expired leases immediately.</para>
2019-10-29 18:35:31 +01:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-leases-reclaim"/></para>
<para>Command syntax:
<screen>{
"command": "leases-reclaim",
"arguments": {
"remove": true
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of leases-reclaim -->
<!-- start of libreload -->
<section xml:id="reference-libreload">
<title>libreload reference</title>
<para xml:id="ref-libreload"><command>libreload</command> - The libreload command will first unload and then load all currently loaded hook libraries.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-libreload"/></para>
<para>Command syntax:
<screen>{
"command": "libreload",
"arguments": { }
}</screen>
The server will respond with a result of 0 indicating success, or 1 indicating a failure.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of libreload -->
<!-- start of list-commands -->
<section xml:id="reference-list-commands">
<title>list-commands reference</title>
<para xml:id="ref-list-commands"><command>list-commands</command> - The list-commands command retrieves a list of all commands supported by the server.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-list-commands"/></para>
<para>Command syntax:
<screen>{
"command": "list-commands",
"arguments": { }
}</screen>
The server will respond with a list of all supported commands.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of list-commands -->
<!-- start of network4-add -->
<section xml:id="reference-network4-add">
<title>network4-add reference</title>
<para xml:id="ref-network4-add"><command>network4-add</command> - The network4-add command is used to add a new shared network.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network4-add"/></para>
<para>Command syntax:
<screen>{
"command": "network4-add",
"arguments": {
"shared-networks": [ {
"name": "floor13",
"subnet4": [
{
"id": 100,
"pools": [ { "pool": "192.0.2.2-192.0.2.99" } ],
"subnet": "192.0.2.0/24",
"option-data": [
{
"name": "routers",
"data": "192.0.2.1"
}
]
},
{
"id": 101,
"pools": [ { "pool": "192.0.3.2-192.0.3.99" } ],
"subnet": "192.0.3.0/24",
"option-data": [
{
"name": "routers",
"data": "192.0.3.1"
}
]
} ]
} ]
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"arguments": {
"shared-networks": [ { "name": "floor13" } ]
},
"result": 0,
"text": "A new IPv4 shared network 'floor13' added"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network4-add -->
<!-- start of network4-del -->
<section xml:id="reference-network4-del">
<title>network4-del reference</title>
<para xml:id="ref-network4-del"><command>network4-del</command> - The network4-del command is used to delete existing shared networks.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network4-del"/></para>
<para>Command syntax:
<screen>{
"command": "network4-del",
"arguments": {
"name": "floor13"
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"arguments": {
"shared-networks": [
{
"name": "floor13"
}
]
},
"result": 0,
"text": "IPv4 shared network 'floor13' deleted"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network4-del -->
<!-- start of network4-get -->
<section xml:id="reference-network4-get">
<title>network4-get reference</title>
<para xml:id="ref-network4-get"><command>network4-get</command> - The network4-get command is used to retrieve detailed information about shared networks, including subnets currently being part of a given network.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network4-get"/></para>
<para>Command syntax:
<screen>{
"command": "network4-get",
"arguments": {
"name": "floor13"
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "Info about IPv4 shared network 'floor13' returned",
"arguments": {
"shared-networks": [
{
"match-client-id": true,
"name": "floor13",
"option-data": [ ],
"rebind-timer": 90,
"relay": {
"ip-address": "0.0.0.0"
},
"renew-timer": 60,
"reservation-mode": "all",
"subnet4": [
{
"subnet": "192.0.2.0/24",
"id": 5,
// many other subnet specific details here
},
{
"id": 6,
"subnet": "192.0.3.0/31",
// many other subnet specific details here
}
],
"valid-lifetime": 120
}
]
}
}</screen>
Note that the actual response contains many additional fields that are omitted here for clarity.</para>
</section>
<!-- end of network4-get -->
<!-- start of network4-list -->
<section xml:id="reference-network4-list">
<title>network4-list reference</title>
<para xml:id="ref-network4-list"><command>network4-list</command> - The network4-list command is used to retrieve full list of currently configured shared networks.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network4-list"/></para>
<para>Command syntax:
<screen>{
"command": "network4-list"
}</screen>
</para>
<para>Response syntax:
<screen>{
"arguments": {
"shared-networks": [
{ "name": "floor1" },
{ "name": "office" }
]
},
"result": 0,
"text": "2 IPv4 network(s) found"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network4-list -->
<!-- start of network4-subnet-add -->
<section xml:id="reference-network4-subnet-add">
<title>network4-subnet-add reference</title>
<para xml:id="ref-network4-subnet-add"><command>network4-subnet-add</command> - The network4-subnet-add command is used to add existing subnets to existing shared networks.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network4-subnet-add"/></para>
<para>Command syntax:
<screen>{
"command": "network4-subnet-add",
"arguments": {
"name": "floor13",
"id": 5
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv4 subnet 10.0.0.0/8 (id 5) is now part of shared network 'floor1'"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network4-subnet-add -->
<!-- start of network4-subnet-del -->
<section xml:id="reference-network4-subnet-del">
<title>network4-subnet-del reference</title>
<para xml:id="ref-network4-subnet-del"><command>network4-subnet-del</command> - The network4-subnet-del command is used to remove a subnet that is part of an existing shared network and demote it to a plain, stand-alone subnet.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network4-subnet-del"/></para>
<para>Command syntax:
<screen>{
"command": "network4-subnet-del",
"arguments": {
"name": "floor13",
"id": 5
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv4 subnet 10.0.0.0/8 (id 5) is now removed from shared network 'floor13'"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network4-subnet-del -->
<!-- start of network6-add -->
<section xml:id="reference-network6-add">
<title>network6-add reference</title>
<para xml:id="ref-network6-add"><command>network6-add</command> - The network6-add command is used to add a new shared network.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network6-add"/></para>
<para>Command syntax:
<screen>{
"command": "network4-add",
"arguments": {
"shared-networks": [ {
"name": "floor13",
"subnet4": [
{
"id": 100,
"pools": [ { "pool": "192.0.2.2-192.0.2.99" } ],
"subnet": "192.0.2.0/24",
"option-data": [
{
"name": "routers",
"data": "192.0.2.1"
}
]
},
{
"id": 101,
"pools": [ { "pool": "192.0.3.2-192.0.3.99" } ],
"subnet": "192.0.3.0/24",
"option-data": [
{
"name": "routers",
"data": "192.0.3.1"
}
]
} ]
} ]
}
}</screen>
The network6-add uses the same syntax for both the query and the response. However, there are some parameters that are IPv4-only (e.g. match-client-id) and some are IPv6-only (e.g. interface-id).</para>
<para>Response syntax:
<screen>{
"arguments": {
"shared-networks": [ { "name": "floor13" } ]
},
"result": 0,
"text": "A new IPv4 shared network 'floor13' added"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network6-add -->
<!-- start of network6-del -->
<section xml:id="reference-network6-del">
<title>network6-del reference</title>
<para xml:id="ref-network6-del"><command>network6-del</command> - The network6-del command is used to delete existing shared networks.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network6-del"/></para>
<para>Command syntax:
<screen>{
"command": "network4-del",
"arguments": {
"name": "floor13"
}
}</screen>
The network6-del command uses exactly the same syntax for
both the command and the response.</para>
<para>Response syntax:
<screen>{
"command": "network4-del",
"arguments": {
"name": "floor13",
"subnets-action": "delete"
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network6-del -->
<!-- start of network6-get -->
<section xml:id="reference-network6-get">
<title>network6-get reference</title>
<para xml:id="ref-network6-get"><command>network6-get</command> - The network6-get command is used to retrieve detailed information about shared networks, including subnets currently being part of a given network.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network6-get"/></para>
<para>Command syntax:
<screen>{
"command": "network4-get",
"arguments": {
"name": "floor13"
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "Info about IPv4 shared network 'floor13' returned",
"arguments": {
"shared-networks": [
{
"match-client-id": true,
"name": "floor13",
"option-data": [ ],
"rebind-timer": 90,
"relay": {
"ip-address": "0.0.0.0"
},
"renew-timer": 60,
"reservation-mode": "all",
"subnet4": [
{
"subnet": "192.0.2.0/24",
"id": 5,
// many other subnet specific details here
},
{
"id": 6,
"subnet": "192.0.3.0/31",
// many other subnet specific details here
}
],
"valid-lifetime": 120
}
]
}
}</screen>
Note that the actual response contains many additional fields that are omitted here for clarity.</para>
</section>
<!-- end of network6-get -->
<!-- start of network6-list -->
<section xml:id="reference-network6-list">
<title>network6-list reference</title>
<para xml:id="ref-network6-list"><command>network6-list</command> - The network6-list command is used to retrieve full list of currently configured shared networks.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network6-list"/></para>
<para>Command syntax:
<screen>{
"command": "network4-list"
}</screen>
network6-list follows exactly the same syntax for both the query and the response.</para>
<para>Response syntax:
<screen>{
"arguments": {
"shared-networks": [
{ "name": "floor1" },
{ "name": "office" }
]
},
"result": 0,
"text": "2 IPv4 network(s) found"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network6-list -->
<!-- start of network6-subnet-add -->
<section xml:id="reference-network6-subnet-add">
<title>network6-subnet-add reference</title>
<para xml:id="ref-network6-subnet-add"><command>network6-subnet-add</command> - The network6-subnet-add command is used to add existing subnets to existing shared networks.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network6-subnet-add"/></para>
<para>Command syntax:
<screen>{
"command": "network4-subnet-add",
"arguments": {
"name": "floor13",
"id": 5
}
}</screen>
The network6-subnet-add command uses exactly the same syntax for both the command and the response.</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv4 subnet 10.0.0.0/8 (id 5) is now part of shared network 'floor1'"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network6-subnet-add -->
<!-- start of network6-subnet-del -->
<section xml:id="reference-network6-subnet-del">
<title>network6-subnet-del reference</title>
<para xml:id="ref-network6-subnet-del"><command>network6-subnet-del</command> - The network6-subnet-del command is used to remove a subnet that is part of existing shared network and demote it to a plain, stand-alone subnet.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-network6-subnet-del"/></para>
<para>Command syntax:
<screen>{
"command": "network4-subnet-del",
"arguments": {
"name": "floor13",
"id": 5
}
}</screen>
The network6-subnet-del command uses exactly the same syntax for both the command and the response.</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv4 subnet 10.0.0.0/8 (id 5) is now removed from shared network 'floor13'"
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of network6-subnet-del -->
<!-- start of reservation-add -->
<section xml:id="reference-reservation-add">
<title>reservation-add reference</title>
<para xml:id="ref-reservation-add"><command>reservation-add</command> - adds a new host reservation. The reservation may include IPv4 address,
IPv6 addresses, IPv6 prefixes, various identifiers, a class
the client will be assigned to, DHCPv4 and DHCPv6 options and
more.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.2.0 (<link linkend="commands-host_cmds-lib">host_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-reservation-add"/></para>
<para>Command syntax:
<screen>{
"command": "reservation-add",
"arguments": {
"reservation": {
"boot-file-name": &lt;string&gt;,
"comment": &lt;string&gt;
"client-id": &lt;string&gt;,
"circuit-id": &lt;string&gt;,
"duid": &lt;string&gt;,
"flex-id": &lt;string&gt;,
"ip-address": &lt;string (IPv4 address)&gt;,
"ip-addresses": [ &lt;comma separated strings&gt; ],
"hw-address": &lt;string&gt;,
"hostname": &lt;string&gt;,
"next-server": &lt;string (IPv4 address)&gt;,
"option-data-list": [ &lt;comma separated structures defining options&gt; ],
"prefixes": [ &lt;comma separated IPv6 prefixes&gt; ],
"reservation-client-classes": [ &lt;comma separated strings&gt; ],
"server-hostname": &lt;string&gt;,
"subnet-id": &lt;integer&gt;,
"user-context": &lt;any valid JSON&gt;,
}
}
}</screen>
Note the ip-address, client-id, next-server, server-hostname and
boot-file-name are IPv4 specific. duid, ip-addresses and prefixes are
IPv6 specific.</para>
<para>Response syntax:
<screen>
{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)
</para></listitem>
</itemizedlist></para>
</section>
<!-- end of reservation-add -->
<!-- start of reservation-del -->
<section xml:id="reference-reservation-del">
<title>reservation-del reference</title>
<para xml:id="ref-reservation-del"><command>reservation-del</command> - Deletes an existing host reservation.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.2.0 (<link linkend="commands-host_cmds-lib">host_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-reservation-del"/></para>
<para>Command syntax:
<screen>{
"command": "reservation-del",
"arguments": {
"subnet-id": &lt;integer&gt;,
"ip-address": &lt;string&gt;,
"identifier-type": &lt;one of "hw-address", "duid", "circuit-id", "client-id" and "flex-id"&gt;,
"identifier": &lt;string&gt;
}
}</screen>
The host reservation can be identified by either (subnet-id, ip-address) pair or a triplet of (subnet-id, identifier-type, identifier).</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of reservation-del -->
<!-- start of reservation-get -->
<section xml:id="reference-reservation-get">
<title>reservation-get reference</title>
2019-10-29 18:35:31 +01:00
<para xml:id="ref-reservation-get"><command>reservation-get</command> - Attempts to retrieve an existing host reservation</para>
2018-10-05 18:33:30 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.2.0 (<link linkend="commands-host_cmds-lib">host_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-reservation-get"/></para>
<para>Command syntax:
<screen>{
"command": "reservation-get",
"arguments": {
"subnet-id": &lt;integer&gt;,
"identifier-type": &lt;string with one value out of: hw-address|duid|circuit-id|client-id|flex-id&gt;,
"identifier": &lt;string&gt;;
}
}</screen>
The host reservation can be identified by either (subnet-id, ip-address) pair or a triplet of (subnet-id, identifier-type, identifier).</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;,
"arguments": {
"boot-file-name": &lt;string&gt;,
"comment": &lt;string&gt;
"client-id": &lt;string&gt;,
"circuit-id": &lt;string&gt;,
"duid": &lt;string&gt;,
"flex-id": &lt;string&gt;,
"ip-address": &lt;string (IPv4 address)&gt;,
"ip-addresses": [ &lt;comma separated strings&gt; ],
"hw-address": &lt;string&gt;,
"hostname": &lt;string&gt;,
"next-server": &lt;string (IPv4 address)&gt;,
"option-data-list": [ &lt;comma separated structures defining options&gt; ],
"prefixes": [ &lt;comma separated IPv6 prefixes&gt; ],
"reservation-client-classes": [ &lt;comma separated strings&gt; ],
"server-hostname": &lt;string&gt;,
"subnet-id": &lt;integer&gt;,
"user-context": &lt;any valid JSON&gt;,
}
}</screen>
Arguments object appear only if a host is found. Many fields in the arguments
object appear only if specific field is set.</para>
</section>
<!-- end of reservation-get -->
<!-- start of shutdown -->
<section xml:id="reference-shutdown">
<title>shutdown reference</title>
<para xml:id="ref-shutdown"><command>shutdown</command> - The shutdown command instructs the server to initiate its shutdown procedure.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-shutdown"/></para>
<para>Command syntax:
<screen>{
"command": "shutdown"
}</screen>
The server will respond with a confirmation that the shutdown
procedure has been initiated.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of shutdown -->
<!-- start of stat-lease4-get -->
<section xml:id="reference-stat-lease4-get">
<title>stat-lease4-get reference</title>
<para xml:id="ref-stat-lease4-get"><command>stat-lease4-get</command> - The stat-lease4-get command fetches lease statistics for a range
of known IPv4 subnets.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.4.0 (<link linkend="commands-stat_cmds-lib">stat_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-stat-lease4-get"/></para>
<para>Command syntax:
<screen>{
"command": "stat-lease4-get"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "stat-lease4-get: 2 rows found",
"arguments": {
"result-set": {
"columns": [ "subnet-id",
"total-addresses",
"assigned-addresses",
"declined-addresses" ]
"rows": [
[ 10, 256, 111, 0 ],
[ 20, 4098, 2034, 4 ]
],
"timestamp": "2018-05-04 15:03:37.000000"
}
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of stat-lease4-get -->
<!-- start of stat-lease6-get -->
<section xml:id="reference-stat-lease6-get">
<title>stat-lease6-get reference</title>
<para xml:id="ref-stat-lease6-get"><command>stat-lease6-get</command> - The stat-lease6-get command fetches lease statistics for a range
of known IPv6 subnets.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.4.0 (<link linkend="commands-stat_cmds-lib">stat_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-stat-lease6-get"/></para>
<para>Command syntax:
<screen>{
"command": "stat-lease6-get",
"arguments": {
"subnet-id" : 10
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "stat-lease6-get: 2 rows found",
"arguments": {
"result-set": {
"columns": [ "subnet-id", "total-nas", "assigned-nas", "declined-nas", "total-pds", "assigned-pds" ]
"rows": [
[ 10, 4096, 2400, 3, 0, 0],
[ 20, 0, 0, 0, 1048, 233 ]
[ 30, 256, 60, 0, 1048, 15 ]
],
"timestamp": "2018-05-04 15:03:37.000000"
}
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of stat-lease6-get -->
<!-- start of statistic-get -->
<section xml:id="reference-statistic-get">
<title>statistic-get reference</title>
<para xml:id="ref-statistic-get"><command>statistic-get</command> - The statistic-get command retrieves a single statistic. It takes a single string parameter called name that specifies the statistic name.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-statistic-get"/></para>
<para>Command syntax:
<screen>{
"command": "statistic-get",
"arguments": {
"name": "pkt4-received"
}
}</screen>
The server will respond with details of the requested statistic, with a result set to 0 indicating success and the specified statistic as the value of the "arguments" parameter.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of statistic-get -->
<!-- start of statistic-get-all -->
<section xml:id="reference-statistic-get-all">
<title>statistic-get-all reference</title>
<para xml:id="ref-statistic-get-all"><command>statistic-get-all</command> - The statistic-get-all command retrieves all statistics recorded.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-statistic-get-all"/></para>
<para>Command syntax:
<screen>{
"command": "statistic-get-all",
"arguments": { }
}</screen>
The server will respond with details of all recorded statistics, with result set to 0 indicating that it iterated over all statistics (even when the total number of statistics is zero).</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of statistic-get-all -->
<!-- start of statistic-remove -->
<section xml:id="reference-statistic-remove">
<title>statistic-remove reference</title>
<para xml:id="ref-statistic-remove"><command>statistic-remove</command> - The statistic-remove command attempts to delete a single statistic. It takes a single string parameter called name that specifies the statistic name.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-statistic-remove"/></para>
<para>Command syntax:
<screen>{
"command": "statistic-remove",
"arguments": {
"name": "pkt4-received"
}
}</screen>
If the specific statistic is found and its removal was successful, the server will respond with a status of 0, indicating success and an empty parameters field. If an error is encountered (e.g. requested statistic was not found), the server will return a status code of 1 (error) and the text field will contain the error description.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of statistic-remove -->
<!-- start of statistic-remove-all -->
<section xml:id="reference-statistic-remove-all">
<title>statistic-remove-all reference</title>
<para xml:id="ref-statistic-remove-all"><command>statistic-remove-all</command> - The statistic-remove-all command attempts to delete all statistics.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-statistic-remove-all"/></para>
<para>Command syntax:
<screen>{
"command": "statistic-remove-all",
"arguments": { }
}</screen>
If the removal of all statistics was successful, the server will respond with a status of 0, indicating success and an empty parameters field. If an error is encountered, the server will return a status code of 1 (error) and the text field will contain the error description.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of statistic-remove-all -->
<!-- start of statistic-reset -->
<section xml:id="reference-statistic-reset">
<title>statistic-reset reference</title>
<para xml:id="ref-statistic-reset"><command>statistic-reset</command> - The statistic-reset command sets the specified statistic to its neutral value: 0 for integer, 0.0 for float, 0h0m0s0us for time duration and "" for string type. It takes a single string parameter called name that specifies the statistic name.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-statistic-reset"/></para>
<para>Command syntax:
<screen>{
"command": "statistic-reset",
"arguments": {
"name": "pkt4-received"
}
}</screen>
If the specific statistic is found and reset was successful, the server will respond with a status of 0, indicating success and an empty parameters field. If an error is encountered (e.g. requested statistic was not found), the server will return a status code of 1 (error) and the text field will contain the error description.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of statistic-reset -->
<!-- start of statistic-reset-all -->
<section xml:id="reference-statistic-reset-all">
<title>statistic-reset-all reference</title>
<para xml:id="ref-statistic-reset-all"><command>statistic-reset-all</command> - The statistic-reset command sets all statistics to their neutral values: 0 for integer, 0.0 for float, 0h0m0s0us for time duration and "" for string type.</para>
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
<para>Availability: 1.0.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-statistic-reset-all"/></para>
<para>Command syntax:
<screen>{
"command": "statistic-reset-all",
"arguments": { }
}</screen>
If the operation is successful, the server will respond with a status of 0, indicating success and an empty parameters field. If an error is encountered, the server will return a status code of 1 (error) and the text field will contain the error description.</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of statistic-reset-all -->
<!-- start of subnet4-add -->
<section xml:id="reference-subnet4-add">
<title>subnet4-add reference</title>
<para xml:id="ref-subnet4-add"><command>subnet4-add</command> - This command is used to create and add a new subnet to the existing server configuration.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet4-add"/></para>
<para>Command syntax:
<screen>{
"command": "subnet4-add",
"arguments": {
"subnets": [ {
"id": 123,
"subnet": "10.20.30.0/24",
...
} ]
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv4 subnet added",
"arguments": {
"subnets": [
{
"id": 123,
"subnet": "10.20.30.0/24"
}
]
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of subnet4-add -->
<!-- start of subnet4-del -->
<section xml:id="reference-subnet4-del">
<title>subnet4-del reference</title>
<para xml:id="ref-subnet4-del"><command>subnet4-del</command> - This command is used to remove a subnet from the server's configuration. This command has no effect on other configured subnets but removing a subnet has certain implications which the server's administrator should be aware of.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet4-del"/></para>
<para>Command syntax:
<screen>{
"command": "subnet4-del",
"arguments": {
"id": 123
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv4 subnet 192.0.2.0/24 (id 123) deleted",
"arguments": {
"subnets": [
{
"id": 123,
"subnet": "192.0.2.0/24"
}
]
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of subnet4-del -->
<!-- start of subnet4-get -->
<section xml:id="reference-subnet4-get">
<title>subnet4-get reference</title>
<para xml:id="ref-subnet4-get"><command>subnet4-get</command> - This command is used to retrieve detailed information about the specified subnet. This command usually follows the subnet4-list, which is used to discover available subnets with their respective subnet identifiers and prefixes.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet4-get"/></para>
<para>Command syntax:
<screen>{
"command": "subnet4-get",
"arguments": {
"id": 10
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "Info about IPv4 subnet 10.0.0.0/8 (id 10) returned",
"arguments": {
"subnets": [
{
"subnet": "10.0.0.0/8",
"id": 1,
"option-data": [
....
]
...
}
]
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of subnet4-get -->
<!-- start of subnet4-list -->
<section xml:id="reference-subnet4-list">
<title>subnet4-list reference</title>
<para xml:id="ref-subnet4-list"><command>subnet4-list</command> - This command is used to list all currently configured subnets. The subnets are returned in a brief form, i.e. a subnet identifier and subnet prefix is included for each subnet.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet4-list"/></para>
<para>Command syntax:
<screen>{
"command": "subnet4-list"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "2 IPv4 subnets found",
"arguments": {
"subnets": [
{
"id": 10,
"subnet": "10.0.0.0/8"
},
{
"id": 100,
"subnet": "192.0.2.0/24"
}
]
}</screen>
If no IPv4 subnets are found, an error code is returned along with the error description.</para>
</section>
<!-- end of subnet4-list -->
<!-- start of subnet6-add -->
<section xml:id="reference-subnet6-add">
<title>subnet6-add reference</title>
<para xml:id="ref-subnet6-add"><command>subnet6-add</command> - This command is used to create and add new subnet to the existing server configuration. This operation has no impact on other subnets.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet6-add"/></para>
<para>Command syntax:
<screen>{
"command": "subnet6-add",
"arguments": {
"subnet6": [ {
"id": 234,
"subnet": "2001:db8:1::/64",
...
} ]
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv6 subnet added",
"arguments": {
"subnet6": [
{
"id": 234,
"subnet": "2001:db8:1::/64"
}
]
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of subnet6-add -->
<!-- start of subnet6-del -->
<section xml:id="reference-subnet6-del">
<title>subnet6-del reference</title>
<para xml:id="ref-subnet6-del"><command>subnet6-del</command> - This command is used to remove a subnet from the server's configuration. This command has no effect on other configured subnets but removing a subnet has certain implications which the server's administrator should be aware of.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet6-del"/></para>
<para>Command syntax:
<screen>{
"command": "subnet6-del",
"arguments": {
"id": 234
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "IPv6 subnet 2001:db8:1::/64 (id 234) deleted",
"subnets": [
{
"id": 234,
"subnet": "2001:db8:1::/64"
}
]
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of subnet6-del -->
<!-- start of subnet6-get -->
<section xml:id="reference-subnet6-get">
<title>subnet6-get reference</title>
<para xml:id="ref-subnet6-get"><command>subnet6-get</command> - This command is used to retrieve detailed information about the specified subnet. This command usually follows the subnet6-list, which is used to discover available subnets with their respective subnet identifiers and prefixes.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet6-get"/></para>
<para>Command syntax:
<screen>{
"command": "subnet6-get",
"arguments": {
"id": 11
}
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "Info about IPv6 subnet 2001:db8:1::/64 (id 11) returned",
"arguments": {
"subnets": [
{
"subnet": "2001:db8:1::/64",
"id": 1,
"option-data": [
...
]
....
}
]
}
}</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of subnet6-get -->
<!-- start of subnet6-list -->
<section xml:id="reference-subnet6-list">
<title>subnet6-list reference</title>
<para xml:id="ref-subnet6-list"><command>subnet6-list</command> - This command is used to list all currently configured subnets. The subnets are returned in a brief form, i.e. a subnet identifier and subnet prefix is included for each subnet.</para>
2018-10-16 17:49:50 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command></para>
2018-10-05 18:33:30 +02:00
<para>Availability: 1.3.0 (<link linkend="commands-subnet_cmds-lib">subnet_cmds</link> hook)</para>
<para>Description and examples: See <xref linkend="command-subnet6-list"/></para>
<para>Command syntax:
<screen>{
"command": "subnet6-list"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": 0,
"text": "2 IPv6 subnets found",
"arguments": {
"subnets": [
{
"id": 11,
"subnet": "2001:db8:1::/64"
},
{
"id": 233,
"subnet": "3000::/16"
}
]
}</screen>
If no IPv6 subnets are found, an error code is returned along with the error description.</para>
</section>
<!-- end of subnet6-list -->
<!-- start of version-get -->
<section xml:id="reference-version-get">
<title>version-get reference</title>
<para xml:id="ref-version-get"><command>version-get</command> - The version-get command returns extended information about
Kea version. The returned string is the same as if Kea would
be run with -V command line option.</para>
2018-10-05 18:33:30 +02:00
<para>Supported by: <command><link linkend="commands-kea-dhcp4">kea-dhcp4</link></command>, <command><link linkend="commands-kea-dhcp6">kea-dhcp6</link></command>, <command><link linkend="commands-kea-ctrl-agent">kea-ctrl-agent</link></command></para>
<para>Availability: 1.2.0 (built-in)</para>
<para>Description and examples: See <xref linkend="command-version-get"/></para>
<para>Command syntax:
<screen>{
"command": "version-get"
}</screen>
</para>
<para>Response syntax:
<screen>{
"result": &lt;integer&gt;,
"text": &lt;string&gt;
}
</screen>
Result is an integer representation of the status. Currently supported statuses are:
<itemizedlist>
<listitem><para>0 - success</para></listitem>
<listitem><para>1 - error</para></listitem>
<listitem><para>2 - unsupported</para></listitem>
<listitem><para>3 - empty (command was completed successfully, but no data was affected or returned)</para></listitem>
</itemizedlist>
</para>
</section>
<!-- end of version-get -->
</appendix>