]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3446] updated documentation
authorRazvan Becheriu <razvan@isc.org>
Wed, 10 Jul 2024 20:40:51 +0000 (23:40 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 16 Jul 2024 12:43:21 +0000 (12:43 +0000)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/lib/dhcpsrv/network_state.cc
src/share/api/perfmon-get-all-durations.json
src/share/api/status-get.json

index 3863e8fdb9018b9ddf9114bda644671ead0e6efb..198f8ac409147c2ddd85ac73437bbb08f94cf9fa 100644 (file)
@@ -799,7 +799,7 @@ ControlledDhcpv4Srv::commandStatusGetHandler(const string&,
     }
     status->set("sockets", sockets);
 
-    status->set("dhcp-state": network_state_->toElement());
+    status->set("dhcp-state", network_state_->toElement());
 
     return (createAnswer(CONTROL_RESULT_SUCCESS, status));
 }
index 6bcfb3f2540a8285f65cbc50bcc1d5465eb1f887..511b3c7f013e90c1ab3d80dfafb2ef13740dd763 100644 (file)
@@ -804,7 +804,7 @@ ControlledDhcpv6Srv::commandStatusGetHandler(const string&,
     }
     status->set("sockets", sockets);
 
-    status->set("dhcp-state": network_state_->toElement());
+    status->set("dhcp-state", network_state_->toElement());
 
     return (createAnswer(CONTROL_RESULT_SUCCESS, status));
 }
index 57b567171420b12377d93d1f175277be04bbf24d..61aba7df00ca15cd6afb758b6fc651da8d8dfe36 100644 (file)
@@ -184,18 +184,16 @@ public:
         result->set("disabled-by-db-connection", Element::create(disabled_by_db_connection_ != 0));
         bool disabled_by_user = false;
         ElementPtr local_origin = Element::createList();
-        uint16_t local_count = 0;
         ElementPtr remote_origin = Element::createList();
-        uint16_t remote_count = 0;
         for (auto const& origin : disabled_by_origin_) {
             if (origin == NetworkState::USER_COMMAND) {
                 disabled_by_user = true;
             }
             if (origin >= NetworkState::HA_LOCAL_COMMAND && origin < NetworkState::HA_REMOTE_COMMAND) {
-                local_origin->set(local_count++, Element::create(origin - NetworkState::HA_LOCAL_COMMAND));
+                local_origin->add(Element::create(origin - NetworkState::HA_LOCAL_COMMAND));
             }
             if (origin >= NetworkState::HA_REMOTE_COMMAND && origin < NetworkState::DB_CONNECTION) {
-                remote_origin->set(remote_count++, Element::create(origin - NetworkState::HA_REMOTE_COMMAND));
+                remote_origin->add(Element::create(origin - NetworkState::HA_REMOTE_COMMAND));
             }
         }
         result->set("disabled-by-user", Element::create(disabled_by_user));
index ee99f8ddb41cc3b61ea38038d99b903df1a4419b..d95c9dbcd2057f37d2d881c200198bd662df8eaf 100644 (file)
         "           \"occurrences\": 501,",
         "           \"start-time\": \"2024-06-12 17:52:06.814884\",",
         "           \"total-duration-usecs\": 23951",
-        "       }",
-        "       ..",
-        "       ]",
+        "       },",
+        "       ...",
+        "       ],",
         "       \"result-set-format\": false,",
         "       \"interval-width-secs\": 5,",
         "       \"timestamp\": \"2024-06-12 17:52:22.397233\"",
-        "   }",
-        "\"result\": 0,",
-        "\"text\": \"perfmon-get-all-durations: n found\"",
+        "   },",
+        "   \"result\": 0,",
+        "   \"text\": \"perfmon-get-all-durations: n found\"",
         "}",
         "If result-set-format is true, the output will be as shown below:",
         "{",
@@ -62,7 +62,7 @@
         "               \"occurences\",",
         "               \"min-duration-usecs\",",
         "               \"max-duration-usecs\",",
-        "               \"total-duration-usecs\"",
+        "               \"total-duration-usecs\",",
         "               \"mean-duration-usecs\"",
         "           ],",
         "           \"rows\": [",
         "                   23951,",
         "                   47",
         "               ],",
-        "               ..",
+        "               ...",
         "           ]",
-        "       }",
+        "       },",
         "       \"result-set-format\": true,",
         "       \"interval-width-secs\": 5,",
         "       \"timestamp\": \"2024-06-12 17:52:22.397233\"",
-        "   }",
-        "\"result\": 0,",
-        "\"text\": \"perfmon-get-all-durations: n found\"",
+        "   },",
+        "   \"result\": 0,",
+        "   \"text\": \"perfmon-get-all-durations: n found\"",
         "}"
     ],
     "support": [
index 8e107a71d550321b166d9c0310c9c0bbfb5f6b7e..d1f22ec70d6a76617ded8ccedfbf5580deca95da 100644 (file)
         "        \"sockets\": {",
         "            \"errors\": [ <error received during the last attempt to open all sockets> ],",
         "            \"status\": <ready, retrying, or failed>",
+        "        },",
+        "        \"dhcp-state\": {",
+        "            \"disabled-by-db-connection\": false,",
+        "            \"disabled-by-local-command\": [],",
+        "            \"disabled-by-remote-command\": [],",
+        "            \"disabled-by-user\": false,",
+        "            \"globally-disabled\": false",
         "        }",
         "    }",
         "}"