]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#689] Updated Kea ARM to include error code/message for bulk lease updates.
authorMarcin Siodelski <marcin@isc.org>
Mon, 24 Jun 2019 15:44:55 +0000 (17:44 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 24 Jun 2019 17:10:14 +0000 (13:10 -0400)
doc/api/lease6-bulk-apply.json
doc/guide/api.xml
doc/guide/hooks-lease-cmds.xml

index aff923b53f84d906b584b15f42b9d18bae5c29e5..d132b9758f9c76ad863effaf486bec592d46abb3 100644 (file)
@@ -9,13 +9,11 @@
         \"arguments\": {
             \"deleted-leases\": [
                 {
-                    \"subnet-id\": 66,
                     \"ip-address\": \"2001:db8:abcd::\",
                     \"type\": \"IA_PD\",
                     ...
                 },
                 {
-                    \"subnet-id\": 66,
                     \"ip-address\": \"2001:db8:abcd::234\",
                     \"type\": \"IA_NA\",
                     ...
         \"arguments\": {
             \"failed-deleted-leases\": [
                 {
-                    \"subnet-id\": 66,
                     \"ip-address\": \"2001:db8:abcd::\",
-                    \"type\": \"IA_PD\"
+                    \"type\": \"IA_PD\",
+                    \"result\": <control result>,
+                    \"error-message\": <error message>
                 }
             ],
             \"failed-leases\": [
                 {
-                    \"subnet-id\": 66,
                     \"ip-address\": \"2001:db8:cafe::\",
                     \"type\": \"IA_PD\",
-                    ...
+                    \"result\" <control result>,
+                    \"error-message\": <error message>
                 }
             ]
         }
     }
 }",
-    "resp-comment": "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."
+    "resp-comment": "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 while processing the lease, inserting it into the database etc. the result is set to 1. For each lease which was not deleted because the server didn't find it in the database the result of 3 is returned."
 }
index b899b09b6f18c0001502f9edaaf0430d55e6f10c..e280e88ccbabef94e1030e4a0f931864542d89f4 100644 (file)
@@ -1700,13 +1700,11 @@ Result is an integer representation of the status. Currently supported statuses
         "arguments": {
             "deleted-leases": [
                 {
-                    "subnet-id": 66,
                     "ip-address": "2001:db8:abcd::",
                     "type": "IA_PD",
                     ...
                 },
                 {
-                    "subnet-id": 66,
                     "ip-address": "2001:db8:abcd::234",
                     "type": "IA_NA",
                     ...
@@ -1738,23 +1736,24 @@ If any of the leases is malformed, all changes are rolled back. If the leases ar
         "arguments": {
             "failed-deleted-leases": [
                 {
-                    "subnet-id": 66,
                     "ip-address": "2001:db8:abcd::",
-                    "type": "IA_PD"
+                    "type": "IA_PD",
+                    "result": &lt;control result&gt;,
+                    "error-message": &lt;error message&gt;
                 }
             ],
             "failed-leases": [
                 {
-                    "subnet-id": 66,
                     "ip-address": "2001:db8:cafe::",
                     "type": "IA_PD",
-                    ...
+                    "result" &lt;control result&gt;,
+                    "error-message": &lt;error message&gt;
                 }
             ]
         }
     }
 }</screen>
-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.</para>
+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 while processing the lease, inserting it into the database etc. the result is set to 1. For each lease which was not deleted because the server didn't find it in the database the result of 3 is returned.</para>
 
 </section>
 <!-- end of lease6-bulk-apply -->
index fbad82e81b387740afebcc798510ded69454be92..1b46cf22d75a848efabf5fe684494ebb5ace517a 100644 (file)
@@ -321,16 +321,12 @@ The commands can take a number of additional optional parameters:
     "arguments": {
         "deleted-leases": [
             {
-                "subnet-id": 66,
                 "ip-address": "2001:db8:abcd::",
                 "type": "IA_PD",
-                 ...
             },
             {
-                "subnet-id": 66,
                 "ip-address": "2001:db8:abcd::234",
                 "type": "IA_NA",
-                ...
             }
         ],
         "leases": [
@@ -368,17 +364,18 @@ The commands can take a number of additional optional parameters:
     "arguments": {
         "failed-deleted-leases": [
             {
-                "subnet-id": 66,
                 "ip-address": "2001:db8:abcd::",
-                "type": "IA_PD"
+                "type": "IA_PD",
+                "result": 3,
+                "error-message": "no lease found"
             }
         ],
         "failed-leases": [
             {
-                "subnet-id": 66,
                 "ip-address": "2001:db8:cafe::",
                 "type": "IA_PD",
-                ...
+                "result": 1,
+                "error-message": "unable to communicate with the lease database"
             }
         ]
     }
@@ -388,7 +385,14 @@ The commands can take a number of additional optional parameters:
           <para>The response above indicates that the hooks library was unable to
           delete the lease for prefix "2001:db8:abcd::" and add or update the lease
           for prefix "2001:db8:cafe::". However, there are two other lease changes
-          which have been applied as indicated by the text message.
+          which have been applied as indicated by the text message. The
+          <command>result</command> is the status constant that indicates the type
+          of the error experienced for the particular lease. The meaning of the
+          returned codes are the same as the results returned for the commands.
+          In particular, the result of 1 indicates an error while processing the
+          lease, e.g. a communication error with the database. The result of 3
+          indicates that an attempt to delete the lease was unsuccessful because
+          such lease doesn't exist (empty result).
           </para>
         </section>