From: Francis Dupont Date: Mon, 14 Jan 2019 15:41:15 +0000 (+0100) Subject: [313-return-a-list-of-all-reservations-by-subnet-id] Updated doc X-Git-Tag: 429-Updated-StampedValue-to-support-reals_base~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6244106c82a77a488e802539ad72b9845c6694f1;p=thirdparty%2Fkea.git [313-return-a-list-of-all-reservations-by-subnet-id] Updated doc --- diff --git a/doc/Makefile.am b/doc/Makefile.am index 95f03b1849..192f64d44c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -107,7 +107,7 @@ EXTRA_DIST += api/network6-get.json api/network6-list.json EXTRA_DIST += api/network6-subnet-add.json api/network6-subnet-del.json EXTRA_DIST += api/reservation-add.json api/reservation-del.json EXTRA_DIST += api/reservation-get.json api/reservation-get-all.json -EXTRA_DIST += api/shutdown.json +EXTRA_DIST += api/reservation-get-page.json api/shutdown.json EXTRA_DIST += api/statistic-get-all.json api/statistic-get.json EXTRA_DIST += api/statistic-remove-all.json api/statistic-remove.json EXTRA_DIST += api/statistic-reset-all.json api/statistic-reset.json diff --git a/doc/api/reservation-get-page.json b/doc/api/reservation-get-page.json new file mode 100644 index 0000000000..fb74bdc4f1 --- /dev/null +++ b/doc/api/reservation-get-page.json @@ -0,0 +1,18 @@ +{ + "name": "reservation-get-page", + "brief": "Retrieve host reservations for a specified subnet by page.", + "support": [ "kea-dhcp4", "kea-dhcp6" ], + "hook": "host_cmds", + "avail": "1.6.0", + + "cmd-syntax": "{ + \"command\": \"reservation-get-page\", + \"arguments\": { + \"subnet-id\": , + \"limit\": , + \"source-index\": , + \"from\": + } +}", + "cmd-comment": "the subnet id and the page size limit are mandatory. The source index and from host id are optional and default to 0." +} diff --git a/doc/docgen/cmds-list b/doc/docgen/cmds-list index adbdffdb03..9aa4be6a80 100644 --- a/doc/docgen/cmds-list +++ b/doc/docgen/cmds-list @@ -52,6 +52,7 @@ reservation-add reservation-del reservation-get reservation-get-all +reservation-get-page shutdown stat-lease4-get stat-lease6-get diff --git a/doc/guide/api.xml b/doc/guide/api.xml index e20fa59f6b..fbc1aa9b8f 100644 --- a/doc/guide/api.xml +++ b/doc/guide/api.xml @@ -64,6 +64,7 @@ , reservation-del , reservation-get , reservation-get-all +, reservation-get-page , shutdown , stat-lease4-get , stat-lease6-get @@ -145,6 +146,7 @@ , reservation-del , reservation-get , reservation-get-all +, reservation-get-page , shutdown , stat-lease4-get , statistic-get @@ -201,6 +203,7 @@ , reservation-del , reservation-get , reservation-get-all +, reservation-get-page , shutdown , stat-lease6-get , statistic-get @@ -237,6 +240,7 @@ , reservation-del , reservation-get , reservation-get-all +, reservation-get-page . Commands supported by lease_cmds hook library: lease4-add , lease4-del @@ -2570,6 +2574,71 @@ The reservation-get-all command may result in very large responses. + +
+reservation-get reference +reservation-get-page - Retrieve all host reservations for a specified subnet by pages. + +Supported by: kea-dhcp4, kea-dhcp6 + +Availability: 1.6.0 (host_cmds hook) + +Description and examples: See + +Command syntax: + { + "command": "reservation-get-page", + "arguments": { + "subnet-id": <integer>, + "limit": <integer>, + "source-index": <integer>, + "from": <integer> + } +} +Returned host reservations are from the specified subnet. Page size is +limited by the limit parameter. Start of the page is given by the optional +source index (default 0 i.e. configuration file) and from host id (default +0). + + +Response syntax: + { + "result": <integer>, + "text": <string>, + "arguments": { + "source-index": <string>, + "count": <string>, + "next": <integer>, + "hosts": [ + { + "boot-file-name": <string>, + "comment": <string> + "client-id": <string>, + "circuit-id": <string>, + "duid": <string>, + "flex-id": <string>, + "ip-address": <string (IPv4 address)>, + "ip-addresses": [ <comma separated strings> ], + "hw-address": <string>, + "hostname": <string>, + "next-server": <string (IPv4 address)>, + "option-data-list": [ <comma separated structures defining options> ], + "prefixes": [ <comma separated IPv6 prefixes> ], + "reservation-client-classes": [ <comma separated strings> ], + "server-hostname": <string>, + "subnet-id": <integer>, + "user-context": <any valid JSON>, + }, + ... + ] + } +} +The source index and the next host id should be used getting the next page. +After the last page the result is 3 (empty). + +
+ +
shutdown reference diff --git a/doc/guide/hooks.xml b/doc/guide/hooks.xml index bc4bdd67cc..582d25e9cb 100644 --- a/doc/guide/hooks.xml +++ b/doc/guide/hooks.xml @@ -1421,8 +1421,9 @@ $ Currently four commands are supported: reservation-add (which adds new host reservation), reservation-get (which returns existing reservation if specified criteria are matched), reservation-get-all - (which returns all reservations in a specified subnet) and - reservation-del + (which returns all reservations in a specified subnet), + reservation-get-page (variant of reservation-get-all which returns + all reservations in a specified subnet by pages) and reservation-del (which attempts to delete a reservation matching specified criteria). To use commands that change the reservation information (currently these are reservation-add and reservation-del, but this @@ -1664,7 +1665,27 @@ An example result returned when the query was malformed: The response returned by reservation-get-all can be very long. -
+ + +
+ reservation-get-page command + reservation-get-page can be used to + query the host database and retrieve all reservations in a + specified subnet by pages. This command uses parameters providing the + mandatory subnet-id. Use a value of zero (0) to fetch global + reservations. The second mandatory parameter is the page size limit. + Optional source-index and from host id, both defaulting to 0, are + uses to chain page queries. + + + + + The first page is queried without source-index and from, + for next pages source-index and from should be set using + the preceeding result source-index and next. After the last page + the result is empty (code 3). + +
reservation-del command