.. _api: ************* API Reference ************* Kea currently supports 121 commands: ``build-report`` , ``cache-clear`` , ``cache-get`` , ``cache-get-by-id`` , ``cache-insert`` , ``cache-load`` , ``cache-remove`` , ``cache-size`` , ``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`` , ``remote-global-parameter4-del`` , ``remote-global-parameter4-get`` , ``remote-global-parameter4-get-all`` , ``remote-global-parameter4-set`` , ``remote-global-parameter6-del`` , ``remote-global-parameter6-get`` , ``remote-global-parameter6-get-all`` , ``remote-global-parameter6-set`` , ``remote-network4-del`` , ``remote-network4-get`` , ``remote-network4-list`` , ``remote-network4-set`` , ``remote-network6-del`` , ``remote-network6-get`` , ``remote-network6-list`` , ``remote-network6-set`` , ``remote-option-def4-del`` , ``remote-option-def4-get`` , ``remote-option-def4-get-all`` , ``remote-option-def4-set`` , ``remote-option-def6-del`` , ``remote-option-def6-get`` , ``remote-option-def6-get-all`` , ``remote-option-def6-set`` , ``remote-option4-global-del`` , ``remote-option4-global-get`` , ``remote-option4-global-get-all`` , ``remote-option4-global-set`` , ``remote-option6-global-del`` , ``remote-option6-global-get`` , ``remote-option6-global-get-all`` , ``remote-option6-global-set`` , ``remote-subnet4-del-by-id`` , ``remote-subnet4-del-by-prefix`` , ``remote-subnet4-get-by-id`` , ``remote-subnet4-get-by-prefix`` , ``remote-subnet4-list`` , ``remote-subnet4-set`` , ``remote-subnet6-del-by-id`` , ``remote-subnet6-del-by-prefix`` , ``remote-subnet6-get-by-id`` , ``remote-subnet6-get-by-prefix`` , ``remote-subnet6-list`` , ``remote-subnet6-set`` , ``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`` , ``subnet4-update`` , ``subnet6-add`` , ``subnet6-del`` , ``subnet6-get`` , ``subnet6-list`` , ``subnet6-update`` , ``version-get`` . Commands supported by the kea-ctrl-agent daemon: ``build-report`` , ``config-get`` , ``config-reload`` , ``config-set`` , ``config-test`` , ``config-write`` , ``list-commands`` , ``shutdown`` , ``version-get`` . Commands supported by the kea-dhcp-ddns daemon: ``build-report`` , ``config-get`` , ``config-reload`` , ``config-set`` , ``config-test`` , ``config-write`` , ``list-commands`` , ``shutdown`` , ``version-get`` . Commands supported by the kea-dhcp4 daemon: ``build-report`` , ``cache-clear`` , ``cache-get`` , ``cache-get-by-id`` , ``cache-insert`` , ``cache-load`` , ``cache-remove`` , ``cache-size`` , ``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`` , ``remote-global-parameter4-del`` , ``remote-global-parameter4-get`` , ``remote-global-parameter4-get-all`` , ``remote-global-parameter4-set`` , ``remote-network4-del`` , ``remote-network4-get`` , ``remote-network4-list`` , ``remote-network4-set`` , ``remote-option-def4-del`` , ``remote-option-def4-get`` , ``remote-option-def4-get-all`` , ``remote-option-def4-set`` , ``remote-option4-global-del`` , ``remote-option4-global-get`` , ``remote-option4-global-get-all`` , ``remote-option4-global-set`` , ``remote-subnet4-del-by-id`` , ``remote-subnet4-del-by-prefix`` , ``remote-subnet4-get-by-id`` , ``remote-subnet4-get-by-prefix`` , ``remote-subnet4-list`` , ``remote-subnet4-set`` , ``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`` , ``subnet4-update`` , ``version-get`` . Commands supported by the kea-dhcp6 daemon: ``build-report`` , ``cache-clear`` , ``cache-get`` , ``cache-get-by-id`` , ``cache-insert`` , ``cache-load`` , ``cache-remove`` , ``cache-size`` , ``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`` , ``remote-global-parameter6-del`` , ``remote-global-parameter6-get`` , ``remote-global-parameter6-get-all`` , ``remote-global-parameter6-set`` , ``remote-network6-del`` , ``remote-network6-get`` , ``remote-network6-list`` , ``remote-network6-set`` , ``remote-option-def6-del`` , ``remote-option-def6-get`` , ``remote-option-def6-get-all`` , ``remote-option-def6-set`` , ``remote-option6-global-del`` , ``remote-option6-global-get`` , ``remote-option6-global-get-all`` , ``remote-option6-global-set`` , ``remote-subnet6-del-by-id`` , ``remote-subnet6-del-by-prefix`` , ``remote-subnet6-get-by-id`` , ``remote-subnet6-get-by-prefix`` , ``remote-subnet6-list`` , ``remote-subnet6-set`` , ``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`` , ``subnet6-update`` , ``version-get`` . .. _commands-cb_cmds-lib: Commands supported by the Configuration Backend Commands (cb_cmds) hooks library: ``remote-global-parameter4-del`` , ``remote-global-parameter4-get`` , ``remote-global-parameter4-get-all`` , ``remote-global-parameter4-set`` , ``remote-global-parameter6-del`` , ``remote-global-parameter6-get`` , ``remote-global-parameter6-get-all`` , ``remote-global-parameter6-set`` , ``remote-network4-del`` , ``remote-network4-get`` , ``remote-network4-list`` , ``remote-network4-set`` , ``remote-network6-del`` , ``remote-network6-get`` , ``remote-network6-list`` , ``remote-network6-set`` , ``remote-option-def4-del`` , ``remote-option-def4-get`` , ``remote-option-def4-get-all`` , ``remote-option-def4-set`` , ``remote-option-def6-del`` , ``remote-option-def6-get`` , ``remote-option-def6-get-all`` , ``remote-option-def6-set`` , ``remote-option4-global-del`` , ``remote-option4-global-get`` , ``remote-option4-global-get-all`` , ``remote-option4-global-set`` , ``remote-option6-global-del`` , ``remote-option6-global-get`` , ``remote-option6-global-get-all`` , ``remote-option6-global-set`` , ``remote-subnet4-del-by-id`` , ``remote-subnet4-del-by-prefix`` , ``remote-subnet4-get-by-id`` , ``remote-subnet4-get-by-prefix`` , ``remote-subnet4-list`` , ``remote-subnet4-set`` , ``remote-subnet6-del-by-id`` , ``remote-subnet6-del-by-prefix`` , ``remote-subnet6-get-by-id`` , ``remote-subnet6-get-by-prefix`` , ``remote-subnet6-list`` , ``remote-subnet6-set`` . .. _commands-class_cmds-lib: Commands supported by the Class Commands (class_cmds) hooks library: ``class-add`` , ``class-del`` , ``class-get`` , ``class-list`` , ``class-update`` . .. _commands-high_availability-lib: Commands supported by the High Availability (high_availability) hooks library: ``ha-continue`` , ``ha-heartbeat`` , ``ha-scopes`` , ``ha-sync`` . .. _commands-host_cache-lib: Commands supported by the Host Cache (host_cache) hooks library: ``cache-clear`` , ``cache-get`` , ``cache-get-by-id`` , ``cache-insert`` , ``cache-load`` , ``cache-remove`` , ``cache-size`` , ``cache-write`` . .. _commands-host_cmds-lib: Commands supported by the Host Commands (host_cmds) hooks library: ``reservation-add`` , ``reservation-del`` , ``reservation-get`` , ``reservation-get-all`` , ``reservation-get-page`` . .. _commands-lease_cmds-lib: Commands supported by the Lease Commands (lease_cmds) hooks 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-stat_cmds-lib: Commands supported by the Supplemental Statistics Commands (stat_cmds) hooks library: ``stat-lease4-get`` , ``stat-lease6-get`` . .. _commands-subnet_cmds-lib: Commands supported by the Subnet Commands (subnet_cmds) hooks 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`` , ``subnet4-update`` , ``subnet6-add`` , ``subnet6-del`` , ``subnet6-get`` , ``subnet6-list`` , ``subnet6-update`` . .. _reference-build-report: 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 :ref:`command-build-report` Command syntax: :: { "command": "build-report" } Response syntax: :: { "result": 0, "text": } .. _reference-cache-clear: cache-clear reference ===================== ``cache-clear`` - removes all cached host reservations. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.4.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-clear` Command syntax: :: { "command": "cache-clear" } Response syntax: :: { "result": , "text": } The 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 were affected or returned) .. _reference-cache-get: cache-get reference =================== ``cache-get`` - returns full content of the host cache. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.4.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-get` Command syntax: :: { "command": "cache-get" } Response syntax: :: { "result": 0 "text": "123 entries returned." "arguments": } The 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 were affected or returned) .. _reference-cache-get-by-id: cache-get-by-id reference ========================= ``cache-get-by-id`` - returns entries matching the given identifier from the host cache. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.6.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-get-by-id` Command syntax: :: { "command": "cache-get-by-id", "arguments": { "hw-address": "01:02:03:04:05:06" } Response syntax: :: { "result": 0 "text": "2 entries returned." "arguments": } The 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 were affected or returned) .. _reference-cache-insert: cache-insert reference ====================== ``cache-insert`` - manually inserts a host into the cache. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.4.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-insert` 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": , "text": } The 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 were affected or returned) .. _reference-cache-load: cache-load reference ==================== ``cache-load`` - allows the contents of a file on disk to be loaded into an in-memory cache. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.4.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-load` Command syntax: :: { "command": "cache-load", "arguments": "/tmp/kea-host-cache.json" } Response syntax: :: { "result": , "text": } The 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 were affected or returned) .. _reference-cache-remove: cache-remove reference ====================== ``cache-remove`` - works similarly to the reservation-get command. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.4.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-remove` Command syntax: :: { "command": "cache-remove", "arguments": { "ip-address": "192.0.2.1", "subnet-id": 123 } } Another example that removes the 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": , "text": } The 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 were affected or returned) .. _reference-cache-size: cache-size reference ==================== ``cache-size`` - returns the number of entries in the host cache. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.6.0 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-size` Command syntax: :: { "command": "cache-size" } Response syntax: :: { "result": 0 "text": "123 entries." "arguments": { "size": 123 } } The 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 were affected or returned) .. _reference-cache-write: 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 (:ref:`The Host Cache hooks library`) Description and examples: see :ref:`command-cache-write` 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": , "text": } The 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 were affected or returned) .. _reference-class-add: class-add reference =================== ``class-add`` - creates and adds a new class to the existing server configuration. Supported by: ``kea-dhcp4``, ``kea-dhcp6`` Availability: 1.5.0 (:ref:`The Class Commands hooks library`) Description and examples: see :ref:`command-class-add` Command syntax: :: { "command": "class-add", "arguments": { "client-classes": [ { "name": , "test": , "option-data": [