From: Tomek Mrugalski Date: Thu, 24 Jan 2019 15:52:33 +0000 (+0100) Subject: [#313, !199] reservation-get-page description updated. X-Git-Tag: 429-Updated-StampedValue-to-support-reals_base~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd7d204b7e69ec7ef7034eea9fb8ec8b207e7926;p=thirdparty%2Fkea.git [#313, !199] reservation-get-page description updated. --- diff --git a/doc/guide/hooks.xml b/doc/guide/hooks.xml index df1d57018b..485eea1de2 100644 --- a/doc/guide/hooks.xml +++ b/doc/guide/hooks.xml @@ -1731,12 +1731,33 @@ An example result returned when the query was malformed: 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 returned list is empty, count is 0 and result 3 is returned. + + The usage of next and source-index parameters requires + additional explanation. For the first call those + parameters should not be specified (or specified as + zeros). For any follow up calls they should be set to the + values returned in previous calls. The subsequent calls + should be issued until all reservations are returned. The + end is reached once the returned list is empty, count is 0 + and result status 3 (empty) is returned. + + The next and source-index parameters are + reflecting internal state of the search. There is no need + to understand what they represent, it's simply a value + that is supposed to be copied from one response to the + next query. However, if you are curious, next field + represents a 64 bits representation of host identifier + used by a host backend. The source-index represents + internal representation of multiple host backends: 0 is + used to represent hosts defined in a configuration file, 1 + represents the first database backend. In some uncommon + cases there may be more than one database backend + configured, so potentially there may be 2. In any case, + Kea will iterate over all backends configured. + + For instance for retrieving host reservations for the subnet 1 requesting the first page can be done by: @@ -1747,7 +1768,8 @@ An example result returned when the query was malformed: "limit": 10 } } - leaving source-index and from to their zero default values. + Since this is the first call, source-index and next should +not be specified. They will default to their zero default values. Some hosts are returned with informations to get the next page: @@ -1784,18 +1806,23 @@ An example result returned when the query was malformed: "result": 0, "text": "72 IPv4 host(s) found." } - To get the next page this can be sent: + Note that next and source-index fields were specified in the +response. Those two must be copied to the next command, so Kea +continues from the place where the last command finished. To get the +next page the following command can be sent: { "command": "reservation-get-page", "arguments": { "subnet-id": 1, "source-index": 1, - "from": 1234567, + "next": 1234567, "limit": 10 } } - responses after the last page look like: +. The response will contain a list of hosts with updated +source-index and next fields. Continue calling the command until you +get the last page. Its response will look like this: { "arguments": {