diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 3863e8fdb9..198f8ac409 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -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)); } diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 6bcfb3f254..511b3c7f01 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -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)); } diff --git a/src/lib/dhcpsrv/network_state.cc b/src/lib/dhcpsrv/network_state.cc index 57b5671714..61aba7df00 100644 --- a/src/lib/dhcpsrv/network_state.cc +++ b/src/lib/dhcpsrv/network_state.cc @@ -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)); diff --git a/src/share/api/perfmon-get-all-durations.json b/src/share/api/perfmon-get-all-durations.json index ee99f8ddb4..d95c9dbcd2 100644 --- a/src/share/api/perfmon-get-all-durations.json +++ b/src/share/api/perfmon-get-all-durations.json @@ -38,15 +38,15 @@ " \"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\": [", @@ -79,15 +79,15 @@ " 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": [ diff --git a/src/share/api/status-get.json b/src/share/api/status-get.json index 8e107a71d5..d1f22ec70d 100644 --- a/src/share/api/status-get.json +++ b/src/share/api/status-get.json @@ -48,6 +48,13 @@ " \"sockets\": {", " \"errors\": [ ],", " \"status\": ", + " },", + " \"dhcp-state\": {", + " \"disabled-by-db-connection\": false,", + " \"disabled-by-local-command\": [],", + " \"disabled-by-remote-command\": [],", + " \"disabled-by-user\": false,", + " \"globally-disabled\": false", " }", " }", "}"