# API Reference

Kea currently supports 71 commands: `build-report` , `cache-clear` , `cache-get` , `cache-insert` , `cache-load` , `cache-remove` , `cache-write` , `class-add` , `class-del` , `class-get` , `class-list` , `class-update` , `config-get` , `config-reload` , `config-set` , `config-test` , `config-write` , `dhcp-disable` , `dhcp-enable` , `ha-continue` , `ha-heartbeat` , `ha-scopes` , `ha-sync` , `lease4-add` , `lease4-del` , `lease4-get` , `lease4-get-all` , `lease4-update` , `lease4-wipe` , `lease6-add` , `lease6-del` , `lease6-get` , `lease6-get-all` , `lease6-update` , `lease6-wipe` , `leases-reclaim` , `libreload` , `list-commands` , `network4-add` , `network4-del` , `network4-get` , `network4-list` , `network4-subnet-add` , `network4-subnet-del` , `network6-add` , `network6-del` , `network6-get` , `network6-list` , `network6-subnet-add` , `network6-subnet-del` , `reservation-add` , `reservation-del` , `reservation-get` , `reservation-get-all` , `reservation-get-page` , `shutdown` , `stat-lease4-get` , `stat-lease6-get` , `statistic-get` , `statistic-get-all` , `statistic-remove` , `statistic-remove-all` , `statistic-reset` , `statistic-reset-all` , `subnet4-add` , `subnet4-del` , `subnet4-get` , `subnet4-list` , `subnet6-add` , `subnet6-del` , `subnet6-get` , `subnet6-list` , `version-get` .

Commands supported by kea-ctrl-agent daemon: `build-report` , `config-get` , `config-reload` , `config-set` , `config-test` , `config-write` , `list-commands` , `shutdown` , `version-get` .

Commands supported by kea-dhcp-ddns daemon: `build-report` , `config-get` , `config-reload` , `config-set` , `config-test` , `config-write` , `list-commands` , `shutdown` , `version-get` .

Commands supported by kea-dhcp4 daemon: `build-report` , `cache-clear` , `cache-get` , `cache-insert` , `cache-load` , `cache-remove` , `cache-write` , `class-add` , `class-del` , `class-get` , `class-list` , `class-update` , `config-get` , `config-reload` , `config-set` , `config-test` , `config-write` , `dhcp-disable` , `dhcp-enable` , `ha-continue` , `ha-heartbeat` , `ha-scopes` , `ha-sync` , `lease4-add` , `lease4-del` , `lease4-get` , `lease4-get-all` , `lease4-update` , `lease4-wipe` , `leases-reclaim` , `libreload` , `list-commands` , `network4-add` , `network4-del` , `network4-get` , `network4-list` , `network4-subnet-add` , `network4-subnet-del` , `reservation-add` , `reservation-del` , `reservation-get` , `reservation-get-all` , `reservation-get-page` , `shutdown` , `stat-lease4-get` , `statistic-get` , `statistic-get-all` , `statistic-remove` , `statistic-remove-all` , `statistic-reset` , `statistic-reset-all` , `subnet4-add` , `subnet4-del` , `subnet4-get` , `subnet4-list` , `version-get` .

Commands supported by kea-dhcp6 daemon: `build-report` , `cache-clear` , `cache-get` , `cache-insert` , `cache-load` , `cache-remove` , `cache-write` , `class-add` , `class-del` , `class-get` , `class-list` , `class-update` , `config-get` , `config-reload` , `config-set` , `config-test` , `config-write` , `dhcp-disable` , `dhcp-enable` , `ha-continue` , `ha-heartbeat` , `ha-scopes` , `ha-sync` , `lease6-add` , `lease6-del` , `lease6-get` , `lease6-get-all` , `lease6-update` , `lease6-wipe` , `leases-reclaim` , `libreload` , `list-commands` , `network6-add` , `network6-del` , `network6-get` , `network6-list` , `network6-subnet-add` , `network6-subnet-del` , `reservation-add` , `reservation-del` , `reservation-get` , `reservation-get-all` , `reservation-get-page` , `shutdown` , `stat-lease6-get` , `statistic-get` , `statistic-get-all` , `statistic-remove` , `statistic-remove-all` , `statistic-reset` , `statistic-reset-all` , `subnet6-add` , `subnet6-del` , `subnet6-get` , `subnet6-list` , `version-get` .

Commands supported by class_cmds hook library: `class-add` , `class-del` , `class-get` , `class-list` , `class-update` .

Commands supported by high_availability hook library: `ha-continue` , `ha-heartbeat` , `ha-scopes` , `ha-sync` .

Commands supported by host_cache hook library: `cache-clear` , `cache-get` , `cache-insert` , `cache-load` , `cache-remove` , `cache-write` .

Commands supported by host_cmds hook library: `reservation-add` , `reservation-del` , `reservation-get` , `reservation-get-all` , `reservation-get-page` .

Commands supported by lease_cmds hook library: `lease4-add` , `lease4-del` , `lease4-get` , `lease4-get-all` , `lease4-update` , `lease4-wipe` , `lease6-add` , `lease6-del` , `lease6-get` , `lease6-get-all` , `lease6-update` , `lease6-wipe` .

Commands supported by stat_cmds hook library: `stat-lease4-get` , `stat-lease6-get` .

Commands supported by subnet_cmds hook library: `network4-add` , `network4-del` , `network4-get` , `network4-list` , `network4-subnet-add` , `network4-subnet-del` , `network6-add` , `network6-del` , `network6-get` , `network6-list` , `network6-subnet-add` , `network6-subnet-del` , `subnet4-add` , `subnet4-del` , `subnet4-get` , `subnet4-list` , `subnet6-add` , `subnet6-del` , `subnet6-get` , `subnet6-list` .

## build-report reference

`build-report` - Returns a list of compilation options that this particular binary was built with

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "build-report"
    }

Response syntax:

    {
        "result": 0,
        "text": <string with build details>
    }

## cache-clear reference

`cache-clear` - This command removes all cached host reservations.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (host_cache hook)

Description and examples: See

Command syntax:

    {
        "command": "cache-clear"
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## cache-get reference

`cache-get` - Returns full content of the host cache.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (host_cache hook)

Description and examples: See

Command syntax:

    {
        "command": "cache-get"
    }

Response syntax:

    {
        "result": 0
        "text": "123 entries returned."
        "arguments": <list of cashed host>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## cache-insert reference

`cache-insert` - This command may be used to manually insert a host into the cache.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (host_cache hook)

Description and examples: See

Command syntax:

    {
        "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
        }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## cache-load reference

`cache-load` - This command allows load the contents of a file on disk into an in-memory cache.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (host_cache hook)

Description and examples: See

Command syntax:

    {
        "command": "cache-load",
        "arguments": "/tmp/kea-host-cache.json"
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## cache-remove reference

`cache-remove` - The cache-remove command works similarly to reservation-get command.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (host_cache hook)

Description and examples: See

Command syntax:

    {
        "command": "cache-remove",
        "arguments": {
            "ip-address": "192.0.2.1",
            "subnet-id": 123
        }
    }

    Another example that removes IPv6 host identifier by DUID and specific subnet-id is:
    {
        "command": "cache-remove",
        "arguments": {
            "duid": "00:01:ab:cd:f0:a1:c2:d3:e4",
            "subnet-id": 123
        }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## cache-write reference

`cache-write` - Instructs Kea to write its host cache content to disk.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (host_cache hook)

Description and examples: See

Command syntax:

    {
        "command": "cache-write",
        "arguments": "/path/to/the/file.json"
    }

The command takes one mandatory argument that specifies a filename path of a file to be written.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## class-add reference

`class-add` - This command is used to create and add a new class to the existing server configuration.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.5.0 (class_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "class-add",
        "arguments": {
            "client-classes": [ {
               "name": <name of the class>,
               "test": <test expression to be evaluated on incoming packets>,
               "option-data": [ <option values here> ],
               "option-def": [ <option defintions here> ],
               "next-server": <ipv4 address>,
               "server-hostname": <string>,
               "boot-file-name": <name of the boot file>
            } ]
        }
    }

The `next-server`, `server-hostname` and `boot-file-name` are DHCPv4 specific. Only one client class can be added with a single command.

Response syntax:

    {
        "result": 0,
        "text": "Class '<class-name>' added.",
    }

The command will be successful (result 0), unless the class name is a duplicate or another error occurs (result 1).

## class-del reference

`class-del` - This command is used to remove a client class from the server configuration.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.5.0 (class_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "class-del",
        "arguments": {
            "name": <name of the class>
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "Class '<class-name>' deleted."
    }

The command will return a result of 3 (empty) if the client class doesn't exist. If the client class exists, the retured result is 0 if the deletion was successful and the result is 1 if the deletion is unsuccessful.

## class-get reference

`class-get` - This command is used to return detailed information about an existing client class.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.5.0 (class_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "class-get",
        "arguments": {
            "name": <name of the class>
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "Class '<class-name>' definition returned",
        "arguments": {
            "client-classes": [
                {
                    "name": <name of the class>,
                    "only-if-required": <only if required boolean value>,
                    "test": <test expression to be evaluated on incoming packets>,
                    "option-data": [ <option values here> ],
                    "option-def": [ <option defintions here> ],
                    "next-server": <ipv4 address>,
                    "server-hostname": <string>,
                    "boot-file-name": <name of the boot file>
                }
            ]
        }
    }

The returned information depends on the DHCP server type, i.e. some parameters are specific to DHCPv4 server. Also, some parameters may not be returned if they are not set for the client class. If the class with specified name doesn't exist a result of 3 (empty) is returned. If the client class is found, the result of 0 is returned. If there is an error while processing the command, the result of 1 is returned.

## class-list reference

`class-list` - This command is used to retrieve a list of all client classes from the server configuration.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.5.0 (class_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "class-list"
    }

This command includes no arguments.

Response syntax:

    {
        "result": 0,
        "text": "<number of> classes found",
        "arguments": {
            "client-classes": [
                {
                    "name": <first class name>
                },
                {
                    "name": <second class name>
                }
            ]
        }
    }

The returned list of classes merely contains their names. In order to retrieve full information about one of these classes use . The returned result is 3 (empty) if no classes are found. If the command is processed successfully and the list of client classes is not empty, the result of 0 is returned. If there is an error while processing the command, the result of 1 is returned.

## class-update reference

`class-update` - This command is used to update an existing client class in the server configuration.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.5.0 (class_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "class-update",
        "arguments": {
            "client-classes": [ {
               "name": <name of the class>,
               "test": <test expression to be evaluated on incoming packets>,
               "option-data": [ <option values here> ],
               "option-def": [ <option defintions here> ],
               "next-server": <ipv4 address>,
               "server-hostname": <string>,
               "boot-file-name": <name of the boot file>
            } ]
        }
    }

The `next-server`, `server-hostname` and `boot-file-name` are DHCPv4 specific. Only one client class can be updated with a single command.

Response syntax:

    {
        "result": 0,
        "text": "Class '<class-name>' updated.",
    }

The command will return the result of 3 (empty) if the client class doesn't exist. If the client class exists, the retured result is 0 if the update was successful and the result is 1 if the update is unsuccessful.

## config-get reference

`config-get` - Retrieves the current configuration used by the server. The configuration is roughtly equal to the configuration file, but includes additional changes made by other commands and due to parameters inheritance.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "config-get"
    }

This command takes no parameters.

Response syntax:

    {
        "result": <integer>,
        "arguments": {
            <JSON configuration here, starting with Dhcp4, Dhcp6, Dhcp-ddns, or Control-agent object>
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## config-reload reference

`config-reload` - The config-reload command instructs Kea to load again the configuration file that was used previously.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "config-reload"
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## config-set reference

`config-set` - The config-set command instructs the server to replace its current configuration with the new configuration supplied in the command's arguments.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "config-set",
        "arguments":  {
            "<server>": {
            },
            "Logging": {
            }
         }
    }

where <server> is the configuration element name for a given server such as "Dhcp4" or "Dhcp6"

Response syntax:

        {"result": 0, "text": "Configuration successful." }

        or

        {"result": 1, "text": "unsupported parameter: BOGUS (<string>:16:26)" }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## config-test reference

`config-test` - The config-test command instructs the server to check whether the new configuration supplied in the command's arguments can be loaded.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "config-test",
        "arguments":  {
            "<server>": {
            },
            "Logging": {
            }
         }
    }

where <server> is the configuration element name for a given server such as "Dhcp4" or "Dhcp6"

Response syntax:

    {"result": 0, "text": "Configuration seems sane..." }

        or

        {"result": 1, "text": "unsupported parameter: BOGUS (<string>:16:26)" }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## config-write reference

`config-write` - The config-write command instructs the Kea server to write its current configuration to a file on disk.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "config-write",
        "arguments": {
            "filename": "config-modified-2017-03-15.json"
        }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## dhcp-disable reference

`dhcp-disable` - The dhcp-disable command globally disables the DHCP service.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "dhcp-disable",
        "arguments": {
            "max-period": 20
        }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## dhcp-enable reference

`dhcp-enable` - The dhcp-enable command globally enables the DHCP service.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "dhcp-enable"
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## ha-continue reference

`ha-continue` - This command is used to resume the operation of the paused HA state machine.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (high_availability hook)

Description and examples: See

Command syntax:

    {
        "command": "ha-continue"
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## ha-heartbeat reference

`ha-heartbeat` - This command is sent internally by Kea partner when operating in High Availability (HA) mode. It will retrieve the server HA state and clock value.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (high_availability hook)

Description and examples: See

Command syntax:

    {
        "command": "ha-heartbeat"
        }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

The response to this command is different from the typical command response. The response will include server state (see plus the current clock value.

## ha-scopes reference

`ha-scopes` - This command modifies the scope that the server is responsible for serving when operating in High Availability (HA) mode.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (high_availability hook)

Description and examples: See

Command syntax:

    {
        "command": "ha-scopes",
        "service": [ <service, typically "dhcp4" or "dhcp6"> ],
        "arguments": {
            "scopes": [ "HA_server1", "HA_server2" ]
        }
    }

In the example given, the arguments configure the server to handle traffic from both HA_server1 and HA_server2 scopes.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## ha-sync reference

`ha-sync` - The command is issued to instruct the server running in HA mode to synchronize its local lease database with the selected peer.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.4.0 (high_availability hook)

Description and examples: See

Command syntax:

    {
        "command": "ha-sync",
        "service": [ <service affected: "dhcp4" or "dhcp6" ],
        "arguments": {
            "server-name": <name of the partner server>,
            "max-period": <integer, in seconds>
        }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease4-add reference

`lease4-add` - The lease4-add command adds a new IPv4 lease administratively.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "lease4-add",
        "arguments": {
            "ip-address": "192.0.2.202",
            "hw-address": "1a:1b:1c:1d:1e:1f"
        }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease4-del reference

`lease4-del` - lease4-del can be used to delete a lease from the lease database.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "lease4-del",
        "arguments": {
            "ip-address": "192.0.2.202"
        }
    }

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".

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease4-get reference

`lease4-get` - lease4-get can be used to query the lease database and retrieve existing leases.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "lease4-get",
        "arguments": {
            "ip-address": "192.0.2.1"
        }
    }

Response syntax:

    {
      "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."
    }

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).

## lease4-get-all reference

`lease4-get-all` - lease4-get-all is used to retrieve all IPv4 leases or all leases for the specified set of subnets.

Supported by: `kea-dhcp4`

Availability: 1.4.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "lease4-get-all",
        "arguments": "subnets"
    }

The lease4-get-all command may result in very large responses.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease4-update reference

`lease4-update` - The lease4-update command can be used to update existing leases.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
      "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
      }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease4-wipe reference

`lease4-wipe` - lease4-wipe is designed to remove all leases associated with a given subnet.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
      "command": "lease4-wipe",
      "arguments": {
        "subnet-id": 44
      }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease6-add reference

`lease6-add` - The lease6-add command creates a new lease administratively.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "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
        }
    }

lease6-add can be also used to add leases for IPv6 prefixes..

Response syntax:

    { "result": 0,
    	    "text": "Lease added." }

              { "result": 1,
                "text": "missing parameter 'ip-address' (<string>:3:19)" }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease6-del reference

`lease6-del` - lease6-del can be used to delete a lease from the lease database.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "lease6-del",
        "arguments": {
            "ip-address": "192.0.2.202"
        }
    }

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).

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease6-get reference

`lease6-get` - lease6-get can be used to query the lease database and retrieve existing leases.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
      "command": "lease6-get",
      "arguments": {
        "ip-address": "2001:db8:1234:ab::",
        "type": "IA_PD"
      }
    }

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).

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease6-get-all reference

`lease6-get-all` - lease6-get-all is used to retrieve all IPv6 leases or all leases for the specified set of subnets.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "lease6-get-all",
        "arguments": {
            "subnets": [ 1, 2, 3, 4 ]
        }
    }

Response syntax:

    {
        "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."
    }

The lease6-get-all command may result in very large responses.

## lease6-update reference

`lease6-update` - The lease6-update command can be used to update existing leases.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
      "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
      }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## lease6-wipe reference

`lease6-wipe` - lease6-wipe is designed to remove all leases associated with a given subnet.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (lease_cmds hook)

Description and examples: See

Command syntax:

    {
      "command": "lease6-wipe",
      "arguments": {
        "subnet-id": 66
      }
    }

Note: not all backends support this command.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## leases-reclaim reference

`leases-reclaim` - The leases-reclaim command instructs the server to reclaim all expired leases immediately.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "leases-reclaim",
        "arguments": {
            "remove": true
        }
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## libreload reference

`libreload` - The libreload command will first unload and then load all currently loaded hook libraries.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "libreload",
        "arguments": { }
    }

The server will respond with a result of 0 indicating success, or 1 indicating a failure.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## list-commands reference

`list-commands` - The list-commands command retrieves a list of all commands supported by the server.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "list-commands",
        "arguments": { }
    }

The server will respond with a list of all supported commands.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network4-add reference

`network4-add` - The network4-add command is used to add a new shared network.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "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"
                        }
                    ]
                } ]
            } ]
        }
    }

Response syntax:

    {
        "arguments": {
            "shared-networks": [ { "name": "floor13" } ]
        },
        "result": 0,
        "text": "A new IPv4 shared network 'floor13' added"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network4-del reference

`network4-del` - The network4-del command is used to delete existing shared networks.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-del",
        "arguments": {
            "name": "floor13"
        }
    }

Response syntax:

    {
        "arguments": {
            "shared-networks": [
                {
                    "name": "floor13"
                }
            ]
        },
        "result": 0,
        "text": "IPv4 shared network 'floor13' deleted"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network4-get reference

`network4-get` - The network4-get command is used to retrieve detailed information about shared networks, including subnets currently being part of a given network.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-get",
        "arguments": {
            "name": "floor13"
        }
    }

Response syntax:

    {
        "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
            }
            ]
        }
    }

Note that the actual response contains many additional fields that are omitted here for clarity.

## network4-list reference

`network4-list` - The network4-list command is used to retrieve full list of currently configured shared networks.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-list"
    }

Response syntax:

    {
        "arguments": {
            "shared-networks": [
                { "name": "floor1" },
                { "name": "office" }
            ]
        },
        "result": 0,
        "text": "2 IPv4 network(s) found"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network4-subnet-add reference

`network4-subnet-add` - The network4-subnet-add command is used to add existing subnets to existing shared networks.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-subnet-add",
        "arguments": {
            "name": "floor13",
            "id": 5
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "IPv4 subnet 10.0.0.0/8 (id 5) is now part of shared network 'floor1'"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network4-subnet-del reference

`network4-subnet-del` - 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.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-subnet-del",
        "arguments": {
            "name": "floor13",
            "id": 5
        }
     }

Response syntax:

    {
        "result": 0,
        "text": "IPv4 subnet 10.0.0.0/8 (id 5) is now removed from shared network 'floor13'"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network6-add reference

`network6-add` - The network6-add command is used to add a new shared network.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "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"
                        }
                    ]
                } ]
            } ]
        }
    }

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).

Response syntax:

    {
        "arguments": {
            "shared-networks": [ { "name": "floor13" } ]
        },
        "result": 0,
        "text": "A new IPv4 shared network 'floor13' added"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network6-del reference

`network6-del` - The network6-del command is used to delete existing shared networks.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-del",
        "arguments": {
            "name": "floor13"
        }
    }

The network6-del command uses exactly the same syntax for both the command and the response.

Response syntax:

    {
        "command": "network4-del",
        "arguments": {
            "name": "floor13",
            "subnets-action": "delete"
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network6-get reference

`network6-get` - The network6-get command is used to retrieve detailed information about shared networks, including subnets currently being part of a given network.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-get",
        "arguments": {
            "name": "floor13"
        }
    }

Response syntax:

    {
        "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
            }
            ]
        }
    }

Note that the actual response contains many additional fields that are omitted here for clarity.

## network6-list reference

`network6-list` - The network6-list command is used to retrieve full list of currently configured shared networks.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-list"
    }

network6-list follows exactly the same syntax for both the query and the response.

Response syntax:

    {
        "arguments": {
            "shared-networks": [
                { "name": "floor1" },
                { "name": "office" }
            ]
        },
        "result": 0,
        "text": "2 IPv4 network(s) found"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network6-subnet-add reference

`network6-subnet-add` - The network6-subnet-add command is used to add existing subnets to existing shared networks.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-subnet-add",
        "arguments": {
            "name": "floor13",
            "id": 5
        }
    }

The network6-subnet-add command uses exactly the same syntax for both the command and the response.

Response syntax:

    {
        "result": 0,
        "text": "IPv4 subnet 10.0.0.0/8 (id 5) is now part of shared network 'floor1'"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## network6-subnet-del reference

`network6-subnet-del` - 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.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "network4-subnet-del",
        "arguments": {
            "name": "floor13",
            "id": 5
        }
     }

The network6-subnet-del command uses exactly the same syntax for both the command and the response.

Response syntax:

    {
        "result": 0,
        "text": "IPv4 subnet 10.0.0.0/8 (id 5) is now removed from shared network 'floor13'"
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## reservation-add reference

`reservation-add` - 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.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.2.0 (host_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "reservation-add",
        "arguments": {
            "reservation": {
                "boot-file-name": <string>,
                "comment": <string>
                "client-id": <string>,
                "circuit-id": <string>,
                "duid": <string>,
                "flex-id": <string>,
                "ip-address": <string (IPv4 address)>,
                "ip-addresses": [ <comma separated strings> ],
                "hw-address": <string>,
                "hostname": <string>,
                "next-server": <string (IPv4 address)>,
                "option-data-list": [ <comma separated structures defining options> ],
                "prefixes": [ <comma separated IPv6 prefixes> ],
                "reservation-client-classes": [ <comma separated strings> ],
                "server-hostname": <string>,
                "subnet-id": <integer>,
                "user-context": <any valid JSON>,
            }
        }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## reservation-del reference

`reservation-del` - Deletes an existing host reservation.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.2.0 (host_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "reservation-del",
        "arguments": {
            "subnet-id": <integer>,
            "ip-address": <string>,
            "identifier-type": <one of "hw-address", "duid", "circuit-id", "client-id" and "flex-id">,
            "identifier": <string>
        }
    }

The host reservation can be identified by either (subnet-id, ip-address) pair or a triplet of (subnet-id, identifier-type, identifier).

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## reservation-get reference

`reservation-get` - Attempts to retrieve an existing host reservation

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.2.0 (host_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "reservation-get",
        "arguments": {
            "subnet-id": <integer>,
            "identifier-type": <string with one value out of: hw-address|duid|circuit-id|client-id|flex-id>,
            "identifier": <string>;
        }
    }

The host reservation can be identified by either (subnet-id, ip-address) pair or a triplet of (subnet-id, identifier-type, identifier).

Response syntax:

    {
        "result": <integer>,
        "text": <string>,
        "arguments": {
            "boot-file-name": <string>,
            "comment": <string>
            "client-id": <string>,
            "circuit-id": <string>,
            "duid": <string>,
            "flex-id": <string>,
            "ip-address": <string (IPv4 address)>,
            "ip-addresses": [ <comma separated strings> ],
            "hw-address": <string>,
            "hostname": <string>,
            "next-server": <string (IPv4 address)>,
            "option-data-list": [ <comma separated structures defining options> ],
            "prefixes": [ <comma separated IPv6 prefixes> ],
            "reservation-client-classes": [ <comma separated strings> ],
            "server-hostname": <string>,
            "subnet-id": <integer>,
            "user-context": <any valid JSON>,
        }
    }

Arguments object appear only if a host is found. Many fields in the arguments object appear only if specific field is set.

## reservation-get-all reference

`reservation-get-all` - Retrieve all host reservations for a specified subnet.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.6.0 (host_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "reservation-get-all",
        "arguments": {
            "subnet-id": <integer>
        }
    }

Host reservations can be identified by subnet-id.

Response syntax:

    {
        "result": <integer>,
        "text": <string>,
        "arguments": {
            "hosts": [
                {
                    "boot-file-name": <string>,
                    "comment": <string>
                    "client-id": <string>,
                    "circuit-id": <string>,
                    "duid": <string>,
                    "flex-id": <string>,
                    "ip-address": <string (IPv4 address)>,
                    "ip-addresses": [ <comma separated strings> ],
                    "hw-address": <string>,
                    "hostname": <string>,
                    "next-server": <string (IPv4 address)>,
                    "option-data-list": [ <comma separated structures defining options> ],
                    "prefixes": [ <comma separated IPv6 prefixes> ],
                    "reservation-client-classes": [ <comma separated strings> ],
                    "server-hostname": <string>,
                    "subnet-id": <integer>,
                    "user-context": <any valid JSON>,
                },
                ...
            ]
        }
    }

The reservation-get-all command may result in very large responses.

## reservation-get-page reference

`reservation-get-page` - Retrieve all host reservations for a specified subnet by pages.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.6.0 (host_cmds hook) at the exception of the Cassandra host backend

Description and examples: See

Command syntax:

    {
        "command": "reservation-get-page",
        "arguments": {
            "subnet-id": <integer>,
            "limit": <integer>,
            "source-index": <integer>,
            "from": <integer>
        }
    }

Returned host reservations are from the specified subnet. Page size is limited by the limit parameter. Start of the page is given by the optional source index (default 0 i.e. configuration file) and from host id (default 0).

Response syntax:

    {
        "result": <integer>,
        "text": <string>,
        "arguments": {
            "source-index": <string>,
            "count": <string>,
            "next": <integer>,
            "hosts": [
                {
                    "boot-file-name": <string>,
                    "comment": <string>
                    "client-id": <string>,
                    "circuit-id": <string>,
                    "duid": <string>,
                    "flex-id": <string>,
                    "ip-address": <string (IPv4 address)>,
                    "ip-addresses": [ <comma separated strings> ],
                    "hw-address": <string>,
                    "hostname": <string>,
                    "next-server": <string (IPv4 address)>,
                    "option-data-list": [ <comma separated structures defining options> ],
                    "prefixes": [ <comma separated IPv6 prefixes> ],
                    "reservation-client-classes": [ <comma separated strings> ],
                    "server-hostname": <string>,
                    "subnet-id": <integer>,
                    "user-context": <any valid JSON>,
                },
                ...
            ]
        }
    }

The source index and the next host id should be used getting the next page. After the last page the result is 3 (empty).

## shutdown reference

`shutdown` - The shutdown command instructs the server to initiate its shutdown procedure.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "shutdown"
    }

The server will respond with a confirmation that the shutdown procedure has been initiated.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## stat-lease4-get reference

`stat-lease4-get` - The stat-lease4-get command fetches lease statistics for a range of known IPv4 subnets.

Supported by: `kea-dhcp4`

Availability: 1.4.0 (stat_cmds hook)

Description and examples: See

Command syntax:

    {
      "command": "stat-lease4-get"
    }

Response syntax:

    {
        "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"
          }
        }
      }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## stat-lease6-get reference

`stat-lease6-get` - The stat-lease6-get command fetches lease statistics for a range of known IPv6 subnets.

Supported by: `kea-dhcp6`

Availability: 1.4.0 (stat_cmds hook)

Description and examples: See

Command syntax:

    {
      "command": "stat-lease6-get",
      "arguments": {
        "subnet-id" : 10
      }
    }

Response syntax:

    {
        "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"
          }
        }
      }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## statistic-get reference

`statistic-get` - The statistic-get command retrieves a single statistic. It takes a single string parameter called name that specifies the statistic name.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "statistic-get",
        "arguments": {
            "name": "pkt4-received"
        }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## statistic-get-all reference

`statistic-get-all` - The statistic-get-all command retrieves all statistics recorded.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "statistic-get-all",
        "arguments": { }
    }

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).

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## statistic-remove reference

`statistic-remove` - The statistic-remove command attempts to delete a single statistic. It takes a single string parameter called name that specifies the statistic name.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "statistic-remove",
        "arguments": {
            "name": "pkt4-received"
        }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## statistic-remove-all reference

`statistic-remove-all` - The statistic-remove-all command attempts to delete all statistics.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "statistic-remove-all",
        "arguments": { }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## statistic-reset reference

`statistic-reset` - 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.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "statistic-reset",
        "arguments": {
            "name": "pkt4-received"
        }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## statistic-reset-all reference

`statistic-reset-all` - 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.

Supported by: `kea-dhcp4`, `kea-dhcp6`

Availability: 1.0.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "statistic-reset-all",
        "arguments": { }
    }

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.

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet4-add reference

`subnet4-add` - This command is used to create and add a new subnet to the existing server configuration.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet4-add",
        "arguments": {
            "subnet4": [ {
                "id": 123,
                "subnet": "10.20.30.0/24",
                ...
            } ]
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "IPv4 subnet added",
        "arguments": {
            "subnets": [
                {
                    "id": 123,
                    "subnet": "10.20.30.0/24"
                }
            ]
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet4-del reference

`subnet4-del` - 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.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet4-del",
        "arguments": {
            "id": 123
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "IPv4 subnet 192.0.2.0/24 (id 123) deleted",
        "arguments": {
            "subnets": [
                {
                    "id": 123,
                    "subnet": "192.0.2.0/24"
                }
            ]
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet4-get reference

`subnet4-get` - 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.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet4-get",
        "arguments": {
            "id": 10
        }
    }

Response syntax:

    {
        "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": [
                        ....
                    ]
                    ...
                }
            ]
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet4-list reference

`subnet4-list` - 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.

Supported by: `kea-dhcp4`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet4-list"
    }

Response syntax:

    {
        "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"
            }
        ]
    }

If no IPv4 subnets are found, an error code is returned along with the error description.

## subnet6-add reference

`subnet6-add` - This command is used to create and add new subnet to the existing server configuration. This operation has no impact on other subnets.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet6-add",
        "arguments": {
            "subnet6": [ {
                "id": 234,
                "subnet": "2001:db8:1::/64",
                ...
            } ]
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "IPv6 subnet added",
        "arguments": {
            "subnet6": [
                {
                    "id": 234,
                    "subnet": "2001:db8:1::/64"
                }
            ]
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet6-del reference

`subnet6-del` - 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.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet6-del",
        "arguments": {
            "id": 234
        }
    }

Response syntax:

    {
        "result": 0,
        "text": "IPv6 subnet 2001:db8:1::/64 (id 234) deleted",
        "subnets": [
            {
                "id": 234,
                "subnet": "2001:db8:1::/64"
            }
        ]
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet6-get reference

`subnet6-get` - 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.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet6-get",
        "arguments": {
            "id": 11
        }
    }

Response syntax:

    {
        "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": [
                        ...
                    ]
                    ....
                }
            ]
        }
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)

## subnet6-list reference

`subnet6-list` - 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.

Supported by: `kea-dhcp6`

Availability: 1.3.0 (subnet_cmds hook)

Description and examples: See

Command syntax:

    {
        "command": "subnet6-list"
    }

Response syntax:

    {
        "result": 0,
        "text": "2 IPv6 subnets found",
        "arguments": {
        "subnets": [
            {
                "id": 11,
                "subnet": "2001:db8:1::/64"
            },
            {
                "id": 233,
                "subnet": "3000::/16"
            }
        ]
    }

If no IPv6 subnets are found, an error code is returned along with the error description.

## version-get reference

`version-get` - 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.

Supported by: `kea-dhcp4`, `kea-dhcp6`, `kea-dhcp-ddns`, `kea-ctrl-agent`

Availability: 1.2.0 (built-in)

Description and examples: See

Command syntax:

    {
        "command": "version-get"
    }

Response syntax:

    {
        "result": <integer>,
        "text": <string>
    }

Result is an integer representation of the status. Currently supported statuses are:

- 0 - success

- 1 - error

- 2 - unsupported

- 3 - empty (command was completed successfully, but no data was affected or returned)