.. _api:

API Reference
=============

Kea currently supports 196 commands in :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>` daemons and :ref:`cb_cmds <commands-cb_cmds>`, :ref:`class_cmds <commands-class_cmds>`, :ref:`gss_tsig <commands-gss_tsig>`, :ref:`high_availability <commands-high_availability>`, :ref:`host_cache <commands-host_cache>`, :ref:`host_cmds <commands-host_cmds>`, :ref:`lease_cmds <commands-lease_cmds>`, :ref:`lease_query <commands-lease_query>`, :ref:`stat_cmds <commands-stat_cmds>`, :ref:`subnet_cmds <commands-subnet_cmds>` hook libraries.

.. _commands-kea-ctrl-agent:

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

.. _commands-kea-dhcp-ddns:

Commands supported by `kea-dhcp-ddns` daemon: :ref:`build-report <ref-build-report>`, :ref:`config-get <ref-config-get>`, :ref:`config-hash-get <ref-config-hash-get>`, :ref:`config-reload <ref-config-reload>`, :ref:`config-set <ref-config-set>`, :ref:`config-test <ref-config-test>`, :ref:`config-write <ref-config-write>`, :ref:`gss-tsig-get <ref-gss-tsig-get>`, :ref:`gss-tsig-get-all <ref-gss-tsig-get-all>`, :ref:`gss-tsig-key-del <ref-gss-tsig-key-del>`, :ref:`gss-tsig-key-expire <ref-gss-tsig-key-expire>`, :ref:`gss-tsig-key-get <ref-gss-tsig-key-get>`, :ref:`gss-tsig-list <ref-gss-tsig-list>`, :ref:`gss-tsig-purge <ref-gss-tsig-purge>`, :ref:`gss-tsig-purge-all <ref-gss-tsig-purge-all>`, :ref:`gss-tsig-rekey <ref-gss-tsig-rekey>`, :ref:`gss-tsig-rekey-all <ref-gss-tsig-rekey-all>`, :ref:`list-commands <ref-list-commands>`, :ref:`shutdown <ref-shutdown>`, :ref:`statistic-get <ref-statistic-get>`, :ref:`statistic-get-all <ref-statistic-get-all>`, :ref:`statistic-reset <ref-statistic-reset>`, :ref:`statistic-reset-all <ref-statistic-reset-all>`, :ref:`status-get <ref-status-get>`, :ref:`version-get <ref-version-get>`.

.. _commands-kea-dhcp4:

Commands supported by `kea-dhcp4` daemon: :ref:`build-report <ref-build-report>`, :ref:`cache-clear <ref-cache-clear>`, :ref:`cache-flush <ref-cache-flush>`, :ref:`cache-get <ref-cache-get>`, :ref:`cache-get-by-id <ref-cache-get-by-id>`, :ref:`cache-insert <ref-cache-insert>`, :ref:`cache-load <ref-cache-load>`, :ref:`cache-remove <ref-cache-remove>`, :ref:`cache-size <ref-cache-size>`, :ref:`cache-write <ref-cache-write>`, :ref:`class-add <ref-class-add>`, :ref:`class-del <ref-class-del>`, :ref:`class-get <ref-class-get>`, :ref:`class-list <ref-class-list>`, :ref:`class-update <ref-class-update>`, :ref:`config-backend-pull <ref-config-backend-pull>`, :ref:`config-get <ref-config-get>`, :ref:`config-hash-get <ref-config-hash-get>`, :ref:`config-reload <ref-config-reload>`, :ref:`config-set <ref-config-set>`, :ref:`config-test <ref-config-test>`, :ref:`config-write <ref-config-write>`, :ref:`dhcp-disable <ref-dhcp-disable>`, :ref:`dhcp-enable <ref-dhcp-enable>`, :ref:`extended-info4-upgrade <ref-extended-info4-upgrade>`, :ref:`ha-continue <ref-ha-continue>`, :ref:`ha-heartbeat <ref-ha-heartbeat>`, :ref:`ha-maintenance-cancel <ref-ha-maintenance-cancel>`, :ref:`ha-maintenance-notify <ref-ha-maintenance-notify>`, :ref:`ha-maintenance-start <ref-ha-maintenance-start>`, :ref:`ha-reset <ref-ha-reset>`, :ref:`ha-scopes <ref-ha-scopes>`, :ref:`ha-sync <ref-ha-sync>`, :ref:`ha-sync-complete-notify <ref-ha-sync-complete-notify>`, :ref:`lease4-add <ref-lease4-add>`, :ref:`lease4-del <ref-lease4-del>`, :ref:`lease4-get <ref-lease4-get>`, :ref:`lease4-get-all <ref-lease4-get-all>`, :ref:`lease4-get-by-client-id <ref-lease4-get-by-client-id>`, :ref:`lease4-get-by-hostname <ref-lease4-get-by-hostname>`, :ref:`lease4-get-by-hw-address <ref-lease4-get-by-hw-address>`, :ref:`lease4-get-page <ref-lease4-get-page>`, :ref:`lease4-resend-ddns <ref-lease4-resend-ddns>`, :ref:`lease4-update <ref-lease4-update>`, :ref:`lease4-wipe <ref-lease4-wipe>`, :ref:`lease4-write <ref-lease4-write>`, :ref:`leases-reclaim <ref-leases-reclaim>`, :ref:`libreload <ref-libreload>`, :ref:`list-commands <ref-list-commands>`, :ref:`network4-add <ref-network4-add>`, :ref:`network4-del <ref-network4-del>`, :ref:`network4-get <ref-network4-get>`, :ref:`network4-list <ref-network4-list>`, :ref:`network4-subnet-add <ref-network4-subnet-add>`, :ref:`network4-subnet-del <ref-network4-subnet-del>`, :ref:`remote-class4-del <ref-remote-class4-del>`, :ref:`remote-class4-get <ref-remote-class4-get>`, :ref:`remote-class4-get-all <ref-remote-class4-get-all>`, :ref:`remote-class4-set <ref-remote-class4-set>`, :ref:`remote-global-parameter4-del <ref-remote-global-parameter4-del>`, :ref:`remote-global-parameter4-get <ref-remote-global-parameter4-get>`, :ref:`remote-global-parameter4-get-all <ref-remote-global-parameter4-get-all>`, :ref:`remote-global-parameter4-set <ref-remote-global-parameter4-set>`, :ref:`remote-network4-del <ref-remote-network4-del>`, :ref:`remote-network4-get <ref-remote-network4-get>`, :ref:`remote-network4-list <ref-remote-network4-list>`, :ref:`remote-network4-set <ref-remote-network4-set>`, :ref:`remote-option-def4-del <ref-remote-option-def4-del>`, :ref:`remote-option-def4-get <ref-remote-option-def4-get>`, :ref:`remote-option-def4-get-all <ref-remote-option-def4-get-all>`, :ref:`remote-option-def4-set <ref-remote-option-def4-set>`, :ref:`remote-option4-global-del <ref-remote-option4-global-del>`, :ref:`remote-option4-global-get <ref-remote-option4-global-get>`, :ref:`remote-option4-global-get-all <ref-remote-option4-global-get-all>`, :ref:`remote-option4-global-set <ref-remote-option4-global-set>`, :ref:`remote-option4-network-del <ref-remote-option4-network-del>`, :ref:`remote-option4-network-set <ref-remote-option4-network-set>`, :ref:`remote-option4-pool-del <ref-remote-option4-pool-del>`, :ref:`remote-option4-pool-set <ref-remote-option4-pool-set>`, :ref:`remote-option4-subnet-del <ref-remote-option4-subnet-del>`, :ref:`remote-option4-subnet-set <ref-remote-option4-subnet-set>`, :ref:`remote-server4-del <ref-remote-server4-del>`, :ref:`remote-server4-get <ref-remote-server4-get>`, :ref:`remote-server4-get-all <ref-remote-server4-get-all>`, :ref:`remote-server4-set <ref-remote-server4-set>`, :ref:`remote-subnet4-del-by-id <ref-remote-subnet4-del-by-id>`, :ref:`remote-subnet4-del-by-prefix <ref-remote-subnet4-del-by-prefix>`, :ref:`remote-subnet4-get-by-id <ref-remote-subnet4-get-by-id>`, :ref:`remote-subnet4-get-by-prefix <ref-remote-subnet4-get-by-prefix>`, :ref:`remote-subnet4-list <ref-remote-subnet4-list>`, :ref:`remote-subnet4-set <ref-remote-subnet4-set>`, :ref:`reservation-add <ref-reservation-add>`, :ref:`reservation-del <ref-reservation-del>`, :ref:`reservation-get <ref-reservation-get>`, :ref:`reservation-get-all <ref-reservation-get-all>`, :ref:`reservation-get-by-address <ref-reservation-get-by-address>`, :ref:`reservation-get-by-hostname <ref-reservation-get-by-hostname>`, :ref:`reservation-get-by-id <ref-reservation-get-by-id>`, :ref:`reservation-get-page <ref-reservation-get-page>`, :ref:`reservation-update <ref-reservation-update>`, :ref:`server-tag-get <ref-server-tag-get>`, :ref:`shutdown <ref-shutdown>`, :ref:`stat-lease4-get <ref-stat-lease4-get>`, :ref:`statistic-get <ref-statistic-get>`, :ref:`statistic-get-all <ref-statistic-get-all>`, :ref:`statistic-remove <ref-statistic-remove>`, :ref:`statistic-remove-all <ref-statistic-remove-all>`, :ref:`statistic-reset <ref-statistic-reset>`, :ref:`statistic-reset-all <ref-statistic-reset-all>`, :ref:`statistic-sample-age-set <ref-statistic-sample-age-set>`, :ref:`statistic-sample-age-set-all <ref-statistic-sample-age-set-all>`, :ref:`statistic-sample-count-set <ref-statistic-sample-count-set>`, :ref:`statistic-sample-count-set-all <ref-statistic-sample-count-set-all>`, :ref:`status-get <ref-status-get>`, :ref:`subnet4-add <ref-subnet4-add>`, :ref:`subnet4-del <ref-subnet4-del>`, :ref:`subnet4-delta-add <ref-subnet4-delta-add>`, :ref:`subnet4-delta-del <ref-subnet4-delta-del>`, :ref:`subnet4-get <ref-subnet4-get>`, :ref:`subnet4-list <ref-subnet4-list>`, :ref:`subnet4-update <ref-subnet4-update>`, :ref:`version-get <ref-version-get>`.

.. _commands-kea-dhcp6:

Commands supported by `kea-dhcp6` daemon: :ref:`build-report <ref-build-report>`, :ref:`cache-clear <ref-cache-clear>`, :ref:`cache-flush <ref-cache-flush>`, :ref:`cache-get <ref-cache-get>`, :ref:`cache-get-by-id <ref-cache-get-by-id>`, :ref:`cache-insert <ref-cache-insert>`, :ref:`cache-load <ref-cache-load>`, :ref:`cache-remove <ref-cache-remove>`, :ref:`cache-size <ref-cache-size>`, :ref:`cache-write <ref-cache-write>`, :ref:`class-add <ref-class-add>`, :ref:`class-del <ref-class-del>`, :ref:`class-get <ref-class-get>`, :ref:`class-list <ref-class-list>`, :ref:`class-update <ref-class-update>`, :ref:`config-backend-pull <ref-config-backend-pull>`, :ref:`config-get <ref-config-get>`, :ref:`config-hash-get <ref-config-hash-get>`, :ref:`config-reload <ref-config-reload>`, :ref:`config-set <ref-config-set>`, :ref:`config-test <ref-config-test>`, :ref:`config-write <ref-config-write>`, :ref:`dhcp-disable <ref-dhcp-disable>`, :ref:`dhcp-enable <ref-dhcp-enable>`, :ref:`ha-continue <ref-ha-continue>`, :ref:`ha-heartbeat <ref-ha-heartbeat>`, :ref:`ha-maintenance-cancel <ref-ha-maintenance-cancel>`, :ref:`ha-maintenance-notify <ref-ha-maintenance-notify>`, :ref:`ha-maintenance-start <ref-ha-maintenance-start>`, :ref:`ha-reset <ref-ha-reset>`, :ref:`ha-scopes <ref-ha-scopes>`, :ref:`ha-sync <ref-ha-sync>`, :ref:`ha-sync-complete-notify <ref-ha-sync-complete-notify>`, :ref:`lease6-add <ref-lease6-add>`, :ref:`lease6-bulk-apply <ref-lease6-bulk-apply>`, :ref:`lease6-del <ref-lease6-del>`, :ref:`lease6-get <ref-lease6-get>`, :ref:`lease6-get-all <ref-lease6-get-all>`, :ref:`lease6-get-by-duid <ref-lease6-get-by-duid>`, :ref:`lease6-get-by-hostname <ref-lease6-get-by-hostname>`, :ref:`lease6-get-page <ref-lease6-get-page>`, :ref:`lease6-resend-ddns <ref-lease6-resend-ddns>`, :ref:`lease6-update <ref-lease6-update>`, :ref:`lease6-wipe <ref-lease6-wipe>`, :ref:`lease6-write <ref-lease6-write>`, :ref:`leases-reclaim <ref-leases-reclaim>`, :ref:`libreload <ref-libreload>`, :ref:`list-commands <ref-list-commands>`, :ref:`network6-add <ref-network6-add>`, :ref:`network6-del <ref-network6-del>`, :ref:`network6-get <ref-network6-get>`, :ref:`network6-list <ref-network6-list>`, :ref:`network6-subnet-add <ref-network6-subnet-add>`, :ref:`network6-subnet-del <ref-network6-subnet-del>`, :ref:`remote-class6-del <ref-remote-class6-del>`, :ref:`remote-class6-get <ref-remote-class6-get>`, :ref:`remote-class6-get-all <ref-remote-class6-get-all>`, :ref:`remote-class6-set <ref-remote-class6-set>`, :ref:`remote-global-parameter6-del <ref-remote-global-parameter6-del>`, :ref:`remote-global-parameter6-get <ref-remote-global-parameter6-get>`, :ref:`remote-global-parameter6-get-all <ref-remote-global-parameter6-get-all>`, :ref:`remote-global-parameter6-set <ref-remote-global-parameter6-set>`, :ref:`remote-network6-del <ref-remote-network6-del>`, :ref:`remote-network6-get <ref-remote-network6-get>`, :ref:`remote-network6-list <ref-remote-network6-list>`, :ref:`remote-network6-set <ref-remote-network6-set>`, :ref:`remote-option-def6-del <ref-remote-option-def6-del>`, :ref:`remote-option-def6-get <ref-remote-option-def6-get>`, :ref:`remote-option-def6-get-all <ref-remote-option-def6-get-all>`, :ref:`remote-option-def6-set <ref-remote-option-def6-set>`, :ref:`remote-option6-global-del <ref-remote-option6-global-del>`, :ref:`remote-option6-global-get <ref-remote-option6-global-get>`, :ref:`remote-option6-global-get-all <ref-remote-option6-global-get-all>`, :ref:`remote-option6-global-set <ref-remote-option6-global-set>`, :ref:`remote-option6-network-del <ref-remote-option6-network-del>`, :ref:`remote-option6-network-set <ref-remote-option6-network-set>`, :ref:`remote-option6-pd-pool-del <ref-remote-option6-pd-pool-del>`, :ref:`remote-option6-pd-pool-set <ref-remote-option6-pd-pool-set>`, :ref:`remote-option6-pool-del <ref-remote-option6-pool-del>`, :ref:`remote-option6-pool-set <ref-remote-option6-pool-set>`, :ref:`remote-option6-subnet-del <ref-remote-option6-subnet-del>`, :ref:`remote-option6-subnet-set <ref-remote-option6-subnet-set>`, :ref:`remote-server6-del <ref-remote-server6-del>`, :ref:`remote-server6-get <ref-remote-server6-get>`, :ref:`remote-server6-get-all <ref-remote-server6-get-all>`, :ref:`remote-server6-set <ref-remote-server6-set>`, :ref:`remote-subnet6-del-by-id <ref-remote-subnet6-del-by-id>`, :ref:`remote-subnet6-del-by-prefix <ref-remote-subnet6-del-by-prefix>`, :ref:`remote-subnet6-get-by-id <ref-remote-subnet6-get-by-id>`, :ref:`remote-subnet6-get-by-prefix <ref-remote-subnet6-get-by-prefix>`, :ref:`remote-subnet6-list <ref-remote-subnet6-list>`, :ref:`remote-subnet6-set <ref-remote-subnet6-set>`, :ref:`reservation-add <ref-reservation-add>`, :ref:`reservation-del <ref-reservation-del>`, :ref:`reservation-get <ref-reservation-get>`, :ref:`reservation-get-all <ref-reservation-get-all>`, :ref:`reservation-get-by-address <ref-reservation-get-by-address>`, :ref:`reservation-get-by-hostname <ref-reservation-get-by-hostname>`, :ref:`reservation-get-by-id <ref-reservation-get-by-id>`, :ref:`reservation-get-page <ref-reservation-get-page>`, :ref:`reservation-update <ref-reservation-update>`, :ref:`server-tag-get <ref-server-tag-get>`, :ref:`shutdown <ref-shutdown>`, :ref:`stat-lease6-get <ref-stat-lease6-get>`, :ref:`statistic-get <ref-statistic-get>`, :ref:`statistic-get-all <ref-statistic-get-all>`, :ref:`statistic-remove <ref-statistic-remove>`, :ref:`statistic-remove-all <ref-statistic-remove-all>`, :ref:`statistic-reset <ref-statistic-reset>`, :ref:`statistic-reset-all <ref-statistic-reset-all>`, :ref:`statistic-sample-age-set <ref-statistic-sample-age-set>`, :ref:`statistic-sample-age-set-all <ref-statistic-sample-age-set-all>`, :ref:`statistic-sample-count-set <ref-statistic-sample-count-set>`, :ref:`statistic-sample-count-set-all <ref-statistic-sample-count-set-all>`, :ref:`status-get <ref-status-get>`, :ref:`subnet6-add <ref-subnet6-add>`, :ref:`subnet6-del <ref-subnet6-del>`, :ref:`subnet6-delta-add <ref-subnet6-delta-add>`, :ref:`subnet6-delta-del <ref-subnet6-delta-del>`, :ref:`subnet6-get <ref-subnet6-get>`, :ref:`subnet6-list <ref-subnet6-list>`, :ref:`subnet6-update <ref-subnet6-update>`, :ref:`version-get <ref-version-get>`.

.. _commands-cb_cmds:

Commands supported by `cb_cmds` hook library: :ref:`remote-class4-del <ref-remote-class4-del>`, :ref:`remote-class4-get <ref-remote-class4-get>`, :ref:`remote-class4-get-all <ref-remote-class4-get-all>`, :ref:`remote-class4-set <ref-remote-class4-set>`, :ref:`remote-class6-del <ref-remote-class6-del>`, :ref:`remote-class6-get <ref-remote-class6-get>`, :ref:`remote-class6-get-all <ref-remote-class6-get-all>`, :ref:`remote-class6-set <ref-remote-class6-set>`, :ref:`remote-global-parameter4-del <ref-remote-global-parameter4-del>`, :ref:`remote-global-parameter4-get <ref-remote-global-parameter4-get>`, :ref:`remote-global-parameter4-get-all <ref-remote-global-parameter4-get-all>`, :ref:`remote-global-parameter4-set <ref-remote-global-parameter4-set>`, :ref:`remote-global-parameter6-del <ref-remote-global-parameter6-del>`, :ref:`remote-global-parameter6-get <ref-remote-global-parameter6-get>`, :ref:`remote-global-parameter6-get-all <ref-remote-global-parameter6-get-all>`, :ref:`remote-global-parameter6-set <ref-remote-global-parameter6-set>`, :ref:`remote-network4-del <ref-remote-network4-del>`, :ref:`remote-network4-get <ref-remote-network4-get>`, :ref:`remote-network4-list <ref-remote-network4-list>`, :ref:`remote-network4-set <ref-remote-network4-set>`, :ref:`remote-network6-del <ref-remote-network6-del>`, :ref:`remote-network6-get <ref-remote-network6-get>`, :ref:`remote-network6-list <ref-remote-network6-list>`, :ref:`remote-network6-set <ref-remote-network6-set>`, :ref:`remote-option-def4-del <ref-remote-option-def4-del>`, :ref:`remote-option-def4-get <ref-remote-option-def4-get>`, :ref:`remote-option-def4-get-all <ref-remote-option-def4-get-all>`, :ref:`remote-option-def4-set <ref-remote-option-def4-set>`, :ref:`remote-option-def6-del <ref-remote-option-def6-del>`, :ref:`remote-option-def6-get <ref-remote-option-def6-get>`, :ref:`remote-option-def6-get-all <ref-remote-option-def6-get-all>`, :ref:`remote-option-def6-set <ref-remote-option-def6-set>`, :ref:`remote-option4-global-del <ref-remote-option4-global-del>`, :ref:`remote-option4-global-get <ref-remote-option4-global-get>`, :ref:`remote-option4-global-get-all <ref-remote-option4-global-get-all>`, :ref:`remote-option4-global-set <ref-remote-option4-global-set>`, :ref:`remote-option4-network-del <ref-remote-option4-network-del>`, :ref:`remote-option4-network-set <ref-remote-option4-network-set>`, :ref:`remote-option4-pool-del <ref-remote-option4-pool-del>`, :ref:`remote-option4-pool-set <ref-remote-option4-pool-set>`, :ref:`remote-option4-subnet-del <ref-remote-option4-subnet-del>`, :ref:`remote-option4-subnet-set <ref-remote-option4-subnet-set>`, :ref:`remote-option6-global-del <ref-remote-option6-global-del>`, :ref:`remote-option6-global-get <ref-remote-option6-global-get>`, :ref:`remote-option6-global-get-all <ref-remote-option6-global-get-all>`, :ref:`remote-option6-global-set <ref-remote-option6-global-set>`, :ref:`remote-option6-network-del <ref-remote-option6-network-del>`, :ref:`remote-option6-network-set <ref-remote-option6-network-set>`, :ref:`remote-option6-pd-pool-del <ref-remote-option6-pd-pool-del>`, :ref:`remote-option6-pd-pool-set <ref-remote-option6-pd-pool-set>`, :ref:`remote-option6-pool-del <ref-remote-option6-pool-del>`, :ref:`remote-option6-pool-set <ref-remote-option6-pool-set>`, :ref:`remote-option6-subnet-del <ref-remote-option6-subnet-del>`, :ref:`remote-option6-subnet-set <ref-remote-option6-subnet-set>`, :ref:`remote-server4-del <ref-remote-server4-del>`, :ref:`remote-server4-get <ref-remote-server4-get>`, :ref:`remote-server4-get-all <ref-remote-server4-get-all>`, :ref:`remote-server4-set <ref-remote-server4-set>`, :ref:`remote-server6-del <ref-remote-server6-del>`, :ref:`remote-server6-get <ref-remote-server6-get>`, :ref:`remote-server6-get-all <ref-remote-server6-get-all>`, :ref:`remote-server6-set <ref-remote-server6-set>`, :ref:`remote-subnet4-del-by-id <ref-remote-subnet4-del-by-id>`, :ref:`remote-subnet4-del-by-prefix <ref-remote-subnet4-del-by-prefix>`, :ref:`remote-subnet4-get-by-id <ref-remote-subnet4-get-by-id>`, :ref:`remote-subnet4-get-by-prefix <ref-remote-subnet4-get-by-prefix>`, :ref:`remote-subnet4-list <ref-remote-subnet4-list>`, :ref:`remote-subnet4-set <ref-remote-subnet4-set>`, :ref:`remote-subnet6-del-by-id <ref-remote-subnet6-del-by-id>`, :ref:`remote-subnet6-del-by-prefix <ref-remote-subnet6-del-by-prefix>`, :ref:`remote-subnet6-get-by-id <ref-remote-subnet6-get-by-id>`, :ref:`remote-subnet6-get-by-prefix <ref-remote-subnet6-get-by-prefix>`, :ref:`remote-subnet6-list <ref-remote-subnet6-list>`, :ref:`remote-subnet6-set <ref-remote-subnet6-set>`.

.. _commands-class_cmds:

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

.. _commands-gss_tsig:

Commands supported by `gss_tsig` hook library: :ref:`gss-tsig-get <ref-gss-tsig-get>`, :ref:`gss-tsig-get-all <ref-gss-tsig-get-all>`, :ref:`gss-tsig-key-del <ref-gss-tsig-key-del>`, :ref:`gss-tsig-key-expire <ref-gss-tsig-key-expire>`, :ref:`gss-tsig-key-get <ref-gss-tsig-key-get>`, :ref:`gss-tsig-list <ref-gss-tsig-list>`, :ref:`gss-tsig-purge <ref-gss-tsig-purge>`, :ref:`gss-tsig-purge-all <ref-gss-tsig-purge-all>`, :ref:`gss-tsig-rekey <ref-gss-tsig-rekey>`, :ref:`gss-tsig-rekey-all <ref-gss-tsig-rekey-all>`.

.. _commands-high_availability:

Commands supported by `high_availability` hook library: :ref:`ha-continue <ref-ha-continue>`, :ref:`ha-heartbeat <ref-ha-heartbeat>`, :ref:`ha-maintenance-cancel <ref-ha-maintenance-cancel>`, :ref:`ha-maintenance-notify <ref-ha-maintenance-notify>`, :ref:`ha-maintenance-start <ref-ha-maintenance-start>`, :ref:`ha-reset <ref-ha-reset>`, :ref:`ha-scopes <ref-ha-scopes>`, :ref:`ha-sync <ref-ha-sync>`, :ref:`ha-sync-complete-notify <ref-ha-sync-complete-notify>`.

.. _commands-host_cache:

Commands supported by `host_cache` hook library: :ref:`cache-clear <ref-cache-clear>`, :ref:`cache-flush <ref-cache-flush>`, :ref:`cache-get <ref-cache-get>`, :ref:`cache-get-by-id <ref-cache-get-by-id>`, :ref:`cache-insert <ref-cache-insert>`, :ref:`cache-load <ref-cache-load>`, :ref:`cache-remove <ref-cache-remove>`, :ref:`cache-size <ref-cache-size>`, :ref:`cache-write <ref-cache-write>`.

.. _commands-host_cmds:

Commands supported by `host_cmds` hook library: :ref:`reservation-add <ref-reservation-add>`, :ref:`reservation-del <ref-reservation-del>`, :ref:`reservation-get <ref-reservation-get>`, :ref:`reservation-get-all <ref-reservation-get-all>`, :ref:`reservation-get-by-address <ref-reservation-get-by-address>`, :ref:`reservation-get-by-hostname <ref-reservation-get-by-hostname>`, :ref:`reservation-get-by-id <ref-reservation-get-by-id>`, :ref:`reservation-get-page <ref-reservation-get-page>`, :ref:`reservation-update <ref-reservation-update>`.

.. _commands-lease_cmds:

Commands supported by `lease_cmds` hook library: :ref:`lease4-add <ref-lease4-add>`, :ref:`lease4-del <ref-lease4-del>`, :ref:`lease4-get <ref-lease4-get>`, :ref:`lease4-get-all <ref-lease4-get-all>`, :ref:`lease4-get-by-client-id <ref-lease4-get-by-client-id>`, :ref:`lease4-get-by-hostname <ref-lease4-get-by-hostname>`, :ref:`lease4-get-by-hw-address <ref-lease4-get-by-hw-address>`, :ref:`lease4-get-page <ref-lease4-get-page>`, :ref:`lease4-resend-ddns <ref-lease4-resend-ddns>`, :ref:`lease4-update <ref-lease4-update>`, :ref:`lease4-wipe <ref-lease4-wipe>`, :ref:`lease4-write <ref-lease4-write>`, :ref:`lease6-add <ref-lease6-add>`, :ref:`lease6-bulk-apply <ref-lease6-bulk-apply>`, :ref:`lease6-del <ref-lease6-del>`, :ref:`lease6-get <ref-lease6-get>`, :ref:`lease6-get-all <ref-lease6-get-all>`, :ref:`lease6-get-by-duid <ref-lease6-get-by-duid>`, :ref:`lease6-get-by-hostname <ref-lease6-get-by-hostname>`, :ref:`lease6-get-page <ref-lease6-get-page>`, :ref:`lease6-resend-ddns <ref-lease6-resend-ddns>`, :ref:`lease6-update <ref-lease6-update>`, :ref:`lease6-wipe <ref-lease6-wipe>`, :ref:`lease6-write <ref-lease6-write>`.

.. _commands-lease_query:

Commands supported by `lease_query` hook library: :ref:`extended-info4-upgrade <ref-extended-info4-upgrade>`.

.. _commands-stat_cmds:

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

.. _commands-subnet_cmds:

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

.. _ref-build-report:

build-report
------------

This command returns the list of compilation options that this particular binary was built with.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`build-report command <command-build-report>`

Command syntax:

::

    {
        "command": "build-report"
    }


Response syntax:

::

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





.. _ref-cache-clear:

cache-clear
-----------

This command removes all cached host reservations.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-clear command <command-cache-clear>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-flush:

cache-flush
-----------

This command removes up to the given number or all cached host reservations.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-flush command <command-cache-flush>`

Command syntax:

::

    {
        "command": "cache-flush",
        "arguments": 5
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-get:

cache-get
---------

This command returns the full content of the host cache.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-get command <command-cache-get>`

Command syntax:

::

   {
       "command": "cache-get"
   }

Response syntax:

::

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


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-get-by-id:

cache-get-by-id
---------------

This command returns entries matching the given identifier from the host cache.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-get-by-id command <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": <list of host reservations>
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-insert:

cache-insert
------------

This command inserts a host into the cache.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-insert command <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
        }
    }
    
    Another example that adds IPv6 host reservation to cache is:
    {
        "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-load:

cache-load
----------

This command allows the contents of a file on disk to be loaded into an in-memory cache.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-load command <command-cache-load>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-remove:

cache-remove
------------

This command removes entries from the host cache. It takes parameters similar to the ``reservation-get`` command.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-remove command <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": <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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-size:

cache-size
----------

This command returns the number of entries in the host cache.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-size command <command-cache-size>`

Command syntax:

::

   {
       "command": "cache-size"
   }

Response syntax:

::

    {
        "result": 0,
        "text": "123 entries.",
        "arguments": { "size": 123 }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-cache-write:

cache-write
-----------

This command instructs Kea to write its host cache content to disk.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`host_cache <commands-host_cache>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`cache-write command <command-cache-write>`

Command syntax:

::

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


The command takes one mandatory argument that specifies the 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-class-add:

class-add
---------

This command adds a new class to the existing server configuration.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.5.0 (:ref:`class_cmds <commands-class_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`class-add command <command-class-add>`

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 definitions 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 is successful (result 0), unless the class name is a duplicate or another error occurs (result 1).


.. _ref-class-del:

class-del
---------

This command removes a client class from the server configuration.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.5.0 (:ref:`class_cmds <commands-class_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`class-del command <command-class-del>`

Command syntax:

::

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


Response syntax:

::

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


The command returns a result of 3 (empty) if the client class does not exist. If the client class exists, the returned result is 0 if the deletion was successful; the result is 1 if the deletion is unsuccessful.


.. _ref-class-get:

class-get
---------

This command returns detailed information about an existing client class.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.5.0 (:ref:`class_cmds <commands-class_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`class-get command <command-class-get>`

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 definitions 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 the DHCPv4 server. Also, some parameters may not be returned if they are not set for the client class. If a class with the specified name does not 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.


.. _ref-class-list:

class-list
----------

This command retrieves a list of all client classes from the server configuration.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.5.0 (:ref:`class_cmds <commands-class_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`class-list command <command-class-list>`

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 :ref:`command-class-get`.
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.


.. _ref-class-update:

class-update
------------

This command updates an existing client class in the server configuration.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.5.0 (:ref:`class_cmds <commands-class_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`class-update command <command-class-update>`

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 definitions 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 returns the result of 3 (empty) if the client class does not exist. If the client class exists, the returned result is 0 if the update was successful, or 1 if the update is unsuccessful.


.. _ref-config-backend-pull:

config-backend-pull
-------------------

This command forces an immediate update of the server using Config Backends.
This command does not take any parameters.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.1 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-backend-pull command <command-config-backend-pull>`

Command syntax:

::

    {
        "command": "config-backend-pull"
    }


Response syntax:

::

    {
        "result": 0,
        "text": "On demand configuration update successful."
    }


When no Config Backends are configured this command returns empty (3); 
If an error occurs error (1) is returned with the error details; 
otherwise success (0) is returned.


.. _ref-config-get:

config-get
----------

This command retrieves the current configuration used by the server. The configuration is essentially the same as the contents of the configuration file, but includes additional changes made by other commands and due to parameters' inheritance.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-get command <command-config-get>`

Command syntax:

::

    {
        "command": "config-get"
    }


This command takes no parameters.

Response syntax:

::

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


Starting with Kea 2.4.0, the successful response contains an SHA256 digest of the configuration that was 
just retrieved. It might be used to determine if a configuration has been modified or not, possibly with the 
use of config-hash-get.


.. _ref-config-hash-get:

config-hash-get
---------------

This command retrieves the hash of the current configuration used by the server. The 
configuration is essentially the same as the contents of the configuration file, but 
includes additional changes made by other commands and due to parameters' inheritance.
Currently it is SHA256, but the algorithm may change in the future.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 2.4.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-hash-get command <command-config-hash-get>`

Command syntax:

::

    {
        "command": "config-hash-get"
    }


This command takes no parameters.

Response syntax:

::

    {
        "result": <integer>,
        "arguments": {
            "hash": <SHA256 hash of the config in hexa> 
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-config-reload:

config-reload
-------------

This command instructs Kea to reload the configuration file that was used previously.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-reload command <command-config-reload>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-config-set:

config-set
----------

This command instructs the server to replace its current configuration with the new configuration supplied in the command's arguments.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-set command <command-config-set>`

Command syntax:

::

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


In the example below, '<server>' is the configuration element name for a given server such as "Dhcp4" or "Dhcp6".

Response syntax:

::

    {
        "arguments": {
            "hash": "8B5F5822E93178B65CE658304C37EA511BDE7D29F792AA5E88012FC741F2BE32"
        },
        "result": 0,
        "text": "Configuration successful."
    }
    
    or
    
    { "result": 1, "text": "unsupported parameter: BOGUS (<string>:16:26)" }


Starting with Kea 2.4.0, the successful response from a DHCPv4, DHCPv6, or DHCP-DDNS daemons
also contain a SHA-256 digest of the newly set configuration. The digest can be used to easily
determine if a configuration has been modified or not, possibly with the use of config-hash-get.


.. _ref-config-test:

config-test
-----------

This command instructs the server to check whether the new configuration supplied in the command's arguments can be loaded.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-test command <command-config-test>`

Command syntax:

::

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


In the example below, '<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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-config-write:

config-write
------------

This command instructs the Kea server to write its
current configuration to a file on disk.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`config-write command <command-config-write>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-dhcp-disable:

dhcp-disable
------------

This command globally disables the DHCP service.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`dhcp-disable command <command-dhcp-disable>`

Command syntax:

::

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


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-dhcp-enable:

dhcp-enable
-----------

This command globally enables the DHCP service.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`dhcp-enable command <command-dhcp-enable>`

Command syntax:

::

    {
        "command": "dhcp-enable",
        "arguments": {
            "origin": "user"
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-extended-info4-upgrade:

extended-info4-upgrade
----------------------

This command sanitizes extended info of all IPv4 leases and fills relay and remote ID columns in the SQL lease database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 2.3.8 (:ref:`lease_query <commands-lease_query>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`extended-info4-upgrade command <command-extended-info4-upgrade>`

Command syntax:

::

    {
        "command": "extended-info4-upgrade"
        }
    }


Response syntax:

::

    {
      "arguments": {
      },
      "result": 0,
      "text": "to be done"
    }


This command should be used when some old IPv4 leases are present in the lease database using a SQL backend.


.. _ref-gss-tsig-get:

gss-tsig-get
------------

This command retrieves information about the specified GSS-TSIG server.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-get command <command-gss-tsig-get>`

Command syntax:

::

    {
        "command": "gss-tsig-get",
        "arguments": {
            "server-id": "foo"
        }
    }


Response syntax:

::

    {
        "result": 0,
        "text": "GSS-TSIG server[foo] found",
        "arguments": {
            "id": "foo",
            "ip-address": "192.1.2.3",
            "port": 53,
            "server-principal": "DNS/foo.com@FOO.COM",
            "key-name-suffix": "foo.com.",
            "tkey-lifetime": 3600,
            "tkey-protocol": "TCP",
            "keys": [
                {
                    "name": "1234.sig-foo.com.",
                    "server-id": "foo",
                    "inception-date": "2021-09-05 12:23:36.281176",
                    "expire-date": "2021-09-05 13:23:36.281176",
                    "status": "not yet ready",
                    "tkey-exchange": true
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-get-all:

gss-tsig-get-all
----------------

This command lists GSS-TSIG servers and keys.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-get-all command <command-gss-tsig-get-all>`

Command syntax:

::

    {
        "command": "gss-tsig-get-all"
    }


Response syntax:

::

    {
        "result": 0,
        "text": "1 GSS-TSIG servers and 1 keys",
        "arguments": {
            "gss-tsig-servers": [
                {
                    "id": "foo",
                    "ip-address": "192.1.2.3",
                    "port": 53,
                    "server-principal": "DNS/foo.com@FOO.COM",
                    "key-name-suffix": "foo.com.",
                    "tkey-lifetime": 3600,
                    "tkey-protocol": "TCP",
                    "keys": [
                        {
                            "name": "1234.sig-foo.com.",
                            "inception-date": "2021-09-05 12:23:36.281176",
                            "server-id": "foo",
                            "expire-date": "2021-09-05 13:23:36.281176",
                            "status": "not yet ready",
                            "tkey-exchange": true
                        }
                    ]
                },
                {
                    "id": "bar",
                    "ip-address": "192.1.2.4",
                    "port": 53,
                    "server-principal": "DNS/bar.com@FOO.COM",
                    "key-name-suffix": "bar.com.",
                    "tkey-lifetime": 7200,
                    "tkey-protocol": "UDP",
                    "keys": [ ]
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-key-del:

gss-tsig-key-del
----------------

This command deletes the specified GSS-TSIG key.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-key-del command <command-gss-tsig-key-del>`

Command syntax:

::

    {
        "command": "gss-tsig-key-del",
        "arguments": {
            "key-name": "1234.sig-foo.com."
        }
    }


Response syntax:

::

    {
        "result": 0,
        "text": "GSS-TSIG key '1234.sig-foo.com.' 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-key-expire:

gss-tsig-key-expire
-------------------

This command expires the specified GSS-TSIG key.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-key-expire command <command-gss-tsig-key-expire>`

Command syntax:

::

    {
        "command": "gss-tsig-key-expire",
        "arguments": {
            "key-name": "1234.sig-foo.com."
        }
    }


Response syntax:

::

    {
        "result": 0,
        "text": "GSS-TSIG key '1234.sig-foo.com.' expired"
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-key-get:

gss-tsig-key-get
----------------

This command retrieves information about the specified GSS-TSIG key.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-key-get command <command-gss-tsig-key-get>`

Command syntax:

::

    {
        "command": "gss-tsig-key-get",
        "arguments": {
            "key-name": "1234.sig-foo.com."
        }
    }


Response syntax:

::

    {
        "result": 0,
        "text": "GSS-TSIG key '1234.sig-foo.com.' found",
        "arguments": {
            "name": "1234.sig-foo.com.",
            "server-id": "foo",
            "inception-date": "2021-09-05 12:23:36.281176",
            "expire-date": "2021-09-05 13:23:36.281176",
            "status": "not yet ready",
            "tkey-exchange": true
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-list:

gss-tsig-list
-------------

This command lists GSS-TSIG server IDs and key names.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-list command <command-gss-tsig-list>`

Command syntax:

::

    {
        "command": "gss-tsig-list"
    }


Response syntax:

::

    {
        "result": 0,
        "text": "2 GSS-TSIG servers and 3 keys",
        "arguments": {
            "gss-tsig-servers": [
                "foo",
                "bar"
            ],
            "gss-tsig-keys": [
                "1234.example.com.",
                "5678.example.com.",
                "43888.example.org."
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-purge:

gss-tsig-purge
--------------

This command removes not usable GSS-TSIG keys for the specified server.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-purge command <command-gss-tsig-purge>`

Command syntax:

::

    {
        "command": "gss-tsig-purge",
        "arguments": {
            "server-id": "foo"
        }
    }


Response syntax:

::

    {
        "result": 0,
        "text": "2 purged keys for GSS-TSIG server[foo]"
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-purge-all:

gss-tsig-purge-all
------------------

This command removes not usable GSS-TSIG keys.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-purge-all command <command-gss-tsig-purge-all>`

Command syntax:

::

    {
        "command": "gss-tsig-purge-all"
    }


Response syntax:

::

    {
        "result": 0,
        "text": "2 purged GSS-TSIG keys"
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-rekey:

gss-tsig-rekey
--------------

The command unconditionally creates new GSS-TSIG keys for (rekeys) a specified DNS server.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-rekey command <command-gss-tsig-rekey>`

Command syntax:

::

    {
        "command": "gss-tsig-rekey",
        "arguments": {
            "server-id": "foo"
        }
    }


Response syntax:

::

    {
        "result": 0,
        "text": "GSS-TSIG server[foo] rekeyed"
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-gss-tsig-rekey-all:

gss-tsig-rekey-all
------------------

This command unconditionally creates new GSS-TSIG keys (rekeys) for all DNS servers.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`

Availability: 2.0.0 (:ref:`gss_tsig <commands-gss_tsig>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`gss-tsig-rekey-all command <command-gss-tsig-rekey-all>`

Command syntax:

::

    {
        "command": "gss-tsig-rekey-all"
    }


Response syntax:

::

    {
        "result": 0,
        "text": "rekeyed"
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-continue:

ha-continue
-----------

This command resumes the operation of a paused HA state machine.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-continue command <command-ha-continue>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-heartbeat:

ha-heartbeat
------------

This command is sent internally by a Kea partner when operating in High Availability (HA) mode or by the system administrator to verify the state of the servers with regards to the High Availability. It retrieves the server's HA state and clock value.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-heartbeat command <command-ha-heartbeat>`

Command syntax:

::

    {
        "command": "ha-heartbeat"
    }


Response syntax:

::

    {
        "result": 0,
        "text": "HA peer status returned.",
        "arguments": {
            "state": <server state>,
            "date-time": <server notion of time>,
            "scopes": [ <first scope>, <second scope>, ... ],
            "unsent-update-count": <total number of lease allocations in partner-down state>
        }
    }


The response includes a server state (see :ref:`ha-server-states`), current clock value, served scopes and the counter indicating how many leases the server has allocated without sending lease updates to its partner. The partner uses this counter to determine if it should synchronize its lease database.


.. _ref-ha-maintenance-cancel:

ha-maintenance-cancel
---------------------

This command is sent to instruct a server in the partner-in-maintenance
state to transition back to the previous state, effectively canceling the
maintenance.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.4 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-maintenance-cancel command <command-ha-maintenance-cancel>`

Command syntax:

::

   {
       "command": "ha-maintenance-cancel"
   }

This command takes no arguments.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-maintenance-notify:

ha-maintenance-notify
---------------------

This command is sent by the server receiving the ha-maintenance-start
to its partner to cause the partner to transition to the in-maintenance
state or to revert it from the in-maintenance state as a result of
receiving the ha-maintenance-cancel command.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.4 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-maintenance-notify command <command-ha-maintenance-notify>`

Command syntax:

::

    {
        "command": "ha-maintenance-notify",
        "arguments": {
            "cancel": <boolean>
        }
    }


This command includes a boolean argument which, if false, indicates
that the server should transition to the in-maintenance state.
If the argument is set to true it instructs the server to revert from
the in-maintenance state to its previous state.
This command is not meant to be used by the administrator. It is
merely used for internal communication between the HA partners.

Response syntax:

::

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

The response may include a special error code of 1001
to indicate that the partner refused to enter the maintenance state.


.. _ref-ha-maintenance-start:

ha-maintenance-start
--------------------

This command is sent to instruct one of the servers to transition
to the partner-in-maintenance state in which it will be responding to
all DHCP queries. The server receiving this command sends the
ha-maintenance-notify to its partner to cause the partner to
transition to the in-maintenance state.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.4 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-maintenance-start command <command-ha-maintenance-start>`

Command syntax:

::

   {
       "command": "ha-maintenance-start"
   }

This command takes no arguments.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-reset:

ha-reset
--------

This command resets the HA state machine of the server by transitioning it to the waiting state.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.4 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-reset command <command-ha-reset>`

Command syntax:

::

   {
       "command": "ha-reset"
   }

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-scopes:

ha-scopes
---------

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

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-scopes command <command-ha-scopes>`

Command syntax:

::

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


In the example below, the arguments configure the server to handle traffic from both the 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-sync:

ha-sync
-------

This command instructs the server running in HA mode to synchronize its local lease database with the selected peer.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-sync command <command-ha-sync>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-ha-sync-complete-notify:

ha-sync-complete-notify
-----------------------

A server notifies its partner with this command that it has finished the
lease database synchronization. If the partner is in the partner-down state
it temporarily stops allocating new leases until it transitions to a normal
operation state (e.g. load-balancing). If the partner observes a failing
heartbeat it can resume allocating new leases in the partner-down state.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.11 (:ref:`high_availability <commands-high_availability>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`ha-sync-complete-notify command <command-ha-sync-complete-notify>`

Command syntax:

::

   {
       "command": "ha-sync-complete-notify"
   }

This command takes no arguments.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-lease4-add:

lease4-add
----------

This command administratively adds a new IPv4 lease.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-add command <command-lease4-add>`

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

If the returned result is equal to 4, it indicates that the lease could not be created because it was in conflict with the server's state or its notion of the configuration. The High Availability hook library can handle such a result differently than a general error. A general error of 1 can indicate issues with processing the command, database availability etc.


.. _ref-lease4-del:

lease4-del
----------

This command deletes a lease from the lease database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-del command <command-lease4-del>`

Command syntax:

::

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


The lease to be deleted can be specified either by IP address or by identifier-type and identifier value. The 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-lease4-get:

lease4-get
----------

This command queries the lease database and retrieves existing leases.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-get command <command-lease4-get>`

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 the outcome of the operation and lease details,
if found. It has one of the following values: 0 (success), 1 (error), or 3 (empty). 
Result 3 is returned if no leases are found with specified IP address.


.. _ref-lease4-get-all:

lease4-get-all
--------------

This command retrieves all IPv4 leases or all leases for the specified set of subnets.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.4.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-get-all command <command-lease4-get-all>`

Command syntax:

::

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


The ``lease4-get-all`` command may result in very large responses. Please consider using 
``lease4-get-page`` to get them in chunks. The ``subnets`` parameter is optional. If not 
specified, leases from all subnets are returned.

Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "client-id": "01:00:0c:01:02:03:04",
              "cltt": 1600432232,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "",
              "hw-address": "00:0c:01:02:03:04",
              "ip-address": "192.168.1.150",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            },
            {
              "client-id": "01:00:0c:01:02:03:05",
              "cltt": 1600432234,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "",
              "hw-address": "00:0c:01:02:03:05",
              "ip-address": "192.168.1.151",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "2 IPv4 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found with specified parameter.


.. _ref-lease4-get-by-client-id:

lease4-get-by-client-id
-----------------------

This command retrieves all IPv4 leases with the specified client id.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.7.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-get-by-client-id command <command-lease4-get-by-client-id>`

Command syntax:

::

    {
        "command": "lease4-get-by-client-id",
        "arguments": {
            "client-id": "01:00:0c:01:02:03:04"
        }
    }


Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "client-id": "01:00:0c:01:02:03:04",
              "cltt": 1600432232,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "",
              "hw-address": "00:0c:01:02:03:04",
              "ip-address": "192.168.1.150",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv4 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found.


.. _ref-lease4-get-by-hostname:

lease4-get-by-hostname
----------------------

This command retrieves all IPv4 leases with the specified hostname.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.7.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-get-by-hostname command <command-lease4-get-by-hostname>`

Command syntax:

::

    {
        "command": "lease4-get-by-hostname",
        "arguments": {
            "hostname": "myhost.example.com."
        }
    }


Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "client-id": "01:00:0c:01:02:03:04",
              "cltt": 1600432232,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "myhost.example.com.",
              "hw-address": "00:0c:01:02:03:04",
              "ip-address": "192.168.1.150",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv4 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found.


.. _ref-lease4-get-by-hw-address:

lease4-get-by-hw-address
------------------------

This command retrieves all IPv4 leases with the specified hardware address.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.7.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-get-by-hw-address command <command-lease4-get-by-hw-address>`

Command syntax:

::

    {
        "command": "lease4-get-by-hw-address",
        "arguments": {
            "hw-address": "00:0c:01:02:03:04"
        }
    }


Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "client-id": "01:00:0c:01:02:03:04",
              "cltt": 1600432232,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "myhost.example.com.",
              "hw-address": "00:0c:01:02:03:04",
              "ip-address": "192.168.1.150",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv4 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found.


.. _ref-lease4-get-page:

lease4-get-page
---------------

This command retrieves all IPv4 leases by page.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.5.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-get-page command <command-lease4-get-page>`

Command syntax:

::

    {
        "command": "lease4-get-page",
        "arguments": {
            "limit": <integer>,
            "from": <IPv4 address or 'start'>
        }
    }


The from address and the page size limit are mandatory.

Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "client-id": "01:00:0c:01:02:03:04",
              "cltt": 1600432232,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "",
              "hw-address": "00:0c:01:02:03:04",
              "ip-address": "192.168.1.150",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            },
            {
              "client-id": "01:00:0c:01:02:03:05",
              "cltt": 1600432234,
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "",
              "hw-address": "00:0c:01:02:03:05",
              "ip-address": "192.168.1.151",
              "state": 0,
              "subnet-id": 1,
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "2 IPv4 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found with specified parameters.


.. _ref-lease4-resend-ddns:

lease4-resend-ddns
------------------

This command resends a request to kea-dhcp-ddns to update DNS for an existing lease.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.7.6 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-resend-ddns command <command-lease4-resend-ddns>`

Command syntax:

::

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


Response syntax:

::

    {
      "arguments": {
      },
      "result": 0,
      "text": "NCR generated for: 192.0.2.1, hostname: example.com."
    }


lease4-resend-ddns returns a result that indicates the outcome of the operation and lease details, if found. It has one of the following values: 0 (success), 1 (error), or 3 (empty).


.. _ref-lease4-update:

lease4-update
-------------

This command updates existing leases.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-update command <command-lease4-update>`

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

If the returned result is equal to 4, it indicates that the lease could not be updated because it was in conflict with the server's state or its notion of the configuration. The High Availability hook library can handle such a result differently than a general error. A general error of 1 can indicate issues with processing the command, database availability etc.


.. _ref-lease4-wipe:

lease4-wipe
-----------

This command removes all leases associated with a given subnet.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-wipe command <command-lease4-wipe>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-lease4-write:

lease4-write
------------

This command writes the IPv4 memfile lease database into a CSV file.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 2.3.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease4-write command <command-lease4-write>`

Command syntax:

::

    {
        "command": "lease4-write",
        "arguments": {
            "filename": "a_file.csv"
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-lease6-add:

lease6-add
----------

This command administratively creates a new lease.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-add command <command-lease6-add>`

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." }
    or
    { "result": 1, "text": "missing parameter 'ip-address' (<string>:3:19)" }


If the returned result is equal to 4, it indicates that the lease could not be created because it was in conflict with the server's state or its notion of the configuration. The High Availability hook library can handle such a result differently than a general error. A general error of 1 can indicate issues with processing the command, database availability etc.


.. _ref-lease6-bulk-apply:

lease6-bulk-apply
-----------------

This command creates, updates, or deletes multiple IPv6 leases in a single transaction. It communicates lease changes between HA peers, but may be used in all cases where it is desirable to apply multiple lease updates in a single transaction.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-bulk-apply command <command-lease6-bulk-apply>`

Command syntax:

::

    {
        "command": "lease6-bulk-apply",
        "arguments": {
            "deleted-leases": [
                {
                    "ip-address": "2001:db8:abcd::",
                    "type": "IA_PD",
                    ...
                },
                {
                    "ip-address": "2001:db8:abcd::234",
                    "type": "IA_NA",
                    ...
                }
            ],
            "leases": [
                {
                    "subnet-id": 66,
                    "ip-address": "2001:db8:cafe::",
                    "type": "IA_PD",
                    ...
                },
                {
                    "subnet-id": 66,
                    "ip-address": "2001:db8:abcd::333",
                    "type": "IA_NA",
                    ...
                }
            ]
        }
    }


If any of the leases is malformed, all changes are rolled back. If the leases are well-formed but the operation fails for one or more leases, these leases are listed in the response; however, the changes are preserved for all leases for which the operation was successful. The "deleted-leases" and "leases" are optional parameters, but one of them must be specified.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 leases bulk apply completed.",
        "arguments": {
            "failed-deleted-leases": [
                {
                    "ip-address": "2001:db8:abcd::",
                    "type": "IA_PD",
                    "result": <control result>,
                    "error-message": <error message>
                }
            ],
            "failed-leases": [
                {
                    "ip-address": "2001:db8:cafe::",
                    "type": "IA_PD",
                    "result": <control result>,
                    "error-message": <error message>
                }
            ]
        }
    }


The "failed-deleted-leases" holds the list of leases which failed to delete; this includes leases which were not found in the database. The "failed-leases" includes the list of leases which failed to create or update. For each lease for which there was an error during processing, insertion into the database, etc., the result is set to 1. If an error occurs due to a conflict between the lease and the server's configuration or state, the result of 4 is returned instead of 1. For each lease which was not deleted because the server did not find it in the database, the result of 3 is returned.


.. _ref-lease6-del:

lease6-del
----------

This command deletes a lease from the lease database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-del command <command-lease6-del>`

Command syntax:

::

    {
        "command": "lease6-del",
        "arguments": {
            "ip-address": "2001:db8::3"
        }
    }


lease6-del returns a result that indicates the 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-lease6-get:

lease6-get
----------

This command queries the lease database and retrieves existing leases.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-get command <command-lease6-get>`

Command syntax:

::

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


lease6-get returns a result that indicates the outcome of the operation and lease details, if found.

Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "cltt": 1600439560,
              "duid": "00:01:00:01:26:f7:81:88:00:0c:01:02:03:04",
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "foobar.example.org",
              "hw-address": "00:0c:01:02:03:04",
              "iaid": 1,
              "ip-address": "2001:db8:1::",
              "preferred-lft": 3000,
              "state": 0,
              "subnet-id": 1,
              "type": "IA_NA",
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv6 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found with specified parameter.


.. _ref-lease6-get-all:

lease6-get-all
--------------

This command retrieves all IPv6 leases or all leases for the specified set of subnets.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-get-all command <command-lease6-get-all>`

Command syntax:

::

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


The ``lease6-get-all`` command may result in very large responses. Please consider using 
``lease6-get-page`` to get them in chunks. the ``subnets`` parameter is optional. If not 
specified, leases from all subnets are returned.

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


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found with specified parameter.


.. _ref-lease6-get-by-duid:

lease6-get-by-duid
------------------

This command retrieves all IPv6 leases with the specified hardware address.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-get-by-duid command <command-lease6-get-by-duid>`

Command syntax:

::

    {
        "command": "lease6-get-by-duid",
        "arguments": {
            "duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24"
        }
    }


Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "cltt": 1600439560,
              "duid": "00:01:00:01:26:f7:81:88:00:0c:01:02:03:04",
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "foobar.example.org",
              "hw-address": "00:0c:01:02:03:04",
              "iaid": 1,
              "ip-address": "2001:db8:1::",
              "preferred-lft": 3000,
              "state": 0,
              "subnet-id": 1,
              "type": "IA_NA",
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv6 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found with specified parameter.


.. _ref-lease6-get-by-hostname:

lease6-get-by-hostname
----------------------

This command retrieves all IPv6 leases with the specified hostname.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-get-by-hostname command <command-lease6-get-by-hostname>`

Command syntax:

::

    {
        "command": "lease6-get-by-hostname",
        "arguments": {
            "hostname": "myhost.example.com."
        }
    }


Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "cltt": 1600439560,
              "duid": "00:01:00:01:26:f7:81:88:00:0c:01:02:03:04",
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "foobar.example.org",
              "hw-address": "00:0c:01:02:03:04",
              "iaid": 1,
              "ip-address": "2001:db8:1::",
              "preferred-lft": 3000,
              "state": 0,
              "subnet-id": 1,
              "type": "IA_NA",
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv6 lease(s) found."
      }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found with specified parameter.


.. _ref-lease6-get-page:

lease6-get-page
---------------

This command retrieves all IPv6 leases by page.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.5.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-get-page command <command-lease6-get-page>`

Command syntax:

::

    {
        "command": "lease6-get-page",
        "arguments": {
            "limit": <integer>,
            "from": <IPv6 address or 'start'>
        }
    }


The from address and the page size limit are mandatory.

Response syntax:

::

      {
        "arguments": {
          "leases": [
            {
              "cltt": 1600439560,
              "duid": "00:01:00:01:26:f7:81:88:00:0c:01:02:03:04",
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "foo.example.org",
              "hw-address": "00:0c:01:02:03:04",
              "iaid": 1,
              "ip-address": "2001:db8:1::1",
              "preferred-lft": 3000,
              "state": 0,
              "subnet-id": 1,
              "type": "IA_NA",
              "valid-lft": 4000
            },
            {
              "cltt": 1600439570,
              "duid": "00:01:00:01:26:f7:81:88:00:0c:01:02:03:05",
              "fqdn-fwd": false,
              "fqdn-rev": false,
              "hostname": "bar.example.org",
              "hw-address": "00:0c:01:02:03:05",
              "iaid": 1,
              "ip-address": "2001:db8:1::2",
              "preferred-lft": 3000,
              "state": 0,
              "subnet-id": 1,
              "type": "IA_NA",
              "valid-lft": 4000
            }
          ]
        },
        "result": 0,
        "text": "1 IPv6 lease(s) found."
    }


Result 0 is returned when at least one lease is found, 1 when parameters are malformed or missing,
3 is returned if no leases are found.


.. _ref-lease6-resend-ddns:

lease6-resend-ddns
------------------

This command resends a request to kea-dhcp-ddns to update DNS for an existing lease.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.6 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-resend-ddns command <command-lease6-resend-ddns>`

Command syntax:

::

    {
        "command": "lease6-resend-ddns",
        "arguments": {
            "ip-address": "2001:db8::1"
        }
    }


Response syntax:

::

    {
      "arguments": {
      },
      "result": 0,
      "text": "NCR generated for: 2001:db8::1, hostname: example.com."
    }


lease6-resend-ddns returns a result that indicates the outcome of the operation and lease details, if found. It has one of the following values: 0 (success), 1 (error), or 3 (empty).


.. _ref-lease6-update:

lease6-update
-------------

This command updates existing leases.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-update command <command-lease6-update>`

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

If the returned result is equal to 4, it indicates that the lease could not be updated because it was in conflict with the server's state or its notion of the configuration. The High Availability hook library can handle such a result differently than a general error. A general error of 1 can indicate issues with processing the command, database availability etc.


.. _ref-lease6-wipe:

lease6-wipe
-----------

This command removes all leases associated with a given subnet.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-wipe command <command-lease6-wipe>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-lease6-write:

lease6-write
------------

This command writes the IPv6 memfile lease database into a CSV file.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 2.3.1 (:ref:`lease_cmds <commands-lease_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`lease6-write command <command-lease6-write>`

Command syntax:

::

    {
        "command": "lease6-write",
        "arguments": {
            "filename": "a_file.csv"
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-leases-reclaim:

leases-reclaim
--------------

This command instructs the server to reclaim all expired leases immediately.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`leases-reclaim command <command-leases-reclaim>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-libreload:

libreload
---------

This command first unloads and then reloads all currently loaded hooks libraries.
This command is deprecated and will be removed in future Kea versions.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`libreload command <command-libreload>`

Command syntax:

::

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


The server responds with 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-list-commands:

list-commands
-------------

This command retrieves a list of all commands supported by the server.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`list-commands command <command-list-commands>`

Command syntax:

::

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


The server responds 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network4-add:

network4-add
------------

This command adds a new shared network.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network4-add command <command-network4-add>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network4-del:

network4-del
------------

This command deletes existing shared networks.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network4-del command <command-network4-del>`

Command syntax:

::

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


Response syntax:

::

    {
        "command": "network4-del",
        "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network4-get:

network4-get
------------

This command retrieves detailed information about shared networks, including subnets that are currently part of a given network.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network4-get command <command-network4-get>`

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,
                "subnet4": [
                    {
                        "subnet": "192.0.2.0/24",
                        "id": 5,
                        <many other subnet specific details here>
                    },
                    {
                        "subnet": "192.0.3.0/31",
                        "id": 6,
                        <many other subnet specific details here>
                    }
                ],
                "valid-lifetime": 120
            }
            ]
        }
    }


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


.. _ref-network4-list:

network4-list
-------------

This command retrieves the full list of currently configured shared networks.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network4-list command <command-network4-list>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network4-subnet-add:

network4-subnet-add
-------------------

This command adds existing subnets to existing shared networks.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network4-subnet-add command <command-network4-subnet-add>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network4-subnet-del:

network4-subnet-del
-------------------

This command removes a subnet that is part of an existing shared network and demotes it to a plain, stand-alone subnet.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network4-subnet-del command <command-network4-subnet-del>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network6-add:

network6-add
------------

This command adds a new shared network.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network6-add command <command-network6-add>`

Command syntax:

::

    {
        "command": "network6-add",
        "arguments": {
            "shared-networks": [ {
                "name": "floor13",
                "subnet6": [
                {
                    "id": 100,
                    "pools": [ { "pool": "2003:db8:1::1-2003:db8:1::ff" } ],
                    "subnet": "2003:db8:1::/64",
                    "option-data": [
                        {
                            "name": "dns-servers",
                            "data": "2005:db8:1::1"
                        }
                    ]
                },
                {
                    "id": 101,
                    "pools": [ { "pool": "2003:db8:2::1-2003:db8:2::ff" } ],
                    "subnet": "2003:db8:2::/64",
                    "option-data": [
                        {
                            "name": "dns-servers",
                            "data": "2006:db8:1::1"
                        }
                    ]
                } ]
            } ]
        }
    }


Response syntax:

::

    {
        "arguments": {
            "shared-networks": [ { "name": "floor13" } ]
        },
        "result": 0,
        "text": "A new IPv6 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network6-del:

network6-del
------------

This command deletes existing shared networks.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network6-del command <command-network6-del>`

Command syntax:

::

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


Response syntax:

::

    {
        "command": "network6-del",
        "arguments": {
            "shared-networks": [
                {
                    "name": "floor13"
                }
            ]
        },
        "result": 0,
        "text": "IPv6 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network6-get:

network6-get
------------

This command retrieves detailed information about shared networks, including subnets that are currently part of a given network.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network6-get command <command-network6-get>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "Info about IPv6 shared network 'floor13' returned",
        "arguments": {
            "shared-networks": [
            {
                "match-client-id": true,
                "name": "floor13",
                "option-data": [ ],
                "rebind-timer": 90,
                "relay": {
                    "ip-address": "::"
                },
                "renew-timer": 60,
                "subnet6": [
                    {
                        "subnet": "2003:db8:1::/64",
                        "id": 5,
                        <many other subnet specific details here>
                    },
                    {
                        "subnet": "2003:db8:2::/71",
                        "id": 6,
                        <many other subnet specific details here>
                    }
                ],
                "valid-lifetime": 120
            }
            ]
        }
    }


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


.. _ref-network6-list:

network6-list
-------------

This command retrieves the full list of currently configured shared networks.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network6-list command <command-network6-list>`

Command syntax:

::

    {
        "command": "network6-list"
    }


Response syntax:

::

    {
        "arguments": {
            "shared-networks": [
                { "name": "floor1" },
                { "name": "office" }
            ]
        },
        "result": 0,
        "text": "2 IPv6 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network6-subnet-add:

network6-subnet-add
-------------------

This command adds existing subnets to existing shared networks.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network6-subnet-add command <command-network6-subnet-add>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet 2003:db8::/64 (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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-network6-subnet-del:

network6-subnet-del
-------------------

This command removes a subnet that is part of an existing shared network and demotes it to a plain, stand-alone subnet.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`network6-subnet-del command <command-network6-subnet-del>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet 2003:db8::/64 (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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-class4-del:

remote-class4-del
-----------------

This command deletes a DHCPv4 client class from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class4-del command <command-remote-class4-del>`

Command syntax:

::

    {
        "command": "remote-class4-del",
        "arguments": {
            "client-classes": [
                {
                    "name": <client class name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the client class to be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 client class(es) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-class4-get:

remote-class4-get
-----------------

This command fetches a selected DHCPv4 client class by name from the specified database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class4-get command <command-remote-class4-get>`

Command syntax:

::

    {
        "command": "remote-class4-get",
        "arguments": {
            "client-classes": [
                {
                    "name": <client class name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the client class to be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 client class found.",
        "arguments": {
            "client-classes": [
                {
                    "name": <client class name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    },
                    <the rest of the client class information>
                }
            ],
            "count": 1
        }
    }


The metadata is included in the returned shared network definition and provides the database-specific information associated with the returned object.


.. _ref-remote-class4-get-all:

remote-class4-get-all
---------------------

This command fetches all DHCPv4 client classes for specified servers from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class4-get-all command <command-remote-class4-get-all>`

Command syntax:

::

    {
        "command": "remote-class4-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The ``server-tags`` list is required for this command, and must not be empty.

Response syntax:

::

    {
        "result": 0,
        "text": "2 DHCPv4 client class(es) found.",
        "arguments": {
            "client-classes": [
                {
                    <first client class specification>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    }
                },
                {
                    <second client class specification>,
                    "metadata": {
                        "server-tags": [ <first server tag>, ... ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a client class name and the metadata, which provides database-specific information associated with the client class.


.. _ref-remote-class4-set:

remote-class4-set
-----------------

This command creates or replaces a DHCPv4 client class in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class4-set command <command-remote-class4-set>`

Command syntax:

::

    {
        "command": "remote-class4-set",
        "arguments": {
            "client-class": [
                {
                    <client class specification>,
                    "follow-class-name": <existing class name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The provided list must contain exactly one client class specification. It may contain an optional parameter "follow-class-name" which can specify an existing class name to indicate that the class from the command is placed right after this existing class in the hierarchy. This parameter can be omitted or set to "null" to indicate that the new client class should be appended at the end of the hierarchy or an updated class should remain at the current position. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the client class with one or more user-defined servers. It may include the special server tag "all" to associate the class with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 shared network successfully set.",
        "arguments": {
            "client-classes": [
                {
                    "name": <set client class name>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-class6-del:

remote-class6-del
-----------------

This command deletes a DHCPv6 client class from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class6-del command <command-remote-class6-del>`

Command syntax:

::

    {
        "command": "remote-class6-del",
        "arguments": {
            "client-classes": [
                {
                    "name": <client class name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the client class to be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 client class(es) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-class6-get:

remote-class6-get
-----------------

This command fetches a selected DHCPv6 client class by name from the specified database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class6-get command <command-remote-class6-get>`

Command syntax:

::

    {
        "command": "remote-class6-get",
        "arguments": {
            "client-classes": [
                {
                    "name": <client class name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the client class to be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 client class found.",
        "arguments": {
            "client-classes": [
                {
                    "name": <client class name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    },
                    <the rest of the client class information>
                }
            ],
            "count": 1
        }
    }


The metadata is included in the returned shared network definition and provides the database-specific information associated with the returned object.


.. _ref-remote-class6-get-all:

remote-class6-get-all
---------------------

This command fetches all DHCPv6 client classes for specified servers from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class6-get-all command <command-remote-class6-get-all>`

Command syntax:

::

    {
        "command": "remote-class6-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The ``server-tags`` list is required for this command, and must not be empty.

Response syntax:

::

    {
        "result": 0,
        "text": "2 DHCPv6 client class(es) found.",
        "arguments": {
            "client-classes": [
                {
                    <first client class specification>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    }
                },
                {
                    <second client class specification>,
                    "metadata": {
                        "server-tags": [ <first server tag>, ... ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a client class name and the metadata, which provides database-specific information associated with the client class.


.. _ref-remote-class6-set:

remote-class6-set
-----------------

This command creates or replaces a DHCPv6 client class in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.10 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-class6-set command <command-remote-class6-set>`

Command syntax:

::

    {
        "command": "remote-class6-set",
        "arguments": {
            "client-class": [
                {
                    <client class specification>,
                    "follow-class-name": <existing class name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The provided list must contain exactly one client class specification. It may contain an optional parameter "follow-class-name" which can specify an existing class name to indicate that the class from the command is placed right after this existing class in the hierarchy. This parameter can be omitted or set to "null" to indicate that the new client class should be appended at the end of the hierarchy or an updated class should remain at the current position. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the client class with one or more user-defined servers. It may include the special server tag "all" to associate the class with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 shared network successfully set.",
        "arguments": {
            "client-classes": [
                {
                    "name": <set client class name>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-global-parameter4-del:

remote-global-parameter4-del
----------------------------

This command deletes a global DHCPv4 parameter from the configuration database. The server uses the value specified in the configuration file, or a default value if the parameter is not specified, after deleting the parameter from the database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter4-del command <command-remote-global-parameter4-del>`

Command syntax:

::

    {
        "command": "remote-global-parameter4-del",
        "arguments": {
            "parameters": [ <parameter name as string> ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command carries the list including exactly one name of the parameter to be deleted. The ``server-tags`` list is mandatory and it must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 global parameter(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-global-parameter4-get:

remote-global-parameter4-get
----------------------------

This command fetches the selected global parameter for the server from the specified database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter4-get command <command-remote-global-parameter4-get>`

Command syntax:

::

    {
        "command": "remote-global-parameter4-get",
        "arguments": {
            "parameters": [ <parameter name as string> ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command carries a list including exactly one name of the parameter to be fetched. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it fetches the global parameter value shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 global parameter found.",
        "arguments": {
            "parameters": {
                <parameter name>: <parameter value>,
                "metadata": {
                    "server-tags": [ <server tag> ]
                }
            },
            "count": 1
        }
    }


The returned response contains a map with a global parameter name/value pair. The value may be a JSON string, integer, real, or boolean. The metadata is included and provides database-specific information associated with the returned object. If the "all" server tag is specified, the command attempts to fetch the global parameter value associated with all servers. If the explicit server tag is specified, the command fetches the value associated with the given server. If the server-specific value does not exist, the ``remote-global-parameter4-get`` command fetches the value associated with all servers.


.. _ref-remote-global-parameter4-get-all:

remote-global-parameter4-get-all
--------------------------------

This command fetches all global parameters for the server from the specified database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter4-get-all command <command-remote-global-parameter4-get-all>`

Command syntax:

::

    {
        "command": "remote-global-parameter4-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The special server tag "all" is allowed; it fetches the global parameters shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 global parameters found.",
        "arguments": {
            "parameters": [
                {
                    <first parameter name>: <first parameter value>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                },
                {
                    <second parameter name>: <second parameter value>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a global parameter name/value pair. The value may be a JSON string, integer, real, or boolean. The metadata is appended to each parameter and provides database-specific information associated with the returned objects. If the server tag "all" is included in the command, the response contains the global parameters shared among all servers. It excludes server-specific global parameters. If an explicit server tag is included in the command, the response contains all global parameters directly associated with the given server, and the global parameters associated with all servers when server-specific values are not present.


.. _ref-remote-global-parameter4-set:

remote-global-parameter4-set
----------------------------

This command creates or updates one or more global parameters in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter4-set command <command-remote-global-parameter4-set>`

Command syntax:

::

    {
        "command": "remote-global-parameter4-set",
        "arguments": {
            "parameters": {
                <first parameter name>: <first parameter value>,
                <second parameter name>: <second parameter value>
            },
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command carries multiple global parameters with their values. Care should be taken when specifying more than one parameter; in some cases, only a subset of the parameters may be successfully stored in the database and other parameters may fail to be stored. In such cases the ``remote-global-parameter4-get-all`` command may be useful to verify the contents of the database after the update. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it associates the specified parameters with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 global parameter(s) successfully set.",
        "arguments": {
            "parameters": {
                <first parameter name>: <first parameter value>,
                <second parameter name>: <second parameter value>
            },
            "count": 2
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-global-parameter6-del:

remote-global-parameter6-del
----------------------------

This command deletes a global DHCPv6 parameter from the configuration database. The server uses the value specified in the configuration file, or a default value if the parameter is not specified in the configuration file, after deleting the parameter from the database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter6-del command <command-remote-global-parameter6-del>`

Command syntax:

::

    {
        "command": "remote-global-parameter6-del",
        "arguments": {
            "parameters": [ <parameter name as string> ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command carries the list including exactly one name of the parameter to be deleted. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 global parameter(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-global-parameter6-get:

remote-global-parameter6-get
----------------------------

This command fetches the selected global parameter for the server from the specified database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter6-get command <command-remote-global-parameter6-get>`

Command syntax:

::

    {
        "command": "remote-global-parameter6-get",
        "arguments": {
            "parameters": [ <parameter name as string> ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command carries a list including exactly one name of the parameter to be fetched. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it fetches the global parameter value shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 global parameter found.",
        "arguments": {
            "parameters": {
                <parameter name>: <parameter value>,
                "metadata": {
                    "server-tags": [ <server tag> ]
                }
            },
            "count": 1
        }
    }


The returned response contains a map with a global parameter name/value pair. The value may be a JSON string, integer, real, or boolean. The metadata is included and provides database-specific information associated with the returned object. If the "all" server tag is specified, the command attempts to fetch the global parameter value associated with all servers. If the explicit server tag is specified, the command fetches the value associated with the given server. If the server-specific value does not exist, the ``remote-global-parameter6-get`` fetches the value associated with all servers.


.. _ref-remote-global-parameter6-get-all:

remote-global-parameter6-get-all
--------------------------------

This command fetches all global parameters for the server from the specified database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter6-get-all command <command-remote-global-parameter6-get-all>`

Command syntax:

::

    {
        "command": "remote-global-parameter6-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The special server tag "all" is allowed; it fetches the global parameters shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 global parameters found.",
        "arguments": {
            "parameters": [
                {
                    <first parameter name>: <first parameter value>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                },
                {
                    <second parameter name>: <second parameter value>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a global parameter name/value pair. The value may be a JSON string, integer, real, or boolean. The metadata is appended to each parameter and provides database-specific information associated with the returned objects. If the server tag "all" is included in the command, the response contains the global parameters shared among all servers. It excludes server-specific global parameters. If an explicit server tag is included in the command, the response contains all global parameters directly associated with the given server, and the global parameters associated with all servers when server-specific values are not present.


.. _ref-remote-global-parameter6-set:

remote-global-parameter6-set
----------------------------

This command creates or updates one or more global parameters in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-global-parameter6-set command <command-remote-global-parameter6-set>`

Command syntax:

::

    {
        "command": "remote-global-parameter6-set",
        "arguments": {
            "parameters": {
                <first parameter name>: <first parameter value>,
                <second parameter name>: <second parameter value>
            },
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command carries multiple global parameters with their values. Care should be taken when specifying more than one parameter; in some cases, only a subset of the parameters may be successfully stored in the database and other parameters may fail to be stored. In such cases the ``remote-global-parameter6-get-all`` command may be useful to verify the contents of the database after the update. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it associates the specified parameters with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 global parameter(s) successfully set.",
        "arguments": {
            "parameters": {
                <first parameter name>: <first parameter value>,
                <second parameter name>: <second parameter value>
            },
            "count": 2
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-network4-del:

remote-network4-del
-------------------

This command deletes an IPv4 shared network from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network4-del command <command-remote-network4-del>`

Command syntax:

::

    {
        "command": "remote-network4-del",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "subnets-action": <'keep' | 'delete'>,
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the shared network to be deleted. The ``subnets-action`` parameter denotes whether the subnets in this shared network should be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 IPv4 shared network(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-network4-get:

remote-network4-get
-------------------

This command fetches the selected IPv4 shared network for the server from the specified database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network4-get command <command-remote-network4-get>`

Command syntax:

::

    {
        "command": "remote-network4-get",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "subnets-include": <'full' | 'no'>,
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the shared network to be returned. The ``subnets-include`` optional parameter allows for specifying whether the subnets belonging to the shared network should also be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 shared network found.",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    },
                    <the rest of the shared network information, potentially including subnets>
                }
            ],
            "count": 1
        }
    }


If the subnets are returned with the shared network, they are carried in the ``subnet4`` list within the shared network definition. The metadata is included in the returned shared network definition and provides the database-specific information associated with the returned object.


.. _ref-remote-network4-list:

remote-network4-list
--------------------

This command fetches a list of all IPv4 shared networks from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network4-list command <command-remote-network4-list>`

Command syntax:

::

    {
        "command": "remote-network4-list",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The ``server-tags`` list is required for this command, and must not be empty. It may either contain one or multiple server tags as strings, or a single ``null`` value.

Response syntax:

::

    {
        "result": 0,
        "text": "2 IPv4 shared network(s) found.",
        "arguments": {
            "shared-networks": [
                {
                    "name": <first shared network name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    }
                },
                {
                    "name": <second shared network name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, ... ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains the list of maps. Each map contains the shared network name and the metadata, which provides database-specific information associated with the shared network. The returned list does not contain full definitions of the shared networks; use ``remote-network4-get`` to fetch the full information about the selected shared networks. If the command includes explicit server tags as strings (including the special server tag "all"), the list contains all shared networks which are associated with any of the specified tags. A network is returned even if it is associated with multiple servers and only one of the specified tags matches. If the command includes the ``null`` value in the ``server-tags`` list, the response contains all shared networks which are assigned to no servers (unassigned).


.. _ref-remote-network4-set:

remote-network4-set
-------------------

This command creates or replaces an IPv4 shared network in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network4-set command <command-remote-network4-set>`

Command syntax:

::

    {
        "command": "remote-network4-set",
        "arguments": {
            "shared-networks": [
                {
                    <shared network specification excluding subnets list>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The provided list must contain exactly one shared network specification, and must not contain subnets (the "subnet4" parameter). The subnets are added to the shared network using the ``remote-subnet4-set`` command. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the shared network with one or more user-defined servers. It may include the special server tag "all" to associate the network with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 shared network successfully set."
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-network6-del:

remote-network6-del
-------------------

This command deletes an IPv6 shared network from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network6-del command <command-remote-network6-del>`

Command syntax:

::

    {
        "command": "remote-network6-del",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "subnets-action": <'keep' | 'delete'>,
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the shared network to be deleted. The ``subnets-action`` parameter indicates whether the subnets in this shared network should be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 IPv6 shared network(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-network6-get:

remote-network6-get
-------------------

This command fetches the selected IPv6 shared network for the server from the specified database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network6-get command <command-remote-network6-get>`

Command syntax:

::

    {
        "command": "remote-network6-get",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "subnets-include": <'full' | 'no'>,
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one name of the shared network to be returned. The ``subnets-include`` optional parameter allows for specifying whether the subnets belonging to the shared network should also be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 shared network found.",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    },
                    <the rest of the shared network information, potentially including subnets>
                }
            ],
            "count": 1
        }
    }


If the subnets are returned with the shared network, they are carried in the ``subnet6`` list within the shared network definition. The metadata is included in the returned shared network definition and provides the database-specific information associated with the returned object.


.. _ref-remote-network6-list:

remote-network6-list
--------------------

This command fetches a list of all IPv6 shared networks from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network6-list command <command-remote-network6-list>`

Command syntax:

::

    {
        "command": "remote-network6-list",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The ``server-tags`` list is required for this command, and must not be empty. It may either contain one or multiple server tags as strings, or a single ``null`` value.

Response syntax:

::

    {
        "result": 0,
        "text": "2 IPv6 shared network(s) found.",
        "arguments": {
            "shared-networks": [
                {
                    "name": <first shared network name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    }
                },
                {
                    "name": <second shared network name>,
                    "metadata": {
                        "server-tags": [ <first server tag>, ... ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains the list of maps. Each map contains the shared network name and the metadata, which provides database-specific information associated with the shared network. The returned list does not contain full definitions of the shared networks; use ``remote-network6-get`` to fetch the full information about the selected shared networks. If the command includes explicit server tags as strings (including the special server tag "all"), the list contains all shared networks which are associated with any of the specified tags. A network is returned even if it is associated with multiple servers and only one of the specified tags matches. If the command includes the ``null`` value in the ``server-tags`` list, the response contains all shared networks which are assigned to no servers (unassigned).


.. _ref-remote-network6-set:

remote-network6-set
-------------------

This command creates or replaces an IPv6 shared network in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-network6-set command <command-remote-network6-set>`

Command syntax:

::

    {
        "command": "remote-network6-set",
        "arguments": {
            "shared-networks": [
                {
                    <shared network specification excluding subnets list>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The provided list must contain exactly one shared network specification, and must not contain subnets (the "subnet6" parameter). The subnets are added to the shared network using the ``remote-subnet6-set`` command. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the shared network with one or more user-defined servers. It may include the special server tag "all" to associate the network with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 shared network successfully set."
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option-def4-del:

remote-option-def4-del
----------------------

This command deletes a DHCPv4 option definition from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def4-del command <command-remote-option-def4-del>`

Command syntax:

::

    {
        "command": "remote-option-def4-del",
        "arguments": {
            "option-defs": [ {
                "code": <option code>,
                "space": <option space>
            } ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command includes a list with exactly one option definition specification, comprising an option name and code. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 option definition(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option-def4-get:

remote-option-def4-get
----------------------

This command fetches a DHCPv4 option definition from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def4-get command <command-remote-option-def4-get>`

Command syntax:

::

    {
        "command": "remote-option-def4-get",
        "arguments": {
            "option-defs": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The desired option definition is identified by the pair of option code/space values. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed, to fetch the option definition instance shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option definition found.",
        "arguments": {
            "option-defs": [
                {
                    <option definition>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 1
        }
    }


The metadata is included and provides database-specific information associated with the returned object. If the "all" server tag is specified, the command attempts to fetch the option definition associated with all servers. If the explicit server tag is specified, the command fetches the option definition associated with the given server. If the server-specific option definition does not exist, the ``remote-option-def4-get`` command fetches the option definition associated with all servers.


.. _ref-remote-option-def4-get-all:

remote-option-def4-get-all
--------------------------

This command fetches all DHCPv4 option definitions from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def4-get-all command <command-remote-option-def4-get-all>`

Command syntax:

::

    {
        "command": "remote-option-def4-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The special server tag "all" is allowed, to fetch the option definitions shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "2 DHCPv4 option definition(s) found.",
        "arguments": {
            "option-defs": [
                {
                    <first option definition>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                },
                {
                    <second option definition>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains an option definition specification and the metadata, including database-specific information associated with the returned objects. If the server tag "all" is included in the command, the response contains the option definitions shared among all servers. It excludes server-specific option definitions. If an explicit server tag is included in the command, the response contains all option definitions directly associated with the given server, and the option definitions associated with all servers when server-specific option definitions are not present.


.. _ref-remote-option-def4-set:

remote-option-def4-set
----------------------

This command creates or replaces a DHCPv4 option definition in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def4-set command <command-remote-option-def4-set>`

Command syntax:

::

    {
        "command": "remote-option-def4-set",
        "arguments": {
            "option-defs": [
                {
                    <option definition specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The provided list must contain exactly one option definition specification. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it associates the specified option definition with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option definition set."
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option-def6-del:

remote-option-def6-del
----------------------

This command deletes a DHCPv6 option definition from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def6-del command <command-remote-option-def6-del>`

Command syntax:

::

    {
        "command": "remote-option-def6-del",
        "arguments": {
            "option-defs": [ {
                "code": <option code>,
                "space": <option space>
            } ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command includes a list with exactly one option definition specification, comprising an option name and code. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 option definition(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option-def6-get:

remote-option-def6-get
----------------------

This command fetches a DHCPv6 option definition from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def6-get command <command-remote-option-def6-get>`

Command syntax:

::

    {
        "command": "remote-option-def6-get",
        "arguments": {
            "option-defs": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The desired option definition is identified by the pair of option code/space values. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed, to fetch the option definition instance shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option definition found.",
        "arguments": {
            "option-defs": [
                {
                    <option definition>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 1
        }
    }


The metadata is included and provides database-specific information associated with the returned object. If the "all" server tag is specified, the command fetches the option definition associated with all servers. If the explicit server tag is specified, the command fetches the option definition associated with the given server. If the server-specific option definition does not exist, the ``remote-option-def6-get`` command fetches the option definition associated with all servers.


.. _ref-remote-option-def6-get-all:

remote-option-def6-get-all
--------------------------

This command fetches all DHCPv6 option definitions from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def6-get-all command <command-remote-option-def6-get-all>`

Command syntax:

::

    {
        "command": "remote-option-def6-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The special server tag "all" is allowed, to fetch the option definitions shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "2 DHCPv6 option definition(s) found.",
        "arguments": {
            "option-defs": [
                {
                    <first option definition>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                },
                {
                    <second option definition>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains an option definition specification and the metadata, including database-specific information associated with the returned objects. If the server tag "all" is included in the command, the response contains the option definitions shared among all servers. It excludes server-specific option definitions. If an explicit server tag is included in the command, the response contains all option definitions directly associated with the given server, and the option definitions associated with all servers when server-specific option definitions are not present.


.. _ref-remote-option-def6-set:

remote-option-def6-set
----------------------

This command creates or replaces a DHCPv6 option definition in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option-def6-set command <command-remote-option-def6-set>`

Command syntax:

::

    {
        "command": "remote-option-def6-set",
        "arguments": {
            "option-defs": [
                {
                    <option definition specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The provided list must contain exactly one option definition specification. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it associates the specified option definition with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option definition set."
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-global-del:

remote-option4-global-del
-------------------------

This command deletes a DHCPv4 global option from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-global-del command <command-remote-option4-global-del>`

Command syntax:

::

    {
        "command": "remote-option4-global-del",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command includes a list with exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-global-get:

remote-option4-global-get
-------------------------

This command fetches a global DHCPv4 option for the server from the specified database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-global-get command <command-remote-option4-global-get>`

Command syntax:

::

    {
        "command": "remote-option4-global-get",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The option is identified by the pair of option code/space values. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed, to fetch the global option instance shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option is found.",
        "arguments": {
            "options": [
                {
                    <option information>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ]
        }
    }


The metadata is included and provides database specific information associated with the returned object. If the "all" server tag is specified, the command fetches the global option associated with all servers. If the explicit server tag is specified, the command fetches the global option associated with the given server. If the server specific option does not exist, it fetches the option associated with all servers.


.. _ref-remote-option4-global-get-all:

remote-option4-global-get-all
-----------------------------

This command fetches all DHCPv4 global options for the server from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-global-get-all command <command-remote-option4-global-get-all>`

Command syntax:

::

    {
        "command": "remote-option4-global-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The special server tag "all" is allowed, to fetch the global options shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "2 DHCPv4 option(s) found.",
        "arguments": {
            "options": [
                {
                    <first option specification>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                },
                {
                    <second option specification>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a global option specification and the metadata, including database-specific information associated with the returned object. If the server tag "all" is included in the command, the response contains the global options shared among all servers. It excludes server-specific global options. If an explicit server tag is included in the command, the response contains all global options directly associated with the given server, and the options associated with all servers when server-specific options are not present.


.. _ref-remote-option4-global-set:

remote-option4-global-set
-------------------------

This command creates or replaces a DHCPv4 global option in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-global-set command <command-remote-option4-global-set>`

Command syntax:

::

    {
        "command": "remote-option4-global-set",
        "arguments": {
            "options": [
                {
                    <global option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The provided list must contain exactly one option specification. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it associates the specified option with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-network-del:

remote-option4-network-del
--------------------------

This command deletes a DHCPv4 option from a shared network from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-network-del command <command-remote-option4-network-del>`

Command syntax:

::

    {
        "command": "remote-option4-network-del",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one name of the shared network and exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-network-set:

remote-option4-network-set
--------------------------

This command creates or replaces a DHCPv4 option in a shared network in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-network-set command <command-remote-option4-network-set>`

Command syntax:

::

    {
        "command": "remote-option4-network-set",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "options": [
                {
                    <shared network option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


The provided lists must contain exactly one name of the shared network and one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-pool-del:

remote-option4-pool-del
-----------------------

This command deletes a DHCPv4 option from an address pool from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-pool-del command <command-remote-option4-pool-del>`

Command syntax:

::

    {
        "command": "remote-option4-pool-del",
        "arguments": {
            "pools": [
                {
                    "pool": <pool range or prefix>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one address pool specification and exactly one option specification comprising an option space name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-pool-set:

remote-option4-pool-set
-----------------------

This command creates or replaces a DHCPv4 option in an address pool in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-pool-set command <command-remote-option4-pool-set>`

Command syntax:

::

    {
        "command": "remote-option4-pool-set",
        "arguments": {
            "pools": [
                {
                    "pool": <pool range or prefix>
                }
            ],
            "options": [
                {
                    <address pool option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly address pool specification and exactly one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-subnet-del:

remote-option4-subnet-del
-------------------------

This command deletes a DHCPv4 option from a subnet from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-subnet-del command <command-remote-option4-subnet-del>`

Command syntax:

::

    {
        "command": "remote-option4-subnet-del",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one ID of the subnet and exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option4-subnet-set:

remote-option4-subnet-set
-------------------------

This command creates or replaces a DHCPv4 option in a subnet in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option4-subnet-set command <command-remote-option4-subnet-set>`

Command syntax:

::

    {
        "command": "remote-option4-subnet-set",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "options": [
                {
                    <subnet option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


The provided lists must contain exactly one ID of the subnet and one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-global-del:

remote-option6-global-del
-------------------------

This command deletes a DHCPv6 global option from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-global-del command <command-remote-option6-global-del>`

Command syntax:

::

    {
        "command": "remote-option6-global-del",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


This command includes a list with exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-global-get:

remote-option6-global-get
-------------------------

This command fetches a global DHCPv6 option for the server from the specified database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-global-get command <command-remote-option6-global-get>`

Command syntax:

::

    {
        "command": "remote-option6-global-get",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The option is identified by the pair of option code/space values. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed, to fetch the global option instance shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option is found.",
        "arguments": {
            "options": [
                {
                    <option information>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ]
        }
    }


The metadata is included and provides database-specific information associated with the returned object. If the "all" server tag is specified, the command attempts to fetch the global option associated with all servers. If the explicit server tag is specified, the command will fetch the global option associated with the given server. If the server-specific option does not exist, it fetches the option associated with all servers.


.. _ref-remote-option6-global-get-all:

remote-option6-global-get-all
-----------------------------

This command fetches all DHCPv6 global options for the server from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-global-get-all command <command-remote-option6-global-get-all>`

Command syntax:

::

    {
        "command": "remote-option6-global-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The special server tag "all" is allowed, to fetch the global options shared by all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "2 DHCPv6 option(s) found.",
        "arguments": {
            "options": [
                {
                    <first option specification>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                },
                {
                    <second option specification>,
                    "metadata": {
                        "server-tags": [ <server tag> ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a global option specification and the metadata, including database-specific information associated with the returned object. If the server tag "all" is included in the command, the response contains the global options shared between all servers. It excludes server-specific global options. If an explicit server tag is included in the command, the response contains all global options directly associated with the given server, and the options associated with all servers when server-specific options are not present.


.. _ref-remote-option6-global-set:

remote-option6-global-set
-------------------------

This command creates or replaces a DHCPv6 global option in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-global-set command <command-remote-option6-global-set>`

Command syntax:

::

    {
        "command": "remote-option6-global-set",
        "arguments": {
            "options": [
                {
                    <global option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <single server tag as string> ]
        }
    }


The provided list must contain exactly one option specification. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. The server tag "all" is allowed; it associates the specified option with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-network-del:

remote-option6-network-del
--------------------------

This command deletes a DHCPv6 option from a shared network from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-network-del command <command-remote-option6-network-del>`

Command syntax:

::

    {
        "command": "remote-option6-network-del",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one name of the shared network and exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-network-set:

remote-option6-network-set
--------------------------

This command creates or replaces a DHCPv6 option in a shared network in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-network-set command <command-remote-option6-network-set>`

Command syntax:

::

    {
        "command": "remote-option6-network-set",
        "arguments": {
            "shared-networks": [
                {
                    "name": <shared network name>
                }
            ],
            "options": [
                {
                    <shared network option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


The provided lists must contain exactly one name of the shared network and one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-pd-pool-del:

remote-option6-pd-pool-del
--------------------------

This command deletes a DHCPv6 option from a prefix delegation pool from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-pd-pool-del command <command-remote-option6-pd-pool-del>`

Command syntax:

::

    {
        "command": "remote-option6-pd-pool-del",
        "arguments": {
            "pd-pools": [
                {
                    "prefix": <pool prefix (address part)>,
                    "prefix-len": <pool prefix (length part)>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one prefix delegation pool specification and exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-pd-pool-set:

remote-option6-pd-pool-set
--------------------------

This command creates or replaces a DHCPv6 option in a prefix delegation pool in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-pd-pool-set command <command-remote-option6-pd-pool-set>`

Command syntax:

::

    {
        "command": "remote-option6-pd-pool-set",
        "arguments": {
            "pd-pools": [
                {
                    "prefix": <pool prefix (address part)>,
                    "prefix-len": <pool prefix (length part)>
                }
            ],
            "options": [
                {
                    <prefix delegation pool option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one prefix delegation pool specification and exactly one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-pool-del:

remote-option6-pool-del
-----------------------

This command deletes a DHCPv6 option from an address pool from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-pool-del command <command-remote-option6-pool-del>`

Command syntax:

::

    {
        "command": "remote-option6-pool-del",
        "arguments": {
            "pools": [
                {
                    "pool": <pool range or prefix>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one address pool specification and exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-pool-set:

remote-option6-pool-set
-----------------------

This command creates or replaces a DHCPv6 option in an address pool in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-pool-set command <command-remote-option6-pool-set>`

Command syntax:

::

    {
        "command": "remote-option6-pool-set",
        "arguments": {
            "pools": [
                {
                    "pool": <pool range or prefix>
                }
            ],
            "options": [
                {
                    <address pool option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly address pool specification and exactly one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-subnet-del:

remote-option6-subnet-del
-------------------------

This command deletes a DHCPv6 option from a subnet from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-subnet-del command <command-remote-option6-subnet-del>`

Command syntax:

::

    {
        "command": "remote-option6-subnet-del",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes two lists with exactly one ID of the subnet and exactly one option specification, comprising an option name and code. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 option(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-option6-subnet-set:

remote-option6-subnet-set
-------------------------

This command creates or replaces a DHCPv6 option in a subnet in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-option6-subnet-set command <command-remote-option6-subnet-set>`

Command syntax:

::

    {
        "command": "remote-option6-subnet-set",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "options": [
                {
                    <subnet option specification>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


The provided lists must contain exactly one ID of the subnet and one option specification. Specifying an empty list, a value of ``null``, or a server tag will result in an error.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 option successfully set.",
        "arguments": {
            "options": [
                {
                    "code": <option code>,
                    "space": <option space>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-server4-del:

remote-server4-del
------------------

This command deletes information about a DHCPv4 server from the configuration database. Any configuration explicitly associated with the deleted server is automatically disassociated. In addition, configuration elements not shareable with other servers (e.g. global DHCP parameters) are deleted. Shareable configuration elements (e.g. subnets, shared networks) are not deleted as they may be used by other servers.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server4-del command <command-remote-server4-del>`

Command syntax:

::

    {
        "command": "remote-server4-del",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command carries the list including exactly one map with the tag of the server to be deleted.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv4 server(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-server4-get:

remote-server4-get
------------------

This command fetches information about the DHCPv4 server, such as the server tag and description.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server4-get command <command-remote-server4-get>`

Command syntax:

::

    {
        "command": "remote-server4-get",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command carries the list including exactly one map with the tag of the server to be fetched.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCP server 'server tag' found.",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>,
                    "description": <server description>
                }
            ],
            "count": 1
        }
    }


The server tag is the unique identifier of the server, used to associate the configuration elements in the database with the particular server instance. The returned server description is specified by the user when setting the server information.


.. _ref-remote-server4-get-all:

remote-server4-get-all
----------------------

This command fetches information about all DHCPv4 servers specified by the user.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server4-get-all command <command-remote-server4-get-all>`

Command syntax:

::

    {
        "command": "remote-server4-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command contains no arguments besides the optional ``remote``.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 servers found.",
        "arguments": {
            "servers": [
                {
                    "server-tag": <first server tag>,
                    "description": <first server description>
                },
                {
                    "server-tag": <second server tag>,
                    "description": <second server description>
                }
            ],
            "count": 2
        }
    }


The returned response contain a list of maps. Each map contains a server tag uniquely identifying a server, and the user-defined description of the server. The Kea Configuration Backend uses the keyword ``all`` to associate parts of the configuration with all servers. Internally, it creates the logical server ``all`` for this purpose. However, this logical server is not returned as a result of the ``remote-server4-get-all`` command; only the user-defined servers are returned.


.. _ref-remote-server4-set:

remote-server4-set
------------------

This command creates or replaces information about the DHCPv4 server in the database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server4-set command <command-remote-server4-set>`

Command syntax:

::

    {
        "command": "remote-server4-set",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>,
                    "description": <server description>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


The provided list must contain exactly one server specification. The ``server-tag`` must be unique across all servers within the configuration database. The ``description`` is the arbitrary text describing the server, its location within the network, etc.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv4 server successfully set.",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>,
                    "description": <server description>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-server6-del:

remote-server6-del
------------------

This command deletes information about a DHCPv6 server from the configuration database. Any configuration explicitly associated with the deleted server is automatically disassociated. In addition, configuration elements not shareable with other servers (e.g. global DHCP parameters) are deleted. Shareable configuration elements (e.g. subnets, shared networks) are not deleted as they may be used by other servers.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server6-del command <command-remote-server6-del>`

Command syntax:

::

    {
        "command": "remote-server6-del",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server name>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command carries the list including exactly one map with the tag of the server to be deleted.

Response syntax:

::

    {
        "result": 0,
        "text": "1 DHCPv6 server(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-server6-get:

remote-server6-get
------------------

This command fetches information about the DHCPv6 server, such as the server tag and description.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server6-get command <command-remote-server6-get>`

Command syntax:

::

    {
        "command": "remote-server6-get",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command carries the list including exactly one map with the tag of the server to be fetched.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCP server 'server tag' found.",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>,
                    "description": <server description>
                }
            ],
            "count": 1
        }
    }


The server tag is the unique identifier of the server, used to associate the configuration elements in the database with the particular server instance. The returned server description is specified by the user when setting the server information.


.. _ref-remote-server6-get-all:

remote-server6-get-all
----------------------

This command fetches information about all DHCPv6 servers specified by the user.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server6-get-all command <command-remote-server6-get-all>`

Command syntax:

::

    {
        "command": "remote-server6-get-all",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command contains no arguments besides the optional ``remote``.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 servers found.",
        "arguments": {
            "servers": [
                {
                    "server-tag": <first server tag>,
                    "description": <first server description>
                },
                {
                    "server-tag": <second server tag>,
                    "description": <second server description>
                }
            ],
            "count": 2
        }
    }


The returned response contain a list of maps. Each map contains a server tag uniquely identifying a server, and the user-defined description of the server. The Kea Configuration Backend uses the keyword ``all`` to associate parts of the configuration with all servers. Internally, it creates the logical server ``all`` for this purpose. However, this logical server is not returned as a result of the ``remote-server6-get-all`` command; only the user-defined servers are returned.


.. _ref-remote-server6-set:

remote-server6-set
------------------

This command creates or replaces information about the DHCPv6 server in the database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-server6-set command <command-remote-server6-set>`

Command syntax:

::

    {
        "command": "remote-server6-set",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>,
                    "description": <server description>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


The provided list must contain exactly one server specification. The ``server-tag`` must be unique across all servers within the configuration database. The ``description`` is the arbitrary text describing the server, its location within the network, etc.

Response syntax:

::

    {
        "result": 0,
        "text": "DHCPv6 server successfully set.",
        "arguments": {
            "servers": [
                {
                    "server-tag": <server tag>,
                    "description": <server description>
                }
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-subnet4-del-by-id:

remote-subnet4-del-by-id
------------------------

This command deletes an IPv4 subnet by ID from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet4-del-by-id command <command-remote-subnet4-del-by-id>`

Command syntax:

::

    {
        "command": "remote-subnet4-del-by-id",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one ID of the subnet to be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 IPv4 subnet(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-subnet4-del-by-prefix:

remote-subnet4-del-by-prefix
----------------------------

This command deletes an IPv4 subnet by prefix from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet4-del-by-prefix command <command-remote-subnet4-del-by-prefix>`

Command syntax:

::

    {
        "command": "remote-subnet4-del-by-prefix",
        "arguments": {
            "subnets": [
                {
                    "subnet": <subnet prefix>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one prefix of the subnet to be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 IPv4 subnet(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-subnet4-get-by-id:

remote-subnet4-get-by-id
------------------------

This command fetches the selected IPv4 subnet by ID from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet4-get-by-id command <command-remote-subnet4-get-by-id>`

Command syntax:

::

    {
        "command": "remote-subnet4-get-by-id",
        "arguments": {
            "subnets": [ {
                "id": <subnet identifier>
            } ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one ID of the subnet to be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 subnet found.",
        "arguments": {
            "subnets": [ {
                "id": <subnet identifier>,
                "subnet": <subnet prefix>,
                "shared-network-name": <shared network name or null>,
                "metadata": {
                    "server-tags": [ <first server tag>, <second server tag>, ... ]
                },
                <the rest of the subnet specification here>
            } ],
            "count": 1
        }
    }


If the shared network name is null, it means that the returned subnet does not belong to any shared network (a global subnet). The metadata is included in the returned subnet definition and provides database-specific information associated with the returned object.


.. _ref-remote-subnet4-get-by-prefix:

remote-subnet4-get-by-prefix
----------------------------

This command fetches the selected IPv4 subnet by prefix from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet4-get-by-prefix command <command-remote-subnet4-get-by-prefix>`

Command syntax:

::

    {
        "command": "remote-subnet4-get-by-prefix",
        "arguments": {
            "subnets": [ {
                "subnet": <subnet prefix>
            } ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one prefix of the subnet to be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 subnet found.",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>,
                    "subnet": <subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    },
                    <the rest of the subnet specification here>
                }
            ],
            "count": 1
        }
    }


If the shared network name is null, it means that the returned subnet does not belong to any shared network (global subnet). The metadata is included in the returned subnet definition and provides database-specific information associated with the returned object.


.. _ref-remote-subnet4-list:

remote-subnet4-list
-------------------

This command fetches a list of all IPv4 subnets from the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet4-list command <command-remote-subnet4-list>`

Command syntax:

::

    {
        "command": "remote-subnet4-list",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The ``server-tags`` list is required for this command, and must not be empty. It may either contain one or multiple server tags as strings, or a single ``null`` value.

Response syntax:

::

    {
        "result": 0,
        "text": "2 IPv4 subnets found.",
        "arguments": {
            "subnets": [
                {
                    "id": <first subnet identifier>,
                    "subnet": <first subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    }
                },
                {
                    "id": <second subnet identifier>,
                    "subnet": <second subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    "metadata": {
                        "server-tags": [ <first server tag>, ... ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a subnet identifier, prefix, and shared network name to which the subnet belongs. If the subnet does not belong to a shared network, the name is null. The metadata includes database-specific information associated with the subnets. The returned list does not contain full subnet definitions; use ``remote-subnet4-get`` to fetch the full information about the selected subnets. If the command includes explicit server tags as strings (including the special server tag "all"), the list contains all subnets which are associated with any of the specified tags. A subnet is returned even if it is associated with multiple servers and only one of the specified tags matches. If the command includes the ``null`` value in the ``server-tags`` list, the response contains all subnets which are assigned to no servers (unassigned).


.. _ref-remote-subnet4-set:

remote-subnet4-set
------------------

This command creates or replaces an IPv4 subnet in the configuration database.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet4-set command <command-remote-subnet4-set>`

Command syntax:

::

    {
        "command": "remote-subnet4-set",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>,
                    "subnet": <subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    <the rest of the subnet specification here>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The provided list must contain exactly one subnet specification. The ``shared-network-name`` parameter is required for these commands; it associates the subnet with the shared network by its name. If the subnet must not belong to any shared network (a global subnet), the ``null`` value must be specified for the shared network name. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the subnet with one or more user-defined servers. The ``remote-subnet4-set`` command may include the special server tag "all" to associate the subnet with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 subnet successfully set.",
        "arguments": {
            "id": <subnet identifier>,
            "subnet": <subnet prefix>
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-subnet6-del-by-id:

remote-subnet6-del-by-id
------------------------

This command deletes an IPv6 subnet by ID from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet6-del-by-id command <command-remote-subnet6-del-by-id>`

Command syntax:

::

    {
        "command": "remote-subnet6-del-by-id",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one ID of the subnet to be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 IPv6 subnet(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-subnet6-del-by-prefix:

remote-subnet6-del-by-prefix
----------------------------

This command deletes an IPv6 subnet by prefix from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet6-del-by-prefix command <command-remote-subnet6-del-by-prefix>`

Command syntax:

::

    {
        "command": "remote-subnet6-del-by-prefix",
        "arguments": {
            "subnets": [
                {
                    "subnet": <subnet prefix>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one prefix of the subnet to be deleted. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "1 IPv6 subnet(s) deleted.",
        "arguments": {
            "count": 1
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-remote-subnet6-get-by-id:

remote-subnet6-get-by-id
------------------------

This command fetches the selected IPv6 subnet by ID from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet6-get-by-id command <command-remote-subnet6-get-by-id>`

Command syntax:

::

    {
        "command": "remote-subnet6-get-by-id",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one ID of the subnet to be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet found.",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>,
                    "subnet": <subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    },
                    <the rest of the subnet specification here>
                }
            ],
            "count": 1
        }
    }


If the shared network name is null, it means that the returned subnet does not belong to any shared network (a global subnet). The metadata is included in the returned subnet definition and provides database-specific information associated with the returned object.


.. _ref-remote-subnet6-get-by-prefix:

remote-subnet6-get-by-prefix
----------------------------

This command fetches the selected IPv6 subnet by prefix from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet6-get-by-prefix command <command-remote-subnet6-get-by-prefix>`

Command syntax:

::

    {
        "command": "remote-subnet6-get-by-prefix",
        "arguments": {
            "subnets": [
                {
                    "subnet": <subnet prefix>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            }
        }
    }


This command includes a list with exactly one prefix of the subnet to be returned. The ``server-tags`` parameter must not be specified for this command.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet found.",
        "arguments": {
            "subnets": [ {
                "id": <subnet identifier>,
                "subnet": <subnet prefix>,
                "shared-network-name": <shared network name or null>,
                "metadata": {
                    "server-tags": [ <first server tag>, <second server tag>, ... ]
                },
                <the rest of the subnet specification here>
            } ],
            "count": 1
        }
    }


If the shared network name is null, it means that the returned subnet does not belong to any shared network (global subnet). The metadata is included in the returned subnet definition and provides database-specific information associated with the returned object.


.. _ref-remote-subnet6-list:

remote-subnet6-list
-------------------

This command fetches a list of all IPv6 subnets from the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet6-list command <command-remote-subnet6-list>`

Command syntax:

::

    {
        "command": "remote-subnet6-list",
        "arguments": {
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The ``server-tags`` list is required for this command, and must not be empty. It may either contain one or multiple server tags as strings, or a single ``null`` value.

Response syntax:

::

    {
        "result": 0,
        "text": "2 IPv6 subnets found.",
        "arguments": {
            "subnets": [
                {
                    "id": <first subnet identifier>,
                    "subnet": <first subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    "metadata": {
                        "server-tags": [ <first server tag>, <second server tag>, ... ]
                    }
                },
                {
                    "id": <second subnet identifier>,
                    "subnet": <second subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    "metadata": {
                        "server-tags": [ <first server tag>, ... ]
                    }
                }
            ],
            "count": 2
        }
    }


The returned response contains a list of maps. Each map contains a subnet identifier, prefix, and shared network name to which the subnet belongs. If the subnet does not belong to a shared network, the name is null. The metadata includes database-specific information associated with the subnets. The returned list does not contain full subnet definitions; use ``remote-subnet6-get`` to fetch the full information about the selected subnets. If the command includes explicit server tags as strings (including the special server tag "all"), the list contains all subnets which are associated with any of the specified tags. A subnet is returned even if it is associated with multiple servers and only one of the specified tags matches. If the command includes the ``null`` value in the ``server-tags`` list, the response contains all subnets which are assigned to no servers (unassigned).


.. _ref-remote-subnet6-set:

remote-subnet6-set
------------------

This command creates or replaces an IPv6 subnet in the configuration database.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`cb_cmds <commands-cb_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`remote-subnet6-set command <command-remote-subnet6-set>`

Command syntax:

::

    {
        "command": "remote-subnet6-set",
        "arguments": {
            "subnets": [
                {
                    "id": <subnet identifier>,
                    "subnet": <subnet prefix>,
                    "shared-network-name": <shared network name or null>,
                    <the rest of the subnet specification here>
                }
            ],
            "remote": {
                <specification of the database to connect to>
            },
            "server-tags": [ <first server tag>, <second server tag>, ... ]
        }
    }


The provided list must contain exactly one subnet specification. The ``shared-network-name`` parameter is required for these commands; it associates the subnet with the shared network by its name. If the subnet must not belong to any shared network (a global subnet), the ``null`` value must be specified for the shared network name. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the subnet with one or more user-defined servers. The ``remote-subnet6-set`` command may include the special server tag "all" to associate the subnet with all servers.

Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet successfully set.",
        "arguments": {
            "id": <subnet identifier>,
            "subnet": <subnet prefix>
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-reservation-add:

reservation-add
---------------

This command adds a new host reservation. The reservation may include IPv4 addresses, IPv6 addresses, IPv6 prefixes, various identifiers, a class the client will be assigned to, DHCPv4 and DHCPv6 options, and more.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-add command <command-reservation-add>`

Command syntax:

::

    {
        "command": "reservation-add",
        "arguments": {
            "reservation": {
                "boot-file-name": <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": [ <comma-separated structures defining options> ],
                "prefixes": [ <comma-separated IPv6 prefixes> ],
                "client-classes": [ <comma-separated strings> ],
                "server-hostname": <string>,
                "subnet-id": <integer>,
                "user-context": <any valid JSON>
            },
            "operation-target": <string (memory, database, all, default)>
        }
    }


Note that boot-file-name, circuit-id, client-id, ip-address, next-server, and server-hostname are IPv4-specific. ip-addresses, and prefixes are IPv6-specific. Operation-target is optional; default is 'alternate'.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-reservation-del:

reservation-del
---------------

This command deletes an existing host reservation.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-del command <command-reservation-del>`

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>,
            "operation-target": <string (memory, database, all, default)>
        }
    }


The host reservation can be identified by either the (subnet-id, ip-address) pair or a triplet of (subnet-id, identifier-type, identifier). Operation-target is optional; default is 'alternate'.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-reservation-get:

reservation-get
---------------

This command retrieves an existing host reservation.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-get command <command-reservation-get>`

Command syntax:

::

    {
        "command": "reservation-get",
        "arguments": {
            "subnet-id": <integer>,
            "identifier-type": <one of 'hw-address', 'duid', 'circuit-id', 'client-id' and 'flex-id'>,
            "identifier": <string>,
            "operation-target": <string (memory, database, all, default)>
        }
    }


The host reservation can be identified by either the (subnet-id, ip-address) pair or a triplet of (subnet-id, identifier-type, identifier). Operation-target is optional; default is 'all'.

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": [ <comma-separated structures defining options> ],
            "prefixes": [ <comma-separated IPv6 prefixes> ],
            "client-classes": [ <comma-separated strings> ],
            "server-hostname": <string>,
            "subnet-id": <integer>,
            "user-context": <any valid JSON>
        }
    }


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


.. _ref-reservation-get-all:

reservation-get-all
-------------------

This command retrieves all host reservations for a specified subnet.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-get-all command <command-reservation-get-all>`

Command syntax:

::

    {
        "command": "reservation-get-all",
        "arguments": {
            "subnet-id": <integer>,
            "operation-target": <string (memory, database, all, default)>
        }
    }


Operation-target is optional; default is 'all'.

Response syntax:

::

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

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


.. _ref-reservation-get-by-address:

reservation-get-by-address
--------------------------

This command retrieves all host reservations for given ip-address and optionally a specified subnet.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 2.4.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-get-by-address command <command-reservation-get-by-address>`

Command syntax:

::

    {
        "command": "reservation-get-by-address",
        "arguments": {
            "ip-address": <string>,
            "subnet-id": <integer>,
            "operation-target": <string (memory, database, all, default)>
        }
    }


The host reservations can be identified by a pair of 'ip-address' and 'subnet-id'. 'subnet-id' is optional. 'operation-target' is optional; default is 'all'.

Response syntax:

::

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

The reservation-get-by-address may return many reservations for the same ip-address. This command may be useful in case ip-reservations-unique configuration flag is set to false.


.. _ref-reservation-get-by-hostname:

reservation-get-by-hostname
---------------------------

This command retrieves all host reservations for a specified hostname and optionally a specified subnet.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.1 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-get-by-hostname command <command-reservation-get-by-hostname>`

Command syntax:

::

    {
        "command": "reservation-get-by-hostname",
        "arguments": {
            "hostname": <hostname>,
            "subnet-id": <integer>,
            "operation-target": <string (memory, database, all, default)>
        }
    }


Operation-target is optional; default is 'all'.

Response syntax:

::

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

The reservation-get-by-hostname command may result in large responses.


.. _ref-reservation-get-by-id:

reservation-get-by-id
---------------------

This command retrieves all host reservations for a specified identifier (type and value).

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.9.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-get-by-id command <command-reservation-get-by-id>`

Command syntax:

::

    {
        "command": "reservation-get-by-id",
        "arguments": {
            "identifier-type": <one of 'hw-address', 'duid', 'circuit-id', 'client-id' and 'flex-id'>,
            "identifier": <string>,
            "operation-target": <string (memory, database, all, default)>
        }
    }


Operation-target is optional; default is 'all'.

Response syntax:

::

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

The reservation-get-by-id command may result in large responses.


.. _ref-reservation-get-page:

reservation-get-page
--------------------

This command retrieves all host reservations or host reservations for a specified subnet by page.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-get-page command <command-reservation-get-page>`

Command syntax:

::

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


The page size limit is mandatory. The subnet-id is optional since version 1.9.0. The source-index and from host-id are optional and default to 0. Values to use to load the next page are returned in responses in a next map.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-reservation-update:

reservation-update
------------------

This command updates an existing host reservation. The reservation has to include host identifiers and a subnet identifier and may include IPv4 addresses, IPv6 addresses, IPv6 prefixes, various identifiers, a class the client will be assigned to, DHCPv4 and DHCPv6 options, and more.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 2.3.7 (:ref:`host_cmds <commands-host_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`reservation-update command <command-reservation-update>`

Command syntax:

::

    {
        "command": "reservation-update",
        "arguments": {
            "reservation": {
                "boot-file-name": <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": [ <comma-separated structures defining options> ],
                "prefixes": [ <comma-separated IPv6 prefixes> ],
                "client-classes": [ <comma-separated strings> ],
                "server-hostname": <string>,
                "subnet-id": <integer>,
                "user-context": <any valid JSON>
            },
            "operation-target": <string (memory, database, all, default)>
        }
    }


Note that boot-file-name, circuit-id, client-id, ip-address, next-server, and server-hostname are IPv4-specific. ip-addresses, and prefixes are IPv6-specific. Operation-target is optional; default is 'alternate'.

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-server-tag-get:

server-tag-get
--------------

This command returns the server tag used by the server. 
Server tag is essential configuration parameter in the Config Backend configuration.
This parameter is configured in the local config file.
This command does not take any parameters.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`server-tag-get command <command-server-tag-get>`

Command syntax:

::

    {
        "command": "server-tag-get"
    }


Response syntax:

::

    {
        "result": 0,
        "arguments": {
            "server-tag": "office1"
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-shutdown:

shutdown
--------

This command instructs the server to initiate its shutdown procedure.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`shutdown command <command-shutdown>`

Command syntax:

::

    {
        "command": "shutdown",
        "arguments": {
            "exit-value": 123
        }
    }


The server responds 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-stat-lease4-get:

stat-lease4-get
---------------

This command fetches lease statistics for a range of known IPv4 subnets.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.4.0 (:ref:`stat_cmds <commands-stat_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`stat-lease4-get command <command-stat-lease4-get>`

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", "cumulative-assigned-addresses", "assigned-addresses", "declined-addresses" ],
            "rows": [
              [ 10, 256, 200, 111, 0 ],
              [ 20, 4098, 5000, 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-stat-lease6-get:

stat-lease6-get
---------------

This command fetches lease statistics for a range of known IPv6 subnets.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.4.0 (:ref:`stat_cmds <commands-stat_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`stat-lease6-get command <command-stat-lease6-get>`

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", "cumulative-assigned-nas", "assigned-nas", "declined-addresses", "total-pds", "cumulative-assigned-pds", "assigned-pds" ],
            "rows": [
              [ 10, 4096, 3000, 2400, 3, 0, 0],
              [ 20, 0, 0, 0, 1048, 500, 233 ],
              [ 30, 256, 300, 60, 0, 1048, 15, 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-get:

statistic-get
-------------

This command retrieves a single statistic. It takes a single string parameter called name that specifies the statistic name.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-get command <command-statistic-get>`

Command syntax:

::

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


The server responds with the details of the requested statistic, with a result of 0 indicating success, and the specified statistic as the value of the "arguments" parameter.

Response syntax:

::

    {
       "result": 0,
       "arguments": {
           "pkt4-received": [ [ "first_value", "2019-07-30 10:11:19.498739" ], [ "second_value", "2019-07-30 10:11:19.498662" ] ]
           }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-get-all:

statistic-get-all
-----------------

This command retrieves all recorded statistics.

Supported by: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-get-all command <command-statistic-get-all>`

Command syntax:

::

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


The server responds with the details of all recorded statistics, with a result of 0 indicating that it iterated over all statistics (even when the total number of statistics is zero).

Response syntax:

::

    {
        "result": 0,
        "arguments": {
            "cumulative-assigned-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836166"
                ]
            ],
            "declined-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836156"
                ]
            ],
            "pkt4-ack-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616247"
                ]
            ],
            "pkt4-ack-sent": [
                [
                    0,
                    "2023-06-13 20:42:46.616290"
                ]
            ],
            "pkt4-decline-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616296"
                ]
            ],
            "pkt4-discover-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616303"
                ]
            ],
            "pkt4-inform-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616308"
                ]
            ],
            "pkt4-nak-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616312"
                ]
            ],
            "pkt4-nak-sent": [
                [
                    0,
                    "2023-06-13 20:42:46.616314"
                ]
            ],
            "pkt4-offer-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616318"
                ]
            ],
            "pkt4-offer-sent": [
                [
                    0,
                    "2023-06-13 20:42:46.616323"
                ]
            ],
            "pkt4-parse-failed": [
                [
                    0,
                    "2023-06-13 20:42:46.616326"
                ]
            ],
            "pkt4-receive-drop": [
                [
                    0,
                    "2023-06-13 20:42:46.616330"
                ]
            ],
            "pkt4-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616335"
                ]
            ],
            "pkt4-release-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616339"
                ]
            ],
            "pkt4-request-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616343"
                ]
            ],
            "pkt4-sent": [
                [
                    0,
                    "2023-06-13 20:42:46.616348"
                ]
            ],
            "pkt4-unknown-received": [
                [
                    0,
                    "2023-06-13 20:42:46.616354"
                ]
            ],
            "reclaimed-declined-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836159"
                ]
            ],
            "reclaimed-leases": [
                [
                    0,
                    "2023-06-13 20:42:46.836163"
                ]
            ],
            "subnet[1].assigned-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836173"
                ]
            ],
            "subnet[1].cumulative-assigned-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836098"
                ]
            ],
            "subnet[1].declined-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836178"
                ]
            ],
            "subnet[1].pool[0].assigned-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836205"
                ]
            ],
            "subnet[1].pool[0].cumulative-assigned-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836137"
                ]
            ],
            "subnet[1].pool[0].declined-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836213"
                ]
            ],
            "subnet[1].pool[0].reclaimed-declined-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836225"
                ]
            ],
            "subnet[1].pool[0].reclaimed-leases": [
                [
                    0,
                    "2023-06-13 20:42:46.836236"
                ]
            ],
            "subnet[1].pool[0].total-addresses": [
                [
                    11010049,
                    "2023-06-13 20:42:46.836128"
                ]
            ],
            "subnet[1].reclaimed-declined-addresses": [
                [
                    0,
                    "2023-06-13 20:42:46.836186"
                ]
            ],
            "subnet[1].reclaimed-leases": [
                [
                    0,
                    "2023-06-13 20:42:46.836194"
                ]
            ],
            "subnet[1].total-addresses": [
                [
                    11010049,
                    "2023-06-13 20:42:46.836083"
                ]
            ],
            "subnet[1].v4-lease-reuses": [
                [
                    0,
                    "2023-06-13 20:42:46.836105"
                ]
            ],
            "subnet[1].v4-reservation-conflicts": [
                [
                    0,
                    "2023-06-13 20:42:46.836111"
                ]
            ],
            "v4-allocation-fail": [
                [
                    0,
                    "2023-06-13 20:42:46.616358"
                ]
            ],
            "v4-allocation-fail-classes": [
                [
                    0,
                    "2023-06-13 20:42:46.616363"
                ]
            ],
            "v4-allocation-fail-no-pools": [
                [
                    0,
                    "2023-06-13 20:42:46.616368"
                ]
            ],
            "v4-allocation-fail-shared-network": [
                [
                    0,
                    "2023-06-13 20:42:46.616372"
                ]
            ],
            "v4-allocation-fail-subnet": [
                [
                    0,
                    "2023-06-13 20:42:46.616376"
                ]
            ],
            "v4-lease-reuses": [
                [
                    0,
                    "2023-06-13 20:42:46.616410"
                ]
            ],
            "v4-reservation-conflicts": [
                [
                    0,
                    "2023-06-13 20:42:46.616412"
                ]
            ]
        }
    }
    
    or
    
    {
        "result": 0,
        "arguments": {
            "cumulative-assigned-nas": [
                [
                    0,
                    "2023-06-13 21:28:57.196757"
                ]
            ],
            "cumulative-assigned-pds": [
                [
                    0,
                    "2023-06-13 21:28:57.196758"
                ]
            ],
            "declined-addresses": [
                [
                    0,
                    "2023-06-13 21:28:57.196754"
                ]
            ],
            "pkt6-advertise-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177731"
                ]
            ],
            "pkt6-advertise-sent": [
                [
                    0,
                    "2023-06-13 21:28:57.177739"
                ]
            ],
            "pkt6-decline-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177739"
                ]
            ],
            "pkt6-dhcpv4-query-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177740"
                ]
            ],
            "pkt6-dhcpv4-response-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177740"
                ]
            ],
            "pkt6-dhcpv4-response-sent": [
                [
                    0,
                    "2023-06-13 21:28:57.177741"
                ]
            ],
            "pkt6-infrequest-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177742"
                ]
            ],
            "pkt6-parse-failed": [
                [
                    0,
                    "2023-06-13 21:28:57.177742"
                ]
            ],
            "pkt6-rebind-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177743"
                ]
            ],
            "pkt6-receive-drop": [
                [
                    0,
                    "2023-06-13 21:28:57.177743"
                ]
            ],
            "pkt6-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177744"
                ]
            ],
            "pkt6-release-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177744"
                ]
            ],
            "pkt6-renew-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177745"
                ]
            ],
            "pkt6-reply-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177745"
                ]
            ],
            "pkt6-reply-sent": [
                [
                    0,
                    "2023-06-13 21:28:57.177746"
                ]
            ],
            "pkt6-request-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177747"
                ]
            ],
            "pkt6-sent": [
                [
                    0,
                    "2023-06-13 21:28:57.177747"
                ]
            ],
            "pkt6-solicit-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177748"
                ]
            ],
            "pkt6-unknown-received": [
                [
                    0,
                    "2023-06-13 21:28:57.177748"
                ]
            ],
            "reclaimed-declined-addresses": [
                [
                    0,
                    "2023-06-13 21:28:57.196755"
                ]
            ],
            "reclaimed-leases": [
                [
                    0,
                    "2023-06-13 21:28:57.196756"
                ]
            ],
            "subnet[1].assigned-nas": [
                [
                    0,
                    "2023-06-13 21:28:57.196760"
                ]
            ],
            "subnet[1].assigned-pds": [
                [
                    0,
                    "2023-06-13 21:28:57.196761"
                ]
            ],
            "subnet[1].cumulative-assigned-nas": [
                [
                    0,
                    "2023-06-13 21:28:57.196727"
                ]
            ],
            "subnet[1].cumulative-assigned-pds": [
                [
                    0,
                    "2023-06-13 21:28:57.196729"
                ]
            ],
            "subnet[1].declined-addresses": [
                [
                    0,
                    "2023-06-13 21:28:57.196763"
                ]
            ],
            "subnet[1].pd-pool[0].assigned-pds": [
                [
                    0,
                    "2023-06-13 21:28:57.196785"
                ]
            ],
            "subnet[1].pd-pool[0].cumulative-assigned-pds": [
                [
                    0,
                    "2023-06-13 21:28:57.196744"
                ]
            ],
            "subnet[1].pd-pool[0].reclaimed-leases": [
                [
                    0,
                    "2023-06-13 21:28:57.196789"
                ]
            ],
            "subnet[1].pd-pool[0].total-pds": [
                [
                    256,
                    "2023-06-13 21:28:57.196741"
                ]
            ],
            "subnet[1].pool[0].assigned-nas": [
                [
                    0,
                    "2023-06-13 21:28:57.196773"
                ]
            ],
            "subnet[1].pool[0].cumulative-assigned-nas": [
                [
                    0,
                    "2023-06-13 21:28:57.196739"
                ]
            ],
            "subnet[1].pool[0].declined-addresses": [
                [
                    0,
                    "2023-06-13 21:28:57.196775"
                ]
            ],
            "subnet[1].pool[0].reclaimed-declined-addresses": [
                [
                    0,
                    "2023-06-13 21:28:57.196779"
                ]
            ],
            "subnet[1].pool[0].reclaimed-leases": [
                [
                    0,
                    "2023-06-13 21:28:57.196783"
                ]
            ],
            "subnet[1].pool[0].total-nas": [
                [
                    281474976710656,
                    "2023-06-13 21:28:57.196736"
                ]
            ],
            "subnet[1].reclaimed-declined-addresses": [
                [
                    0,
                    "2023-06-13 21:28:57.196766"
                ]
            ],
            "subnet[1].reclaimed-leases": [
                [
                    0,
                    "2023-06-13 21:28:57.196770"
                ]
            ],
            "subnet[1].total-nas": [
                [
                    281474976710656,
                    "2023-06-13 21:28:57.196720"
                ]
            ],
            "subnet[1].total-pds": [
                [
                    256,
                    "2023-06-13 21:28:57.196724"
                ]
            ],
            "subnet[1].v6-ia-na-lease-reuses": [
                [
                    0,
                    "2023-06-13 21:28:57.196731"
                ]
            ],
            "subnet[1].v6-ia-pd-lease-reuses": [
                [
                    0,
                    "2023-06-13 21:28:57.196733"
                ]
            ],
            "v6-allocation-fail": [
                [
                    0,
                    "2023-06-13 21:28:57.177749"
                ]
            ],
            "v6-allocation-fail-classes": [
                [
                    0,
                    "2023-06-13 21:28:57.177755"
                ]
            ],
            "v6-allocation-fail-no-pools": [
                [
                    0,
                    "2023-06-13 21:28:57.177756"
                ]
            ],
            "v6-allocation-fail-shared-network": [
                [
                    0,
                    "2023-06-13 21:28:57.177756"
                ]
            ],
            "v6-allocation-fail-subnet": [
                [
                    0,
                    "2023-06-13 21:28:57.177757"
                ]
            ],
            "v6-ia-na-lease-reuses": [
                [
                    0,
                    "2023-06-13 21:28:57.177757"
                ]
            ],
            "v6-ia-pd-lease-reuses": [
                [
                    0,
                    "2023-06-13 21:28:57.177758"
                ]
            ]
        }
    }
    
    or
    
    {
        "result": 0,
        "arguments": {
            "ncr-error": [
                [
                    0,
                    "2023-06-13 21:42:54.627751"
                ]
            ],
            "ncr-invalid": [
                [
                    0,
                    "2023-06-13 21:42:54.627749"
                ]
            ],
            "ncr-received": [
                [
                    0,
                    "2023-06-13 21:42:54.627737"
                ]
            ],
            "update-error": [
                [
                    0,
                    "2023-06-13 21:42:54.627759"
                ]
            ],
            "update-sent": [
                [
                    0,
                    "2023-06-13 21:42:54.627752"
                ]
            ],
            "update-signed": [
                [
                    0,
                    "2023-06-13 21:42:54.627753"
                ]
            ],
            "update-success": [
                [
                    0,
                    "2023-06-13 21:42:54.627755"
                ]
            ],
            "update-timeout": [
                [
                    0,
                    "2023-06-13 21:42:54.627757"
                ]
            ],
            "update-unsigned": [
                [
                    0,
                    "2023-06-13 21:42:54.627754"
                ]
            ]
        }
    }


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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-remove:

statistic-remove
----------------

This command deletes a single statistic. It takes a single string parameter called name that specifies the statistic name.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-remove command <command-statistic-remove>`

Command syntax:

::

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


If the specific statistic is found and its removal is successful, the server responds with a status of 0, indicating success, and an empty parameters field. If an error is encountered (e.g. the requested statistic was not found), the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-remove-all:

statistic-remove-all
--------------------

(Deprecated) This command deletes all statistics.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-remove-all command <command-statistic-remove-all>`

Command syntax:

::

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


If the removal of all statistics is successful, the server responds with a status of 0, indicating success, and an empty parameters field. If an error is encountered, the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-reset:

statistic-reset
---------------

This 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: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-reset command <command-statistic-reset>`

Command syntax:

::

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


If the specific statistic is found and the reset is successful, the server responds with a status of 0, indicating success, and an empty parameters field. If an error is encountered (e.g. the requested statistic was not found), the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-reset-all:

statistic-reset-all
-------------------

This 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: :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.0.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-reset-all command <command-statistic-reset-all>`

Command syntax:

::

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


If the operation is successful, the server responds with a status of 0, indicating success, and an empty parameters field. If an error is encountered, the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-sample-age-set:

statistic-sample-age-set
------------------------

This command sets a time-based limit for a single statistic. It takes two parameters: a string called name and an integer value called duration.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-sample-age-set command <command-statistic-sample-age-set>`

Command syntax:

::

    {
        "command": "statistic-sample-age-set",
        "arguments": {
            "name": "pkt4-received",
            "duration": 1245
        }
    }


The server responds with a message about a successfully set limit for the given statistic, with a result of 0 indicating success, and an empty parameters field. If an error is encountered (e.g. the requested statistic was not found), the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-sample-age-set-all:

statistic-sample-age-set-all
----------------------------

This command sets a time-based limit for all statistics. It takes a single integer parameter called duration.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-sample-age-set-all command <command-statistic-sample-age-set-all>`

Command syntax:

::

    {
        "command": "statistic-sample-age-set-all",
        "arguments": {
            "duration": 1245
        }
    }


The server responds with a message about successfully set limits for all statistics, with a result of 0 indicating success, and an empty parameters field. If an error is encountered, the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-sample-count-set:

statistic-sample-count-set
--------------------------

This command sets a size-based limit for a single statistic. It takes two parameters: a string called name and an integer value called max-samples.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-sample-count-set command <command-statistic-sample-count-set>`

Command syntax:

::

    {
        "command": "statistic-sample-count-set",
        "arguments": {
            "name": "pkt4-received",
            "max-samples": 100
        }
    }


The server responds with a message about a successfully set limit for the given statistic, with a result of 0 indicating success, and an empty parameters field. If an error is encountered (e.g. the requested statistic was not found), the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-statistic-sample-count-set-all:

statistic-sample-count-set-all
------------------------------

This command sets a size-based limit for all statistics. It takes a single integer parameter called max-samples.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (built-in)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`statistic-sample-count-set-all command <command-statistic-sample-count-set-all>`

Command syntax:

::

    {
        "command": "statistic-sample-count-set-all",
        "arguments": {
            "max-samples": 100
        }
    }


The server responds with a message about successfully set limits for all statistics, with a result of 0 indicating success, and an empty parameters field. If an error is encountered, the server returns a status code of 1 (error) and the text field contains 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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-status-get:

status-get
----------

This command returns server's runtime information.
It takes no arguments.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.7.3 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`status-get command <command-status-get>`

Command syntax:

::

    {
        "command": "status-get"
    }


Response syntax:

::

    {
        "result": <integer>,
        "arguments": {
            "pid": <integer>,
            "uptime": <uptime in seconds>,
            "reload": <time since reload in seconds>,
            "high-availability": [
                {
                    "ha-mode": <HA mode configured for this relationship>,
                    "ha-servers": {
                        "local": {
                            "role": <role of this server as in the configuration file>,
                            "scopes": <list of scope names served by this server>,
                            "state": <HA state name of the server receiving the command>
                        },
                        "remote": {
                            "age": <the age of the remote status in seconds>,
                            "in-touch": <indicates if this server communicated with remote>,
                            "last-scopes": <list of scopes served by partner>,
                            "last-state": <HA state name of the partner>,
                            "role": <partner role>
                        }
                    }
                }
            ],
            "multi-threading-enabled": true,
            "thread-pool-size": 4,
            "packet-queue-size": 64,
            "packet-queue-statistics": [ 1.2, 2.3, 3.4 ],
            "sockets": {
                "errors": [ <error received during the last attempt to open all sockets> ],
                "status": <ready, retrying, or failed>
            }
        }
    }


If the libdhcp_ha (High Availability) hooks library is loaded by the DHCP server receiving this command the response also includes the HA specific status information of the server receiving the command and its partner's status.


.. _ref-subnet4-add:

subnet4-add
-----------

This command creates and adds a new subnet to the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-add command <command-subnet4-add>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet4-del:

subnet4-del
-----------

This command removes 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: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-del command <command-subnet4-del>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet4-delta-add:

subnet4-delta-add
-----------------

This command updates (adds or overwrites) parts of a single subnet in the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 2.1.7 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-delta-add command <command-subnet4-delta-add>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 subnet updated",
        "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet4-delta-del:

subnet4-delta-del
-----------------

This command updates (removes) parts of a single subnet in the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 2.1.7 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-delta-del command <command-subnet4-delta-del>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 subnet updated",
        "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet4-get:

subnet4-get
-----------

This command retrieves detailed information about the specified subnet. This command usually follows ``subnet4-list``, which discovers available subnets with their respective subnet identifiers and prefixes.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-get command <command-subnet4-get>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet4-list:

subnet4-list
------------

This command lists all currently configured subnets. The subnets are returned in a brief format, i.e. a subnet identifier and subnet prefix are included for each subnet.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-list command <command-subnet4-list>`

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.


.. _ref-subnet4-update:

subnet4-update
--------------

This command updates (overwrites) a single subnet in the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp4 <commands-kea-dhcp4>`

Availability: 1.6.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet4-update command <command-subnet4-update>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv4 subnet updated",
        "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet6-add:

subnet6-add
-----------

This command creates and adds a new subnet to the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-add command <command-subnet6-add>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet added",
        "arguments": {
            "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet6-del:

subnet6-del
-----------

This command removes 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: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-del command <command-subnet6-del>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet6-delta-add:

subnet6-delta-add
-----------------

This command updates (adds or overwrites) parts of a single subnet in the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 2.1.7 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-delta-add command <command-subnet6-delta-add>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet updated",
        "arguments": {
            "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet6-delta-del:

subnet6-delta-del
-----------------

This command updates (removes) parts of a single subnet in the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 2.1.7 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-delta-del command <command-subnet6-delta-del>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet updated",
        "arguments": {
            "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet6-get:

subnet6-get
-----------

This command retrieves detailed information about the specified subnet. This command usually follows ``subnet6-list``, which discovers available subnets with their respective subnet identifiers and prefixes.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-get command <command-subnet6-get>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-subnet6-list:

subnet6-list
------------

This command lists all currently configured subnets. The subnets are returned in a brief format, i.e. a subnet identifier and subnet prefix are included for each subnet.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.3.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-list command <command-subnet6-list>`

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.


.. _ref-subnet6-update:

subnet6-update
--------------

This command updates (overwrites) a single subnet in the existing server configuration. This operation has no impact on other subnets.

Supported by: :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.6.0 (:ref:`subnet_cmds <commands-subnet_cmds>` hook library)

Access: write *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`subnet6-update command <command-subnet6-update>`

Command syntax:

::

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


Response syntax:

::

    {
        "result": 0,
        "text": "IPv6 subnet updated",
        "arguments": {
            "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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

.. _ref-version-get:

version-get
-----------

This command returns extended information about the Kea version that is running. The returned string is the same as if Kea were run with the ``-V`` command-line option.

Supported by: :ref:`kea-ctrl-agent <commands-kea-ctrl-agent>`, :ref:`kea-dhcp-ddns <commands-kea-dhcp-ddns>`, :ref:`kea-dhcp4 <commands-kea-dhcp4>`, :ref:`kea-dhcp6 <commands-kea-dhcp6>`

Availability: 1.2.0 (built-in)

Access: read *(parameter ignored in this Kea version)* 

Description and examples: see :ref:`version-get command <command-version-get>`

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)
- 4 - conflict (command could not apply requested configuration changes because they were in conflict with the server state)

